01: /*
02: #IFNDEF ALT_LICENSE
03: ThinWire(R) RIA Ajax Framework
04: Copyright (C) 2003-2007 Custom Credit Systems
05:
06: This library is free software; you can redistribute it and/or modify it under
07: the terms of the GNU Lesser General Public License as published by the Free
08: Software Foundation; either version 2.1 of the License, or (at your option) any
09: later version.
10:
11: This library is distributed in the hope that it will be useful, but WITHOUT ANY
12: WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13: PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14:
15: You should have received a copy of the GNU Lesser General Public License along
16: with this library; if not, write to the Free Software Foundation, Inc., 59
17: Temple Place, Suite 330, Boston, MA 02111-1307 USA
18:
19: Users who would rather have a commercial license, warranty or support should
20: contact the following company who invented, built and supports the technology:
21:
22: Custom Credit Systems, Richardson, TX 75081, USA.
23: email: info@thinwire.com ph: +1 (888) 644-6405
24: http://www.thinwire.com
25: #ENDIF
26: [ v1.2_RC2 ]
27: */
28: package thinwire.render.web;
29:
30: import thinwire.ui.Component;
31:
32: /**
33: * @author Joshua J. Gertzen
34: */
35: final class FrameRenderer extends WindowRenderer {
36: private static final String FRAME_CLASS = "tw_Frame";
37:
38: void render(WindowRenderer wr, Component c,
39: ComponentRenderer container) {
40: init(FRAME_CLASS, wr, c, container);
41: setPropertyChangeIgnored(Component.PROPERTY_X, true);
42: setPropertyChangeIgnored(Component.PROPERTY_Y, true);
43: setPropertyChangeIgnored(Component.PROPERTY_WIDTH, true);
44: setPropertyChangeIgnored(Component.PROPERTY_HEIGHT, true);
45: super .render(wr, c, null);
46: }
47:
48: public void componentChange(WebComponentEvent event) {
49: String name = event.getName();
50: String value = (String) event.getValue();
51:
52: if (name.equals("frameSize")) {
53: String[] ary = value.split(",");
54: ai.setPackagePrivateMember("innerWidth", comp, Integer
55: .valueOf(ary[0]));
56: ai.setPackagePrivateMember("innerHeight", comp, Integer
57: .valueOf(ary[1]));
58: ai.setPackagePrivateMember("frameSize", comp,
59: new Integer[] { Integer.valueOf(ary[2]),
60: Integer.valueOf(ary[3]) });
61: } else {
62: super.componentChange(event);
63: }
64: }
65: }
|