5 // Created by Lutz Mueller on 6/16/07.
8 // Copyright (C) 2007 Lutz Mueller
10 // This program is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
15 // This program is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
20 // You should have received a copy of the GNU General Public License
21 // along with this program. If not, see <http://www.gnu.org/licenses/>.
26 import java
.awt
.color
.*;
27 import java
.awt
.event
.*;
31 @SuppressWarnings("unchecked")
32 public class WindowWidget
extends gsObject
{
37 public WindowWidget(StringTokenizer params
)
39 id
= params
.nextToken();
42 window
= new Window(frame
);
46 int x
= Integer
.parseInt(params
.nextToken());
47 int y
= Integer
.parseInt(params
.nextToken());
48 int width
= Integer
.parseInt(params
.nextToken());
49 int height
= Integer
.parseInt(params
.nextToken());
51 window
.setBounds(x
, y
, width
, height
);
53 gsObject
.widgets
.put(id
, this);
57 public void setBackground(StringTokenizer tokens
)
59 Float red
= Float
.parseFloat(tokens
.nextToken());
60 Float green
= Float
.parseFloat(tokens
.nextToken());
61 Float blue
= Float
.parseFloat(tokens
.nextToken());
62 if(tokens
.hasMoreTokens())
64 Float alpha
= Float
.parseFloat(tokens
.nextToken());
65 component
.setBackground(new Color(red
, green
, blue
, alpha
));
68 component
.setBackground(new Color(red
, green
, blue
));
71 public void dispose(StringTokenizer tokens
)
77 public void setFont(StringTokenizer tokens
)
79 ErrorDialog
.wrongApplication(Dispatcher
.cmd
, id
);
82 public void setToolTip(StringTokenizer tokens
)
84 ErrorDialog
.wrongApplication(Dispatcher
.cmd
, id
);
87 public void setTitledBorder(StringTokenizer tokens
)
89 ErrorDialog
.wrongApplication(Dispatcher
.cmd
, id
);
92 public void setBevelBorder(StringTokenizer tokens
)
94 ErrorDialog
.wrongApplication(Dispatcher
.cmd
, id
);
97 public void getBounds(StringTokenizer tokens
)
99 int x
, y
, width
, height
;
101 x
= frame
.getLocationOnScreen().x
;
102 y
= frame
.getLocationOnScreen().y
;
104 width
= frame
.getWidth();
105 height
= frame
.getHeight();
107 guiserver
.out
.println("( set 'gs:bounds '(" + x
+ " " + y
+ " " + width
+ " " + height
+ "))\n");
108 guiserver
.out
.flush();