5dcc372f01479c2df210bca19b078fc865da337b
[scilab.git] / scilab / modules / graphic_objects / src / java / org / scilab / modules / graphic_objects / xmlloader / GOBuilder.java
1 package org.scilab.modules.graphic_objects.xmlloader;
2
3 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_BORDER_OPT_PADDING__;
4 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_DOCKABLE__;
5 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_GRID_OPT_GRID__;
6 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_GRID_OPT_PADDING__;
7 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_INFOBAR_VISIBLE__;
8 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_LAYOUT__;
9 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_LINE_THICKNESS__;
10 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_MARGINS__;
11 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_MENUBAR_VISIBLE__;
12 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_NAME__;
13 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_POSITION__;
14 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_RESIZE__;
15 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_SIZE__;
16 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_STYLE__;
17 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TAG__;
18 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TITLE__;
19 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TOOLBAR_VISIBLE__;
20 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TYPE__;
21 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_BORDER_POSITION__;
22 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_CHECKBOX__;
23 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTANGLE__;
24 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTNAME__;
25 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTSIZE__;
26 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTWEIGHT__;
27 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_COLOR__;
28 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_HIGHLIGHT_IN__;
29 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__;
30 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_IN_BORDER__;
31 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_JUSTIFICATION__;
32 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_OUT_BORDER__;
33 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_POSITION__;
34 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_ROUNDED__;
35 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_SHADOW_IN__;
36 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_SHADOW_OUT__;
37 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_STYLE__;
38 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_TITLE__;
39 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER__;
40 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME__;
41 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_ANCHOR__;
42 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_FILL__;
43 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_GRID__;
44 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_PADDING__;
45 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_WEIGHT__;
46 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_HORIZONTALALIGNMENT__;
47 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_MAX__;
48 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_PUSHBUTTON__;
49 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_STRING__;
50 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TAB__;
51 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TEXT__;
52 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_VISIBLE__;
53
54 import java.util.Map;
55
56 import org.scilab.modules.graphic_objects.builder.Builder;
57 import org.scilab.modules.graphic_objects.graphicController.GraphicController;
58 import org.scilab.modules.graphic_objects.graphicObject.GraphicObject;
59 import org.scilab.modules.graphic_objects.uicontrol.Uicontrol;
60 import org.scilab.modules.graphic_objects.uicontrol.frame.border.FrameBorder;
61 import org.scilab.modules.graphic_objects.uicontrol.frame.border.FrameBorder.BorderType;
62 import org.scilab.modules.graphic_objects.uicontrol.frame.border.FrameBorderType;
63 import org.scilab.modules.graphic_objects.utils.LayoutType;
64 import org.xml.sax.Attributes;
65
66 public class GOBuilder {
67     public static Integer figureBuilder(GraphicController controller, Attributes attributes) {
68         Integer fig = Builder.createFigure(false, 0, 0, false, false);
69         //Integer fig = Builder.createNewFigureWithAxes();
70         String item = null;
71
72         // hide toolbar
73         controller.setProperty(fig, __GO_TOOLBAR_VISIBLE__, false);
74
75         // hide menubar
76         controller.setProperty(fig, __GO_MENUBAR_VISIBLE__, false);
77
78         // hide infobar
79         controller.setProperty(fig, __GO_INFOBAR_VISIBLE__, false);
80
81         // remove docking bar
82         controller.setProperty(fig, __GO_DOCKABLE__, false);
83
84         // id
85         XmlTools.setPropAsString(fig, __GO_TAG__, attributes.getValue("id"));
86
87         // position
88         Integer[] position = (Integer[]) controller.getProperty(fig, __GO_POSITION__);
89
90         // posX
91         item = attributes.getValue("posX");
92         if (item != null) {
93             position[0] = Integer.parseInt(item);
94         }
95
96         // posY
97         item = attributes.getValue("posY");
98         if (item != null) {
99             position[1] = Integer.parseInt(item);
100         }
101
102         // set position
103         controller.setProperty(fig, __GO_POSITION__, position);
104
105         Integer[] size = (Integer[]) controller.getProperty(fig, __GO_SIZE__);
106         // width
107         item = attributes.getValue("width");
108         if (item != null) {
109             size[0] = Integer.parseInt(item);
110         }
111
112         // height
113         item = attributes.getValue("height");
114         if (item != null) {
115             size[1] = Integer.parseInt(item);
116         }
117
118         // set size
119         controller.setProperty(fig, __GO_SIZE__, size);
120
121         // title
122         XmlTools.setPropAsString(fig, __GO_NAME__, attributes.getValue("title"));
123
124         // icon
125         // XmlTools.setPropAsString(fig, __GO_ICON__,
126         // attributes.getValue("icon"));
127
128         // resizable
129         XmlTools.setPropAsBoolean(fig, __GO_RESIZE__, attributes.getValue("resizable"));
130
131         // layout and layout_options
132         setLayoutProperty(controller, fig, attributes.getValue("layout"));
133
134         // visible
135         XmlTools.setPropAsBoolean(fig, __GO_VISIBLE__, attributes.getValue("visible"));
136
137         return fig;
138     }
139
140     public static Integer uicontrolBuilder(GraphicController controller, int type, Attributes attributes, int parent) {
141         Integer uic = controller.askObject(GraphicObject.getTypeFromName(type));
142         return uicontrolUpdater(controller, uic, attributes, parent);
143     }
144
145     public static Integer uicontrolUpdater(GraphicController controller, int uic, Attributes attributes, int parent) {
146         return uicontrolUpdater(controller, uic, attributes, parent, null);
147     }
148
149     public static Integer uicontrolUpdater(GraphicController controller, int uic, Attributes attributes, int parent, Map<String, String> fromModel) {
150         String item = null;
151
152         try {
153             Map<String, String> map = null;
154             // Common attributes
155
156             // id
157             XmlTools.setPropAsString(uic, __GO_TAG__, attributes.getValue("id"));
158
159             // layout and layout_options
160             item = attributes.getValue("layout");
161             if (item == null && fromModel != null) {
162                 item = fromModel.get("layout");
163             }
164             setLayoutProperty(controller, uic, item);
165
166             // constraints
167
168             // get parent layout
169             LayoutType layout = LayoutType.NONE;
170             if (parent != 0) {
171                 layout = LayoutType.intToEnum((Integer) controller.getProperty(parent, __GO_LAYOUT__));
172             }
173
174             if (layout != LayoutType.NONE) {
175                 item = attributes.getValue("constraint");
176                 if (item == null && fromModel != null) {
177                     // use value from model if property is not in "declaration"
178                     item = XmlTools.getFromMap(fromModel, "constraint");
179                 }
180
181                 if (item != null) {
182                     map = CSSParser.parseLine(item);
183                 }
184
185                 switch (layout) {
186                     case BORDER: {
187                         item = XmlTools.getFromMap(map, "position", "center");
188                         controller.setProperty(uic, __GO_UI_BORDER_POSITION__, Uicontrol.BorderLayoutType.stringToEnum(item).ordinal());
189                         break;
190                     }
191                     case GRIDBAG: {
192                         Integer[] grid = new Integer[] { 0, 0, 0, 0 };
193                         grid[0] = Integer.parseInt(XmlTools.getFromMap(map, "gridx", "0"));
194                         grid[1] = Integer.parseInt(XmlTools.getFromMap(map, "gridy", "0"));
195                         grid[2] = Integer.parseInt(XmlTools.getFromMap(map, "gridwidth", "1"));
196                         grid[3] = Integer.parseInt(XmlTools.getFromMap(map, "gridheight", "1"));
197
198                         Double[] weight = new Double[] { 0.0, 0.0 };
199                         weight[0] = Double.parseDouble(XmlTools.getFromMap(map, "weightx", "1.0"));
200                         weight[1] = Double.parseDouble(XmlTools.getFromMap(map, "weighty", "1.0"));
201
202                         Integer fill = Uicontrol.FillType.stringToEnum(XmlTools.getFromMap(map, "fill", "none")).ordinal();
203                         Integer anchor = Uicontrol.AnchorType.stringToEnum(XmlTools.getFromMap(map, "anchor", "center")).ordinal();
204
205                         Integer[] padding = new Integer[] { 0, 0 };
206                         padding[0] = Integer.parseInt(XmlTools.getFromMap(map, "ipadx", "0"));
207                         padding[1] = Integer.parseInt(XmlTools.getFromMap(map, "ipady", "0"));
208
209                         controller.setProperty(uic, __GO_UI_GRIDBAG_GRID__, grid);
210                         controller.setProperty(uic, __GO_UI_GRIDBAG_WEIGHT__, weight);
211                         controller.setProperty(uic, __GO_UI_GRIDBAG_FILL__, fill);
212                         controller.setProperty(uic, __GO_UI_GRIDBAG_ANCHOR__, anchor);
213                         controller.setProperty(uic, __GO_UI_GRIDBAG_PADDING__, padding);
214                         break;
215                     }
216                     default:
217                         break;
218                 }
219
220                 // insets -> marging
221                 String insets = XmlTools.getFromMap(map, "insets", "0,0,0,0");
222                 Double[] margins = new Double[] { 0.0, 0.0, 0.0, 0.0 };
223                 String[] insert = insets.split(",");
224                 for (int i = 0; i < insert.length && i < 4; i++) {
225                     margins[i] = Double.parseDouble(insert[i]);
226                 }
227
228                 controller.setProperty(uic, __GO_MARGINS__, margins);
229             }
230
231             // specific attributes
232             Integer type = (Integer) controller.getProperty(uic, __GO_STYLE__);
233             switch (type) {
234                 case __GO_UI_FRAME__: {
235                     // border
236                     item = attributes.getValue("border");
237                     if (item == null && fromModel != null) {
238                         // use value from model if property is not in
239                         // "declaration"
240                         item = XmlTools.getFromMap(fromModel, "border");
241                     }
242
243                     if (item != null) {
244                         map = CSSParser.parseLine(item);
245                     }
246
247                     FrameBorderType borderType = FrameBorderType.stringToEnum(XmlTools.getFromMap(map, "name", "none"));
248                     Integer border = createBorder(controller, uic, borderType, map);
249                     controller.setProperty(uic, __GO_UI_FRAME_BORDER__, border);
250
251                     String[] text = new String[1];
252                     text[0] = attributes.getValue("tab-title");
253                     if (text[0] != null) {
254                         controller.setProperty(uic, __GO_UI_STRING__, text);
255                     }
256                     break;
257                 }
258
259                 case __GO_UI_TAB__: {
260                     item = attributes.getValue("ui-style");
261                     if (item != null) {
262                         map = CSSParser.parseLine(item);
263                         item = XmlTools.getFromMap(map, "bold", "false");
264                         if (item.equals("true")) {
265                             controller.setProperty(uic, __GO_UI_FONTWEIGHT__, "bold");
266                         }
267
268                         item = XmlTools.getFromMap(map, "italic", "false");
269                         if (item.equals("true")) {
270                             controller.setProperty(uic, __GO_UI_FONTANGLE__, "italic");
271                         }
272                     }
273                     break;
274                 }
275                 case __GO_UI_CHECKBOX__: {
276                     controller.setProperty(uic, __GO_UI_HORIZONTALALIGNMENT__, "left");
277
278                     String[] text = new String[1];
279                     text[0] = attributes.getValue("text");
280                     if (text[0] != null) {
281                         controller.setProperty(uic, __GO_UI_STRING__, text);
282                     }
283                     break;
284                 }
285                 case __GO_UI_PUSHBUTTON__: {
286                     String[] text = new String[1];
287                     text[0] = attributes.getValue("text");
288                     if (text[0] != null) {
289                         controller.setProperty(uic, __GO_UI_STRING__, text);
290                     }
291                     break;
292                 }
293                 case __GO_UI_TEXT__:
294                     controller.setProperty(uic, __GO_UI_HORIZONTALALIGNMENT__, "left");
295                     String[] text = new String[1];
296                     text[0] = attributes.getValue("text");
297                     if (text[0] != null) {
298                         controller.setProperty(uic, __GO_UI_STRING__, text);
299                     }
300
301                     String columns = attributes.getValue("columns");
302                     if (columns != null) {
303                         System.out.println("columns : " + columns);
304                         controller.setProperty(uic, __GO_UI_MAX__, Double.parseDouble(columns));
305                     }
306                     break;
307             }
308
309         } catch (CSSParserException e) {
310             e.printStackTrace();
311         }
312
313         return uic;
314     }
315
316     private static void setLayoutProperty(GraphicController controller, Integer uid, String item) {
317         try {
318             if (item != null) {
319                 Map<String, String> map = null;
320                 map = CSSParser.parseLine(item);
321                 item = map.get("name");
322                 LayoutType layout = LayoutType.stringToEnum(item);
323                 controller.setProperty(uid, __GO_LAYOUT__, layout.ordinal());
324
325                 // layout_options
326                 switch (layout) {
327                     case BORDER: {
328                         Integer[] pad = new Integer[] { 0, 0 };
329                         pad[0] = Integer.parseInt(XmlTools.getFromMap(map, "hgap", "0"));
330                         pad[1] = Integer.parseInt(XmlTools.getFromMap(map, "vgap", "0"));
331
332                         controller.setProperty(uid, __GO_BORDER_OPT_PADDING__, pad);
333                         break;
334                     }
335                     case GRID: {
336                         Integer[] grid = new Integer[] { 0, 0 };
337                         grid[0] = Integer.parseInt(XmlTools.getFromMap(map, "rows", "0"));
338                         grid[1] = Integer.parseInt(XmlTools.getFromMap(map, "cols", "0"));
339
340                         Integer[] pad = new Integer[] { 0, 0 };
341                         pad[0] = Integer.parseInt(XmlTools.getFromMap(map, "hgap", "0"));
342                         pad[1] = Integer.parseInt(XmlTools.getFromMap(map, "vgap", "0"));
343
344                         controller.setProperty(uid, __GO_GRID_OPT_GRID__, grid);
345                         controller.setProperty(uid, __GO_GRID_OPT_PADDING__, pad);
346                         break;
347                     }
348                     default:
349                     case GRIDBAG:
350                     case NONE:
351                         // nothing to do
352                         break;
353                 }
354             }
355         } catch (CSSParserException e) {
356             e.printStackTrace();
357         }
358
359     }
360
361     private static Integer createBorder(GraphicController controller, Integer uic, FrameBorderType borderType, Map<String, String> map) {
362         Integer border = controller.askObject(GraphicObject.getTypeFromName(__GO_UI_FRAME_BORDER__));
363         controller.setProperty(border, __GO_UI_FRAME_BORDER_STYLE__, borderType.ordinal());
364
365         switch (borderType) {
366             case SOFTBEVEL:
367             case BEVEL: {
368                 BorderType etching = BorderType.stringToEnum(XmlTools.getFromMap(map, "type", "none"));
369                 String color = XmlTools.getFromMap(map, "color", "black");
370
371                 controller.setProperty(border, __GO_TYPE__, etching.ordinal());
372                 controller.setProperty(border, __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__, color);
373                 controller.setProperty(border, __GO_UI_FRAME_BORDER_HIGHLIGHT_IN__, color);
374                 controller.setProperty(border, __GO_UI_FRAME_BORDER_SHADOW_OUT__, color);
375                 controller.setProperty(border, __GO_UI_FRAME_BORDER_SHADOW_IN__, color);
376                 break;
377             }
378             case COMPOUND: {
379                 FrameBorderType borderOut = FrameBorderType.stringToEnum(XmlTools.getFromMap(map, "border-out", "none"));
380                 FrameBorderType borderIn = FrameBorderType.stringToEnum(XmlTools.getFromMap(map, "border-in", "none"));
381
382                 Integer out = createBorder(controller, border, borderOut, map);
383                 Integer in = createBorder(controller, border, borderIn, map);
384
385                 controller.setProperty(border, __GO_UI_FRAME_BORDER_OUT_BORDER__, out);
386                 controller.setProperty(border, __GO_UI_FRAME_BORDER_IN_BORDER__, in);
387
388                 break;
389             }
390             case EMPTY: {
391                 Double[] position = new Double[4];
392                 position[0] = Double.parseDouble(XmlTools.getFromMap(map, "top", "0"));
393                 position[1] = Double.parseDouble(XmlTools.getFromMap(map, "left", "0"));
394                 position[2] = Double.parseDouble(XmlTools.getFromMap(map, "right", "0"));
395                 position[3] = Double.parseDouble(XmlTools.getFromMap(map, "bottom", "0"));
396
397                 controller.setProperty(border, __GO_POSITION__, position);
398                 break;
399             }
400             case ETCHED: {
401                 BorderType etching = BorderType.stringToEnum(XmlTools.getFromMap(map, "type", "none"));
402                 String color = XmlTools.getFromMap(map, "color", "black");
403
404                 controller.setProperty(border, __GO_TYPE__, etching.ordinal());
405                 controller.setProperty(border, __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__, color);
406                 controller.setProperty(border, __GO_UI_FRAME_BORDER_HIGHLIGHT_IN__, color);
407                 break;
408             }
409             case LINE: {
410                 String color = XmlTools.getFromMap(map, "color", "black");
411                 Integer thickness = Integer.parseInt(XmlTools.getFromMap(map, "thickness", "1"));
412                 Boolean rounded = Boolean.parseBoolean(XmlTools.getFromMap(map, "rounded", "false"));
413
414                 controller.setProperty(border, __GO_UI_FRAME_BORDER_COLOR__, color);
415                 controller.setProperty(border, __GO_LINE_THICKNESS__, thickness);
416                 controller.setProperty(border, __GO_UI_FRAME_BORDER_ROUNDED__, rounded);
417                 break;
418             }
419             case MATTE: {
420                 Double[] position = new Double[4];
421                 position[0] = Double.parseDouble(XmlTools.getFromMap(map, "top", "0"));
422                 position[1] = Double.parseDouble(XmlTools.getFromMap(map, "left", "0"));
423                 position[2] = Double.parseDouble(XmlTools.getFromMap(map, "right", "0"));
424                 position[3] = Double.parseDouble(XmlTools.getFromMap(map, "bottom", "0"));
425                 String color = XmlTools.getFromMap(map, "color", "black");
426
427                 controller.setProperty(border, __GO_POSITION__, position);
428                 controller.setProperty(border, __GO_UI_FRAME_BORDER_COLOR__, color);
429                 break;
430             }
431             case TITLED: {
432
433                 FrameBorderType borderOut = FrameBorderType.stringToEnum(XmlTools.getFromMap(map, "border", "none"));
434                 Integer out = createBorder(controller, border, borderOut, map);
435                 String title = XmlTools.getFromMap(map, "title", "");
436                 FrameBorder.JustificationType justify = FrameBorder.JustificationType.stringToEnum(XmlTools.getFromMap(map, "justify", "leading"));
437                 String fontName = XmlTools.getFromMap(map, "font-name", "");
438                 String fontAngle = XmlTools.getFromMap(map, "italic", "false") == "false" ? "normal" : "italic";
439                 Integer fontSize = Integer.parseInt(XmlTools.getFromMap(map, "font-size", "0"));
440                 String fontWeight = XmlTools.getFromMap(map, "bold", "false") == "false" ? "normal" : "bold";
441                 
442                 FrameBorder.TitlePositionType position = FrameBorder.TitlePositionType.stringToEnum(XmlTools.getFromMap(map, "position", "leading"));
443
444                 String color = XmlTools.getFromMap(map, "color", "black");
445
446                 controller.setProperty(border, __GO_UI_FRAME_BORDER_OUT_BORDER__, out);
447
448                 controller.setProperty(border, __GO_UI_FRAME_BORDER_TITLE__, out);
449                 controller.setProperty(border, __GO_TITLE__, title);
450                 controller.setProperty(border, __GO_UI_FRAME_BORDER_JUSTIFICATION__, justify.ordinal());
451                 controller.setProperty(border, __GO_UI_FONTNAME__, fontName);
452                 controller.setProperty(border, __GO_UI_FONTANGLE__, fontAngle);
453                 controller.setProperty(border, __GO_UI_FONTSIZE__, fontSize);
454                 controller.setProperty(border, __GO_UI_FONTWEIGHT__, fontWeight);
455                 controller.setProperty(border, __GO_UI_FRAME_BORDER_POSITION__, position.ordinal());
456                 controller.setProperty(border, __GO_UI_FRAME_BORDER_COLOR__, color);
457
458                 break;
459             }
460             case NONE:
461             default:
462                 break;
463         }
464
465         return border;
466     }
467
468 }