fix latex trouble from xml, add preferredsize in border constraints 33/13833/3
Antoine ELIAS [Tue, 25 Feb 2014 22:18:25 +0000 (23:18 +0100)]
Change-Id: Ia7b30119de1decdb947fa07831c47b972a7ad9f4

15 files changed:
scilab/modules/graphic_objects/includes/graphicObjectProperties.h
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/graphicObject/GraphicObjectProperties.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/uicontrol/Uicontrol.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/xmlloader/GOBuilder.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/xmlloader/XMLDomLoader.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/xmlloader/XmlLoader.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/xmlloader/XmlSaver.java
scilab/modules/graphic_objects/src/scripts/propertiesMap.properties
scilab/modules/graphics/macros/%BorderCo_p.sci
scilab/modules/graphics/macros/createConstraints.sci
scilab/modules/graphics/src/c/getHandleProperty/get_constraints_property.c
scilab/modules/graphics/src/c/getHandleProperty/set_constraints_property.c
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/frame/SwingScilabFrame.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/frame/SwingScilabScrollableFrame.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/tab/SwingScilabCommonPanel.java

index af75180..438f2cc 100755 (executable)
 #define __GO_UI_GRID_GRID__ 357
 #define __GO_UI_GRID_PADDING__ 358
 #define __GO_UI_BORDER_POSITION__ 359
-#define __GO_GRID_OPT_GRID__ 360
-#define __GO_GRID_OPT_PADDING__ 361
-#define __GO_BORDER_OPT_PADDING__ 362
-#define __GO_UI_FRAME_BORDER__ 363
-#define __GO_UI_FRAME_BORDER_COLOR__ 364
-#define __GO_UI_FRAME_BORDER_HIGHLIGHT_IN__ 365
-#define __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__ 366
-#define __GO_UI_FRAME_BORDER_IN_BORDER__ 367
-#define __GO_UI_FRAME_BORDER_JUSTIFICATION__ 368
-#define __GO_UI_FRAME_BORDER_OUT_BORDER__ 369
-#define __GO_UI_FRAME_BORDER_ROUNDED__ 370
-#define __GO_UI_FRAME_BORDER_SHADOW_IN__ 371
-#define __GO_UI_FRAME_BORDER_SHADOW_OUT__ 372
-#define __GO_UI_FRAME_BORDER_TITLE__ 373
-#define __GO_UI_FRAME_BORDER_POSITION__ 374
-#define __GO_UI_FRAME_BORDER_STYLE__ 375
-#define __GO_UI_GROUP_NAME__ 376
-#define __GO_UI_TITLE_POSITION__ 377
-#define __GO_UI_TITLE_SCROLL__ 378
-#define __GO_UI_FRAME_BORDER_TYPE__ 379
-#define __GO_UI_SCROLLABLE__ 380
+#define __GO_UI_BORDER_PREFERREDSIZE__ 360
+#define __GO_GRID_OPT_GRID__ 361
+#define __GO_GRID_OPT_PADDING__ 362
+#define __GO_BORDER_OPT_PADDING__ 363
+#define __GO_UI_FRAME_BORDER__ 364
+#define __GO_UI_FRAME_BORDER_COLOR__ 365
+#define __GO_UI_FRAME_BORDER_HIGHLIGHT_IN__ 366
+#define __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__ 367
+#define __GO_UI_FRAME_BORDER_IN_BORDER__ 368
+#define __GO_UI_FRAME_BORDER_JUSTIFICATION__ 369
+#define __GO_UI_FRAME_BORDER_OUT_BORDER__ 370
+#define __GO_UI_FRAME_BORDER_ROUNDED__ 371
+#define __GO_UI_FRAME_BORDER_SHADOW_IN__ 372
+#define __GO_UI_FRAME_BORDER_SHADOW_OUT__ 373
+#define __GO_UI_FRAME_BORDER_TITLE__ 374
+#define __GO_UI_FRAME_BORDER_POSITION__ 375
+#define __GO_UI_FRAME_BORDER_STYLE__ 376
+#define __GO_UI_GROUP_NAME__ 377
+#define __GO_UI_TITLE_POSITION__ 378
+#define __GO_UI_TITLE_SCROLL__ 379
+#define __GO_UI_FRAME_BORDER_TYPE__ 380
+#define __GO_UI_SCROLLABLE__ 381
 
 #endif /* !__GRAPHIC_OBJECT_PROPERTIES_H__ */
