add border property in frame uicontrol 41/13541/6
Antoine ELIAS [Sat, 25 Jan 2014 23:38:23 +0000 (00:38 +0100)]
Change-Id: I070b926a2d2982ed34dcfb172d86a46e24f6e615

46 files changed:
scilab/modules/graphic_objects/includes/graphicObjectProperties.h
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/graphicModel/GraphicModel.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/graphicObject/GraphicObject.java
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/uicontrol/frame/border/FrameBorder.java [new file with mode: 0644]
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/uicontrol/frame/border/FrameBorderType.java [new file with mode: 0644]
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/XmlLoader.java
scilab/modules/graphic_objects/src/scripts/propertiesMap.properties
scilab/modules/graphics/Makefile.am
scilab/modules/graphics/Makefile.in
scilab/modules/graphics/graphics.vcxproj
scilab/modules/graphics/graphics.vcxproj.filters
scilab/modules/graphics/macros/%BevelBor_i_h.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%BevelBor_p.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%Compound_i_h.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%Compound_p.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%EmptyBor_i_h.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%EmptyBor_p.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%EtchedBo_i_h.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%EtchedBo_p.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%LineBord_i_h.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%LineBord_p.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%MatteBor_i_h.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%MatteBor_p.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%NoBorder_i_h.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%NoBorder_p.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%SoftBeve_i_h.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%SoftBeve_p.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%TitledBo_i_h.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%TitledBo_p.sci [new file with mode: 0644]
scilab/modules/graphics/macros/%h_p.sci
scilab/modules/graphics/macros/createBorders.sci [new file with mode: 0644]
scilab/modules/graphics/src/c/getHandleProperty/FrameBorderType.h [new file with mode: 0644]
scilab/modules/graphics/src/c/getHandleProperty/GetHashTable.c
scilab/modules/graphics/src/c/getHandleProperty/SetHashTable.c
scilab/modules/graphics/src/c/getHandleProperty/getHandleProperty.h
scilab/modules/graphics/src/c/getHandleProperty/get_borders_property.c [new file with mode: 0644]
scilab/modules/graphics/src/c/getHandleProperty/get_layout_options_property.c
scilab/modules/graphics/src/c/getHandleProperty/setHandleProperty.h
scilab/modules/graphics/src/c/getHandleProperty/set_borders_property.c [new file with mode: 0644]
scilab/modules/graphics/src/c/getHandleProperty/set_layout_property.c
scilab/modules/graphics/tests/unit_tests/borders.dia.ref [new file with mode: 0644]
scilab/modules/graphics/tests/unit_tests/borders.tst [new file with mode: 0644]
scilab/modules/gui/sci_gateway/c/sci_uicontrol.c

index 81a042c..c5fde2a 100755 (executable)
 #define __GO_GRID_OPT_GRID__ 351
 #define __GO_GRID_OPT_PADDING__ 352
 #define __GO_BORDER_OPT_PADDING__ 353
+#define __GO_UI_FRAME_BORDER__ 354
+#define __GO_UI_FRAME_BORDER_COLOR__ 355
+#define __GO_UI_FRAME_BORDER_HIGHLIGHT_IN__ 356
+#define __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__ 357
+#define __GO_UI_FRAME_BORDER_IN_BORDER__ 358
+#define __GO_UI_FRAME_BORDER_JUSTIFICATION__ 359
+#define __GO_UI_FRAME_BORDER_OUT_BORDER__ 360
+#define __GO_UI_FRAME_BORDER_ROUNDED__ 361
+#define __GO_UI_FRAME_BORDER_SHADOW_IN__ 362
+#define __GO_UI_FRAME_BORDER_SHADOW_OUT__ 363
+#define __GO_UI_FRAME_BORDER_TITLE__ 364
+#define __GO_UI_FRAME_BORDER_POSITION__ 365
+#define __GO_UI_FRAME_BORDER_STYLE__ 366
 
 #endif /* !__GRAPHIC_OBJECT_PROPERTIES_H__ */
index 150ca53..f01f3e6 100644 (file)
@@ -43,6 +43,7 @@ import org.scilab.modules.graphic_objects.uicontrol.checkbox.CheckBox;
 import org.scilab.modules.graphic_objects.uicontrol.edit.Edit;
 import org.scilab.modules.graphic_objects.uicontrol.frame.Frame;
 import org.scilab.modules.graphic_objects.uicontrol.layer.Layer;
+import org.scilab.modules.graphic_objects.uicontrol.frame.border.FrameBorder;
 import org.scilab.modules.graphic_objects.uicontrol.listbox.ListBox;
 import org.scilab.modules.graphic_objects.uicontrol.popupmenu.PopupMenu;
 import org.scilab.modules.graphic_objects.uicontrol.pushbutton.PushButton;
