01: package com.xoetrope.svgscanner.model;
02:
03: import net.xoetrope.swing.XEdit;
04: import net.xoetrope.xml.XmlElement;
05: import net.xoetrope.xui.XPage;
06:
07: /**
08: *
09: * <p> Copyright (c) Xoetrope Ltd., 2001-2007, This software is licensed under
10: * the GNU Public License (GPL), please see license.txt for more details. If
11: * you make commercial use of this software you must purchase a commercial
12: * license from Xoetrope.</p>
13: * <p>$Revision: 1.7 $</p>
14: */
15: public class InsetsElementHandler extends SynthElementHandler {
16:
17: /** Creates a new instance of InsetsElementHandler */
18: public InsetsElementHandler() {
19: }
20:
21: public String getName(XmlElement e) {
22: String name = super .getName(e);
23: String attr;
24: if ((attr = e.getAttribute("id")) != null)
25: name += "(" + attr + ")";
26:
27: return name;
28: }
29:
30: /**
31: * Update the panel showing details of this type of element
32: * @param page the page with the UI for this component
33: */
34: public void updateUI(XPage page) {
35: XEdit idEdit = (XEdit) page.findComponent("insetsIdEdit");
36: String value = objectElement.getAttribute("id");
37: idEdit.setText(value);
38:
39: XEdit idRefEdit = (XEdit) page.findComponent("insetsIdRefEdit");
40: value = objectElement.getAttribute("idref");
41: idRefEdit.setText(value);
42:
43: XEdit idLeftEdit = (XEdit) page.findComponent("insetsLeft");
44: value = objectElement.getAttribute("left");
45: idLeftEdit.setText(value);
46:
47: XEdit idTopEdit = (XEdit) page.findComponent("insetsTop");
48: value = objectElement.getAttribute("top");
49: idTopEdit.setText(value);
50:
51: XEdit idRightEdit = (XEdit) page.findComponent("insetsRight");
52: value = objectElement.getAttribute("right");
53: idRightEdit.setText(value);
54:
55: XEdit idBottomEdit = (XEdit) page.findComponent("insetsBottom");
56: value = objectElement.getAttribute("bottom");
57: idBottomEdit.setText(value);
58: }
59: }
|