index aa6ac9b..a146823 100755 (executable)
@@ -380,26 +380,27 @@ public class GraphicObjectProperties {
     public static final int __GO_UI_GRID_GRID__ = 357;
     public static final int __GO_UI_GRID_PADDING__ = 358;
     public static final int __GO_UI_BORDER_POSITION__ = 359;
-    public static final int __GO_GRID_OPT_GRID__ = 360;
-    public static final int __GO_GRID_OPT_PADDING__ = 361;
-    public static final int __GO_BORDER_OPT_PADDING__ = 362;
-    public static final int __GO_UI_FRAME_BORDER__ = 363;
-    public static final int __GO_UI_FRAME_BORDER_COLOR__ = 364;
-    public static final int __GO_UI_FRAME_BORDER_HIGHLIGHT_IN__ = 365;
-    public static final int __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__ = 366;
-    public static final int __GO_UI_FRAME_BORDER_IN_BORDER__ = 367;
-    public static final int __GO_UI_FRAME_BORDER_JUSTIFICATION__ = 368;
-    public static final int __GO_UI_FRAME_BORDER_OUT_BORDER__ = 369;
-    public static final int __GO_UI_FRAME_BORDER_ROUNDED__ = 370;
-    public static final int __GO_UI_FRAME_BORDER_SHADOW_IN__ = 371;
-    public static final int __GO_UI_FRAME_BORDER_SHADOW_OUT__ = 372;
-    public static final int __GO_UI_FRAME_BORDER_TITLE__ = 373;
-    public static final int __GO_UI_FRAME_BORDER_POSITION__ = 374;
-    public static final int __GO_UI_FRAME_BORDER_STYLE__ = 375;
-    public static final int __GO_UI_GROUP_NAME__ = 376;
-    public static final int __GO_UI_TITLE_POSITION__ = 377;
-    public static final int __GO_UI_TITLE_SCROLL__ = 378;
-    public static final int __GO_UI_FRAME_BORDER_TYPE__ = 379;
-    public static final int __GO_UI_SCROLLABLE__ = 380;
+    public static final int __GO_UI_BORDER_PREFERREDSIZE__ = 360;
+    public static final int __GO_GRID_OPT_GRID__ = 361;
+    public static final int __GO_GRID_OPT_PADDING__ = 362;
+    public static final int __GO_BORDER_OPT_PADDING__ = 363;
+    public static final int __GO_UI_FRAME_BORDER__ = 364;
+    public static final int __GO_UI_FRAME_BORDER_COLOR__ = 365;
+    public static final int __GO_UI_FRAME_BORDER_HIGHLIGHT_IN__ = 366;
+    public static final int __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__ = 367;
+    public static final int __GO_UI_FRAME_BORDER_IN_BORDER__ = 368;
+    public static final int __GO_UI_FRAME_BORDER_JUSTIFICATION__ = 369;
+    public static final int __GO_UI_FRAME_BORDER_OUT_BORDER__ = 370;
+    public static final int __GO_UI_FRAME_BORDER_ROUNDED__ = 371;
+    public static final int __GO_UI_FRAME_BORDER_SHADOW_IN__ = 372;
+    public static final int __GO_UI_FRAME_BORDER_SHADOW_OUT__ = 373;
+    public static final int __GO_UI_FRAME_BORDER_TITLE__ = 374;
+    public static final int __GO_UI_FRAME_BORDER_POSITION__ = 375;
+    public static final int __GO_UI_FRAME_BORDER_STYLE__ = 376;
+    public static final int __GO_UI_GROUP_NAME__ = 377;
+    public static final int __GO_UI_TITLE_POSITION__ = 378;
+    public static final int __GO_UI_TITLE_SCROLL__ = 379;
+    public static final int __GO_UI_FRAME_BORDER_TYPE__ = 380;
+    public static final int __GO_UI_SCROLLABLE__ = 381;
 
 }
