1:
37:
38: package ;
39:
40: import ;
41: import ;
42: import ;
43: import ;
44: import ;
45: import ;
46: import ;
47:
48: public class QtFramePeer extends QtWindowPeer implements FramePeer
49: {
50: private int theState;
51:
52: long frameObject;
53:
54: public QtFramePeer( QtToolkit kit, Component owner )
55: {
56: super( kit, owner );
57: }
58:
59: protected native void init();
60:
61: protected void setup()
62: {
63: super.setup();
64: setTitle( ((Frame)owner).getTitle() );
65: if( ((Frame)owner).getMenuBar() != null )
66: setMenuBar( ((Frame)owner).getMenuBar() );
67: }
68:
69: private native void setIcon(QtImage image);
70:
71: private native void setMaximizedBounds(int w, int h);
72:
73: private native void setMenu(QtMenuBarPeer mb);
74:
75: private native int menuBarHeight();
76:
77:
78:
79: public void destroy()
80: {
81: dispose();
82: }
83:
84: public int getState()
85: {
86:
87: return theState;
88: }
89:
90: public Insets getInsets()
91: {
92: int mbHeight = ( ((Frame)owner).getMenuBar() != null ) ?
93: menuBarHeight() : 0;
94: return new Insets(mbHeight, 0, 0, 0);
95: }
96:
97: public void setIconImage(Image im)
98: {
99: if (im instanceof QtImage)
100: setIcon( (QtImage)im );
101: else
102: setIcon( new QtImage( im.getSource() ) );
103: }
104:
105: public void setMaximizedBounds(Rectangle rect)
106: {
107:
108: }
109:
110: public void setMenuBar(MenuBar mb)
111: {
112: if( mb != null )
113: {
114: QtMenuBarPeer mbpeer = (QtMenuBarPeer)mb.getPeer();
115: if( mbpeer == null )
116: {
117: mb.addNotify();
118: mbpeer = (QtMenuBarPeer)mb.getPeer();
119: if( mbpeer == null )
120: throw new IllegalStateException("No menu bar peer.");
121: }
122: mbpeer.addMenus();
123: setMenu( mbpeer );
124: }
125: else
126: setMenu( null );
127: }
128:
129: public void setResizable(boolean resizeable)
130: {
131:
132: }
133:
134: public void setState(int s)
135: {
136: theState = s;
137:
138: }
139:
140: public void setBoundsPrivate(int x, int y, int width, int height)
141: {
142:
143:
144: }
145:
146: public void updateAlwaysOnTop()
147: {
148:
149:
150: }
151:
152: public boolean requestWindowFocus()
153: {
154:
155: return false;
156: }
157:
158: public Rectangle getBoundsPrivate()
159: {
160:
161: throw new InternalError("Not yet implemented");
162: }
163:
164: }