@@ -315,9 +316,6 @@ public final class GraphicModel {
             case LIGHT:
                 createdObject = new Light();
                 break;
-            case UNKNOWNOBJECT:
-                createdObject = null;
-                break;
             case DATATIP:
                 createdObject = new Datatip();
                 break;
@@ -327,7 +325,9 @@ public final class GraphicModel {
             case LAYER:
                 createdObject = new Layer();
                 break;
-
+            case BORDER:
+                createdObject = new FrameBorder();
+                break;
             default:
                 createdObject = null;
         }
index 41d4fe4..bb7cea5 100644 (file)
@@ -45,7 +45,7 @@ public abstract class GraphicObject implements Cloneable {
     public enum Type { ARC, AXES, AXESMODEL, AXIS, CHAMP, COMPOUND, FAC3D, FEC, FIGURE, FIGUREMODEL, GRAYPLOT,
                        LABEL, LEGEND, MATPLOT, PLOT3D, POLYLINE, RECTANGLE, SEGS, TEXT, CHECKBOX, EDIT, FRAME,
                        IMAGE, LISTBOX, POPUPMENU, PUSHBUTTON, RADIOBUTTON, CONSOLE, JAVACONSOLE, SLIDER, TABLE, UITEXT, UIMENU, UIMENUMODEL,
-                       PROGRESSIONBAR, WAITBAR, UICONTEXTMENU, DATATIP, LIGHT, TABGROUP, TAB, LAYER, UNKNOWNOBJECT
+                       PROGRESSIONBAR, WAITBAR, UICONTEXTMENU, DATATIP, LIGHT, TABGROUP, TAB, LAYER, BORDER, UNKNOWNOBJECT
                      };
 
     /** GraphicObject properties */
@@ -226,6 +226,8 @@ public abstract class GraphicObject implements Cloneable {
                 return Type.TAB;
             case __GO_UI_LAYER__ :
                 return Type.LAYER;
+            case __GO_UI_FRAME_BORDER__ :
+                return Type.BORDER;
             default :
                 return Type.UNKNOWNOBJECT;
         }
index d5aeccd..15e6a03 100755 (executable)
@@ -374,5 +374,18 @@ public class GraphicObjectProperties {
     public static final int __GO_GRID_OPT_GRID__ = 351;
     public static final int __GO_GRID_OPT_PADDING__ = 352;
     public static final int __GO_BORDER_OPT_PADDING__ = 353;
+    public static final int __GO_UI_FRAME_BORDER__ = 354;
+    public static final int __GO_UI_FRAME_BORDER_COLOR__ = 355;
+    public static final int __GO_UI_FRAME_BORDER_HIGHLIGHT_IN__ = 356;
+    public static final int __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__ = 357;
+    public static final int __GO_UI_FRAME_BORDER_IN_BORDER__ = 358;
+    public static final int __GO_UI_FRAME_BORDER_JUSTIFICATION__ = 359;
+    public static final int __GO_UI_FRAME_BORDER_OUT_BORDER__ = 360;
+    public static final int __GO_UI_FRAME_BORDER_ROUNDED__ = 361;
+    public static final int __GO_UI_FRAME_BORDER_SHADOW_IN__ = 362;
+    public static final int __GO_UI_FRAME_BORDER_SHADOW_OUT__ = 363;
+    public static final int __GO_UI_FRAME_BORDER_TITLE__ = 364;
+    public static final int __GO_UI_FRAME_BORDER_POSITION__ = 365;
+    public static final int __GO_UI_FRAME_BORDER_STYLE__ = 366;
 
 }
index 1a10c5d..748139f 100644 (file)
@@ -65,12 +65,17 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_VALUE_SIZE__;
 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_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_UI_FRAME_BORDER__;
 
 import java.util.Arrays;
 import java.util.StringTokenizer;
 
 import org.scilab.modules.graphic_objects.graphicObject.GraphicObject;
 import org.scilab.modules.graphic_objects.graphicObject.Visitor;
+import org.scilab.modules.graphic_objects.uicontrol.frame.border.FrameBorder;
 import org.scilab.modules.graphic_objects.utils.LayoutType;
 
 /**
@@ -292,6 +297,9 @@ public class Uicontrol extends GraphicObject {
     private Integer[] gridOptPadding = new Integer[] {0, 0};
     private Integer[] borderOptPadding = new Integer[] {0, 0};
 
+    /** border options */
+    private Integer frameBorder = 0;
+
     /**
      * All uicontrol properties
      */
@@ -335,7 +343,8 @@ public class Uicontrol extends GraphicObject {
         BORDER_POSITION,
         GRIDOPT_GRID,
         GRIDOPT_PADDING,
-        BORDEROPT_PADDING
+        BORDEROPT_PADDING,
+        FRAMEBORDER
     };
 
     /**
@@ -534,6 +543,8 @@ public class Uicontrol extends GraphicObject {
                 return UicontrolProperty.GRIDOPT_PADDING;
             case __GO_BORDER_OPT_PADDING__:
                 return UicontrolProperty.BORDEROPT_PADDING;
+            case __GO_UI_FRAME_BORDER__:
+                return UicontrolProperty.FRAMEBORDER;
             default :
                 return super.getPropertyFromName(propertyName);
         }
@@ -621,6 +632,8 @@ public class Uicontrol extends GraphicObject {
             return getGridOptPadding();
         } else if (property == UicontrolProperty.BORDEROPT_PADDING) {
             return getBorderOptPadding();
+        } else if (property == UicontrolProperty.FRAMEBORDER) {
+            return getFrameBorder();
         } else {
             return super.getProperty(property);
         }
@@ -705,6 +718,8 @@ public class Uicontrol extends GraphicObject {
                 return setGridOptPadding((Integer[]) value);
             case BORDEROPT_PADDING:
                 return setBorderOptPadding((Integer[]) value);
+            case FRAMEBORDER:
+                return setFrameBorder((Integer) value);
             default:
                 return super.setProperty(property, value);
         }
@@ -1279,6 +1294,19 @@ public class Uicontrol extends GraphicObject {
         return status;
     }
 
+    public Integer getFrameBorder() {
+        return frameBorder;
+    }
+
+    public UpdateStatus setFrameBorder(Integer value) {
+        if (value.equals(frameBorder)) {
+            return UpdateStatus.NoChange;
+        }
+
+        frameBorder = value;
+        return UpdateStatus.Success;
+    }
+
     public void accept(Visitor visitor) {
     }
 }
diff --git a/scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/uicontrol/frame/border/FrameBorder.java b/scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/uicontrol/frame/border/FrameBorder.java
new file mode 100644 (file)
index 0000000..2e5a6ec
--- /dev/null
@@ -0,0 +1,681 @@
+package org.scilab.modules.graphic_objects.uicontrol.frame.border;
+
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_LINE_THICKNESS__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_POSITION__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_STYLE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TITLE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TYPE__;
+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_FONTWEIGHT__;
+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_TITLE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER__;
+
+import java.util.Arrays;
+
+import org.scilab.modules.graphic_objects.ObjectRemovedException;
+import org.scilab.modules.graphic_objects.graphicObject.GraphicObject;
+import org.scilab.modules.graphic_objects.graphicObject.Visitor;
+
+public class FrameBorder extends GraphicObject {
+    enum FrameBorderProperty {
+        TYPE, //RAISED or LOWERED
+        COLOR, //string
+        THICKNESS, //int
+        ROUNDED, //boolean
+        STYLE, //FrameBorderType
+        HIGHLIGHT_OUT, //string
+        HIGHLIGHT_IN, //string
+        SHADOW_OUT, //string
+        SHADOW_IN, //string
+        TITLE_BORDER,
+        TITLE, //string
+        JUSTIFICATION, //JustificationType
+        FONTNAME, //string
+        FONTANGLE, // string
+        FONT_SIZE, //int
+        FONT_WEIGHT, //string
+        TITLE_POSITION, // TitlePostionType
+        POSITION, //tlbr
+        IN_BORDER,
+        OUT_BORDER,
+    };
+
+    public enum BorderType {
+        RAISED, LOWERED;
+        public static BorderType intToEnum(Integer value) {
+            switch (value) {
+                default:
+                case 0:
+                    return RAISED;
+                case 1:
+                    return LOWERED;
+            }
+        }
+
+        public static BorderType stringToEnum(String value) {
+            if (value == null || value.equals("")) {
+                return RAISED;
+            }
+
+            char[] chars = value.toCharArray();
+            if (chars[0] == 'l' || chars[0] == 'L') {
+                return LOWERED;
+            }
+
+            return RAISED;
+        }
+    }
+
+    public enum JustificationType {
+        LEADING, LEFT, CENTER, RIGHT, TRAILING;
+
+        public static JustificationType intToEnum(Integer val) {
+            switch (val) {
+                default :
+                case 0:
+                    return LEADING;
+                case 1:
+                    return LEFT;
+                case 2:
+                    return CENTER;
+                case 3:
+                    return RIGHT;
+                case 4:
+                    return TRAILING;
+            }
+        }
+
+        public static JustificationType stringToEnum(String value) {
+            if (value == null || value.equals("")) {
+                return LEADING;
+            }
+
+            char[] chars = value.toCharArray();
+            if (chars[0] == 'l' || chars[0] == 'L') {
+                if (chars[3] == 'f' || chars[3] == 'F') {
+                    return LEFT;
+                }
+                return LEADING;
+            }
+
+            if (chars[0] == 'c' || chars[0] == 'C') {
+                return CENTER;
+            }
+
+            if (chars[0] == 'r' || chars[0] == 'R') {
+                return RIGHT;
+            }
+
+            if (chars[0] == 't' || chars[0] == 'T') {
+                return TRAILING;
+            }
+
+
+            return LEADING;
+        }
+
+    };
+
+    public enum TitlePositionType {
+        TOP, ABOVE_TOP, BELOW_TOP, BOTTOM, ABOVE_BOTTOM, BELOW_BOTTOM;
+
+        public static TitlePositionType intToEnum(Integer val) {
+            switch (val) {
+                default :
+                case 0:
+                    return TOP;
+                case 1:
+                    return ABOVE_TOP;
+                case 2:
+                    return BELOW_TOP;
+                case 3:
+                    return BOTTOM;
+                case 4:
+                    return ABOVE_BOTTOM;
+                case 5:
+                    return BELOW_BOTTOM;
+            }
+        }
+
+        public static TitlePositionType stringToEnum(String value) {
+            if (value == null || value.equals("")) {
+                return TOP;
+            }
+
+            if (value.equalsIgnoreCase("above_top")) {
+                return ABOVE_TOP;
+            }
+
+            if (value.equalsIgnoreCase("below_top")) {
+                return BELOW_TOP;
+            }
+
+            if (value.equalsIgnoreCase("bottom")) {
+                return BOTTOM;
+            }
+
+            if (value.equalsIgnoreCase("above_bottom")) {
+                return ABOVE_BOTTOM;
+            }
+
+            if (value.equalsIgnoreCase("below_bottom")) {
+                return BELOW_BOTTOM;
+            }
+
+            return TOP;
+        }
+    };
+
+    private static final Integer DEFAULTFONTSIZE = 10;
+    private static final String DEFAULTFONTNAME = "helvetica";
+    private static final String DEFAULTFONTWEIGHT = "normal";
+    private static final String DEFAULTFONTANGLE = DEFAULTFONTWEIGHT;
+    private static final String DEFAULTCOLOR = "black";
+
+    private BorderType type = BorderType.RAISED;
+    private String color = DEFAULTCOLOR;
+    private String hlOutColor = DEFAULTCOLOR;
+    private String hlInColor = DEFAULTCOLOR;
+    private String shadowOutColor = DEFAULTCOLOR;
+    private String shadowInColor = DEFAULTCOLOR;
+    private Integer thickness = 1;
+    private Boolean rounded = false;
+    private FrameBorderType style = FrameBorderType.ETCHED;
+    private String title = "";
+    private JustificationType justification = JustificationType.LEADING;
+    private String fontAngle = DEFAULTFONTANGLE;
+    private String fontName = DEFAULTFONTNAME;
+    private Integer fontSize = DEFAULTFONTSIZE;
+    private String fontWeight = DEFAULTFONTWEIGHT;
+    private TitlePositionType titlePosition = TitlePositionType.TOP;
+    private Double[] position = new Double[] {0.0, 0.0, 0.0, 0.0};//TLBR
+
+    private Integer titleBorder = 0;
+    private Integer inBorder = 0;
+    private Integer outBorder = 0;
+
+    public FrameBorder() {
+
+    }
+
+    /**
+     * Get style as a string
+     * @param style the uicontrol style
+     * @return the uicontrol style as a string
+     */
+    public Object getPropertyFromName(int propertyName) {
+        switch (propertyName) {
+            case __GO_UI_FRAME_BORDER_COLOR__:
+                return FrameBorderProperty.COLOR;
+            case __GO_UI_FONTANGLE__:
+                return FrameBorderProperty.FONTANGLE;
+            case __GO_UI_FONTNAME__:
+                return FrameBorderProperty.FONTNAME;
+            case __GO_UI_FONTSIZE__:
+                return FrameBorderProperty.FONT_SIZE;
+            case __GO_UI_FONTWEIGHT__:
+                return FrameBorderProperty.FONT_WEIGHT;
+            case __GO_UI_FRAME_BORDER_HIGHLIGHT_IN__:
+                return FrameBorderProperty.HIGHLIGHT_IN;
+            case __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__:
+                return FrameBorderProperty.HIGHLIGHT_OUT;
+            case __GO_UI_FRAME_BORDER_IN_BORDER__:
+                return FrameBorderProperty.IN_BORDER;
+            case __GO_UI_FRAME_BORDER_JUSTIFICATION__:
+                return FrameBorderProperty.JUSTIFICATION;
+            case __GO_UI_FRAME_BORDER_OUT_BORDER__:
+                return FrameBorderProperty.OUT_BORDER;
+            case __GO_POSITION__:
+                return FrameBorderProperty.POSITION;
+            case __GO_UI_FRAME_BORDER_ROUNDED__:
+                return FrameBorderProperty.ROUNDED;
+            case __GO_UI_FRAME_BORDER_SHADOW_IN__:
+                return FrameBorderProperty.SHADOW_IN;
+            case __GO_UI_FRAME_BORDER_SHADOW_OUT__:
+                return FrameBorderProperty.SHADOW_OUT;
+            case __GO_UI_FRAME_BORDER_STYLE__:
+                return FrameBorderProperty.STYLE;
+            case __GO_LINE_THICKNESS__:
+                return FrameBorderProperty.THICKNESS;
+            case __GO_TITLE__:
+                return FrameBorderProperty.TITLE;
+            case __GO_UI_FRAME_BORDER_TITLE__:
+                return FrameBorderProperty.TITLE_BORDER;
+            case __GO_UI_FRAME_BORDER_POSITION__:
+                return FrameBorderProperty.TITLE_POSITION;
+            case __GO_TYPE__:
+                return FrameBorderProperty.TYPE;
+            default:
+                return super.getPropertyFromName(propertyName);
+        }
+    }
+
+    public Object getProperty(Object property) {
+        if (property instanceof FrameBorderProperty) {
+            switch ((FrameBorderProperty)property) {
+                case COLOR:
+                    return getColor();
+                case FONTANGLE:
+                    return getFontAngle();
+                case FONTNAME:
+                    return getFontName();
+                case FONT_SIZE:
+                    return getFontSize();
+                case FONT_WEIGHT:
+                    return getFontWeight();
+                case HIGHLIGHT_IN:
+                    return getHlIn();
+                case HIGHLIGHT_OUT:
+                    return getHlOut();
+                case IN_BORDER:
+                    return getInBorder();
+                case JUSTIFICATION:
+                    return getJustification();
+                case OUT_BORDER:
+                    return getOutBorder();
+                case POSITION:
+                    return getPosition();
+                case ROUNDED:
+                    return getRounded();
+                case SHADOW_IN:
+                    return getShadowIn();
+                case SHADOW_OUT:
+                    return getShadowOut();
+                case STYLE:
+                    return getStyle();
+                case THICKNESS:
+                    return getThickness();
+                case TITLE:
+                    return getTitle();
+                case TITLE_BORDER:
+                    return getTitleBorder();
+                case TITLE_POSITION:
+                    return getTitlePosition();
+                case TYPE:
+                    return getBorderType();
+            }
+        }
+
+        return super.getProperty(property);
+    }
+
+    public UpdateStatus setProperty(Object property, Object value) {
+        if (property instanceof FrameBorderProperty) {
+            switch ((FrameBorderProperty) property) {
+                case COLOR:
+                    return setColor((String)value);
+                case FONTANGLE:
+                    return setFontAngle((String)value);
+                case FONTNAME:
+                    return setFontName((String)value);
+                case FONT_SIZE:
+                    return setFontSize((Integer)value);
+                case FONT_WEIGHT:
+                    return setFontWeight((String)value);
+                case HIGHLIGHT_IN:
+                    return setHlIn((String)value);
+                case HIGHLIGHT_OUT:
+                    return setHlOut((String)value);
+                case IN_BORDER:
+                    return setInBorder((Integer)value);
+                case JUSTIFICATION:
+                    return setJustification((Integer)value);
+                case OUT_BORDER:
+                    return setOutBorder((Integer)value);
+                case POSITION:
+                    return setPosition((Double[])value);
+                case ROUNDED:
+                    return setRounded((Boolean)value);
+                case SHADOW_IN:
+                    return setShadowIn((String)value);
+                case SHADOW_OUT:
+                    return setShadowOut((String)value);
+                case STYLE:
+                    return setStyle((Integer)value);
+                case THICKNESS:
+                    return setThickness((Integer)value);
+                case TITLE:
+                    return setTitle((String)value);
+                case TITLE_BORDER:
+                    return setTitleBorder((Integer)value);
+                case TITLE_POSITION:
+                    return setTitlePosition((Integer)value);
+                case TYPE:
+                    return setBorderType((Integer)value);
+            }
+        }
+        return super.setProperty(property, value);
+    }
+
+    /** type */
+    public Integer getBorderType() {
+        return type.ordinal();
+    }
+
+    public BorderType getBorderTypeAsEnum() {
+        return type;
+    }
+
+    public UpdateStatus setBorderType(BorderType value) {
+        if (value == type) {
+            return UpdateStatus.NoChange;
+        }
+
+        type = value;
+        return UpdateStatus.Success;
+    }
+
+    public UpdateStatus setBorderType(Integer value) {
+        return setBorderType(BorderType.intToEnum(value));
+    }
+
+    /** titleposition */
+    public Integer getTitlePosition() {
+        return titlePosition.ordinal();
+    }
+
+    public TitlePositionType getTitlePositionAsEnum() {
+        return titlePosition;
+    }
+
+    public UpdateStatus setTitlePosition(Integer value) {
+        return setTitlePosition(TitlePositionType.intToEnum(value));
+    }
+
+    public UpdateStatus setTitlePosition(TitlePositionType value) {
+        if (titlePosition == value) {
+            return UpdateStatus.NoChange;
+        }
+
+        titlePosition = value;
+        return UpdateStatus.Success;
+    }
+
+    /** titleborder */
+    public Integer getTitleBorder() {
+        return titleBorder;
+    }
+
+    public UpdateStatus setTitleBorder(Integer value) {
+        if (titleBorder.equals(value)) {
+            return UpdateStatus.NoChange;
+        }
+
+        titleBorder = value;
+        return UpdateStatus.Success;
+    }
+
+    /** title */
+    public String getTitle() {
+        return title;
+    }
+
+    public UpdateStatus setTitle(String value) {
+        if (title.equals(value)) {
+            return UpdateStatus.NoChange;
+        }
+
+        title = value;
+        return UpdateStatus.Success;
+    }
+
+    /** thickness */
+    public Integer getThickness() {
+        return thickness;
+    }
+
+    public UpdateStatus setThickness(Integer value) {
+        if (thickness.equals(value)) {
+            return UpdateStatus.NoChange;
+        }
+
+        thickness = value;
+        return UpdateStatus.Success;
+    }
+
+    /** style */
+    public Integer getStyle() {
+        return style.ordinal();
+    }
+
+    public FrameBorderType getStyleAsEnum() {
+        return style;
+    }
+
+    public UpdateStatus setStyle(Integer value) {
+        return setStyle(FrameBorderType.intToEnum(value));
+    }
+
+    public UpdateStatus setStyle(FrameBorderType value) {
+        if (style.equals(value)) {
+            return UpdateStatus.NoChange;
+        }
+
+        style = value;
+        return UpdateStatus.Success;
+    }
+
+    /** shadowOut */
+    public String getShadowOut() {
+        return shadowOutColor;
+    }
+
+    public UpdateStatus setShadowOut(String value) {
+        if (shadowOutColor.equals(value)) {
+            return UpdateStatus.NoChange;
+        }
+
+        shadowOutColor = value;
+        return UpdateStatus.Success;
+    }
+
+    /** shadowIn */
+    public String getShadowIn() {
+        return shadowInColor;
+    }
+
+    public UpdateStatus setShadowIn(String value) {
+        if (shadowInColor.equals(value)) {
+            return UpdateStatus.NoChange;
+        }
+
+        shadowInColor = value;
+        return UpdateStatus.Success;
+    }
+
+    /** rounded */
+    public Boolean getRounded() {
+        return rounded;
+    }
+
+    public UpdateStatus setRounded(Boolean value) {
+        if (rounded.equals(value)) {
+            return UpdateStatus.NoChange;
+        }
+
+        rounded = value;
+        return UpdateStatus.Success;
+    }
+
+    /** position */
+    public Double[] getPosition() {
+        return position;
+    }
+
+    public UpdateStatus setPosition(Double[] value) {
+        if (Arrays.equals(position, value)) {
+            return UpdateStatus.NoChange;
+        }
+
+        position = value;
+        return UpdateStatus.Success;
+    }
+
+    /** outBorder */
+    public Integer getOutBorder() {
+        return outBorder;
+    }
+
+    public UpdateStatus setOutBorder(Integer value) {
+        if (outBorder.equals(value)) {
+            return UpdateStatus.NoChange;
+        }
+
+        outBorder = value;
+        return UpdateStatus.Success;
+    }
+
+    /** justification */
+    public Integer getJustification() {
+        return justification.ordinal();
+    }
+
+    public JustificationType getJustificationAsEnum() {
+        return justification;
+    }
+
+    public UpdateStatus setJustification(Integer value) {
+        return setJustification(JustificationType.intToEnum(value));
+    }
+
+    public UpdateStatus setJustification(JustificationType value) {
+        if (justification == value) {
+            return UpdateStatus.NoChange;
+        }
+
+        justification = value;
+        return UpdateStatus.Success;
+    }
+
+    /** inBorder */
+    public Integer getInBorder() {
+        return inBorder;
+    }
+
+    public UpdateStatus setInBorder(Integer value) {
+        if (inBorder.equals(value)) {
+            return UpdateStatus.NoChange;
+        }
+
+        inBorder = value;
+        return UpdateStatus.Success;
+    }
+
+    /** hlOutColor */
+    public String getHlOut() {
+        return hlOutColor;
+    }
+
+    public UpdateStatus setHlOut(String value) {
+        if (hlOutColor.equals(value)) {
+            return UpdateStatus.NoChange;
+        }
+
+        hlOutColor = value;
+        return UpdateStatus.Success;
+    }
+
+    /** hlInColor */
+    public String getHlIn() {
+        return hlInColor;
+    }
+
+    public UpdateStatus setHlIn(String value) {
+        if (hlInColor.equals(value)) {
+            return UpdateStatus.NoChange;
+        }
+
+        hlInColor = value;
+        return UpdateStatus.Success;
+    }
+
+    /** fontWeight */
+    public String getFontWeight() {
+        return fontWeight;
+    }
+
+    public UpdateStatus setFontWeight(String value) {
+        if (fontWeight.equals(value)) {
+            return UpdateStatus.NoChange;
+        }
+
+        fontWeight = value;
+        return UpdateStatus.Success;
+    }
+
+    /** fontSize */
+    public Integer getFontSize() {
+        return fontSize;
+    }
+
+    public UpdateStatus setFontSize(Integer value) {
+        if (fontSize.equals(value)) {
+            return UpdateStatus.NoChange;
+        }
+
+        fontSize = value;
+        return UpdateStatus.Success;
+    }
+
+    /** fontName */
+    public String getFontName() {
+        return fontName;
+    }
+
+    public UpdateStatus setFontName(String value) {
+        if (fontName.equals(value)) {
+            return UpdateStatus.NoChange;
+        }
+
+        fontName = value;
+        return UpdateStatus.Success;
+    }
+
+    /** fontAngle */
+    public String getFontAngle() {
+        return fontAngle;
+    }
+
+    public UpdateStatus setFontAngle(String value) {
+        if (fontAngle.equals(value)) {
+            return UpdateStatus.NoChange;
+        }
+
+        fontAngle = value;
+        return UpdateStatus.Success;
+    }
+
+    /** color */
+    public String getColor() {
+        return color;
+    }
+
+    public UpdateStatus setColor(String value) {
+        if (color.equals(value)) {
+            return UpdateStatus.NoChange;
+        }
+
+        color = value;
+        return UpdateStatus.Success;
+    }
+
+    public void accept(Visitor visitor) throws ObjectRemovedException {
+    }
+
+    public Integer getType() {
+        return __GO_UI_FRAME_BORDER__;
+    }
+
+}
diff --git a/scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/uicontrol/frame/border/FrameBorderType.java b/scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/uicontrol/frame/border/FrameBorderType.java
new file mode 100644 (file)
index 0000000..c2d336e
--- /dev/null
@@ -0,0 +1,69 @@
+package org.scilab.modules.graphic_objects.uicontrol.frame.border;
+
+public enum FrameBorderType {
+    NONE, LINE, BEVEL, SOFTBEVEL, ETCHED, TITLED, EMPTY, COMPOUND, MATTE;
+
+    public static FrameBorderType intToEnum(Integer value) {
+        switch (value) {
+            default :
+            case 0 :
+                return NONE;
+            case 1 :
+                return LINE;
+            case 2 :
+                return BEVEL;
+            case 3 :
+                return SOFTBEVEL;
+            case 4 :
+                return ETCHED;
+            case 5 :
+                return TITLED;
+            case 6 :
+                return EMPTY;
+            case 7 :
+                return COMPOUND;
+            case 8 :
+                return MATTE;
+        }
+    }
+
+    public static FrameBorderType stringToEnum(String value) {
+        if (value == null || value.equals("")) {
+            return NONE;
+        }
+
+        char[] chars = value.toCharArray();
+        if (chars[0] == 'l' || chars[0] == 'L') {
+            return LINE;
+        }
+
+        if (chars[0] == 'b' || chars[0] == 'B') {
+            return BEVEL;
+        }
+
+        if (chars[0] == 's' || chars[0] == 'S') {
+            return SOFTBEVEL;
+        }
+
+        if (chars[0] == 'e' || chars[0] == 'E') {
+            if (chars[1] == 'm' || chars[1] == 'M') {
+                return EMPTY;
+            }
+            return ETCHED;
+        }
+
+        if (chars[0] == 't' || chars[0] == 'T') {
+            return TITLED;
+        }
+
+        if (chars[0] == 'c' || chars[0] == 'C') {
+            return COMPOUND;
+        }
+
+        if (chars[0] == 'm' || chars[0] == 'M') {
+            return MATTE;
+        }
+
+        return NONE;
+    }
+}
index ee31a35..7669be7 100644 (file)
@@ -6,23 +6,43 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 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__;
 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_NAME__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_POSITION__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_RESIZE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_SIZE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_STYLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TAG__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TOOLBAR_VISIBLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_BORDER_POSITION__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_VISIBLE__;
-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_WEIGHT__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_FILL__;
+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_ROUNDED__;
+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__;
 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_MARGINS__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_STYLE__;
-
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GRIDBAG_WEIGHT__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_VISIBLE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TYPE__;
+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_HIGHLIGHT_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_SHADOW_IN__;
+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_OUT_BORDER__;
+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_TITLE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_TITLE__;
+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_FONTNAME__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTANGLE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTSIZE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTWEIGHT__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER_POSITION__;
 
 import java.util.Map;
 
@@ -30,13 +50,15 @@ import org.scilab.modules.graphic_objects.builder.Builder;
 import org.scilab.modules.graphic_objects.graphicController.GraphicController;
 import org.scilab.modules.graphic_objects.graphicObject.GraphicObject;
 import org.scilab.modules.graphic_objects.uicontrol.Uicontrol;
-import org.scilab.modules.graphic_objects.uicontrol.Uicontrol.AnchorType;
-import org.scilab.modules.graphic_objects.uicontrol.uitext.UiText;
+import org.scilab.modules.graphic_objects.uicontrol.frame.border.FrameBorder;
+import org.scilab.modules.graphic_objects.uicontrol.frame.border.FrameBorder.BorderType;
+import org.scilab.modules.graphic_objects.uicontrol.frame.border.FrameBorderType;
 import org.scilab.modules.graphic_objects.utils.LayoutType;
 import org.xml.sax.Attributes;
 
 public class GOBuilder {
-    public static Integer figureBuilder(GraphicController controller, Attributes attributes) {
+    public static Integer figureBuilder(GraphicController controller,
+                                        Attributes attributes) {
         Integer fig = Builder.createNewFigureWithAxes();
         String item = null;
 
@@ -49,7 +71,7 @@ public class GOBuilder {
         // hide infobar
         controller.setProperty(fig, __GO_INFOBAR_VISIBLE__, false);
 
-        // remove dock
+        // remove docking bar
         controller.setProperty(fig, __GO_DOCKABLE__, false);
 
         // id
@@ -60,7 +82,8 @@ public class GOBuilder {
                                   attributes.getValue("visible"));
 
         // position
-        Integer[] position = (Integer[]) controller.getProperty(fig, __GO_POSITION__);
+        Integer[] position = (Integer[]) controller.getProperty(fig,
+                             __GO_POSITION__);
         // posX
         item = attributes.getValue("posX");
         if (item != null) {
@@ -100,7 +123,8 @@ public class GOBuilder {
         // attributes.getValue("icon"));
 
         // resizable
-        XmlTools.setPropAsBoolean(fig, __GO_RESIZE__, attributes.getValue("resizable"));
+        XmlTools.setPropAsBoolean(fig, __GO_RESIZE__,
+                                  attributes.getValue("resizable"));
 
         // layout and layout_options
         setLayoutProperty(controller, fig, attributes.getValue("layout"));
@@ -108,26 +132,29 @@ public class GOBuilder {
         return fig;
     }
 
-    public static Integer uicontrolBuilder(GraphicController controller, int type, Attributes attributes, int parent) {
+    public static Integer uicontrolBuilder(GraphicController controller,
+                                           int type, Attributes attributes, int parent) {
         Integer uic = controller.askObject(GraphicObject.getTypeFromName(type));
         return uicontrolUpdater(controller, uic, attributes, parent);
     }
 
-    public static Integer uicontrolUpdater(GraphicController controller, int uic, Attributes attributes, int parent) {
+    public static Integer uicontrolUpdater(GraphicController controller,
+                                           int uic, Attributes attributes, int parent) {
         return uicontrolUpdater(controller, uic, attributes, parent, null);
     }
 
-    public static Integer uicontrolUpdater(GraphicController controller, int uic, Attributes attributes, int parent, Map<String, String> fromModel) {
+    public static Integer uicontrolUpdater(GraphicController controller,
+                                           int uic, Attributes attributes, int parent,
+                                           Map<String, String> fromModel) {
         String item = null;
 
         try {
             Map<String, String> map = null;
-            //Common attributes
+            // Common attributes
 
-            //id
+            // id
             XmlTools.setPropAsString(uic, __GO_TAG__, attributes.getValue("id"));
 
-
             // layout and layout_options
             item = attributes.getValue("layout");
             if (item == null && fromModel != null) {
@@ -135,18 +162,19 @@ public class GOBuilder {
             }
             setLayoutProperty(controller, uic, item);
 
-            //constraints
+            // constraints
 
-            //get parent layout
+            // get parent layout
             LayoutType layout = LayoutType.NONE;
             if (parent != 0) {
-                layout = LayoutType.intToEnum((Integer)controller.getProperty(parent, __GO_LAYOUT__));
+                layout = LayoutType.intToEnum((Integer) controller.getProperty(
+                                                  parent, __GO_LAYOUT__));
             }
 
             if (layout != LayoutType.NONE) {
                 item = attributes.getValue("constraint");
                 if (item == null && fromModel != null) {
-                    //use value from model if property is not in "declaration"
+                    // use value from model if property is not in "declaration"
                     item = XmlTools.getFromMap(fromModel, "constraint");
                 }
 
@@ -157,41 +185,57 @@ public class GOBuilder {
                 switch (layout) {
                     case BORDER: {
                         item = XmlTools.getFromMap(map, "position", "center");
-                        controller.setProperty(uic, __GO_UI_BORDER_POSITION__, Uicontrol.BorderLayoutType.stringToEnum(item).ordinal());
+                        controller.setProperty(uic, __GO_UI_BORDER_POSITION__,
+                                               Uicontrol.BorderLayoutType.stringToEnum(item)
+                                               .ordinal());
                         break;
                     }
                     case GRIDBAG: {
-                        Integer[] grid = new Integer[] {0, 0, 0, 0};
-                        grid[0] = Integer.parseInt(XmlTools.getFromMap(map, "gridx", "0"));
-                        grid[1] = Integer.parseInt(XmlTools.getFromMap(map, "gridy", "0"));
-                        grid[2] = Integer.parseInt(XmlTools.getFromMap(map, "gridwidth", "0"));
-                        grid[3] = Integer.parseInt(XmlTools.getFromMap(map, "gridheight", "0"));
-
-                        Double[] weight = new Double[] {0.0, 0.0};
-                        weight[0] = Double.parseDouble(XmlTools.getFromMap(map, "weightx", "0.0"));
-                        weight[1] = Double.parseDouble(XmlTools.getFromMap(map, "weighty", "0.0"));
-
-                        Integer fill = Uicontrol.FillType.stringToEnum(XmlTools.getFromMap(map, "fill", "none")).ordinal();
-                        Integer anchor = Uicontrol.AnchorType.stringToEnum(XmlTools.getFromMap(map, "anchor", "center")).ordinal();
-
-                        Integer[] padding = new Integer[] {0, 0};
-                        padding[0] = Integer.parseInt(XmlTools.getFromMap(map, "ipadx", "0"));
-                        padding[1] = Integer.parseInt(XmlTools.getFromMap(map, "ipady", "0"));
+                        Integer[] grid = new Integer[] { 0, 0, 0, 0 };
+                        grid[0] = Integer.parseInt(XmlTools.getFromMap(map,
+                                                   "gridx", "0"));
+                        grid[1] = Integer.parseInt(XmlTools.getFromMap(map,
+                                                   "gridy", "0"));
+                        grid[2] = Integer.parseInt(XmlTools.getFromMap(map,
+                                                   "gridwidth", "0"));
+                        grid[3] = Integer.parseInt(XmlTools.getFromMap(map,
+                                                   "gridheight", "0"));
+
+                        Double[] weight = new Double[] { 0.0, 0.0 };
+                        weight[0] = Double.parseDouble(XmlTools.getFromMap(map,
+                                                       "weightx", "0.0"));
+                        weight[1] = Double.parseDouble(XmlTools.getFromMap(map,
+                                                       "weighty", "0.0"));
+
+                        Integer fill = Uicontrol.FillType.stringToEnum(
+                                           XmlTools.getFromMap(map, "fill", "none")).ordinal();
+                        Integer anchor = Uicontrol.AnchorType.stringToEnum(
+                                             XmlTools.getFromMap(map, "anchor", "center"))
+                                         .ordinal();
+
+                        Integer[] padding = new Integer[] { 0, 0 };
+                        padding[0] = Integer.parseInt(XmlTools.getFromMap(map,
+                                                      "ipadx", "0"));
+                        padding[1] = Integer.parseInt(XmlTools.getFromMap(map,
+                                                      "ipady", "0"));
 
                         controller.setProperty(uic, __GO_UI_GRIDBAG_GRID__, grid);
-                        controller.setProperty(uic, __GO_UI_GRIDBAG_WEIGHT__, weight);
+                        controller.setProperty(uic, __GO_UI_GRIDBAG_WEIGHT__,
+                                               weight);
                         controller.setProperty(uic, __GO_UI_GRIDBAG_FILL__, fill);
-                        controller.setProperty(uic, __GO_UI_GRIDBAG_ANCHOR__, anchor);
-                        controller.setProperty(uic, __GO_UI_GRIDBAG_PADDING__, padding);
+                        controller.setProperty(uic, __GO_UI_GRIDBAG_ANCHOR__,
+                                               anchor);
+                        controller.setProperty(uic, __GO_UI_GRIDBAG_PADDING__,
+                                               padding);
                         break;
                     }
                     default:
                         break;
                 }
 
-                //inserts -> marging
+                // inserts -> marging
                 String insets = XmlTools.getFromMap(map, "insets", "0,0,0,0");
-                Double[] margins = new Double[] {0.0, 0.0, 0.0, 0.0};
+                Double[] margins = new Double[] { 0.0, 0.0, 0.0, 0.0 };
                 String[] insert = insets.split(",");
                 for (int i = 0; i < insert.length && i < 4; i++) {
                     margins[i] = Double.parseDouble(insert[i]);
@@ -200,10 +244,28 @@ public class GOBuilder {
                 controller.setProperty(uic, __GO_MARGINS__, margins);
             }
 
-
-            //specific attributes
-            Integer type = (Integer)controller.getProperty(uic, __GO_STYLE__);
+            // specific attributes
+            Integer type = (Integer) controller.getProperty(uic, __GO_STYLE__);
             switch (type) {
+                case __GO_UI_FRAME__: {
+                    // border
+                    item = attributes.getValue("border");
+                    if (item == null && fromModel != null) {
+                        // use value from model if property is not in "declaration"
+                        item = XmlTools.getFromMap(fromModel, "border");
+                    }
+
+                    if (item != null) {
+                        map = CSSParser.parseLine(item);
+                    }
+
+                    FrameBorderType borderType = FrameBorderType
+                                                 .stringToEnum(XmlTools.getFromMap(map, "name", "none"));
+                    Integer border = createBorder(controller, uic, borderType, map);
+                    controller.setProperty(uic, __GO_UI_FRAME_BORDER__, border);
+
+                    break;
+                }
             }
 
         } catch (CSSParserException e) {
@@ -213,7 +275,8 @@ public class GOBuilder {
         return uic;
     }
 
-    private static void setLayoutProperty(GraphicController controller, Integer uid, String item) {
+    private static void setLayoutProperty(GraphicController controller,
+                                          Integer uid, String item) {
         try {
             if (item != null) {
                 Map<String, String> map = null;
@@ -226,20 +289,26 @@ public class GOBuilder {
                 switch (layout) {
                     case BORDER: {
                         Integer[] pad = new Integer[] { 0, 0 };
-                        pad[0] = Integer.parseInt(XmlTools.getFromMap(map, "hgap", "0"));
-                        pad[1] = Integer.parseInt(XmlTools.getFromMap(map, "vgap", "0"));
+                        pad[0] = Integer.parseInt(XmlTools.getFromMap(map, "hgap",
+                                                  "0"));
+                        pad[1] = Integer.parseInt(XmlTools.getFromMap(map, "vgap",
+                                                  "0"));
 
                         controller.setProperty(uid, __GO_BORDER_OPT_PADDING__, pad);
                         break;
                     }
                     case GRID: {
                         Integer[] grid = new Integer[] { 0, 0 };
-                        grid[0] = Integer.parseInt(XmlTools.getFromMap(map, "rows", "0"));
-                        grid[1] = Integer.parseInt(XmlTools.getFromMap(map, "cols", "0"));
+                        grid[0] = Integer.parseInt(XmlTools.getFromMap(map, "rows",
+                                                   "0"));
+                        grid[1] = Integer.parseInt(XmlTools.getFromMap(map, "cols",
+                                                   "0"));
 
                         Integer[] pad = new Integer[] { 0, 0 };
-                        pad[0] = Integer.parseInt(XmlTools.getFromMap(map, "hgap", "0"));
-                        pad[1] = Integer.parseInt(XmlTools.getFromMap(map, "vgap", "0"));
+                        pad[0] = Integer.parseInt(XmlTools.getFromMap(map, "hgap",
+                                                  "0"));
+                        pad[1] = Integer.parseInt(XmlTools.getFromMap(map, "vgap",
+                                                  "0"));
 
                         controller.setProperty(uid, __GO_GRID_OPT_GRID__, grid);
                         controller.setProperty(uid, __GO_GRID_OPT_PADDING__, pad);
@@ -257,4 +326,145 @@ public class GOBuilder {
         }
 
     }
+
+    private static Integer createBorder(GraphicController controller,
+                                        Integer uic, FrameBorderType borderType, Map<String, String> map) {
+        Integer border = controller.askObject(GraphicObject
+                                              .getTypeFromName(__GO_UI_FRAME_BORDER__));
+        controller.setProperty(border, __GO_UI_FRAME_BORDER_STYLE__,
+                               borderType.ordinal());
+
+        switch (borderType) {
+            case SOFTBEVEL:
+            case BEVEL: {
+                BorderType etching = BorderType.stringToEnum(XmlTools.getFromMap(
+                                         map, "type", "raised"));
+                String color = XmlTools.getFromMap(map, "color", "black");
+
+                controller.setProperty(border, __GO_TYPE__, etching.ordinal());
+                controller.setProperty(border,
+                                       __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__, color);
+                controller.setProperty(border, __GO_UI_FRAME_BORDER_HIGHLIGHT_IN__,
+                                       color);
+                controller.setProperty(border, __GO_UI_FRAME_BORDER_SHADOW_OUT__,
+                                       color);
+                controller.setProperty(border, __GO_UI_FRAME_BORDER_SHADOW_IN__,
+                                       color);
+                break;
+            }
+            case COMPOUND: {
+                FrameBorderType borderOut = FrameBorderType.stringToEnum(XmlTools
+                                            .getFromMap(map, "border-out", "none"));
+                FrameBorderType borderIn = FrameBorderType.stringToEnum(XmlTools
+                                           .getFromMap(map, "border-in", "none"));
+
+                Integer out = createBorder(controller, border, borderOut, map);
+                Integer in = createBorder(controller, border, borderIn, map);
+
+                controller.setProperty(border, __GO_UI_FRAME_BORDER_OUT_BORDER__,
+                                       out);
+                controller
+                .setProperty(border, __GO_UI_FRAME_BORDER_IN_BORDER__, in);
+
+                break;
+            }
+            case EMPTY: {
+                Double[] position = new Double[4];
+                position[0] = Double.parseDouble(XmlTools.getFromMap(map, "top",
+                                                 "0"));
+                position[1] = Double.parseDouble(XmlTools.getFromMap(map, "left",
+                                                 "0"));
+                position[2] = Double.parseDouble(XmlTools.getFromMap(map, "right",
+                                                 "0"));
+                position[3] = Double.parseDouble(XmlTools.getFromMap(map, "bottom",
+                                                 "0"));
+
+                controller.setProperty(border, __GO_POSITION__, position);
+                break;
+            }
+            case ETCHED: {
+                BorderType etching = BorderType.stringToEnum(XmlTools.getFromMap(
+                                         map, "type", "raised"));
+                String color = XmlTools.getFromMap(map, "color", "black");
+
+                controller.setProperty(border, __GO_TYPE__, etching.ordinal());
+                controller.setProperty(border,
+                                       __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__, color);
+                controller.setProperty(border, __GO_UI_FRAME_BORDER_HIGHLIGHT_IN__,
+                                       color);
+                break;
+            }
+            case LINE: {
+                String color = XmlTools.getFromMap(map, "color", "black");
+                Integer thickness = Integer.parseInt(XmlTools.getFromMap(map,
+                                                     "thickness", "1"));
+                Boolean rounded = Boolean.parseBoolean(XmlTools.getFromMap(map,
+                                                       "rounded", "false"));
+
+                controller.setProperty(border, __GO_UI_FRAME_BORDER_COLOR__, color);
+                controller.setProperty(border, __GO_LINE_THICKNESS__, thickness);
+                controller.setProperty(border, __GO_UI_FRAME_BORDER_ROUNDED__,
+                                       rounded);
+                break;
+            }
+            case MATTE: {
+                Double[] position = new Double[4];
+                position[0] = Double.parseDouble(XmlTools.getFromMap(map, "top",
+                                                 "0"));
+                position[1] = Double.parseDouble(XmlTools.getFromMap(map, "left",
+                                                 "0"));
+                position[2] = Double.parseDouble(XmlTools.getFromMap(map, "right",
+                                                 "0"));
+                position[3] = Double.parseDouble(XmlTools.getFromMap(map, "bottom",
+                                                 "0"));
+                String color = XmlTools.getFromMap(map, "color", "black");
+
+                controller.setProperty(border, __GO_POSITION__, position);
+                controller.setProperty(border, __GO_UI_FRAME_BORDER_COLOR__, color);
+                break;
+            }
+            case TITLED: {
+
+                FrameBorderType borderOut = FrameBorderType.stringToEnum(XmlTools
+                                            .getFromMap(map, "border", "none"));
+                Integer out = createBorder(controller, border, borderOut, map);
+                String title = XmlTools.getFromMap(map, "title", "");
+                FrameBorder.JustificationType justify = FrameBorder.JustificationType
+                                                        .stringToEnum(XmlTools
+                                                                .getFromMap(map, "justify", "leading"));
+                String fontName = XmlTools.getFromMap(map, "font-name", "helvetica");
+                String fontAngle = XmlTools.getFromMap(map, "italic", "false") == "false" ? "normal" : "italic";
+                Integer fontSize = Integer.parseInt(XmlTools.getFromMap(map, "font-size", "10"));
+
+                String fontWeight = XmlTools.getFromMap(map, "bold", "false") == "false" ? "normal" : "bold";
+                FrameBorder.TitlePositionType position = FrameBorder.TitlePositionType
+                        .stringToEnum(XmlTools
+                                      .getFromMap(map, "position", "leading"));
+
+                String color = XmlTools.getFromMap(map, "color", "black");
+
+                controller.setProperty(border, __GO_UI_FRAME_BORDER_OUT_BORDER__,
+                                       out);
+
+                controller.setProperty(border, __GO_UI_FRAME_BORDER_TITLE__, out);
+                controller.setProperty(border, __GO_TITLE__, title);
+                controller.setProperty(border, __GO_UI_FRAME_BORDER_JUSTIFICATION__, justify.ordinal());
+                controller.setProperty(border, __GO_UI_FONTNAME__, fontName);
+                controller.setProperty(border, __GO_UI_FONTANGLE__, fontAngle);
+                controller.setProperty(border, __GO_UI_FONTSIZE__, fontSize);
+                controller.setProperty(border, __GO_UI_FONTWEIGHT__, fontWeight);
+                controller.setProperty(border, __GO_UI_FRAME_BORDER_POSITION__, position.ordinal());
+                controller.setProperty(border, __GO_UI_FRAME_BORDER_COLOR__, color);
+
+                break;
+            }
+            case NONE:
+            default: {
+                break;
+            }
+        }
+
+        return border;
+    }
+
 }
index ae20028..62a4481 100644 (file)
@@ -225,26 +225,25 @@ public class XmlLoader extends DefaultHandler {
 
             for (int i = 0 ; i < attributes.getLength() ; i++) {
                 String val = attributes.getValue(i);
-                System.out.print(attributes.getLocalName(i) + ":");
+                //System.out.print(attributes.getLocalName(i) + ":");
                 if (val != null) {
-                    System.out.println(val);
+                    //System.out.println(val);
                     try {
                         Map<String, String> map = CSSParser.parseLine(val);
                         if (map.size() != 0) {
                             Set<Entry<String, String>> entries = map.entrySet();
                             for (Entry<String, String> entry : entries) {
-                                System.out.println(entry.getKey() + " -> " + entry.getValue());
+                                //System.out.println(entry.getKey() + " -> " + entry.getValue());
                             }
                         }
                     } catch (CSSParserException e) {
-                        //e.printStackTrace();
                     }
                 } else {
-                    System.out.println("");
+                    //System.out.println("");
                 }
             }
 
-            System.out.println("");
+            //System.out.println("");
 
 
 
index d4eec64..bc46aca 100755 (executable)
@@ -403,3 +403,17 @@ __GO_UI_BORDER_POSITION__
 __GO_GRID_OPT_GRID__
 __GO_GRID_OPT_PADDING__
 __GO_BORDER_OPT_PADDING__
+
+__GO_UI_FRAME_BORDER__
+__GO_UI_FRAME_BORDER_COLOR__
+__GO_UI_FRAME_BORDER_HIGHLIGHT_IN__
+__GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__
+__GO_UI_FRAME_BORDER_IN_BORDER__
+__GO_UI_FRAME_BORDER_JUSTIFICATION__
+__GO_UI_FRAME_BORDER_OUT_BORDER__
+__GO_UI_FRAME_BORDER_ROUNDED__
+__GO_UI_FRAME_BORDER_SHADOW_IN__
+__GO_UI_FRAME_BORDER_SHADOW_OUT__
+__GO_UI_FRAME_BORDER_TITLE__
+__GO_UI_FRAME_BORDER_POSITION__
+__GO_UI_FRAME_BORDER_STYLE__
index 711324b..9f23fe9 100644 (file)
@@ -333,6 +333,8 @@ src/c/getHandleProperty/set_constraints_property.c \
 src/c/getHandleProperty/set_rect_property.c \
 src/c/getHandleProperty/get_layout_options_property.c \
 src/c/getHandleProperty/set_layout_options_property.c \
+src/c/getHandleProperty/get_borders_property.c \
+src/c/getHandleProperty/set_borders_property.c \
 src/c/DefaultCommandArg.c \
 src/c/Axes.c \
 src/c/sciMatrix.c \
index 889503e..1a79668 100644 (file)
@@ -480,6 +480,8 @@ am__objects_1 = src/c/libscigraphics_algo_la-GetCommandArg.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-set_rect_property.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-get_layout_options_property.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-set_layout_options_property.lo \
+       src/c/getHandleProperty/libscigraphics_algo_la-get_borders_property.lo \
+       src/c/getHandleProperty/libscigraphics_algo_la-set_borders_property.lo \
        src/c/libscigraphics_algo_la-DefaultCommandArg.lo \
        src/c/libscigraphics_algo_la-Axes.lo \
        src/c/libscigraphics_algo_la-sciMatrix.lo \
@@ -1262,6 +1264,8 @@ src/c/getHandleProperty/set_constraints_property.c \
 src/c/getHandleProperty/set_rect_property.c \
 src/c/getHandleProperty/get_layout_options_property.c \
 src/c/getHandleProperty/set_layout_options_property.c \
+src/c/getHandleProperty/get_borders_property.c \
+src/c/getHandleProperty/set_borders_property.c \
 src/c/DefaultCommandArg.c \
 src/c/Axes.c \
 src/c/sciMatrix.c \
@@ -2545,6 +2549,12 @@ src/c/getHandleProperty/libscigraphics_algo_la-get_layout_options_property.lo:
 src/c/getHandleProperty/libscigraphics_algo_la-set_layout_options_property.lo:  \
        src/c/getHandleProperty/$(am__dirstamp) \
        src/c/getHandleProperty/$(DEPDIR)/$(am__dirstamp)
+src/c/getHandleProperty/libscigraphics_algo_la-get_borders_property.lo:  \
+       src/c/getHandleProperty/$(am__dirstamp) \
+       src/c/getHandleProperty/$(DEPDIR)/$(am__dirstamp)
+src/c/getHandleProperty/libscigraphics_algo_la-set_borders_property.lo:  \
+       src/c/getHandleProperty/$(am__dirstamp) \
+       src/c/getHandleProperty/$(DEPDIR)/$(am__dirstamp)
 src/c/libscigraphics_algo_la-DefaultCommandArg.lo:  \
        src/c/$(am__dirstamp) src/c/$(DEPDIR)/$(am__dirstamp)
 src/c/libscigraphics_algo_la-Axes.lo: src/c/$(am__dirstamp) \
@@ -2989,6 +2999,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_background_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_bar_layout_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_bar_width_property.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_borders_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_box_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_callback_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_callback_type_property.Plo@am__quote@
@@ -3148,6 +3159,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_background_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_bar_layout_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_bar_width_property.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_borders_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_box_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_callback_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_callback_type_property.Plo@am__quote@
@@ -5465,6 +5477,20 @@ src/c/getHandleProperty/libscigraphics_algo_la-set_layout_options_property.lo: s
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/getHandleProperty/libscigraphics_algo_la-set_layout_options_property.lo `test -f 'src/c/getHandleProperty/set_layout_options_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/set_layout_options_property.c
 
+src/c/getHandleProperty/libscigraphics_algo_la-get_borders_property.lo: src/c/getHandleProperty/get_borders_property.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/getHandleProperty/libscigraphics_algo_la-get_borders_property.lo -MD -MP -MF src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_borders_property.Tpo -c -o src/c/getHandleProperty/libscigraphics_algo_la-get_borders_property.lo `test -f 'src/c/getHandleProperty/get_borders_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/get_borders_property.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_borders_property.Tpo src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_borders_property.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/getHandleProperty/get_borders_property.c' object='src/c/getHandleProperty/libscigraphics_algo_la-get_borders_property.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/getHandleProperty/libscigraphics_algo_la-get_borders_property.lo `test -f 'src/c/getHandleProperty/get_borders_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/get_borders_property.c
+
+src/c/getHandleProperty/libscigraphics_algo_la-set_borders_property.lo: src/c/getHandleProperty/set_borders_property.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/getHandleProperty/libscigraphics_algo_la-set_borders_property.lo -MD -MP -MF src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_borders_property.Tpo -c -o src/c/getHandleProperty/libscigraphics_algo_la-set_borders_property.lo `test -f 'src/c/getHandleProperty/set_borders_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/set_borders_property.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_borders_property.Tpo src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_borders_property.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/getHandleProperty/set_borders_property.c' object='src/c/getHandleProperty/libscigraphics_algo_la-set_borders_property.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/getHandleProperty/libscigraphics_algo_la-set_borders_property.lo `test -f 'src/c/getHandleProperty/set_borders_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/set_borders_property.c
+
 src/c/libscigraphics_algo_la-DefaultCommandArg.lo: src/c/DefaultCommandArg.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscigraphics_algo_la-DefaultCommandArg.lo -MD -MP -MF src/c/$(DEPDIR)/libscigraphics_algo_la-DefaultCommandArg.Tpo -c -o src/c/libscigraphics_algo_la-DefaultCommandArg.lo `test -f 'src/c/DefaultCommandArg.c' || echo '$(srcdir)/'`src/c/DefaultCommandArg.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscigraphics_algo_la-DefaultCommandArg.Tpo src/c/$(DEPDIR)/libscigraphics_algo_la-DefaultCommandArg.Plo
index f6d4b80..3f1b58c 100644 (file)
@@ -233,6 +233,7 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClCompile Include="src\c\getHandleProperty\get_background_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_bar_layout_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_bar_width_property.c" />
+    <ClCompile Include="src\c\getHandleProperty\get_borders_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_constraints_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_datatips_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_box_property.c" />
@@ -343,6 +344,7 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClCompile Include="src\c\getHandleProperty\get_toolbar_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_use_color_material_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_ambient_color_property.c" />
+    <ClCompile Include="src\c\getHandleProperty\set_borders_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_constraints_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_diffuse_color_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_direction_property.c" />
@@ -635,6 +637,7 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClInclude Include="src\c\Fec.h" />
     <ClInclude Include="includes\Format.h" />
     <ClInclude Include="src\c\getHandleProperty\FillType.h" />
+    <ClInclude Include="src\c\getHandleProperty\FrameBorderType.h" />
     <ClInclude Include="src\c\getHandleProperty\get_data_property.h" />
     <ClInclude Include="src\c\getHandleProperty\LayoutType.h" />
     <ClInclude Include="src\c\get_ticks_utils.h" />
index a218933..9c4c310 100644 (file)
     <ClCompile Include="src\c\getHandleProperty\get_layout_options_property.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="src\c\getHandleProperty\get_borders_property.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="src\c\getHandleProperty\set_borders_property.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="includes\Axes.h">
     <ClInclude Include="src\c\getHandleProperty\FillType.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="src\c\getHandleProperty\FrameBorderType.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="Gui_Import.def">
diff --git a/scilab/modules/graphics/macros/%BevelBor_i_h.sci b/scilab/modules/graphics/macros/%BevelBor_i_h.sci
new file mode 100644 (file)
index 0000000..37622b5
--- /dev/null
@@ -0,0 +1,14 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function h = %BevelBor_i_h(i,v,h)
+    if type(i)==10 then
+        set(h,i,v)
+    else
+        error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%BevelBor_i_h",1));
+    end
+endfunction
diff --git a/scilab/modules/graphics/macros/%BevelBor_p.sci b/scilab/modules/graphics/macros/%BevelBor_p.sci
new file mode 100644 (file)
index 0000000..0f7b549
--- /dev/null
@@ -0,0 +1,15 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function %BevelBor_p(t)
+    printf("Bevel Border\n");
+    printf("  Type            : %s\n", sci2exp(t.type));
+    printf("  Highlight outer : %s\n", sci2exp(t.hlouter));
+    printf("  Highlight inner : %s\n", sci2exp(t.hlinner));
+    printf("  Shadow outer    : %s\n", sci2exp(t.shadowouter));
+    printf("  Shadow inner    : %s\n", sci2exp(t.shadowinner));
+endfunction
diff --git a/scilab/modules/graphics/macros/%Compound_i_h.sci b/scilab/modules/graphics/macros/%Compound_i_h.sci
new file mode 100644 (file)
index 0000000..e62602e
--- /dev/null
@@ -0,0 +1,14 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function h = %Compound_i_h(i,v,h)
+    if type(i)==10 then
+        set(h,i,v)
+    else
+        error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%Compound_i_h",1));
+    end
+endfunction
diff --git a/scilab/modules/graphics/macros/%Compound_p.sci b/scilab/modules/graphics/macros/%Compound_p.sci
new file mode 100644 (file)
index 0000000..1202eea
--- /dev/null
@@ -0,0 +1,12 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function %Compound_p(t)
+    printf("Compound Border\n");
+    printf("  Outer : %s\n", typeof(t.outer));
+    printf("  Inner : %s\n", typeof(t.inner));
+endfunction
diff --git a/scilab/modules/graphics/macros/%EmptyBor_i_h.sci b/scilab/modules/graphics/macros/%EmptyBor_i_h.sci
new file mode 100644 (file)
index 0000000..e84200e
--- /dev/null
@@ -0,0 +1,14 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function h = %EmptyBor_i_h(i,v,h)
+    if type(i)==10 then
+        set(h,i,v)
+    else
+        error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%EmptyBor_i_h",1));
+    end
+endfunction
diff --git a/scilab/modules/graphics/macros/%EmptyBor_p.sci b/scilab/modules/graphics/macros/%EmptyBor_p.sci
new file mode 100644 (file)
index 0000000..72aecea
--- /dev/null
@@ -0,0 +1,14 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function %EmptyBor_p(t)
+    printf("Empty Border\n");
+    printf("  Top    : %s\n", sci2exp(t.top));
+    printf("  Left   : %s\n", sci2exp(t.left));
+    printf("  Bottom : %s\n", sci2exp(t.bottom));
+    printf("  Right  : %s\n", sci2exp(t.right));
+endfunction
diff --git a/scilab/modules/graphics/macros/%EtchedBo_i_h.sci b/scilab/modules/graphics/macros/%EtchedBo_i_h.sci
new file mode 100644 (file)
index 0000000..b3c31ec
--- /dev/null
@@ -0,0 +1,14 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function h = %EtchedBo_i_h(i,v,h)
+    if type(i)==10 then
+        set(h,i,v)
+    else
+        error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%EtchedBo_i_h",1));
+    end
+endfunction
diff --git a/scilab/modules/graphics/macros/%EtchedBo_p.sci b/scilab/modules/graphics/macros/%EtchedBo_p.sci
new file mode 100644 (file)
index 0000000..fed7743
--- /dev/null
@@ -0,0 +1,13 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function %EtchedBo_p(t)
+    printf("Etched Border\n");
+    printf("  Type      : %s\n", sci2exp(t.type));
+    printf("  Highlight : %s\n", sci2exp(t.hl));
+    printf("  Shadow    : %s\n", sci2exp(t.shadow));
+endfunction
diff --git a/scilab/modules/graphics/macros/%LineBord_i_h.sci b/scilab/modules/graphics/macros/%LineBord_i_h.sci
new file mode 100644 (file)
index 0000000..c215e4c
--- /dev/null
@@ -0,0 +1,14 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function h = %LineBord_i_h(i,v,h)
+    if type(i)==10 then
+        set(h,i,v)
+    else
+        error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%LineBord_i_h",1));
+    end
+endfunction
diff --git a/scilab/modules/graphics/macros/%LineBord_p.sci b/scilab/modules/graphics/macros/%LineBord_p.sci
new file mode 100644 (file)
index 0000000..f7b4c0e
--- /dev/null
@@ -0,0 +1,13 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function %LineBord_p(t)
+    printf("Line Border\n");
+    printf("  Color     : %s\n", sci2exp(t.color));
+    printf("  Thickness : %s\n", sci2exp(t.thickness));
+    printf("  Rounded   : %s\n", sci2exp(t.rounded));
+endfunction
diff --git a/scilab/modules/graphics/macros/%MatteBor_i_h.sci b/scilab/modules/graphics/macros/%MatteBor_i_h.sci
new file mode 100644 (file)
index 0000000..ac1c648
--- /dev/null
@@ -0,0 +1,14 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function h = %MatteBor_i_h(i,v,h)
+    if type(i)==10 then
+        set(h,i,v)
+    else
+        error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%MatteBor_i_h",1));
+    end
+endfunction
diff --git a/scilab/modules/graphics/macros/%MatteBor_p.sci b/scilab/modules/graphics/macros/%MatteBor_p.sci
new file mode 100644 (file)
index 0000000..be3036f
--- /dev/null
@@ -0,0 +1,15 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function %MatteBor_p(t)
+    printf("Matte Border\n");
+    printf("  Top    : %s\n", sci2exp(t.top));
+    printf("  Left   : %s\n", sci2exp(t.left));
+    printf("  Bottom : %s\n", sci2exp(t.bottom));
+    printf("  Right  : %s\n", sci2exp(t.right));
+    printf("  Color  : %s\n", sci2exp(t.color));
+endfunction
diff --git a/scilab/modules/graphics/macros/%NoBorder_i_h.sci b/scilab/modules/graphics/macros/%NoBorder_i_h.sci
new file mode 100644 (file)
index 0000000..1feaf91
--- /dev/null
@@ -0,0 +1,14 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function h = %NoBorder_i_h(i,v,h)
+    if type(i)==10 then
+        set(h,i,v)
+    else
+        error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%NoBorder_i_h",1));
+    end
+endfunction
diff --git a/scilab/modules/graphics/macros/%NoBorder_p.sci b/scilab/modules/graphics/macros/%NoBorder_p.sci
new file mode 100644 (file)
index 0000000..9681622
--- /dev/null
@@ -0,0 +1,11 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function %NoBorder_p(t)
+    printf("No Border\n");
+    printf("  No option\n");
+endfunction
diff --git a/scilab/modules/graphics/macros/%SoftBeve_i_h.sci b/scilab/modules/graphics/macros/%SoftBeve_i_h.sci
new file mode 100644 (file)
index 0000000..ed1bb18
--- /dev/null
@@ -0,0 +1,14 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function h = %SoftBeve_i_h(i,v,h)
+    if type(i)==10 then
+        set(h,i,v)
+    else
+        error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%SoftBeve_i_h",1));
+    end
+endfunction
diff --git a/scilab/modules/graphics/macros/%SoftBeve_p.sci b/scilab/modules/graphics/macros/%SoftBeve_p.sci
new file mode 100644 (file)
index 0000000..b0100ff
--- /dev/null
@@ -0,0 +1,15 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function %SoftBeve_p(t)
+    printf("SoftBevel Border\n");
+    printf("  Type            : %s\n", sci2exp(t.type));
+    printf("  Highlight outer : %s\n", sci2exp(t.hlouter));
+    printf("  Highlight inner : %s\n", sci2exp(t.hlinner));
+    printf("  Shadow outer    : %s\n", sci2exp(t.shadowouter));
+    printf("  Shadow inner    : %s\n", sci2exp(t.shadowinner));
+endfunction
diff --git a/scilab/modules/graphics/macros/%TitledBo_i_h.sci b/scilab/modules/graphics/macros/%TitledBo_i_h.sci
new file mode 100644 (file)
index 0000000..e402b4e
--- /dev/null
@@ -0,0 +1,14 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function h = %TitledBo_i_h(i,v,h)
+    if type(i)==10 then
+        set(h,i,v)
+    else
+        error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%TitledBo_i_h",1));
+    end
+endfunction
diff --git a/scilab/modules/graphics/macros/%TitledBo_p.sci b/scilab/modules/graphics/macros/%TitledBo_p.sci
new file mode 100644 (file)
index 0000000..2eb40fc
--- /dev/null
@@ -0,0 +1,19 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2104 - Scilab Enterprises - Antoine ELIAS
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+function %TitledBo_p(t)
+    printf("Titled Border\n");
+    printf("  Border        : %s\n", typeof(t.border));
+    printf("  Title         : %s\n", sci2exp(t.title));
+    printf("  Justification : %s\n", sci2exp(t.justification));
+    printf("  FontName      : %s\n", sci2exp(t.fontname));
+    printf("  FontAngle     : %s\n", sci2exp(t.fontangle));
+    printf("  FontSize      : %s\n", sci2exp(t.fontsize));
+    printf("  FontWeight    : %s\n", sci2exp(t.fontweight));
+    printf("  Position      : %s\n", sci2exp(t.position));
+    printf("  Color         : %s\n", sci2exp(t.color));
+endfunction
index b518260..66ff2a3 100755 (executable)
@@ -957,6 +957,11 @@ function %h_p(h)
                 l = l(1);
                 l = l(1);
             end
+            b = h.borders;
+            if type(b) == 16 then //tlist
+                b = b(1);
+                b = b(1);
+            end
             if h.style == "tabgroup" then
                 t=[t;
                 "Parent: "+h.parent.type
@@ -1027,6 +1032,7 @@ function %h_p(h)
                 "Layout = "+sci2exp(h.layout)
                 "Layout_options = "+sci2exp(l)
                 "Constraints = "+sci2exp(c)
+                "Borders = "+sci2exp(b)
                 "Margins = "+sci2exp(h.margins)
                 "Userdata = "+fmtuser_data(u)
                 "Tag = "+h.tag
diff --git a/scilab/modules/graphics/macros/createBorders.sci b/scilab/modules/graphics/macros/createBorders.sci
new file mode 100644 (file)
index 0000000..0304663
--- /dev/null
@@ -0,0 +1,348 @@
+//
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+//
+//
+
+function ret = createBorders(constType, varargin)
+    [lhs,rhs]=argn(0)
+
+    if rhs < 1 then
+        error(msprintf(gettext("%s: Wrong number of input argument(s): At least %d expected."), "createBorders", 1));
+    end
+
+    ret = [];
+    if constType == "none" then
+        ret = tlist(["NoBorder"]);
+    elseif constType == "line" then
+        arg1 = "black"; //color
+        arg2 = 1; //thickness
+        arg3 = %f; //rounded
+
+        if size(varargin) > 0 then
+            arg1 = varargin(1);
+            if typeof(arg1) <> "string" | size(arg1, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 2));
+            end
+        end
+
+        if size(varargin) > 1 then
+            arg2 = varargin(2);
+            if typeof(arg2) <> "constant" | size(arg2, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A integer expected.\n"), "createBorders", 3));
+            end
+        end
+
+        if size(varargin) > 2 then
+            arg3 = varargin(3);
+            t = typeof(arg3);
+            if (t <> "boolean" & t <> "string") | size(arg3, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A boolean expected.\n"), "createBorders", 4));
+            end
+
+            if t == "string" then
+                if arg3 == "on" then
+                    arg3 = %t;
+                else
+                    arg3 = %f;
+                end
+            end
+        end
+
+        ret = tlist(["LineBorder", "color", "thickness", "rounded"], arg1, arg2, arg3);
+    elseif constType == "bevel" then
+        arg1 = "raised"; //type
+        arg2 = "black"; //hl out color
+        arg3 = "black"; //hl in color
+        arg4 = "black"; //shadow out color
+        arg5 = "black"; //shadow in color
+
+        if size(varargin) > 0 then
+            arg1 = varargin(1);
+            if typeof(arg1) <> "string" | size(arg1, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 2));
+            end
+        end
+
+        if size(varargin) > 1 then
+            arg2 = varargin(2);
+            if typeof(arg2) <> "string" | size(arg2, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 3));
+            end
+        end
+
+        if size(varargin) > 2 then
+            arg3 = varargin(3);
+            if typeof(arg3) <> "string" | size(arg3, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 4));
+            end
+        end
+
+        if size(varargin) > 3 then
+            arg4 = varargin(4);
+            if typeof(arg4) <> "string" | size(arg4, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 5));
+            end
+        end
+
+        if size(varargin) > 4 then
+            arg5 = varargin(5);
+            if typeof(arg5) <> "string" | size(arg5, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 6));
+            end
+        end
+
+        ret = tlist(["BevelBorder", "type", "hlouter", "hlinner", "shadowouter", "shadowinner"], arg1, arg2, arg3, arg4, arg5);
+    elseif constType == "softbevel" then
+        arg1 = "raised"; //type
+        arg2 = "black"; //hl out color
+        arg3 = "black"; //hl in color
+        arg4 = "black"; //shadow out color
+        arg5 = "black"; //shadow in color
+
+        if size(varargin) > 0 then
+            arg1 = varargin(1);
+            if typeof(arg1) <> "string" | size(arg1, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 2));
+            end
+        end
+
+        if size(varargin) > 1 then
+            arg2 = varargin(2);
+            if typeof(arg2) <> "string" | size(arg2, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 3));
+            end
+        end
+
+        if size(varargin) > 2 then
+            arg3 = varargin(3);
+            if typeof(arg3) <> "string" | size(arg3, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 4));
+            end
+        end
+
+        if size(varargin) > 3 then
+            arg4 = varargin(4);
+            if typeof(arg4) <> "string" | size(arg4, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 5));
+            end
+        end
+
+        if size(varargin) > 4 then
+            arg5 = varargin(5);
+            if typeof(arg5) <> "string" | size(arg5, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 6));
+            end
+        end
+
+        ret = tlist(["SoftBevelBorder", "type", "hlouter", "hlinner", "shadowouter", "shadowinner"], arg1, arg2, arg3, arg4, arg5);
+    elseif constType == "etched" then
+        arg1 = "raised"; //type
+        arg2 = "black"; //hl color
+        arg3 = "black"; //shadow color
+
+        if size(varargin) > 0 then
+            arg1 = varargin(1);
+            if typeof(arg1) <> "string" | size(arg1, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 2));
+            end
+        end
+
+        if size(varargin) > 1 then
+            arg2 = varargin(2);
+            if typeof(arg2) <> "string" | size(arg2, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 3));
+            end
+        end
+
+        if size(varargin) > 2 then
+            arg3 = varargin(3);
+            if typeof(arg3) <> "string" | size(arg3, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 4));
+            end
+        end
+
+        ret = tlist(["EtchedBorder", "type", "hl", "shadow"], arg1, arg2, arg3);
+    elseif constType == "titled" then
+        arg1 = createBorders("etched"); //border
+        arg2 = "Title"; //title
+        arg3 = "leading"; //justification
+        arg4 = "helvetica"; //fontname
+        arg5 = "normal"; //font angle
+        arg6 = 10; //font size
+        arg7 = "normal"; //font weight
+        arg8 = "top"; //position
+        arg9 = "black"; //color
+
+        if size(varargin) > 0 then
+            arg1 = varargin(1);
+            if typeof(arg1) <> ["LineBorder","BevelBorder","SoftBevelBorder","EtchedBorder","EmptyBorder","MatteBorder"] then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A border expected.\n"), "createBorders", 2));
+            end
+        end
+
+        if size(varargin) > 1 then
+            arg2 = varargin(2);
+            if typeof(arg2) <> "string" | size(arg2, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 3));
+            end
+        end
+
+        if size(varargin) > 2 then
+            arg3 = varargin(3);
+            if typeof(arg3) <> "string" | size(arg3, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 4));
+            end
+        end
+
+        if size(varargin) > 3 then
+            arg4 = varargin(4);
+            if typeof(arg4) <> "string" | size(arg4, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 5));
+            end
+        end
+
+        if size(varargin) > 4 then
+            arg5 = varargin(5);
+            if typeof(arg5) <> "string" | size(arg5, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 6));
+            end
+        end
+
+        if size(varargin) > 5 then
+            arg6 = varargin(6);
+            if typeof(arg6) <> "constant" | size(arg6, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A integer expected.\n"), "createBorders", 7));
+            end
+        end
+
+        if size(varargin) > 6 then
+            arg7 = varargin(7);
+            if typeof(arg7) <> "string" | size(arg7, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 8));
+            end
+        end
+
+        if size(varargin) > 7 then
+            arg8 = varargin(8);
+            if typeof(arg8) <> "string" | size(arg8, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 9));
+            end
+        end
+
+        if size(varargin) > 8 then
+            arg9 = varargin(9);
+            if typeof(arg9) <> "string" | size(arg9, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 10));
+            end
+        end
+
+        ret = tlist(["TitledBorder", "border", "title", "justification", "fontname", "fontangle", "fontsize", "fontweight", "position", "color"], ...
+            arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
+    elseif constType == "empty" then
+        arg1 = 0; //top
+        arg2 = 0; //left
+        arg3 = 0; //bottom
+        arg4 = 0; //right
+
+        if size(varargin) > 0 then
+            arg1 = varargin(1);
+            if typeof(arg1) <> "constant" | size(arg1, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A integer expected.\n"), "createBorders", 2));
+            end
+        end
+
+        if size(varargin) > 1 then
+            arg2 = varargin(2);
+            if typeof(arg2) <> "constant" | size(arg2, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A integer expected.\n"), "createBorders", 3));
+            end
+        end
+
+        if size(varargin) > 2 then
+            arg3 = varargin(3);
+            if typeof(arg3) <> "constant" | size(arg3, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A integer expected.\n"), "createBorders", 4));
+            end
+        end
+
+        if size(varargin) > 3 then
+            arg4 = varargin(4);
+            if typeof(arg4) <> "constant" | size(arg4, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A integer expected.\n"), "createBorders", 5));
+            end
+        end
+
+        ret = tlist(["EmptyBorder", "top", "left", "bottom", "right"], arg1, arg2, arg3, arg4);
+    elseif constType == "compound" then
+        arg1 = createBorders("etched"); //out border
+        arg2 = createBorders("etched"); //in border
+
+        if size(varargin) > 0 then
+            arg1 = varargin(1);
+            if typeof(arg1) <> ["LineBorder","BevelBorder","SoftBevelBorder","EtchedBorder","EmptyBorder","MatteBorder","TitledBorder"] then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A border expected.\n"), "createBorders", 2));
+            end
+        end
+
+        if size(varargin) > 1 then
+            arg2 = varargin(2);
+            if typeof(arg2) <> ["LineBorder","BevelBorder","SoftBevelBorder","EtchedBorder","EmptyBorder","MatteBorder","TitledBorder"] then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A border expected.\n"), "createBorders", 3));
+            end
+        end
+
+        ret = tlist(["CompoundBorder", "outer", "inner"], arg1, arg2);
+    elseif constType == "matte" then
+        arg1 = 0; //top
+        arg2 = 0; //left
+        arg3 = 0; //bottom
+        arg4 = 0; //right
+        arg5 = "black"; //color
+
+        if size(varargin) > 0 then
+            arg1 = varargin(1);
+            if typeof(arg1) <> "constant" | size(arg1, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A integer expected.\n"), "createBorders", 2));
+            end
+        end
+
+        if size(varargin) > 1 then
+            arg2 = varargin(2);
+            if typeof(arg2) <> "constant" | size(arg2, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A integer expected.\n"), "createBorders", 3));
+            end
+        end
+
+        if size(varargin) > 2 then
+            arg3 = varargin(3);
+            if typeof(arg3) <> "constant" | size(arg3, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A integer expected.\n"), "createBorders", 4));
+            end
+        end
+
+        if size(varargin) > 3 then
+            arg4 = varargin(4);
+            if typeof(arg4) <> "constant" | size(arg4, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A integer expected.\n"), "createBorders", 5));
+            end
+        end
+
+        if size(varargin) > 4 then
+            arg5 = varargin(5);
+            if typeof(arg5) <> "string" | size(arg5, "*") <> 1 then
+                error(999, msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"), "createBorders", 6));
+            end
+        end
+
+        ret = tlist(["MatteBorder", "top", "left", "bottom", "right", "color"], arg1, arg2, arg3, arg4, arg5);
+    else
+        error(999, msprintf(_("%s: Wrong value for input argument #%d: Must be in the set {%s}.\n"), "createBorders", 1, "line, bevel, softbevel, etched, titled, empty, compound, matte"));
+    end
+endfunction
diff --git a/scilab/modules/graphics/src/c/getHandleProperty/FrameBorderType.h b/scilab/modules/graphics/src/c/getHandleProperty/FrameBorderType.h
new file mode 100644 (file)
index 0000000..917aa38
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+enum FrameBorderType
+{
+    NONE = 0,
+    LINE,
+    BEVEL,
+    SOFTBEVEL,
+    ETCHED,
+    TITLED,
+    EMPTY,
+    COMPOUND,
+    MATTE
+};
+
index 19b51b6..d801d27 100755 (executable)
@@ -240,7 +240,8 @@ static getHashTableCouple propertyGetTable[] =
     {"layout", get_layout_property},
     {"constraints", get_constraints_property},
     {"rect", get_rect_property},
-    {"layout_options", get_layout_options_property}
+    {"layout_options", get_layout_options_property},
+    {"borders", get_borders_property}
 };
 
 /*--------------------------------------------------------------------------*/
index 7c20008..f1472ee 100755 (executable)
@@ -241,7 +241,8 @@ static setHashTableCouple propertySetTable[] =
     {"layout", set_layout_property},
     {"constraints", set_constraints_property},
     {"rect", set_rect_property},
-    {"layout_options", set_layout_options_property}
+    {"layout_options", set_layout_options_property},
+    {"borders", set_borders_property}
 };
 
 /*--------------------------------------------------------------------------*/
index 21facfa..68ea8aa 100755 (executable)
@@ -213,5 +213,6 @@ int get_layout_property(void* _pvCtx, int iObjUID);
 int get_constraints_property(void* _pvCtx, int iObjUID);
 int get_rect_property(void* _pvCtx, int iObjUID);
 int get_layout_options_property(void* _pvCtx, int iObjUID);
+int get_borders_property(void* _pvCtx, int iObjUID);
 
 #endif /* _GET_HANDLE_PROPERTY_H_ */
diff --git a/scilab/modules/graphics/src/c/getHandleProperty/get_borders_property.c b/scilab/modules/graphics/src/c/getHandleProperty/get_borders_property.c
new file mode 100644 (file)
index 0000000..dfba65b
--- /dev/null
@@ -0,0 +1,757 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+/*------------------------------------------------------------------------*/
+/* file: get_figure_name_property.c                                       */
+/* desc : function to retrieve in Scilab the figure_name field of a       */
+/*        handle                                                          */
+/*------------------------------------------------------------------------*/
+
+#include <string.h>
+#include "api_scilab.h"
+#include "Scierror.h"
+#include "localization.h"
+#include "SetPropertyStatus.h"
+#include "stricmp.h"
+
+#include "getGraphicObjectProperty.h"
+#include "graphicObjectProperties.h"
+#include "FrameBorderType.h"
+#include "returnPropertyList.h"
+
+/*------------------------------------------------------------------------*/
+int getBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID);
+int getNoBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID);
+int getLineBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID);
+int getBevelBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID);
+int getSoftBevelBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID);
+int getCommonBevelBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID, int _iBevel);
+int getEtchedBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID);
+int getTitledBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID);
+int getEmptyBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID);
+int getCompoundBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID);
+int getMatteBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID);
+/*------------------------------------------------------------------------*/
+int get_borders_property(void* _pvCtx, int iObjUID)
+{
+    int iBorder = 0;
+    int* piBorder = &iBorder;
+    int iRhs = nbInputArgument(_pvCtx) + 1;
+
+    getGraphicObjectProperty(iObjUID, __GO_UI_FRAME_BORDER__, jni_int, (void **)&piBorder);
+    if (piBorder == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    return getBorders(_pvCtx, iRhs, 0, 0, iBorder);
+}
+/*------------------------------------------------------------------------*/
+int getBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID)
+{
+    int iStyle = 0;
+    int* piStyle = &iStyle;
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER_STYLE__, jni_int, (void **)&piStyle);
+    if (piStyle == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+
+    switch (iStyle)
+    {
+        default:
+        {
+            return getNoBorders(_pvCtx, _iVar, _piParent, _iPos, _iObjUID);
+        }
+        break;
+        case LINE :
+        {
+            return getLineBorders(_pvCtx, _iVar, _piParent, _iPos, _iObjUID);
+        }
+        break;
+        case BEVEL :
+        {
+            return getBevelBorders(_pvCtx, _iVar, _piParent, _iPos, _iObjUID);
+        }
+        break;
+        case SOFTBEVEL :
+        {
+            return getSoftBevelBorders(_pvCtx, _iVar, _piParent, _iPos, _iObjUID);
+        }
+        break;
+        case ETCHED :
+        {
+            return getEtchedBorders(_pvCtx, _iVar, _piParent, _iPos, _iObjUID);
+        }
+        break;
+        case TITLED :
+        {
+            return getTitledBorders(_pvCtx, _iVar, _piParent, _iPos, _iObjUID);
+        }
+        break;
+        case EMPTY :
+        {
+            return getEmptyBorders(_pvCtx, _iVar, _piParent, _iPos, _iObjUID);
+        }
+        break;
+        case COMPOUND :
+        {
+            return getCompoundBorders(_pvCtx, _iVar, _piParent, _iPos, _iObjUID);
+        }
+        break;
+        case MATTE :
+        {
+            return getMatteBorders(_pvCtx, _iVar, _piParent, _iPos, _iObjUID);
+        }
+        break;
+    }
+
+    return 0;
+}
+/*------------------------------------------------------------------------*/
+int getNoBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID)
+{
+    SciErr sciErr;
+    int* piAddrList = NULL;
+    char * pstFieldList[] = {"NoBorder"};
+    if (_piParent)
+    {
+        sciErr = createTListInList(_pvCtx, _iVar, _piParent, _iPos, 1, &piAddrList);
+    }
+    else
+    {
+        sciErr = createTList(_pvCtx, _iVar, 1, &piAddrList);
+    }
+
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 1, 1, 1, (const char * const*)&pstFieldList);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    return 0;
+}
+/*------------------------------------------------------------------------*/
+int getLineBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID)
+{
+    SciErr sciErr;
+    int* piAddrList = NULL;
+    char * pstFieldList[] = {"LineBorder", "color", "thickness", "rounded"};
+    char* pstColor = NULL;
+    int iThickness = 0;
+    double dblThickness = 0;
+    int* piThickness = &iThickness;
+    int iRounded = 0;
+    int* piRounded = &iRounded;
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER_COLOR__, jni_string, (void **)&pstColor);
+    if (pstColor == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    getGraphicObjectProperty(_iObjUID, __GO_LINE_THICKNESS__, jni_int, (void **)&piThickness);
+    if (piThickness == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    dblThickness = (double)iThickness;
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER_ROUNDED__, jni_bool, (void **)&piRounded);
+    if (piRounded == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    if (_piParent)
+    {
+        sciErr = createTListInList(_pvCtx, _iVar, _piParent, _iPos, 4, &piAddrList);
+    }
+    else
+    {
+        sciErr = createTList(_pvCtx, _iVar, 4, &piAddrList);
+    }
+
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 1, 1, 4, (const char * const*)&pstFieldList);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 2, 1, 1, &pstColor);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfDoubleInList(_pvCtx, _iVar, piAddrList, 3, 1, 1, &dblThickness);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfBooleanInList(_pvCtx, _iVar, piAddrList, 4, 1, 1, &iRounded);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    return 0;
+}
+/*------------------------------------------------------------------------*/
+int getBevelBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID)
+{
+    return getCommonBevelBorders(_pvCtx, _iVar, _piParent, _iPos, _iObjUID, 1);
+}
+/*------------------------------------------------------------------------*/
+int getSoftBevelBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID)
+{
+    return getCommonBevelBorders(_pvCtx, _iVar, _piParent, _iPos, _iObjUID, 2);
+}
+/*------------------------------------------------------------------------*/
+int getCommonBevelBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID, int _iBevel)
+{
+    SciErr sciErr;
+    int* piAddrList = NULL;
+    char * pstFieldList[] = {"BevelBorder", "type", "hlouter", "hlinner", "shadowouter", "shadowinner"};
+    char * pstSoftFieldList[] = {"SoftBevelBorder", "type", "hlouter", "hlinner", "shadowouter", "shadowinner"};
+    int iType = 0;
+    int* piType = &iType;
+    char* pstType[] = {"raised", "lowered"};
+    char* pstHlOutColor = NULL;
+    char* pstHlInColor = NULL;
+    char* pstShadowOutColor = NULL;
+    char* pstShadowInColor = NULL;
+
+    getGraphicObjectProperty(_iObjUID, __GO_TYPE__, jni_int, (void **)&piType);
+    if (piType == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__, jni_string, (void **)&pstHlOutColor);
+    if (pstHlOutColor == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER_HIGHLIGHT_IN__, jni_string, (void **)&pstHlInColor);
+    if (pstHlInColor == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER_SHADOW_OUT__, jni_string, (void **)&pstShadowOutColor);
+    if (pstShadowOutColor == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER_SHADOW_IN__, jni_string, (void **)&pstShadowInColor);
+    if (pstShadowInColor == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    if (_piParent)
+    {
+        sciErr = createTListInList(_pvCtx, _iVar, _piParent, _iPos, 6, &piAddrList);
+    }
+    else
+    {
+        sciErr = createTList(_pvCtx, _iVar, 6, &piAddrList);
+    }
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    if (_iBevel == 1)
+    {
+        sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 1, 1, 6, (const char * const*)&pstFieldList);
+    }
+    else
+    {
+        sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 1, 1, 6, (const char * const*)&pstSoftFieldList);
+    }
+
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 2, 1, 1, &pstType[iType]);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 3, 1, 1, &pstHlOutColor);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 4, 1, 1, &pstHlInColor);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 5, 1, 1, &pstShadowOutColor);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 6, 1, 1, &pstShadowInColor);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    return 0;
+}
+/*------------------------------------------------------------------------*/
+int getEtchedBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID)
+{
+    SciErr sciErr;
+    int* piAddrList = NULL;
+    char * pstFieldList[] = {"EtchedBorder", "type", "hl", "shadow"};
+    int iType = 0;
+    int* piType = &iType;
+    char* pstType[] = {"raised", "lowered"};
+    char* pstHlOutColor = NULL;
+    char* pstShadowOutColor = NULL;
+
+    getGraphicObjectProperty(_iObjUID, __GO_TYPE__, jni_int, (void **)&piType);
+    if (piType == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__, jni_string, (void **)&pstHlOutColor);
+    if (pstHlOutColor == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER_SHADOW_OUT__, jni_string, (void **)&pstShadowOutColor);
+    if (pstShadowOutColor == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    if (_piParent)
+    {
+        sciErr = createTListInList(_pvCtx, _iVar, _piParent, _iPos, 4, &piAddrList);
+    }
+    else
+    {
+        sciErr = createTList(_pvCtx, _iVar, 4, &piAddrList);
+    }
+
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 1, 1, 4, (const char * const*)&pstFieldList);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 2, 1, 1, &pstType[iType]);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 3, 1, 1, &pstHlOutColor);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 4, 1, 1, &pstShadowOutColor);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    return 0;
+}
+/*------------------------------------------------------------------------*/
+int getTitledBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID)
+{
+    SciErr sciErr;
+    int* piAddrList = NULL;
+    char * pstFieldList[] = {"TitledBorder", "border", "title", "justification", "fontname", "fontangle", "fontsize", "fontweight", "position", "color"};
+    char* pstJustification[] = {"leading" , "left" , "center" , "right" , "trailing"};
+    char* pstPosition[] = {"top" , "above_top" , "below_top" , "bottom" , "above_bottom", "below_bottom"};
+    int iChildBorder = 0;
+    int* piChildBorder = &iChildBorder;
+    char* pstTitle = NULL;
+    int iJustification = 0;
+    int* piJustification = &iJustification;
+    char* pstFontName = NULL;
+    char* pstFontAngle = NULL;
+    int iFontSize = 0;
+    int* piFontSize = &iFontSize;
+    double dblFontSize = 0;
+    char* pstFontWeight = NULL;
+    int iPosition = 0;
+    int* piPosition = &iPosition;
+    char* pstColor = NULL;
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER_TITLE__, jni_int, (void **)&piChildBorder);
+    if (piChildBorder == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    getGraphicObjectProperty(_iObjUID, __GO_TITLE__, jni_string, (void **)&pstTitle);
+    if (pstTitle == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER_JUSTIFICATION__, jni_int, (void **)&piJustification);
+    if (piJustification == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FONTNAME__, jni_string, (void **)&pstFontName);
+    if (pstFontName == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FONTANGLE__, jni_string, (void **)&pstFontAngle);
+    if (pstFontAngle == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FONTSIZE__, jni_int, (void **)&piFontSize);
+    if (piFontSize == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    dblFontSize = (double)iFontSize;
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FONTWEIGHT__, jni_string, (void **)&pstFontWeight);
+    if (pstFontWeight == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER_POSITION__, jni_int, (void **)&piPosition);
+    if (piPosition == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER_COLOR__, jni_string, (void **)&pstColor);
+    if (pstColor == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    if (_piParent)
+    {
+        sciErr = createTListInList(_pvCtx, _iVar, _piParent, _iPos, 10, &piAddrList);
+    }
+    else
+    {
+        sciErr = createTList(_pvCtx, _iVar, 10, &piAddrList);
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 1, 1, 10, (const char * const*)&pstFieldList);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    //get child information and fill current list
+    if (getBorders(_pvCtx, _iVar, piAddrList, 2, iChildBorder))
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 3, 1, 1, &pstTitle);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 4, 1, 1, &pstJustification[iJustification]);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 5, 1, 1, &pstFontName);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 6, 1, 1, &pstFontAngle);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfDoubleInList(_pvCtx, _iVar, piAddrList, 7, 1, 1, &dblFontSize);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 8, 1, 1, &pstFontWeight);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 9, 1, 1, &pstPosition[iPosition]);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 10, 1, 1, &pstColor);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    return 0;
+}
+/*------------------------------------------------------------------------*/
+int getEmptyBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID)
+{
+    SciErr sciErr;
+    int* piAddrList = NULL;
+    char * pstFieldList[] = {"EmptyBorder", "top", "left", "bottom", "right"};
+    double* pdblPosition = NULL;
+
+    getGraphicObjectProperty(_iObjUID, __GO_POSITION__, jni_double_vector, (void **)&pdblPosition);
+    if (pdblPosition == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    if (_piParent)
+    {
+        sciErr = createTListInList(_pvCtx, _iVar, _piParent, _iPos, 5, &piAddrList);
+    }
+    else
+    {
+        sciErr = createTList(_pvCtx, _iVar, 5, &piAddrList);
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 1, 1, 5, (const char * const*)&pstFieldList);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfDoubleInList(_pvCtx, _iVar, piAddrList, 2, 1, 1, &pdblPosition[0]);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfDoubleInList(_pvCtx, _iVar, piAddrList, 3, 1, 1, &pdblPosition[1]);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfDoubleInList(_pvCtx, _iVar, piAddrList, 4, 1, 1, &pdblPosition[2]);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfDoubleInList(_pvCtx, _iVar, piAddrList, 5, 1, 1, &pdblPosition[3]);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    return 0;
+}
+/*------------------------------------------------------------------------*/
+int getCompoundBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID)
+{
+    SciErr sciErr;
+    int* piAddrList = NULL;
+    char * pstFieldList[] = {"CompoundBorder", "outer", "inner"};
+    int iChildBorderOut = 0;
+    int* piChildBorderOut = &iChildBorderOut;
+    int iChildBorderIn = 0;
+    int* piChildBorderIn = &iChildBorderIn;
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER_OUT_BORDER__, jni_int, (void **)&piChildBorderOut);
+    if (piChildBorderOut == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER_IN_BORDER__, jni_int, (void **)&piChildBorderIn);
+    if (piChildBorderIn == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    if (_piParent)
+    {
+        sciErr = createTListInList(_pvCtx, _iVar, _piParent, _iPos, 3, &piAddrList);
+    }
+    else
+    {
+        sciErr = createTList(_pvCtx, _iVar, 3, &piAddrList);
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 1, 1, 3, (const char * const*)&pstFieldList);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    //get child information and fill current list
+    if (getBorders(_pvCtx, _iVar, piAddrList, 2, iChildBorderOut))
+    {
+        return -1;
+    }
+
+    if (getBorders(_pvCtx, _iVar, piAddrList, 3, iChildBorderIn))
+    {
+        return -1;
+    }
+
+    return 0;
+}
+/*------------------------------------------------------------------------*/
+int getMatteBorders(void* _pvCtx, int _iVar, int* _piParent, int _iPos, int _iObjUID)
+{
+    SciErr sciErr;
+    int* piAddrList = NULL;
+    char * pstFieldList[] = {"MatteBorder", "top", "left", "bottom", "right", "color"};
+    double* pdblPosition = NULL;
+    char* pstColor = NULL;
+
+    getGraphicObjectProperty(_iObjUID, __GO_POSITION__, jni_double_vector, (void **)&pdblPosition);
+    if (pdblPosition == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER_COLOR__, jni_string, (void **)&pstColor);
+    if (pstColor == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "borders");
+        return -1;
+    }
+
+    if (_piParent)
+    {
+        sciErr = createTListInList(_pvCtx, _iVar, _piParent, _iPos, 6, &piAddrList);
+    }
+    else
+    {
+        sciErr = createTList(_pvCtx, _iVar, 6, &piAddrList);
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 1, 1, 6, (const char * const*)&pstFieldList);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfDoubleInList(_pvCtx, _iVar, piAddrList, 2, 1, 1, &pdblPosition[0]);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfDoubleInList(_pvCtx, _iVar, piAddrList, 3, 1, 1, &pdblPosition[1]);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfDoubleInList(_pvCtx, _iVar, piAddrList, 4, 1, 1, &pdblPosition[2]);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfDoubleInList(_pvCtx, _iVar, piAddrList, 5, 1, 1, &pdblPosition[3]);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    sciErr = createMatrixOfStringInList(_pvCtx, _iVar, piAddrList, 6, 1, 1, &pstColor);
+    if (sciErr.iErr)
+    {
+        return -1;
+    }
+
+    return 0;
+}
+/*------------------------------------------------------------------------*/
index 1190012..64c61ef 100644 (file)
@@ -92,7 +92,7 @@ int get_layout_options_property(void* _pvCtx, int iObjUID)
         {
             char * variable_tlist[] = {"OptBorder", "padding"};
             returnedList * tList = createReturnedList(1, variable_tlist);
-            double pdblPadding[2];
+            double pdblPadding[2] = {0, 0};
             int* piPadding = NULL;
 
             getGraphicObjectProperty(iObjUID, __GO_BORDER_OPT_PADDING__, jni_int_vector, (void **)&piPadding);
index 43ce041..ea7449f 100755 (executable)
@@ -214,5 +214,6 @@ int set_layout_property(void* _pvCtx, int iObj, void* _pvData, int valueType, in
 int set_constraints_property(void* _pvCtx, int iObj, void* _pvData, int valueType, int nbRow, int nbCol);
 int set_rect_property(void* _pvCtx, int iObj, void* _pvData, int valueType, int nbRow, int nbCol);
 int set_layout_options_property(void* _pvCtx, int iObj, void* _pvData, int valueType, int nbRow, int nbCol);
+int set_borders_property(void* _pvCtx, int iObj, void* _pvData, int valueType, int nbRow, int nbCol);
 
 #endif /* _SET_HANDLE_PROPERTY_H_ */
diff --git a/scilab/modules/graphics/src/c/getHandleProperty/set_borders_property.c b/scilab/modules/graphics/src/c/getHandleProperty/set_borders_property.c
new file mode 100644 (file)
index 0000000..cdc053e
--- /dev/null
@@ -0,0 +1,925 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+/*------------------------------------------------------------------------*/
+/* file: set_figure_name_property.c                                       */
+/* desc : function to modify in Scilab the figure_name field of           */
+/*        a handle                                                        */
+/*------------------------------------------------------------------------*/
+#include "api_scilab.h"
+#include "MALLOC.h"
+#include "freeArrayOfString.h"
+#include "Scierror.h"
+#include "localization.h"
+#include "SetPropertyStatus.h"
+#include "sci_types.h"
+#include "stricmp.h"
+
+#include "createGraphicObject.h"
+#include "deleteGraphicObject.h"
+#include "setGraphicObjectProperty.h"
+#include "getGraphicObjectProperty.h"
+#include "graphicObjectProperties.h"
+#include "LayoutType.h"
+#include "BorderLayoutType.h"
+#include "FillType.h"
+#include "AnchorType.h"
+/*------------------------------------------------------------------------*/
+int clearBorders(int iObjUID);
+int createBorder(void* _pvCtx, int* _piAddrList, int _iParent);
+int createLineBorder(void* _pvCtx, int* _piAddrList, int _iObjUID);
+int createBevelBorder(void* _pvCtx, int* _piAddrList, int _iObjUID);
+int createSoftBevelBorder(void* _pvCtx, int* _piAddrList, int _iObjUID);
+int createCommonBevelBorder(void* _pvCtx, int* _piAddrList, int _iObjUID, int _iStyle);
+int createEtchedBorder(void* _pvCtx, int* _piAddrList, int _iObjUID);
+int createTitledBorder(void* _pvCtx, int* _piAddrList, int _iObjUID);
+int createEmptyBorder(void* _pvCtx, int* _piAddrList, int _iObjUID);
+int createCompoundBorder(void* _pvCtx, int* _piAddrList, int _iObjUID);
+int createMatteBorder(void* _pvCtx, int* _piAddrList, int _iObjUID);
+/*------------------------------------------------------------------------*/
+int set_borders_property(void* _pvCtx, int iObjUID, void* _pvData, int valueType, int nbRow, int nbCol)
+{
+    //[] or tlist
+    if (valueType == sci_matrix)
+    {
+        return clearBorders(iObjUID);
+    }
+    else
+    {
+        int* piAddrList = (int*)_pvData;
+
+        int iBorder = createBorder(_pvCtx, piAddrList, iObjUID);
+        if (iBorder == 0)
+        {
+            return SET_PROPERTY_ERROR;
+        }
+
+        setGraphicObjectProperty(iObjUID, __GO_UI_FRAME_BORDER__, &iBorder, jni_int, 1);
+        return SET_PROPERTY_SUCCEED;
+    }
+}
+/*------------------------------------------------------------------------*/
+int createBorder(void* _pvCtx, int* _piAddrList, int _iParent)
+{
+    SciErr sciErr;
+    int* piAddr = NULL;
+    char** pstField = NULL;
+    int iRows = 0;
+    int iCols = 0;
+    char* pstType = NULL;
+
+
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 1, &piAddr);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedMatrixOfString(_pvCtx, piAddr, &iRows, &iCols, &pstField))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    pstType = pstField[0];
+
+    //depend of kind of tlist
+    if (strcmp(pstType, "NoBorder") == 0)
+    {
+        return clearBorders(_iParent);
+    }
+    else if (strcmp(pstType, "LineBorder") == 0)
+    {
+        return createLineBorder(_pvCtx, _piAddrList, _iParent);
+    }
+    else if (strcmp(pstType, "BevelBorder") == 0)
+    {
+        return createBevelBorder(_pvCtx, _piAddrList, _iParent);
+    }
+    else if (strcmp(pstType, "SoftBevelBorder") == 0)
+    {
+        return createSoftBevelBorder(_pvCtx, _piAddrList, _iParent);
+    }
+    else if (strcmp(pstType, "EtchedBorder") == 0)
+    {
+        return createEtchedBorder(_pvCtx, _piAddrList, _iParent);
+    }
+    else if (strcmp(pstType, "TitledBorder") == 0)
+    {
+        return createTitledBorder(_pvCtx, _piAddrList, _iParent);
+    }
+    else if (strcmp(pstType, "EmptyBorder") == 0)
+    {
+        return createEmptyBorder(_pvCtx, _piAddrList, _iParent);
+    }
+    else if (strcmp(pstType, "CompoundBorder") == 0)
+    {
+        return createCompoundBorder(_pvCtx, _piAddrList, _iParent);
+    }
+    else if (strcmp(pstType, "MatteBorder") == 0)
+    {
+        return createMatteBorder(_pvCtx, _piAddrList, _iParent);
+    }
+
+    //empty uid
+    return 0;
+}
+/*------------------------------------------------------------------------*/
+int clearBorders(int iObjUID)
+{
+    BOOL status = FALSE;
+    int iBorder = 0;
+    int* piBorder = &iBorder;
+
+    getGraphicObjectProperty(iObjUID, __GO_UI_FRAME_BORDER__, jni_int, (void**)&piBorder);
+    if (piBorder != NULL && iBorder != 0)
+    {
+        //delete current border
+        deleteGraphicObject(iBorder);
+    }
+
+    iBorder = 0;
+    status = setGraphicObjectProperty(iObjUID, __GO_UI_FRAME_BORDER__, &iBorder, jni_int, 1);
+    if (status != TRUE)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "contraints");
+        return SET_PROPERTY_ERROR;
+    }
+
+
+    return SET_PROPERTY_SUCCEED;
+}
+/*------------------------------------------------------------------------*/
+int createLineBorder(void* _pvCtx, int* _piAddrList, int _iObjUID)
+{
+    //arg1 = string -> string
+    //arg2 = double -> int
+    //arg3 = boolean -> boolean
+    SciErr sciErr;
+    int iBorder = 0;
+    int* piBorder = &iBorder;
+    int iStyle = 1; //FrameBorderType.LINE in java
+    int* piAddr2 = NULL;
+    char* pstColor = NULL;
+    int* piAddr3 = NULL;
+    double dblThickness = 0;
+    int iThickness = 0;
+    int* piAddr4 = NULL;
+    int bRounded = 0;
+
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 2, &piAddr2);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedSingleString(_pvCtx, piAddr2, &pstColor))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 3, &piAddr3);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getScalarDouble(_pvCtx, piAddr3, &dblThickness))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    iThickness = (int)dblThickness;
+
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 4, &piAddr4);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getScalarBoolean(_pvCtx, piAddr4, &bRounded))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //get current border
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER__, jni_int, (void**)&piBorder);
+    if (piBorder != NULL && iBorder != 0)
+    {
+        //delete previous border
+        deleteGraphicObject(iBorder);
+    }
+
+    //create new border object
+    iBorder = createGraphicObject(__GO_UI_FRAME_BORDER__);
+    if (iBorder == 0)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_STYLE__, &iStyle, jni_int, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_COLOR__, pstColor, jni_string, 1);
+    setGraphicObjectProperty(iBorder, __GO_LINE_THICKNESS__, &iThickness, jni_int, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_ROUNDED__, &bRounded, jni_bool, 1);
+
+    freeAllocatedSingleString(pstColor);
+
+    return iBorder;
+}
+/*------------------------------------------------------------------------*/
+int createBevelBorder(void* _pvCtx, int* _piAddrList, int _iObjUID)
+{
+    return createCommonBevelBorder(_pvCtx, _piAddrList, _iObjUID, 2);
+}
+/*------------------------------------------------------------------------*/
+int createSoftBevelBorder(void* _pvCtx, int* _piAddrList, int _iObjUID)
+{
+    return createCommonBevelBorder(_pvCtx, _piAddrList, _iObjUID, 3);
+}
+/*------------------------------------------------------------------------*/
+int createCommonBevelBorder(void* _pvCtx, int* _piAddrList, int _iObjUID, int _iStyle)
+{
+    //arg1 = string -> int ( RAISED or LOWERED )
+    //arg2 = string -> string ( color )
+    //arg3 = string -> string ( color )
+    //arg4 = string -> string ( color )
+    //arg5 = string -> string ( color )
+
+    SciErr sciErr;
+    int iBorder = 0;
+    int* piBorder = &iBorder;
+    int* piAddr2 = NULL;
+    char* pstType = NULL;
+    int iType = 0;
+    int* piAddr3 = NULL;
+    char* pstHlOutColor = NULL;
+    int* piAddr4 = NULL;
+    char* pstHlInColor = NULL;
+    int* piAddr5 = NULL;
+    char* pstShadowOutColor = NULL;
+    int* piAddr6 = NULL;
+    char* pstShadowInColor = NULL;
+
+    //type
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 2, &piAddr2);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedSingleString(_pvCtx, piAddr2, &pstType))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (stricmp(pstType, "raised") == 0)
+    {
+        iType = 0;
+    }
+    else if (stricmp(pstType, "lowered") == 0)
+    {
+        iType = 1;
+    }
+
+    freeAllocatedSingleString(pstType);
+
+    //highlight out
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 3, &piAddr3);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedSingleString(_pvCtx, piAddr3, &pstHlOutColor))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //highlight in
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 4, &piAddr4);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedSingleString(_pvCtx, piAddr4, &pstHlInColor))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //shadow out
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 5, &piAddr5);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedSingleString(_pvCtx, piAddr5, &pstShadowOutColor))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //shadow in
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 6, &piAddr6);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedSingleString(_pvCtx, piAddr6, &pstShadowInColor))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //get current border
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER__, jni_int, (void**)&piBorder);
+    if (piBorder != NULL && iBorder != 0)
+    {
+        //delete previous border
+        deleteGraphicObject(iBorder);
+    }
+
+    //create new border object
+    iBorder = createGraphicObject(__GO_UI_FRAME_BORDER__);
+    if (iBorder == 0)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_STYLE__, &_iStyle, jni_int, 1);
+    setGraphicObjectProperty(iBorder, __GO_TYPE__, &iType, jni_int, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__, pstHlOutColor, jni_string, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_HIGHLIGHT_IN__, pstHlInColor, jni_string, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_SHADOW_OUT__, pstShadowOutColor, jni_string, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_SHADOW_IN__, pstShadowInColor, jni_string, 1);
+
+    return iBorder;
+}
+/*------------------------------------------------------------------------*/
+int createEtchedBorder(void* _pvCtx, int* _piAddrList, int _iObjUID)
+{
+    //arg1 = double -> int ( RAISED or LOWERED )
+    //arg2 = string -> string ( color ) mapped on hl out
+    //arg3 = string -> string ( color ) mapped on shadow out
+    SciErr sciErr;
+    int iBorder = 0;
+    int* piBorder = &iBorder;
+
+    int iStyle = 4; //FrameBorderType.ETCHED in java
+    int* piAddr2 = NULL;
+    char* pstType = NULL;
+    int iType = 0;
+    int* piAddr3 = NULL;
+    char* pstHlOutColor = NULL;
+    int* piAddr4 = NULL;
+    char* pstShadowOutColor = NULL;
+
+    //type
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 2, &piAddr2);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedSingleString(_pvCtx, piAddr2, &pstType))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (stricmp(pstType, "raised") == 0)
+    {
+        iType = 0;
+    }
+    else if (stricmp(pstType, "lowered") == 0)
+    {
+        iType = 1;
+    }
+
+    freeAllocatedSingleString(pstType);
+
+    //highlight out
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 3, &piAddr3);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedSingleString(_pvCtx, piAddr3, &pstHlOutColor))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //shadow out
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 4, &piAddr4);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedSingleString(_pvCtx, piAddr4, &pstShadowOutColor))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+
+    //get current border
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER__, jni_int, (void**)&piBorder);
+    if (piBorder != NULL && iBorder != 0)
+    {
+        //delete previous border
+        deleteGraphicObject(iBorder);
+    }
+
+    //create new border object
+    iBorder = createGraphicObject(__GO_UI_FRAME_BORDER__);
+    if (iBorder == 0)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_STYLE__, &iStyle, jni_int, 1);
+    setGraphicObjectProperty(iBorder, __GO_TYPE__, &iType, jni_int, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__, pstHlOutColor, jni_string, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_SHADOW_OUT__, pstShadowOutColor, jni_string, 1);
+
+    return iBorder;
+}
+/*------------------------------------------------------------------------*/
+int createTitledBorder(void* _pvCtx, int* _piAddrList, int _iObjUID)
+{
+    //arg1 = another border
+    //arg2 = string -> string
+    //arg3 = string -> int ( enum  JustificationType in java )
+    //arg4 = string -> string
+    //arg5 = string -> string
+    //arg6 = double -> int
+    //arg7 = string -> string
+    //arg8 = string -> int (  enum TitlePositionType in java )
+    //arg9 = string -> string
+    SciErr sciErr;
+    int iBorder = 0;
+    int* piBorder = &iBorder;
+    int iStyle = 5; //FrameBorderType.TITLED in java
+    int* piAddr2 = NULL;
+    int iChildBorder = 0;
+    int* piAddr3 = NULL;
+    char* pstTitle = NULL;
+    int* piAddr4 = NULL;
+    char* pstJustification = NULL;
+    int iJustification = 0;
+    int* piAddr5 = NULL;
+    char* pstFontName = NULL;
+    int* piAddr6 = NULL;
+    char* pstFontAngle = NULL;
+    int* piAddr7 = NULL;
+    double dblFontSize = 0;
+    int iFontSize = 0;
+    int* piAddr8 = NULL;
+    char* pstFontWeight = NULL;
+    int* piAddr9 = NULL;
+    char* pstPosition = NULL;
+    int iPosition = 0;
+    int* piAddr10 = NULL;
+    char* pstColor = NULL;
+
+    //child border
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 2, &piAddr2);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //title
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 3, &piAddr3);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedSingleString(_pvCtx, piAddr3, &pstTitle))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //justification
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 4, &piAddr4);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedSingleString(_pvCtx, piAddr4, &pstJustification))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (stricmp(pstJustification, "leading") == 0)
+    {
+        iJustification = 0;
+    }
+    else if (stricmp(pstJustification, "left") == 0)
+    {
+        iJustification = 1;
+    }
+    else if (stricmp(pstJustification, "center") == 0)
+    {
+        iJustification = 2;
+    }
+    else if (stricmp(pstJustification, "right") == 0)
+    {
+        iJustification = 3;
+    }
+    else if (stricmp(pstJustification, "trailing") == 0)
+    {
+        iJustification = 4;
+    }
+
+    freeAllocatedSingleString(pstJustification);
+
+    //fontname
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 5, &piAddr5);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedSingleString(_pvCtx, piAddr5, &pstFontName))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //fontangle
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 6, &piAddr6);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedSingleString(_pvCtx, piAddr6, &pstFontAngle))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //fontsize
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 7, &piAddr7);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getScalarDouble(_pvCtx, piAddr7, &dblFontSize))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    iFontSize = (int)dblFontSize;
+
+    //fontweight
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 8, &piAddr8);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedSingleString(_pvCtx, piAddr8, &pstFontWeight))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //position
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 9, &piAddr9);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedSingleString(_pvCtx, piAddr9, &pstPosition))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (stricmp(pstPosition, "top") == 0)
+    {
+        iPosition = 0;
+    }
+    else if (stricmp(pstPosition, "above_top") == 0)
+    {
+        iPosition = 1;
+    }
+    else if (stricmp(pstPosition, "below_top") == 0)
+    {
+        iPosition = 2;
+    }
+    else if (stricmp(pstPosition, "bottom") == 0)
+    {
+        iPosition = 3;
+    }
+    else if (stricmp(pstPosition, "above_bottom") == 0)
+    {
+        iPosition = 4;
+    }
+    else if (stricmp(pstPosition, "below_bottom") == 0)
+    {
+        iPosition = 5;
+    }
+
+    freeAllocatedSingleString(pstPosition);
+
+    //color
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 10, &piAddr10);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedSingleString(_pvCtx, piAddr10, &pstColor))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //get current border
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER__, jni_int, (void**)&piBorder);
+    if (piBorder != NULL && iBorder != 0)
+    {
+        //delete previous border
+        deleteGraphicObject(iBorder);
+    }
+
+    //create new border object
+    iBorder = createGraphicObject(__GO_UI_FRAME_BORDER__);
+    if (iBorder == 0)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    iChildBorder = createBorder(_pvCtx, piAddr2, iBorder);
+    if (iChildBorder == 0)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_STYLE__, &iStyle, jni_int, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_TITLE__, &iChildBorder, jni_int, 1);
+    setGraphicObjectProperty(iBorder, __GO_TITLE__, pstTitle, jni_string, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_JUSTIFICATION__, &iJustification, jni_int, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FONTNAME__, pstFontName, jni_string, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FONTANGLE__, pstFontAngle, jni_string, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FONTSIZE__, &iFontSize, jni_int, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FONTWEIGHT__, pstFontWeight, jni_string, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_POSITION__, &iPosition, jni_int, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_COLOR__, pstColor, jni_string, 1);
+
+    return iBorder;
+}
+/*------------------------------------------------------------------------*/
+int createEmptyBorder(void* _pvCtx, int* _piAddrList, int _iObjUID)
+{
+    //arg1 = double -> double
+    //arg2 = double -> double
+    //arg3 = double -> double
+    //arg4 = double -> double
+    SciErr sciErr;
+    int iBorder = 0;
+    int* piBorder = &iBorder;
+    int iStyle = 6; //FrameBorderType.EMPTY in java
+    int* piAddr2 = NULL;
+    int* piAddr3 = NULL;
+    int* piAddr4 = NULL;
+    int* piAddr5 = NULL;
+    double pdblPosition[4];
+
+    //top
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 2, &piAddr2);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getScalarDouble(_pvCtx, piAddr2, &pdblPosition[0]))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //left
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 3, &piAddr3);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getScalarDouble(_pvCtx, piAddr3, &pdblPosition[1]))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //bottom
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 4, &piAddr4);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getScalarDouble(_pvCtx, piAddr4, &pdblPosition[2]))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //right
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 5, &piAddr5);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getScalarDouble(_pvCtx, piAddr5, &pdblPosition[3]))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //get current border
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER__, jni_int, (void**)&piBorder);
+    if (piBorder != NULL && iBorder != 0)
+    {
+        //delete previous border
+        deleteGraphicObject(iBorder);
+    }
+
+    //create new border object
+    iBorder = createGraphicObject(__GO_UI_FRAME_BORDER__);
+    if (iBorder == 0)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_STYLE__, &iStyle, jni_int, 1);
+    setGraphicObjectProperty(iBorder, __GO_POSITION__, pdblPosition, jni_double_vector, 4);
+    return iBorder;
+}
+/*------------------------------------------------------------------------*/
+int createCompoundBorder(void* _pvCtx, int* _piAddrList, int _iObjUID)
+{
+    SciErr sciErr;
+    int iBorder = 0;
+    int* piBorder = &iBorder;
+    int iStyle = 7; //FrameBorderType.COMPOUND in java
+    int* piAddr2 = NULL;
+    int iChildBorderOut = 0;
+    int* piAddr3 = NULL;
+    int iChildBorderIn = 0;
+
+    //child border out
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 2, &piAddr2);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    iChildBorderOut = createBorder(_pvCtx, piAddr2, _iObjUID);
+    if (iChildBorderOut == 0)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //child border in
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 3, &piAddr3);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    iChildBorderIn = createBorder(_pvCtx, piAddr3, _iObjUID);
+    if (iChildBorderIn == 0)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //get current border
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER__, jni_int, (void**)&piBorder);
+    if (piBorder != NULL && iBorder != 0)
+    {
+        //delete previous border
+        deleteGraphicObject(iBorder);
+    }
+
+    //create new border object
+    iBorder = createGraphicObject(__GO_UI_FRAME_BORDER__);
+    if (iBorder == 0)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_STYLE__, &iStyle, jni_int, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_OUT_BORDER__, &iChildBorderOut, jni_int, 1);
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_IN_BORDER__, &iChildBorderIn, jni_int, 1);
+    return iBorder;
+}
+/*------------------------------------------------------------------------*/
+int createMatteBorder(void* _pvCtx, int* _piAddrList, int _iObjUID)
+{
+    //arg1 = double -> double
+    //arg2 = double -> double
+    //arg3 = double -> double
+    //arg4 = double -> double
+    //arg4 = string -> string
+    SciErr sciErr;
+    int iBorder = 0;
+    int* piBorder = &iBorder;
+    int iStyle = 8; //FrameBorderType.MATTE in java
+    int* piAddr2 = NULL;
+    int* piAddr3 = NULL;
+    int* piAddr4 = NULL;
+    int* piAddr5 = NULL;
+    double pdblPosition[4];
+    int* piAddr6 = NULL;
+    char* pstColor = NULL;
+
+    //top
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 2, &piAddr2);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getScalarDouble(_pvCtx, piAddr2, &pdblPosition[0]))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //left
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 3, &piAddr3);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getScalarDouble(_pvCtx, piAddr3, &pdblPosition[1]))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //bottom
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 4, &piAddr4);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getScalarDouble(_pvCtx, piAddr4, &pdblPosition[2]))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //right
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 5, &piAddr5);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getScalarDouble(_pvCtx, piAddr5, &pdblPosition[3]))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //color
+    sciErr = getListItemAddress(_pvCtx, _piAddrList, 6, &piAddr6);
+    if (sciErr.iErr)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (getAllocatedSingleString(_pvCtx, piAddr6, &pstColor))
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    //get current border
+    getGraphicObjectProperty(_iObjUID, __GO_UI_FRAME_BORDER__, jni_int, (void**)&piBorder);
+    if (piBorder != NULL && iBorder != 0)
+    {
+        //delete previous border
+        deleteGraphicObject(iBorder);
+    }
+
+    //create new border object
+    iBorder = createGraphicObject(__GO_UI_FRAME_BORDER__);
+    if (iBorder == 0)
+    {
+        return SET_PROPERTY_ERROR;
+    }
+
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_STYLE__, &iStyle, jni_int, 1);
+    setGraphicObjectProperty(iBorder, __GO_POSITION__, pdblPosition, jni_double_vector, 4);
+    setGraphicObjectProperty(iBorder, __GO_UI_FRAME_BORDER_COLOR__, pstColor, jni_string, 1);
+    return iBorder;
+}
+/*------------------------------------------------------------------------*/
index 1eb3a6f..38e27f2 100644 (file)
@@ -72,7 +72,7 @@ int set_layout_property(void* _pvCtx, int iObjUID, void* _pvData, int valueType,
     }
     else
     {
-        Scierror(999, _("Wrong value for '%s' property: %s, %s or %s expected.\n"), "layout", "'none'", "'grid'", "'border'");
+        Scierror(999, _("Wrong value for '%s' property: %s, %s or %s expected.\n"), "layout", "'none'", "'grid'", "'gridbag'", "'border'");
         return SET_PROPERTY_ERROR;
     }
 