index 22713af..9050979 100644 (file)
@@ -14,8 +14,8 @@
 
 package org.scilab.modules.graphic_objects.uicontrol;
 
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_GRID_OPT_GRID__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_BORDER_OPT_PADDING__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_GRID_OPT_GRID__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_GRID_OPT_PADDING__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_LAYOUT_SET__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_LAYOUT__;
@@ -25,6 +25,7 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UICONTROL__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_BACKGROUNDCOLOR__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_BORDER_POSITION__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_BORDER_PREFERREDSIZE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_CHECKBOX__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_EDIT__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ENABLE__;
@@ -316,6 +317,7 @@ public class Uicontrol extends GraphicObject {
     private Integer[] gridbagPadding = new Integer[] {0, 0};
     private Integer[] gridbagPreferredSize = new Integer[] { -1, -1};
     private BorderLayoutType borderPosition = BorderLayoutType.CENTER;
+    private Integer[] borderPreferredSize = new Integer[] { -1, -1};
     private String icon = "";
 
     /** layout options */
@@ -376,6 +378,7 @@ public class Uicontrol extends GraphicObject {
         GRIDBAG_PADDING,
         GRIDBAG_PREFERREDSIZE,
         BORDER_POSITION,
+        BORDER_PREFERREDSIZE,
         GRIDOPT_GRID,
         GRIDOPT_PADDING,
         BORDEROPT_PADDING,
@@ -595,6 +598,8 @@ public class Uicontrol extends GraphicObject {
                 return UicontrolProperty.GRIDBAG_PREFERREDSIZE;
             case __GO_UI_BORDER_POSITION__:
                 return UicontrolProperty.BORDER_POSITION;
+            case __GO_UI_BORDER_PREFERREDSIZE__:
+                return UicontrolProperty.BORDER_PREFERREDSIZE;
             case __GO_GRID_OPT_GRID__:
                 return UicontrolProperty.GRIDOPT_GRID;
             case __GO_GRID_OPT_PADDING__:
@@ -696,6 +701,8 @@ public class Uicontrol extends GraphicObject {
             return getGridBagPreferredSize();
         } else if (property == UicontrolProperty.BORDER_POSITION) {
             return getBorderPosition();
+        } else if (property == UicontrolProperty.BORDER_PREFERREDSIZE) {
+            return getBorderPreferredSize();
         } else if (property == UicontrolProperty.GRIDOPT_GRID) {
             return getGridOptGrid();
         } else if (property == UicontrolProperty.GRIDOPT_PADDING) {
@@ -794,6 +801,8 @@ public class Uicontrol extends GraphicObject {
                 return setGridBagPreferredSize((Integer[]) value);
             case BORDER_POSITION:
                 return setBorderPosition((Integer) value);
+            case BORDER_PREFERREDSIZE:
+                return setBorderPreferredSize((Integer[]) value);
             case GRIDOPT_GRID:
                 return setGridOptGrid((Integer[]) value);
             case GRIDOPT_PADDING:
@@ -1310,6 +1319,26 @@ public class Uicontrol extends GraphicObject {
         return status;
     }
 
+    public Integer[] getBorderPreferredSize() {
+        return borderPreferredSize;
+    }
+
+    public UpdateStatus setBorderPreferredSize(Integer[] value) {
+        UpdateStatus status = UpdateStatus.NoChange;
+        if (borderPreferredSize.length != value.length) {
+            return UpdateStatus.Fail;
+        }
+
+        for (int i = 0 ; i < value.length ; i++) {
+            if (borderPreferredSize[i] != value[i]) {
+                borderPreferredSize[i] = value[i];
+                status = UpdateStatus.Success;
+            }
+        }
+
+        return status;
+    }
+
     public Integer getGridBagAnchor() {
         return gridbagAnchor.ordinal();
     }
index 78e294f..155d6d8 100644 (file)
@@ -1,9 +1,9 @@
 package org.scilab.modules.graphic_objects.xmlloader;
 
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_DOCKABLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_CALLBACK__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_CALLBACKTYPE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_BORDER_OPT_PADDING__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_CALLBACKTYPE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_CALLBACK__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_DOCKABLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_GRID_OPT_GRID__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_GRID_OPT_PADDING__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_INFOBAR_VISIBLE__;
@@ -22,7 +22,9 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TYPE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_BACKGROUNDCOLOR__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_BORDER_POSITION__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_BORDER_PREFERREDSIZE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_CHECKBOX__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_EDIT__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ENABLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTANGLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTNAME__;
@@ -49,20 +51,19 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_PADDING__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_PREFERREDSIZE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_WEIGHT__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GROUP_NAME__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_HORIZONTALALIGNMENT__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ICON__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_LISTBOX__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_MAX__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_MIN__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_POPUPMENU__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_PUSHBUTTON__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_RADIOBUTTON__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_SCROLLABLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_STRING__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TAB__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TEXT__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_EDIT__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_POPUPMENU__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_LISTBOX__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_RADIOBUTTON__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GROUP_NAME__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_VISIBLE__;
 
 import java.awt.Color;
@@ -173,7 +174,14 @@ public class GOBuilder {
             }
         }
 
-        Integer uic = controller.askObject(GraphicObject.getTypeFromName(type));
+        Integer uic = 0;
+        if (type == -1) { //label latex
+            uic = controller.askObject(GraphicObject.getTypeFromName(__GO_UI_TEXT__));
+            controller.setProperty(uic, __GO_UI_STRING__, new String[] {"$$"});
+        } else {
+            uic = controller.askObject(GraphicObject.getTypeFromName(type));
+        }
+
         return uicontrolUpdater(controller, uic, attributes, parent);
     }
 
@@ -231,7 +239,6 @@ public class GOBuilder {
             //backgroundcolor
             item = attributes.getValue("background");
             if (item != null) {
-
                 controller.setProperty(uic, __GO_UI_BACKGROUNDCOLOR__, getColor(item));
             }
 
@@ -243,6 +250,19 @@ public class GOBuilder {
                 layout = LayoutType.intToEnum((Integer) controller.getProperty(parent, __GO_LAYOUT__));
             }
 
+
+            //font properties
+            item = attributes.getValue("font-name");
+            if (item != null) {
+                controller.setProperty(uic, __GO_UI_FONTNAME__, item);
+            }
+
+            item = attributes.getValue("font-size");
+            if (item != null) {
+                controller.setProperty(uic, __GO_UI_FONTSIZE__, Double.parseDouble(item));
+            }
+
+
             if (layout != LayoutType.NONE) {
                 item = attributes.getValue("constraint");
                 if (item == null && fromModel != null) {
@@ -258,6 +278,16 @@ public class GOBuilder {
                     case BORDER: {
                         item = XmlTools.getFromMap(map, "position", "center");
                         controller.setProperty(uic, __GO_UI_BORDER_POSITION__, Uicontrol.BorderLayoutType.stringToEnum(item).ordinal());
+                        Integer[] preferredsize = new Integer[] { -1, -1};
+                        item = attributes.getValue("preferred-size");
+                        if (item != null) {
+                            String[] pref = item.split(",");
+                            for (int i = 0; i < pref.length && i < 4; i++) {
+                                preferredsize[i] = Integer.parseInt(pref[i]);
+                            }
+                        }
+
+                        controller.setProperty(uic, __GO_UI_BORDER_PREFERREDSIZE__, preferredsize);
                         break;
                     }
                     case GRIDBAG: {
@@ -368,6 +398,12 @@ public class GOBuilder {
                         controller.setProperty(uic, __GO_UI_STRING__, text);
                     }
 
+                    //groupname
+                    item = attributes.getValue("button-group");
+                    if (item != null && item.equals("") == false) {
+                        controller.setProperty(uic, __GO_UI_GROUP_NAME__, item);
+                    }
+
                     //callback
                     item = attributes.getValue("onclick");
                     if (item != null && item.equals("") == false) {
@@ -375,12 +411,6 @@ public class GOBuilder {
                         controller.setProperty(uic, __GO_CALLBACKTYPE__, 0);
                     }
 
-                    //groupname
-                    item = attributes.getValue("button-group");
-                    if (item != null && item.equals("") == false) {
-                        controller.setProperty(uic, __GO_UI_GROUP_NAME__, item);
-                    }
-
                     break;
                 }
                 case __GO_UI_RADIOBUTTON__: {
@@ -390,6 +420,12 @@ public class GOBuilder {
                         controller.setProperty(uic, __GO_UI_STRING__, text);
                     }
 
+                    //groupname
+                    item = attributes.getValue("button-group");
+                    if (item != null && item.equals("") == false) {
+                        controller.setProperty(uic, __GO_UI_GROUP_NAME__, item);
+                    }
+
                     //callback
                     item = attributes.getValue("onclick");
                     if (item != null && item.equals("") == false) {
@@ -397,12 +433,6 @@ public class GOBuilder {
                         controller.setProperty(uic, __GO_CALLBACKTYPE__, 0);
                     }
 
-                    //groupname
-                    item = attributes.getValue("button-group");
-                    if (item != null && item.equals("") == false) {
-                        controller.setProperty(uic, __GO_UI_GROUP_NAME__, item);
-                    }
-
                     break;
                 }
                 case __GO_UI_PUSHBUTTON__: {
@@ -435,6 +465,10 @@ public class GOBuilder {
                     String[] text = new String[1];
                     text[0] = attributes.getValue("text");
                     if (text[0] != null) {
+                        String[] old = (String[])controller.getProperty(uic, __GO_UI_STRING__);
+                        if (old != null && old[0] != null && old[0].equals("$$")) {
+                            text[0] = "$" + text[0] + "$";
+                        }
                         controller.setProperty(uic, __GO_UI_STRING__, text);
                     }
 
@@ -447,6 +481,11 @@ public class GOBuilder {
                     break;
                 }
                 case __GO_UI_EDIT__ : {
+                    item = attributes.getValue("columns");
+                    if (item != null) {
+                        controller.setProperty(uic, __GO_UI_MAX__, Double.parseDouble(item));
+                    }
+
                     //callback
                     item = attributes.getValue("onenter");
                     if (item != null && item.equals("") == false) {
@@ -454,11 +493,6 @@ public class GOBuilder {
                         controller.setProperty(uic, __GO_CALLBACKTYPE__, 0);
                     }
 
-                    item = attributes.getValue("columns");
-                    if (item != null) {
-                        controller.setProperty(uic, __GO_UI_MAX__, Double.parseDouble(item));
-                    }
-
                     break;
                 }
                 case __GO_UI_POPUPMENU__ : {
@@ -482,11 +516,9 @@ public class GOBuilder {
                     break;
                 }
                 case __GO_UI_LISTBOX__ : {
-                    //callback
-                    item = attributes.getValue("onclick");
+                    item = attributes.getValue("items");
                     if (item != null && item.equals("") == false) {
-                        controller.setProperty(uic, __GO_CALLBACK__, item);
-                        controller.setProperty(uic, __GO_CALLBACKTYPE__, 0);
+                        controller.setProperty(uic, __GO_UI_STRING__, new String[] {item});
                     }
 
                     item = attributes.getValue("multiple");
@@ -495,6 +527,13 @@ public class GOBuilder {
                         controller.setProperty(uic, __GO_UI_MAX__, 2.0);
                     }
 
+                    //callback
+                    item = attributes.getValue("onclick");
+                    if (item != null && item.equals("") == false) {
+                        controller.setProperty(uic, __GO_CALLBACK__, item);
+                        controller.setProperty(uic, __GO_CALLBACKTYPE__, 0);
+                    }
+
                     break;
                 }
             }
index 25cc787..0ae9c16 100644 (file)
@@ -1,103 +1,6 @@
 package org.scilab.modules.graphic_objects.xmlloader;
 
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_AXES__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_AUTORESIZE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_ANTIALIASING__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_AXES_SIZE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_BACKGROUND__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_BORDER_OPT_PADDING__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_CALLBACKTYPE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_CALLBACK__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_CLOSEREQUESTFCN__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_DEFAULT_AXES__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_DOCKABLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_EVENTHANDLER_ENABLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_EVENTHANDLER_NAME__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_FIGURE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_GRID_OPT_GRID__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_GRID_OPT_PADDING__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_ID__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_IMMEDIATE_DRAWING__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_INFOBAR_VISIBLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_INFO_MESSAGE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_LAYOUT__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_LINE_THICKNESS__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_MARGINS__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_MENUBAR_VISIBLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_MENUBAR__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_NAME__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_PIXEL_DRAWING_MODE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_POSITION__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_RESIZEFCN__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_RESIZE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_ROTATION_TYPE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_SIZE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TAG__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TITLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TOOLBAR_VISIBLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TOOLBAR__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UICONTEXTMENU__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UIMENU__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_BACKGROUNDCOLOR__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_BORDER_POSITION__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_CHECKBOX__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_EDIT__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ENABLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTANGLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTNAME__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTSIZE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTUNITS__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTWEIGHT__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FOREGROUNDCOLOR__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_COLOR__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_HIGHLIGHT_IN__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_IN_BORDER__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_JUSTIFICATION__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_OUT_BORDER__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_POSITION__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_ROUNDED__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_SHADOW_IN__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_SHADOW_OUT__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_STYLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_TITLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_TYPE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_SCROLLABLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_ANCHOR__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_FILL__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_GRID__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_PADDING__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_PREFERREDSIZE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_WEIGHT__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GROUP_NAME__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_HORIZONTALALIGNMENT__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ICON__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_IMAGE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_LAYER__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_LISTBOXTOP__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_LISTBOX__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_MAX__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_MIN__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_POPUPMENU__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_PUSHBUTTON__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_RADIOBUTTON__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_RELIEF__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_SCROLLABLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_SLIDERSTEP__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_SLIDER__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_STRING__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TABLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TAB__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TEXT__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TOOLTIPSTRING__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_UNITS__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_VALUE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_VERTICALALIGNMENT__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_USEDEPRECATEDLF__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_VIEWPORT__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_VISIBLE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.*;
 
 import java.io.File;
 import java.util.HashMap;
@@ -236,6 +139,7 @@ public class XMLDomLoader {
         UiPropToGO.put("gridbagpadding", new Pair<Integer, ModelType>(__GO_UI_GRIDBAG_PADDING__, ModelType.INTEGER_ARRAY));
         UiPropToGO.put("gridbagpreferredsize", new Pair<Integer, ModelType>(__GO_UI_GRIDBAG_PREFERREDSIZE__, ModelType.INTEGER_ARRAY));
         UiPropToGO.put("borderposition", new Pair<Integer, ModelType>(__GO_UI_BORDER_POSITION__, ModelType.INTEGER));
+        UiPropToGO.put("borderpreferredsize", new Pair<Integer, ModelType>(__GO_UI_BORDER_PREFERREDSIZE__, ModelType.INTEGER_ARRAY));
         UiPropToGO.put("margins", new Pair<Integer, ModelType>(__GO_MARGINS__, ModelType.DOUBLE_ARRAY));
         UiPropToGO.put("groupname", new Pair<Integer, ModelType>(__GO_UI_GROUP_NAME__, ModelType.STRING));
         UiPropToGO.put("icon", new Pair<Integer, ModelType>(__GO_UI_ICON__, ModelType.STRING));
index 155ab82..44e836e 100644 (file)
@@ -13,9 +13,9 @@
 package org.scilab.modules.graphic_objects.xmlloader;
 
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_AXES__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TYPE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_CHILDREN__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_FIGURE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TYPE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_CHECKBOX__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_EDIT__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME__;
@@ -48,7 +48,6 @@ import org.scilab.modules.graphic_objects.ScilabNativeView;
 import org.scilab.modules.graphic_objects.builder.Builder;
 import org.scilab.modules.graphic_objects.graphicController.GraphicController;
 import org.scilab.modules.graphic_objects.graphicModel.GraphicModel;
-import org.scilab.modules.graphic_objects.graphicObject.GraphicObject;
 import org.scilab.modules.graphic_objects.graphicObject.GraphicObject.Type;
 import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
 import org.xml.sax.Attributes;
@@ -82,6 +81,7 @@ public class XmlLoader extends DefaultHandler {
         nameToGO.put("UILayer", __GO_UI_LAYER__);
         nameToGO.put("UIButton", __GO_UI_PUSHBUTTON__);
         nameToGO.put("UILabel", __GO_UI_TEXT__);
+        nameToGO.put("UILaTeXLabel", -1);
         nameToGO.put("UICheckbox", __GO_UI_CHECKBOX__);
         nameToGO.put("UITextfield", __GO_UI_EDIT__);
         nameToGO.put("UISplashScreen", __GO_UI_IMAGE__);
@@ -241,7 +241,7 @@ public class XmlLoader extends DefaultHandler {
         } else {
             Integer uitype = getTypeFromName(localName);
             Integer go = 0;
-            if (uitype != null && uitype.intValue() > 0) {
+            if (uitype != null) {
                 if (uitype == __GO_FIGURE__) {
                     // never create a new figure, clone figure model !
                     go = GOBuilder.figureBuilder(controller, attributes);
index 3427835..16c647f 100644 (file)
@@ -346,6 +346,7 @@ public class XmlSaver {
             setAttribute(elemUi, "gridbagpreferredsize", createAttribute(uic.getGridBagPreferredSize()), createAttribute(defaultUi.getGridBagPreferredSize()));
         } else if (layout == LayoutType.BORDER) {
             setAttribute(elemUi, "borderposition", createAttribute(uic.getBorderPosition()), createAttribute(defaultUi.getBorderPosition()));
+            setAttribute(elemUi, "borderpreferredsize", createAttribute(uic.getBorderPreferredSize()), createAttribute(defaultUi.getBorderPreferredSize()));
         } else if (layout == LayoutType.NONE) {
             //Position
             setAttribute(elemUi, "position", createAttribute(uic.getUiPosition()), createAttribute(defaultUi.getUiPosition()));
index b1fbd5a..ffc624b 100755 (executable)
@@ -407,6 +407,7 @@ __GO_UI_GRID_GRID__
 __GO_UI_GRID_PADDING__
 
 __GO_UI_BORDER_POSITION__
+__GO_UI_BORDER_PREFERREDSIZE__
 
 
 __GO_GRID_OPT_GRID__
index 2c1ae81..5ae9865 100644 (file)
@@ -7,5 +7,6 @@
 // http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
 function %BorderCo_p(t)
     printf("Border Layout\n");
-    printf("  Position : %s\n", sci2exp(t.position));
+    printf("  Position      : %s\n", sci2exp(t.position));
+    printf("  PreferredSize : %s\n", sci2exp(t.preferredsize));
 endfunction
index 02b4587..66b9f6f 100644 (file)
@@ -24,8 +24,10 @@ function ret = createConstraints(constType, varargin)
         ret = tlist(["GridConstraints"]);
     elseif constType == "border" then
         arg1 = "center"
-        if size(varargin) <> 1 then
-            error(msprintf(gettext("%s: Wrong number of input argument(s): %d expected."), "createConstraints", 2));
+        arg2 = [-1 -1];
+
+        if size(varargin) <> [1 2] then
+            error(msprintf(gettext("%s: Wrong number of input argument(s): %d to %d expected."), "createConstraints", 2, 3));
         end
 
         arg1 = varargin(1);
@@ -33,7 +35,14 @@ function ret = createConstraints(constType, varargin)
             error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createConstraints", 2));
         end
 
-        ret = tlist(["BorderConstraint","position"], arg1);
+        if size(varargin) > 1 then
+            arg2 = varargin(2);
+            if typeof(arg2) <> "constant" | size(arg2, "*") <> 2 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A real matrix expected.\n"), "createConstraints", 3));
+            end
+        end
+
+        ret = tlist(["BorderConstraint","position", "preferredsize"], arg1, arg2);
     elseif constType == "gridbag" then
         arg1 = [0 0 0 0];
         arg2 = [0 0];
index 8ad9362..02d69eb 100644 (file)
@@ -70,11 +70,15 @@ int get_constraints_property(void* _pvCtx, int iObjUID)
         break;
         case LAYOUT_BORDER :
         {
-            char * variable_tlist[] = {"BorderConstraint", "position"};
-            returnedList * tList = createReturnedList(1, variable_tlist);
+            char * variable_tlist[] = {"BorderConstraint", "position", "preferredsize"};
+            returnedList * tList = createReturnedList(2, variable_tlist);
 
             int iBorder = 0;
             int* piBorder = &iBorder;
+
+            double pdblPreferredSize[2];
+            int* piPreferredSize = NULL;
+
             getGraphicObjectProperty(iObjUID, __GO_UI_BORDER_POSITION__, jni_int, (void **)&piBorder);
             if (piBorder == NULL)
             {
@@ -102,6 +106,19 @@ int get_constraints_property(void* _pvCtx, int iObjUID)
                     break;
             }
 
+            getGraphicObjectProperty(iObjUID, __GO_UI_BORDER_PREFERREDSIZE__, jni_int_vector, (void **)&piPreferredSize);
+            if (piPreferredSize == NULL)
+            {
+                Scierror(999, _("'%s' property does not exist for this handle.\n"), "constraints");
+                return -1;
+            }
+
+            //convert to double
+            pdblPreferredSize[0] = (double)piPreferredSize[0];
+            pdblPreferredSize[1] = (double)piPreferredSize[1];
+
+            addRowVectorToReturnedList(tList, pdblPreferredSize, 2);
+
             destroyReturnedList(tList);
         }
         break;
index 82097fb..6ddb417 100644 (file)
@@ -81,11 +81,18 @@ int set_constraints_property(void* _pvCtx, int iObjUID, void* _pvData, int value
         else if (strcmp(pstType, "BorderConstraint") == 0)
         {
             //arg2 -> string -> int enum
+            //arg3 -> double[] -> int[]
 
             int* piAddr2 = NULL;
             char* pstPos = NULL;
             int iPos = 0;
 
+            int* piAddr3 = NULL;
+            int iRows3 = 0;
+            int iCols3 = 0;
+            double* pdblPreferredSize = NULL;
+            int piPreferredSize[2];
+
             sciErr = getListItemAddress(_pvCtx, piAddrList, 2, &piAddr2);
             if (sciErr.iErr)
             {
@@ -125,8 +132,25 @@ int set_constraints_property(void* _pvCtx, int iObjUID, void* _pvData, int value
                 return SET_PROPERTY_ERROR;
             }
 
+            sciErr = getListItemAddress(_pvCtx, piAddrList, 3, &piAddr3);
+            if (sciErr.iErr)
+            {
+                return SET_PROPERTY_ERROR;
+            }
+
+            sciErr = getMatrixOfDouble(_pvCtx, piAddr3, &iRows3, &iCols3, &pdblPreferredSize);
+            if (sciErr.iErr)
+            {
+                return SET_PROPERTY_ERROR;
+            }
+
+            //reassign double values in int[]
+            piPreferredSize[0] = (int)pdblPreferredSize[0];
+            piPreferredSize[1] = (int)pdblPreferredSize[1];
+
             freeAllocatedSingleString(pstPos);
             setGraphicObjectProperty(iObjUID, __GO_UI_BORDER_POSITION__, &iPos, jni_int, 1);
+            setGraphicObjectProperty(iObjUID, __GO_UI_BORDER_PREFERREDSIZE__, piPreferredSize, jni_int_vector, 2);
         }
         else if (strcmp(pstType, "GridConstraints") == 0)
         {
index eb4b960..26a1659 100644 (file)
@@ -212,6 +212,11 @@ public class SwingScilabFrame extends JPanel implements SwingViewObject, SimpleF
                 default:
                     break;
             }
+
+            Integer[] preferredSize = uicontrol.getBorderPreferredSize();
+            if (preferredSize[0].equals(-1) == false && preferredSize[1].equals(-1) == false) {
+                ((Component) member).setPreferredSize(new Dimension(preferredSize[0], preferredSize[1]));
+            }
         } else if (getLayout() instanceof GridBagLayout) {
             GridBagConstraints constraints = new GridBagConstraints();
 
index d32503f..3e81e15 100644 (file)
@@ -165,6 +165,11 @@ public class SwingScilabScrollableFrame extends JScrollPane implements SwingView
                 default:
                     break;
             }
+
+            Integer[] preferredSize = uicontrol.getBorderPreferredSize();
+            if (preferredSize[0].equals(-1) == false && preferredSize[1].equals(-1) == false) {
+                ((Component) member).setPreferredSize(new Dimension(preferredSize[0], preferredSize[1]));
+            }
         } else if (getLayout() instanceof GridBagLayout) {
             GridBagConstraints constraints = new GridBagConstraints();
 
index 1348884..256660b 100644 (file)
@@ -343,6 +343,11 @@ public class SwingScilabCommonPanel {
                 default:
                     break;
             }
+
+            Integer[] preferredSize = uicontrol.getBorderPreferredSize();
+            if (preferredSize[0].equals(-1) == false && preferredSize[1].equals(-1) == false) {
+                ((Component) member).setPreferredSize(new Dimension(preferredSize[0], preferredSize[1]));
+            }
         } else if (component.getWidgetPane().getLayout() instanceof GridBagLayout) {
             GridBagConstraints constraints = new GridBagConstraints();