diff --git a/scilab/modules/graphics/tests/unit_tests/borders.dia.ref b/scilab/modules/graphics/tests/unit_tests/borders.dia.ref
new file mode 100644 (file)
index 0000000..c237b61
--- /dev/null
@@ -0,0 +1,33 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- TEST WITH GRAPHIC -->
+//borders
+b1 = createBorders("line", "red", 10, %t);
+b2 = createBorders("bevel", "lowered", "red", "green", "blue", "white");
+b3 = createBorders("softbevel", "lowered", "pink", "cyan", "magenta", "orange");
+b4 = createBorders("etched", "lowered", "yellow", "gray");
+b5 = createBorders("titled", b4, "title", "center", "helvetica", "italic", 12, "bold", "top", "gray");
+b6 = createBorders("empty", 10, 10, 10, 10);
+b7 = createBorders("compound", b2, b3);
+b8 = createBorders("matte", 10, 10, 10, 10, "red");
+u = uicontrol("style", "frame");
+u.borders = b1;
+assert_checkequal(u.borders, b1);
+u.borders = b2;
+assert_checkequal(u.borders, b2);
+u.borders = b3;
+assert_checkequal(u.borders, b3);
+u.borders = b4;
+assert_checkequal(u.borders, b4);
+u.borders = b5;
+assert_checkequal(u.borders, b5);
+u.borders = b6;
+assert_checkequal(u.borders, b6);
+u.borders = b7;
+assert_checkequal(u.borders, b7);
+u.borders = b8;
+assert_checkequal(u.borders, b8);
diff --git a/scilab/modules/graphics/tests/unit_tests/borders.tst b/scilab/modules/graphics/tests/unit_tests/borders.tst
new file mode 100644 (file)
index 0000000..537e700
--- /dev/null
@@ -0,0 +1,38 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- TEST WITH GRAPHIC -->
+
+
+
+//borders
+b1 = createBorders("line", "red", 10, %t);
+b2 = createBorders("bevel", "lowered", "red", "green", "blue", "white");
+b3 = createBorders("softbevel", "lowered", "pink", "cyan", "magenta", "orange");
+b4 = createBorders("etched", "lowered", "yellow", "gray");
+b5 = createBorders("titled", b4, "title", "center", "helvetica", "italic", 12, "bold", "top", "gray");
+b6 = createBorders("empty", 10, 10, 10, 10);
+b7 = createBorders("compound", b2, b3);
+b8 = createBorders("matte", 10, 10, 10, 10, "red");
+
+u = uicontrol("style", "frame");
+u.borders = b1;
+assert_checkequal(u.borders, b1);
+u.borders = b2;
+assert_checkequal(u.borders, b2);
+u.borders = b3;
+assert_checkequal(u.borders, b3);
+u.borders = b4;
+assert_checkequal(u.borders, b4);
+u.borders = b5;
+assert_checkequal(u.borders, b5);
+u.borders = b6;
+assert_checkequal(u.borders, b6);
+u.borders = b7;
+assert_checkequal(u.borders, b7);
+u.borders = b8;
+assert_checkequal(u.borders, b8);
index ecc2c66..eb406df 100644 (file)
@@ -70,6 +70,7 @@ static const char* propertiesNames[] =
     "constraints",
     "layout",
     "margins"
+    "borders",
 };
 
 /*--------------------------------------------------------------------------*/