add scrollable property in ui_frame 89/13689/2
Antoine ELIAS [Fri, 7 Feb 2014 14:26:06 +0000 (15:26 +0100)]
Change-Id: Ia878d47419cc84c3647ca6f125edc45998a28898

27 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/xmlloader/GOBuilder.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/%h_p.sci
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_scrollable_property.c [new file with mode: 0644]
scilab/modules/graphics/src/c/getHandleProperty/setHandleProperty.h
scilab/modules/graphics/src/c/getHandleProperty/set_scrollable_property.c [new file with mode: 0644]
scilab/modules/gui/sci_gateway/c/sci_uicontrol.c
scilab/modules/gui/src/java/org/scilab/modules/gui/SwingView.java
scilab/modules/gui/src/java/org/scilab/modules/gui/SwingViewWidget.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/CallScilabBridge.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/frame/SwingScilabLayer.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/frame/SwingScilabScrollableFrame.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/pushbutton/SwingScilabPushButton.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/tab/SwingScilabCommonPanel.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/tab/SwingScilabDockablePanel.java

index 50ae396..f9d50fd 100755 (executable)
 #define __GO_UI_CHECKBOX__ 262
 #define __GO_UI_EDIT__ 263
 #define __GO_UI_FRAME__ 264
-#define __GO_UI_IMAGE__ 265
-#define __GO_UI_LISTBOX__ 266
-#define __GO_UI_POPUPMENU__ 267
-#define __GO_UI_PUSHBUTTON__ 268
-#define __GO_UI_RADIOBUTTON__ 269
-#define __GO_UI_SLIDER__ 270
-#define __GO_UI_TABLE__ 271
-#define __GO_UI_TEXT__ 272
-#define __GO_UI_LAYER__ 273
-#define __GO_UI_BACKGROUNDCOLOR__ 274
-#define __GO_UI_ENABLE__ 275
-#define __GO_UI_FONTANGLE__ 276
-#define __GO_UI_FONTNAME__ 277
-#define __GO_UI_FONTSIZE__ 278
-#define __GO_UI_FONTUNITS__ 279
-#define __GO_UI_FONTWEIGHT__ 280
-#define __GO_UI_FOREGROUNDCOLOR__ 281
-#define __GO_UI_HORIZONTALALIGNMENT__ 282
-#define __GO_UI_LISTBOXTOP__ 283
-#define __GO_UI_LISTBOXTOP_SIZE__ 284
-#define __GO_UI_MAX__ 285
-#define __GO_UI_MIN__ 286
-#define __GO_UI_RELIEF__ 287
-#define __GO_UI_STRING__ 288
-#define __GO_UI_STRING_SIZE__ 289
-#define __GO_UI_STRING_COLNB__ 290
-#define __GO_UI_TOOLTIPSTRING__ 291
-#define __GO_UI_TOOLTIPSTRING_SIZE__ 292
-#define __GO_UI_SLIDERSTEP__ 293
-#define __GO_UI_UNITS__ 294
-#define __GO_UI_VALUE__ 295
-#define __GO_UI_VALUE_SIZE__ 296
-#define __GO_UI_VERTICALALIGNMENT__ 297
-#define __GO_UIPARENTMENU__ 298
-#define __GO_UICHILDMENU__ 299
-#define __GO_UICHECKEDMENU__ 300
-#define __GO_UI_CHECKED__ 301
-#define __GO_UI_LABEL__ 302
-#define __GO_UI_MNEMONIC__ 303
-#define __GO_UI_ACCELERATOR__ 304
-#define __GO_UI_SEPARATOR__ 305
-#define __GO_UI_ICON__ 306
-#define __GO_CONSOLE__ 307
-#define __GO_SHOWHIDDENHANDLES__ 308
-#define __GO_USEDEPRECATEDLF__ 309
-#define __GO_WAITBAR__ 310
-#define __GO_PROGRESSIONBAR__ 311
-#define __GO_UI_MESSAGE__ 312
-#define __GO_UI_MESSAGE_SIZE__ 313
-#define __GO_DATATIP__ 314
-#define __GO_DATATIP_DATA__ 315
-#define __GO_DATATIP_ORIENTATION__ 316
-#define __GO_DATATIP_3COMPONENT__ 317
-#define __GO_DATATIP_AUTOORIENTATION__ 318
-#define __GO_DATATIP_INTERP_MODE__ 319
-#define __GO_DATATIP_DISPLAY_FNC__ 320
-#define __GO_DATATIP_BOX_MODE__ 321
-#define __GO_DATATIP_LABEL_MODE__ 322
-#define __GO_AMBIENTCOLOR__ 323
-#define __GO_DIFFUSECOLOR__ 324
-#define __GO_SPECULARCOLOR__ 325
-#define __GO_COLOR_MATERIAL__ 326
-#define __GO_MATERIAL_SHININESS__ 327
-#define __GO_LIGHT__ 328
-#define __GO_LIGHT_TYPE__ 329
-#define __GO_DATATIPS__ 330
-#define __GO_DATATIPS_COUNT__ 331
-#define __GO_DATATIP_INDEXES__ 332
-#define __GO_DATA_MODEL_DISPLAY_FUNCTION__ 333
-#define __GO_DATA_MODEL_DISPLAY_FUNCTION_SIZE__ 334
-#define __GO_RESIZE__ 335
-#define __GO_TOOLBAR__ 336
-#define __GO_TOOLBAR_VISIBLE__ 337
-#define __GO_MENUBAR__ 338
-#define __GO_MENUBAR_VISIBLE__ 339
-#define __GO_INFOBAR_VISIBLE__ 340
-#define __GO_DOCKABLE__ 341
-#define __GO_LAYOUT__ 342
-#define __GO_LAYOUT_SET__ 343
-#define __GO_UI_TAB__ 344
-#define __GO_UI_GRIDBAG_GRID__ 345
-#define __GO_UI_GRIDBAG_WEIGHT__ 346
-#define __GO_UI_GRIDBAG_FILL__ 347
-#define __GO_UI_GRIDBAG_ANCHOR__ 348
-#define __GO_UI_GRIDBAG_PADDING__ 349
-#define __GO_UI_GRID_GRID__ 350
-#define __GO_UI_GRID_PADDING__ 351
-#define __GO_UI_BORDER_POSITION__ 352
-#define __GO_GRID_OPT_GRID__ 353
-#define __GO_GRID_OPT_PADDING__ 354
-#define __GO_BORDER_OPT_PADDING__ 355
-#define __GO_UI_FRAME_BORDER__ 356
-#define __GO_UI_FRAME_BORDER_COLOR__ 357
-#define __GO_UI_FRAME_BORDER_HIGHLIGHT_IN__ 358
-#define __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__ 359
-#define __GO_UI_FRAME_BORDER_IN_BORDER__ 360
-#define __GO_UI_FRAME_BORDER_JUSTIFICATION__ 361
-#define __GO_UI_FRAME_BORDER_OUT_BORDER__ 362
-#define __GO_UI_FRAME_BORDER_ROUNDED__ 363
-#define __GO_UI_FRAME_BORDER_SHADOW_IN__ 364
-#define __GO_UI_FRAME_BORDER_SHADOW_OUT__ 365
-#define __GO_UI_FRAME_BORDER_TITLE__ 366
-#define __GO_UI_FRAME_BORDER_POSITION__ 367
-#define __GO_UI_FRAME_BORDER_STYLE__ 368
-#define __GO_UI_GROUP_NAME__ 369
-#define __GO_UI_TITLE_POSITION__ 370
-#define __GO_UI_TITLE_SCROLL__ 371
-#define __GO_UI_FRAME_BORDER_TYPE__ 372
+#define __GO_UI_FRAME_SCROLLABLE__ 265
+#define __GO_UI_IMAGE__ 266
+#define __GO_UI_LISTBOX__ 267
+#define __GO_UI_POPUPMENU__ 268
+#define __GO_UI_PUSHBUTTON__ 269
+#define __GO_UI_RADIOBUTTON__ 270
+#define __GO_UI_SLIDER__ 271
+#define __GO_UI_TABLE__ 272
+#define __GO_UI_TEXT__ 273
+#define __GO_UI_LAYER__ 274
+#define __GO_UI_BACKGROUNDCOLOR__ 275
+#define __GO_UI_ENABLE__ 276
+#define __GO_UI_FONTANGLE__ 277
+#define __GO_UI_FONTNAME__ 278
+#define __GO_UI_FONTSIZE__ 279
+#define __GO_UI_FONTUNITS__ 280
+#define __GO_UI_FONTWEIGHT__ 281
+#define __GO_UI_FOREGROUNDCOLOR__ 282
+#define __GO_UI_HORIZONTALALIGNMENT__ 283
+#define __GO_UI_LISTBOXTOP__ 284
+#define __GO_UI_LISTBOXTOP_SIZE__ 285
+#define __GO_UI_MAX__ 286
+#define __GO_UI_MIN__ 287
+#define __GO_UI_RELIEF__ 288
+#define __GO_UI_STRING__ 289
+#define __GO_UI_STRING_SIZE__ 290
+#define __GO_UI_STRING_COLNB__ 291
+#define __GO_UI_TOOLTIPSTRING__ 292
+#define __GO_UI_TOOLTIPSTRING_SIZE__ 293
+#define __GO_UI_SLIDERSTEP__ 294
+#define __GO_UI_UNITS__ 295
+#define __GO_UI_VALUE__ 296
+#define __GO_UI_VALUE_SIZE__ 297
+#define __GO_UI_VERTICALALIGNMENT__ 298
+#define __GO_UIPARENTMENU__ 299
+#define __GO_UICHILDMENU__ 300
+#define __GO_UICHECKEDMENU__ 301
+#define __GO_UI_CHECKED__ 302
+#define __GO_UI_LABEL__ 303
+#define __GO_UI_MNEMONIC__ 304
+#define __GO_UI_ACCELERATOR__ 305
+#define __GO_UI_SEPARATOR__ 306
+#define __GO_UI_ICON__ 307
+#define __GO_CONSOLE__ 308
+#define __GO_SHOWHIDDENHANDLES__ 309
+#define __GO_USEDEPRECATEDLF__ 310
+#define __GO_WAITBAR__ 311
+#define __GO_PROGRESSIONBAR__ 312
+#define __GO_UI_MESSAGE__ 313
+#define __GO_UI_MESSAGE_SIZE__ 314
+#define __GO_DATATIP__ 315
+#define __GO_DATATIP_DATA__ 316
+#define __GO_DATATIP_ORIENTATION__ 317
+#define __GO_DATATIP_3COMPONENT__ 318
+#define __GO_DATATIP_AUTOORIENTATION__ 319
+#define __GO_DATATIP_INTERP_MODE__ 320
+#define __GO_DATATIP_DISPLAY_FNC__ 321
+#define __GO_DATATIP_BOX_MODE__ 322
+#define __GO_DATATIP_LABEL_MODE__ 323
+#define __GO_AMBIENTCOLOR__ 324
+#define __GO_DIFFUSECOLOR__ 325
+#define __GO_SPECULARCOLOR__ 326
+#define __GO_COLOR_MATERIAL__ 327
+#define __GO_MATERIAL_SHININESS__ 328
+#define __GO_LIGHT__ 329
+#define __GO_LIGHT_TYPE__ 330
+#define __GO_DATATIPS__ 331
+#define __GO_DATATIPS_COUNT__ 332
+#define __GO_DATATIP_INDEXES__ 333
+#define __GO_DATA_MODEL_DISPLAY_FUNCTION__ 334
+#define __GO_DATA_MODEL_DISPLAY_FUNCTION_SIZE__ 335
+#define __GO_RESIZE__ 336
+#define __GO_TOOLBAR__ 337
+#define __GO_TOOLBAR_VISIBLE__ 338
+#define __GO_MENUBAR__ 339
+#define __GO_MENUBAR_VISIBLE__ 340
+#define __GO_INFOBAR_VISIBLE__ 341
+#define __GO_DOCKABLE__ 342
+#define __GO_LAYOUT__ 343
+#define __GO_LAYOUT_SET__ 344
+#define __GO_UI_TAB__ 345
+#define __GO_UI_GRIDBAG_GRID__ 346
+#define __GO_UI_GRIDBAG_WEIGHT__ 347
+#define __GO_UI_GRIDBAG_FILL__ 348
+#define __GO_UI_GRIDBAG_ANCHOR__ 349
+#define __GO_UI_GRIDBAG_PADDING__ 350
+#define __GO_UI_GRID_GRID__ 351
+#define __GO_UI_GRID_PADDING__ 352
+#define __GO_UI_BORDER_POSITION__ 353
+#define __GO_GRID_OPT_GRID__ 354
+#define __GO_GRID_OPT_PADDING__ 355
+#define __GO_BORDER_OPT_PADDING__ 356
+#define __GO_UI_FRAME_BORDER__ 357
+#define __GO_UI_FRAME_BORDER_COLOR__ 358
+#define __GO_UI_FRAME_BORDER_HIGHLIGHT_IN__ 359
+#define __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__ 360
+#define __GO_UI_FRAME_BORDER_IN_BORDER__ 361
+#define __GO_UI_FRAME_BORDER_JUSTIFICATION__ 362
+#define __GO_UI_FRAME_BORDER_OUT_BORDER__ 363
+#define __GO_UI_FRAME_BORDER_ROUNDED__ 364
+#define __GO_UI_FRAME_BORDER_SHADOW_IN__ 365
+#define __GO_UI_FRAME_BORDER_SHADOW_OUT__ 366
+#define __GO_UI_FRAME_BORDER_TITLE__ 367
+#define __GO_UI_FRAME_BORDER_POSITION__ 368
+#define __GO_UI_FRAME_BORDER_STYLE__ 369
+#define __GO_UI_GROUP_NAME__ 370
+#define __GO_UI_TITLE_POSITION__ 371
+#define __GO_UI_TITLE_SCROLL__ 372
+#define __GO_UI_FRAME_BORDER_TYPE__ 373
+#define __GO_UI_SCROLLABLE__ 374
 
 #endif /* !__GRAPHIC_OBJECT_PROPERTIES_H__ */
index f01f3e6..72966bf 100644 (file)
@@ -328,6 +328,10 @@ public final class GraphicModel {
             case BORDER:
                 createdObject = new FrameBorder();
                 break;
+            case FRAME_SCROLLABLE:
+                createdObject = new Frame();
+                ((Frame)createdObject).setScrollable(true);
+                break;
             default:
                 createdObject = null;
         }
index fe63411..3b056ec 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, BORDER, UNKNOWNOBJECT
+                       PROGRESSIONBAR, WAITBAR, UICONTEXTMENU, DATATIP, LIGHT, TABGROUP, TAB, LAYER, BORDER, FRAME_SCROLLABLE, UNKNOWNOBJECT
                      };
 
     /** GraphicObject properties */
@@ -228,6 +228,8 @@ public abstract class GraphicObject implements Cloneable {
                 return Type.LAYER;
             case __GO_UI_FRAME_BORDER__ :
                 return Type.BORDER;
+            case __GO_UI_FRAME_SCROLLABLE__ :
+                return Type.FRAME_SCROLLABLE;
             default :
                 return Type.UNKNOWNOBJECT;
         }
index b48ad6e..145dc83 100755 (executable)
@@ -285,113 +285,115 @@ public class GraphicObjectProperties {
     public static final int __GO_UI_CHECKBOX__ = 262;
     public static final int __GO_UI_EDIT__ = 263;
     public static final int __GO_UI_FRAME__ = 264;
-    public static final int __GO_UI_IMAGE__ = 265;
-    public static final int __GO_UI_LISTBOX__ = 266;
-    public static final int __GO_UI_POPUPMENU__ = 267;
-    public static final int __GO_UI_PUSHBUTTON__ = 268;
-    public static final int __GO_UI_RADIOBUTTON__ = 269;
-    public static final int __GO_UI_SLIDER__ = 270;
-    public static final int __GO_UI_TABLE__ = 271;
-    public static final int __GO_UI_TEXT__ = 272;
-    public static final int __GO_UI_LAYER__ = 273;
-    public static final int __GO_UI_BACKGROUNDCOLOR__ = 274;
-    public static final int __GO_UI_ENABLE__ = 275;
-    public static final int __GO_UI_FONTANGLE__ = 276;
-    public static final int __GO_UI_FONTNAME__ = 277;
-    public static final int __GO_UI_FONTSIZE__ = 278;
-    public static final int __GO_UI_FONTUNITS__ = 279;
-    public static final int __GO_UI_FONTWEIGHT__ = 280;
-    public static final int __GO_UI_FOREGROUNDCOLOR__ = 281;
-    public static final int __GO_UI_HORIZONTALALIGNMENT__ = 282;
-    public static final int __GO_UI_LISTBOXTOP__ = 283;
-    public static final int __GO_UI_LISTBOXTOP_SIZE__ = 284;
-    public static final int __GO_UI_MAX__ = 285;
-    public static final int __GO_UI_MIN__ = 286;
-    public static final int __GO_UI_RELIEF__ = 287;
-    public static final int __GO_UI_STRING__ = 288;
-    public static final int __GO_UI_STRING_SIZE__ = 289;
-    public static final int __GO_UI_STRING_COLNB__ = 290;
-    public static final int __GO_UI_TOOLTIPSTRING__ = 291;
-    public static final int __GO_UI_TOOLTIPSTRING_SIZE__ = 292;
-    public static final int __GO_UI_SLIDERSTEP__ = 293;
-    public static final int __GO_UI_UNITS__ = 294;
-    public static final int __GO_UI_VALUE__ = 295;
-    public static final int __GO_UI_VALUE_SIZE__ = 296;
-    public static final int __GO_UI_VERTICALALIGNMENT__ = 297;
-    public static final int __GO_UIPARENTMENU__ = 298;
-    public static final int __GO_UICHILDMENU__ = 299;
-    public static final int __GO_UICHECKEDMENU__ = 300;
-    public static final int __GO_UI_CHECKED__ = 301;
-    public static final int __GO_UI_LABEL__ = 302;
-    public static final int __GO_UI_MNEMONIC__ = 303;
-    public static final int __GO_UI_ACCELERATOR__ = 304;
-    public static final int __GO_UI_SEPARATOR__ = 305;
-    public static final int __GO_UI_ICON__ = 306;
-    public static final int __GO_CONSOLE__ = 307;
-    public static final int __GO_SHOWHIDDENHANDLES__ = 308;
-    public static final int __GO_USEDEPRECATEDLF__ = 309;
-    public static final int __GO_WAITBAR__ = 310;
-    public static final int __GO_PROGRESSIONBAR__ = 311;
-    public static final int __GO_UI_MESSAGE__ = 312;
-    public static final int __GO_UI_MESSAGE_SIZE__ = 313;
-    public static final int __GO_DATATIP__ = 314;
-    public static final int __GO_DATATIP_DATA__ = 315;
-    public static final int __GO_DATATIP_ORIENTATION__ = 316;
-    public static final int __GO_DATATIP_3COMPONENT__ = 317;
-    public static final int __GO_DATATIP_AUTOORIENTATION__ = 318;
-    public static final int __GO_DATATIP_INTERP_MODE__ = 319;
-    public static final int __GO_DATATIP_DISPLAY_FNC__ = 320;
-    public static final int __GO_DATATIP_BOX_MODE__ = 321;
-    public static final int __GO_DATATIP_LABEL_MODE__ = 322;
-    public static final int __GO_AMBIENTCOLOR__ = 323;
-    public static final int __GO_DIFFUSECOLOR__ = 324;
-    public static final int __GO_SPECULARCOLOR__ = 325;
-    public static final int __GO_COLOR_MATERIAL__ = 326;
-    public static final int __GO_MATERIAL_SHININESS__ = 327;
-    public static final int __GO_LIGHT__ = 328;
-    public static final int __GO_LIGHT_TYPE__ = 329;
-    public static final int __GO_DATATIPS__ = 330;
-    public static final int __GO_DATATIPS_COUNT__ = 331;
-    public static final int __GO_DATATIP_INDEXES__ = 332;
-    public static final int __GO_DATA_MODEL_DISPLAY_FUNCTION__ = 333;
-    public static final int __GO_DATA_MODEL_DISPLAY_FUNCTION_SIZE__ = 334;
-    public static final int __GO_RESIZE__ = 335;
-    public static final int __GO_TOOLBAR__ = 336;
-    public static final int __GO_TOOLBAR_VISIBLE__ = 337;
-    public static final int __GO_MENUBAR__ = 338;
-    public static final int __GO_MENUBAR_VISIBLE__ = 339;
-    public static final int __GO_INFOBAR_VISIBLE__ = 340;
-    public static final int __GO_DOCKABLE__ = 341;
-    public static final int __GO_LAYOUT__ = 342;
-    public static final int __GO_LAYOUT_SET__ = 343;
-    public static final int __GO_UI_TAB__ = 344;
-    public static final int __GO_UI_GRIDBAG_GRID__ = 345;
-    public static final int __GO_UI_GRIDBAG_WEIGHT__ = 346;
-    public static final int __GO_UI_GRIDBAG_FILL__ = 347;
-    public static final int __GO_UI_GRIDBAG_ANCHOR__ = 348;
-    public static final int __GO_UI_GRIDBAG_PADDING__ = 349;
-    public static final int __GO_UI_GRID_GRID__ = 350;
-    public static final int __GO_UI_GRID_PADDING__ = 351;
-    public static final int __GO_UI_BORDER_POSITION__ = 352;
-    public static final int __GO_GRID_OPT_GRID__ = 353;
-    public static final int __GO_GRID_OPT_PADDING__ = 354;
-    public static final int __GO_BORDER_OPT_PADDING__ = 355;
-    public static final int __GO_UI_FRAME_BORDER__ = 356;
-    public static final int __GO_UI_FRAME_BORDER_COLOR__ = 357;
-    public static final int __GO_UI_FRAME_BORDER_HIGHLIGHT_IN__ = 358;
-    public static final int __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__ = 359;
-    public static final int __GO_UI_FRAME_BORDER_IN_BORDER__ = 360;
-    public static final int __GO_UI_FRAME_BORDER_JUSTIFICATION__ = 361;
-    public static final int __GO_UI_FRAME_BORDER_OUT_BORDER__ = 362;
-    public static final int __GO_UI_FRAME_BORDER_ROUNDED__ = 363;
-    public static final int __GO_UI_FRAME_BORDER_SHADOW_IN__ = 364;
-    public static final int __GO_UI_FRAME_BORDER_SHADOW_OUT__ = 365;
-    public static final int __GO_UI_FRAME_BORDER_TITLE__ = 366;
-    public static final int __GO_UI_FRAME_BORDER_POSITION__ = 367;
-    public static final int __GO_UI_FRAME_BORDER_STYLE__ = 368;
-    public static final int __GO_UI_GROUP_NAME__ = 369;
-    public static final int __GO_UI_TITLE_POSITION__ = 370;
-    public static final int __GO_UI_TITLE_SCROLL__ = 371;
-    public static final int __GO_UI_FRAME_BORDER_TYPE__ = 372;
+    public static final int __GO_UI_FRAME_SCROLLABLE__ = 265;
+    public static final int __GO_UI_IMAGE__ = 266;
+    public static final int __GO_UI_LISTBOX__ = 267;
+    public static final int __GO_UI_POPUPMENU__ = 268;
+    public static final int __GO_UI_PUSHBUTTON__ = 269;
+    public static final int __GO_UI_RADIOBUTTON__ = 270;
+    public static final int __GO_UI_SLIDER__ = 271;
+    public static final int __GO_UI_TABLE__ = 272;
+    public static final int __GO_UI_TEXT__ = 273;
+    public static final int __GO_UI_LAYER__ = 274;
+    public static final int __GO_UI_BACKGROUNDCOLOR__ = 275;
+    public static final int __GO_UI_ENABLE__ = 276;
+    public static final int __GO_UI_FONTANGLE__ = 277;
+    public static final int __GO_UI_FONTNAME__ = 278;
+    public static final int __GO_UI_FONTSIZE__ = 279;
+    public static final int __GO_UI_FONTUNITS__ = 280;
+    public static final int __GO_UI_FONTWEIGHT__ = 281;
+    public static final int __GO_UI_FOREGROUNDCOLOR__ = 282;
+    public static final int __GO_UI_HORIZONTALALIGNMENT__ = 283;
+    public static final int __GO_UI_LISTBOXTOP__ = 284;
+    public static final int __GO_UI_LISTBOXTOP_SIZE__ = 285;
+    public static final int __GO_UI_MAX__ = 286;
+    public static final int __GO_UI_MIN__ = 287;
+    public static final int __GO_UI_RELIEF__ = 288;
+    public static final int __GO_UI_STRING__ = 289;
+    public static final int __GO_UI_STRING_SIZE__ = 290;
+    public static final int __GO_UI_STRING_COLNB__ = 291;
+    public static final int __GO_UI_TOOLTIPSTRING__ = 292;
+    public static final int __GO_UI_TOOLTIPSTRING_SIZE__ = 293;
+    public static final int __GO_UI_SLIDERSTEP__ = 294;
+    public static final int __GO_UI_UNITS__ = 295;
+    public static final int __GO_UI_VALUE__ = 296;
+    public static final int __GO_UI_VALUE_SIZE__ = 297;
+    public static final int __GO_UI_VERTICALALIGNMENT__ = 298;
+    public static final int __GO_UIPARENTMENU__ = 299;
+    public static final int __GO_UICHILDMENU__ = 300;
+    public static final int __GO_UICHECKEDMENU__ = 301;
+    public static final int __GO_UI_CHECKED__ = 302;
+    public static final int __GO_UI_LABEL__ = 303;
+    public static final int __GO_UI_MNEMONIC__ = 304;
+    public static final int __GO_UI_ACCELERATOR__ = 305;
+    public static final int __GO_UI_SEPARATOR__ = 306;
+    public static final int __GO_UI_ICON__ = 307;
+    public static final int __GO_CONSOLE__ = 308;
+    public static final int __GO_SHOWHIDDENHANDLES__ = 309;
+    public static final int __GO_USEDEPRECATEDLF__ = 310;
+    public static final int __GO_WAITBAR__ = 311;
+    public static final int __GO_PROGRESSIONBAR__ = 312;
+    public static final int __GO_UI_MESSAGE__ = 313;
+    public static final int __GO_UI_MESSAGE_SIZE__ = 314;
+    public static final int __GO_DATATIP__ = 315;
+    public static final int __GO_DATATIP_DATA__ = 316;
+    public static final int __GO_DATATIP_ORIENTATION__ = 317;
+    public static final int __GO_DATATIP_3COMPONENT__ = 318;
+    public static final int __GO_DATATIP_AUTOORIENTATION__ = 319;
+    public static final int __GO_DATATIP_INTERP_MODE__ = 320;
+    public static final int __GO_DATATIP_DISPLAY_FNC__ = 321;
+    public static final int __GO_DATATIP_BOX_MODE__ = 322;
+    public static final int __GO_DATATIP_LABEL_MODE__ = 323;
+    public static final int __GO_AMBIENTCOLOR__ = 324;
+    public static final int __GO_DIFFUSECOLOR__ = 325;
+    public static final int __GO_SPECULARCOLOR__ = 326;
+    public static final int __GO_COLOR_MATERIAL__ = 327;
+    public static final int __GO_MATERIAL_SHININESS__ = 328;
+    public static final int __GO_LIGHT__ = 329;
+    public static final int __GO_LIGHT_TYPE__ = 330;
+    public static final int __GO_DATATIPS__ = 331;
+    public static final int __GO_DATATIPS_COUNT__ = 332;
+    public static final int __GO_DATATIP_INDEXES__ = 333;
+    public static final int __GO_DATA_MODEL_DISPLAY_FUNCTION__ = 334;
+    public static final int __GO_DATA_MODEL_DISPLAY_FUNCTION_SIZE__ = 335;
+    public static final int __GO_RESIZE__ = 336;
+    public static final int __GO_TOOLBAR__ = 337;
+    public static final int __GO_TOOLBAR_VISIBLE__ = 338;
+    public static final int __GO_MENUBAR__ = 339;
+    public static final int __GO_MENUBAR_VISIBLE__ = 340;
+    public static final int __GO_INFOBAR_VISIBLE__ = 341;
+    public static final int __GO_DOCKABLE__ = 342;
+    public static final int __GO_LAYOUT__ = 343;
+    public static final int __GO_LAYOUT_SET__ = 344;
+    public static final int __GO_UI_TAB__ = 345;
+    public static final int __GO_UI_GRIDBAG_GRID__ = 346;
+    public static final int __GO_UI_GRIDBAG_WEIGHT__ = 347;
+    public static final int __GO_UI_GRIDBAG_FILL__ = 348;
+    public static final int __GO_UI_GRIDBAG_ANCHOR__ = 349;
+    public static final int __GO_UI_GRIDBAG_PADDING__ = 350;
+    public static final int __GO_UI_GRID_GRID__ = 351;
+    public static final int __GO_UI_GRID_PADDING__ = 352;
+    public static final int __GO_UI_BORDER_POSITION__ = 353;
+    public static final int __GO_GRID_OPT_GRID__ = 354;
+    public static final int __GO_GRID_OPT_PADDING__ = 355;
+    public static final int __GO_BORDER_OPT_PADDING__ = 356;
+    public static final int __GO_UI_FRAME_BORDER__ = 357;
+    public static final int __GO_UI_FRAME_BORDER_COLOR__ = 358;
+    public static final int __GO_UI_FRAME_BORDER_HIGHLIGHT_IN__ = 359;
+    public static final int __GO_UI_FRAME_BORDER_HIGHLIGHT_OUT__ = 360;
+    public static final int __GO_UI_FRAME_BORDER_IN_BORDER__ = 361;
+    public static final int __GO_UI_FRAME_BORDER_JUSTIFICATION__ = 362;
+    public static final int __GO_UI_FRAME_BORDER_OUT_BORDER__ = 363;
+    public static final int __GO_UI_FRAME_BORDER_ROUNDED__ = 364;
+    public static final int __GO_UI_FRAME_BORDER_SHADOW_IN__ = 365;
+    public static final int __GO_UI_FRAME_BORDER_SHADOW_OUT__ = 366;
+    public static final int __GO_UI_FRAME_BORDER_TITLE__ = 367;
+    public static final int __GO_UI_FRAME_BORDER_POSITION__ = 368;
+    public static final int __GO_UI_FRAME_BORDER_STYLE__ = 369;
+    public static final int __GO_UI_GROUP_NAME__ = 370;
+    public static final int __GO_UI_TITLE_POSITION__ = 371;
+    public static final int __GO_UI_TITLE_SCROLL__ = 372;
+    public static final int __GO_UI_FRAME_BORDER_TYPE__ = 373;
+    public static final int __GO_UI_SCROLLABLE__ = 374;
 
 }
index b9eaa23..6b111ce 100644 (file)
@@ -69,6 +69,7 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_VERTICALALIGNMENT__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TITLE_POSITION__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TITLE_SCROLL__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_SCROLLABLE__;
 
 import java.util.Arrays;
 import java.util.StringTokenizer;
@@ -302,7 +303,7 @@ public class Uicontrol extends GraphicObject {
     private String verticalAlignment = "";
     private LayoutType layout = LayoutType.NONE;
     private Double[] margins = new Double[] {0.0, 0.0, 0.0, 0.0};
-    private Integer[] gridbagGrid = new Integer[] {0, 0, 0, 0};
+    private Integer[] gridbagGrid = new Integer[] { -1, -1, 1, 1};
     private Double[] gridbagWeight = new Double[] {0.0, 0.0};
     private FillType gridbagFill = FillType.NONE;
     private AnchorType gridbagAnchor = AnchorType.CENTER;
@@ -323,6 +324,10 @@ public class Uicontrol extends GraphicObject {
     /** tab properties */
     private Boolean titleScroll = false;
     private TitlePositionType titlePosition = TitlePositionType.TOP;
+
+    /** Scrollable */
+    private Boolean scrollable = false;
+
     /**
      * All uicontrol properties
      */
@@ -370,7 +375,8 @@ public class Uicontrol extends GraphicObject {
         FRAMEBORDER,
         GROUPNAME,
         TITLE_POSITION,
-        TITLE_SCROLL
+        TITLE_SCROLL,
+        SCROLLABLE
     };
 
     /**
@@ -577,6 +583,8 @@ public class Uicontrol extends GraphicObject {
                 return UicontrolProperty.TITLE_POSITION;
             case __GO_UI_TITLE_SCROLL__:
                 return UicontrolProperty.TITLE_SCROLL;
+            case __GO_UI_SCROLLABLE__:
+                return UicontrolProperty.SCROLLABLE;
             default :
                 return super.getPropertyFromName(propertyName);
         }
@@ -672,6 +680,8 @@ public class Uicontrol extends GraphicObject {
             return getTitlePosition();
         } else if (property == UicontrolProperty.TITLE_SCROLL) {
             return getTitleScroll();
+        } else if (property == UicontrolProperty.SCROLLABLE) {
+            return getScrollable();
         } else {
             return super.getProperty(property);
         }
@@ -764,6 +774,8 @@ public class Uicontrol extends GraphicObject {
                 return setTitlePosition((Integer) value);
             case TITLE_SCROLL:
                 return setTitleScroll((Boolean) value);
+            case SCROLLABLE:
+                return setScrollable((Boolean) value);
             default:
                 return super.setProperty(property, value);
         }
@@ -1399,6 +1411,18 @@ public class Uicontrol extends GraphicObject {
         return UpdateStatus.Success;
     }
 
+    public UpdateStatus setScrollable(Boolean scrollable) {
+        if (this.scrollable == scrollable) {
+            return UpdateStatus.NoChange;
+        }
+
+        this.scrollable = scrollable;
+        return UpdateStatus.Success;
+    }
+
+    public Boolean getScrollable() {
+        return scrollable;
+    }
 
     public void accept(Visitor visitor) {
     }
index 5dcc372..317faf7 100644 (file)
@@ -1,7 +1,7 @@
 package org.scilab.modules.graphic_objects.xmlloader;
 
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_BORDER_OPT_PADDING__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_DOCKABLE__;
+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_INFOBAR_VISIBLE__;
@@ -46,10 +46,12 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_HORIZONTALALIGNMENT__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_MAX__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_PUSHBUTTON__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_SCROLLABLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_STRING__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TAB__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TEXT__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_VISIBLE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_SCROLLABLE__;
 
 import java.util.Map;
 
@@ -129,7 +131,13 @@ public class GOBuilder {
         XmlTools.setPropAsBoolean(fig, __GO_RESIZE__, attributes.getValue("resizable"));
 
         // layout and layout_options
-        setLayoutProperty(controller, fig, attributes.getValue("layout"));
+        item = attributes.getValue("layout");
+        if (item == null) {
+            item = "name:border"; //default layout is border
+        }
+
+
+        setLayoutProperty(controller, fig, item);
 
         // visible
         XmlTools.setPropAsBoolean(fig, __GO_VISIBLE__, attributes.getValue("visible"));
@@ -138,6 +146,13 @@ public class GOBuilder {
     }
 
     public static Integer uicontrolBuilder(GraphicController controller, int type, Attributes attributes, int parent) {
+        if (type == __GO_UI_FRAME__) {
+            String item = attributes.getValue("scrollable");
+            if (item != null && item.equals("true")) {
+                type = __GO_UI_FRAME_SCROLLABLE__;
+            }
+        }
+
         Integer uic = controller.askObject(GraphicObject.getTypeFromName(type));
         return uicontrolUpdater(controller, uic, attributes, parent);
     }
@@ -158,11 +173,28 @@ public class GOBuilder {
 
             // layout and layout_options
             item = attributes.getValue("layout");
-            if (item == null && fromModel != null) {
-                item = fromModel.get("layout");
+            if (item == null) {
+                if (fromModel != null) {
+                    item = fromModel.get("layout");
+                }
+            }
+
+            if (item == null) {
+                item = "name:none";
             }
             setLayoutProperty(controller, uic, item);
 
+            //visible
+            item = attributes.getValue("visible");
+            if (item != null) {
+                if (item == null || item.equals("true")) {
+                    System.out.println("setVisible true");
+                    controller.setProperty(uic, __GO_VISIBLE__, true);
+                } else {
+                    System.out.println("setVisible false");
+                    controller.setProperty(uic, __GO_VISIBLE__, false);
+                }
+            }
             // constraints
 
             // get parent layout
@@ -253,6 +285,14 @@ public class GOBuilder {
                     if (text[0] != null) {
                         controller.setProperty(uic, __GO_UI_STRING__, text);
                     }
+
+                    item = attributes.getValue("scrollable");
+                    if (item == null || item.equals("false")) {
+                        controller.setProperty(uic, __GO_UI_SCROLLABLE__, false);
+                    } else {
+                        controller.setProperty(uic, __GO_UI_SCROLLABLE__, true);
+                    }
+
                     break;
                 }
 
@@ -315,42 +355,40 @@ public class GOBuilder {
 
     private static void setLayoutProperty(GraphicController controller, Integer uid, String item) {
         try {
-            if (item != null) {
-                Map<String, String> map = null;
-                map = CSSParser.parseLine(item);
-                item = map.get("name");
-                LayoutType layout = LayoutType.stringToEnum(item);
-                controller.setProperty(uid, __GO_LAYOUT__, layout.ordinal());
-
-                // layout_options
-                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"));
-
-                        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"));
+            Map<String, String> map = null;
+            map = CSSParser.parseLine(item);
+            item = map.get("name");
+            LayoutType layout = LayoutType.stringToEnum(item);
+            controller.setProperty(uid, __GO_LAYOUT__, layout.ordinal());
+
+            // layout_options
+            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"));
+
+                    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"));
 
-                        Integer[] pad = new Integer[] { 0, 0 };
-                        pad[0] = Integer.parseInt(XmlTools.getFromMap(map, "hgap", "0"));
-                        pad[1] = Integer.parseInt(XmlTools.getFromMap(map, "vgap", "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"));
 
-                        controller.setProperty(uid, __GO_GRID_OPT_GRID__, grid);
-                        controller.setProperty(uid, __GO_GRID_OPT_PADDING__, pad);
-                        break;
-                    }
-                    default:
-                    case GRIDBAG:
-                    case NONE:
-                        // nothing to do
-                        break;
+                    controller.setProperty(uid, __GO_GRID_OPT_GRID__, grid);
+                    controller.setProperty(uid, __GO_GRID_OPT_PADDING__, pad);
+                    break;
                 }
+                default:
+                case GRIDBAG:
+                case NONE:
+                    // nothing to do
+                    break;
             }
         } catch (CSSParserException e) {
             e.printStackTrace();
@@ -438,7 +476,7 @@ public class GOBuilder {
                 String fontAngle = XmlTools.getFromMap(map, "italic", "false") == "false" ? "normal" : "italic";
                 Integer fontSize = Integer.parseInt(XmlTools.getFromMap(map, "font-size", "0"));
                 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");
index dfd2626..d4f7efe 100755 (executable)
@@ -298,6 +298,7 @@ __GO_STYLE__
 __GO_UI_CHECKBOX__
 __GO_UI_EDIT__
 __GO_UI_FRAME__
+__GO_UI_FRAME_SCROLLABLE__
 __GO_UI_IMAGE__
 __GO_UI_LISTBOX__
 __GO_UI_POPUPMENU__
@@ -423,3 +424,5 @@ __GO_UI_GROUP_NAME__
 __GO_UI_TITLE_POSITION__
 __GO_UI_TITLE_SCROLL__
 __GO_UI_FRAME_BORDER_TYPE__
+__GO_UI_SCROLLABLE__
+
index 8e897b0..e4e3bdf 100644 (file)
@@ -340,6 +340,8 @@ src/c/getHandleProperty/get_groupname_property.c \
 src/c/getHandleProperty/set_groupname_property.c \
 src/c/getHandleProperty/get_tabtitle_property.c \
 src/c/getHandleProperty/set_tabtitle_property.c \
+src/c/getHandleProperty/get_scrollable_property.c \
+src/c/getHandleProperty/set_scrollable_property.c \
 src/c/DefaultCommandArg.c \
 src/c/Axes.c \
 src/c/sciMatrix.c \
index 4737918..e0cc4d6 100644 (file)
@@ -487,6 +487,8 @@ am__objects_1 = src/c/libscigraphics_algo_la-GetCommandArg.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-set_groupname_property.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-get_tabtitle_property.lo \
        src/c/getHandleProperty/libscigraphics_algo_la-set_tabtitle_property.lo \
+       src/c/getHandleProperty/libscigraphics_algo_la-get_scrollable_property.lo \
+       src/c/getHandleProperty/libscigraphics_algo_la-set_scrollable_property.lo \
        src/c/libscigraphics_algo_la-DefaultCommandArg.lo \
        src/c/libscigraphics_algo_la-Axes.lo \
        src/c/libscigraphics_algo_la-sciMatrix.lo \
@@ -1275,6 +1277,8 @@ src/c/getHandleProperty/get_groupname_property.c \
 src/c/getHandleProperty/set_groupname_property.c \
 src/c/getHandleProperty/get_tabtitle_property.c \
 src/c/getHandleProperty/set_tabtitle_property.c \
+src/c/getHandleProperty/get_scrollable_property.c \
+src/c/getHandleProperty/set_scrollable_property.c \
 src/c/DefaultCommandArg.c \
 src/c/Axes.c \
 src/c/sciMatrix.c \
@@ -2578,6 +2582,12 @@ src/c/getHandleProperty/libscigraphics_algo_la-get_tabtitle_property.lo:  \
 src/c/getHandleProperty/libscigraphics_algo_la-set_tabtitle_property.lo:  \
        src/c/getHandleProperty/$(am__dirstamp) \
        src/c/getHandleProperty/$(DEPDIR)/$(am__dirstamp)
+src/c/getHandleProperty/libscigraphics_algo_la-get_scrollable_property.lo:  \
+       src/c/getHandleProperty/$(am__dirstamp) \
+       src/c/getHandleProperty/$(DEPDIR)/$(am__dirstamp)
+src/c/getHandleProperty/libscigraphics_algo_la-set_scrollable_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) \
@@ -3117,6 +3127,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_rotation_angles_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_rotation_style_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_screen_position_property.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_scrollable_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_segs_color_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_specular_color_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_sub_tics_property.Plo@am__quote@
@@ -3278,6 +3289,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_rotation_angles_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_rotation_style_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_screen_position_property.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_scrollable_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_segs_color_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_specular_color_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_sub_tics_property.Plo@am__quote@
@@ -5550,6 +5562,20 @@ src/c/getHandleProperty/libscigraphics_algo_la-set_tabtitle_property.lo: src/c/g
 @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_tabtitle_property.lo `test -f 'src/c/getHandleProperty/set_tabtitle_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/set_tabtitle_property.c
 
+src/c/getHandleProperty/libscigraphics_algo_la-get_scrollable_property.lo: src/c/getHandleProperty/get_scrollable_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_scrollable_property.lo -MD -MP -MF src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_scrollable_property.Tpo -c -o src/c/getHandleProperty/libscigraphics_algo_la-get_scrollable_property.lo `test -f 'src/c/getHandleProperty/get_scrollable_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/get_scrollable_property.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_scrollable_property.Tpo src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-get_scrollable_property.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/getHandleProperty/get_scrollable_property.c' object='src/c/getHandleProperty/libscigraphics_algo_la-get_scrollable_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_scrollable_property.lo `test -f 'src/c/getHandleProperty/get_scrollable_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/get_scrollable_property.c
+
+src/c/getHandleProperty/libscigraphics_algo_la-set_scrollable_property.lo: src/c/getHandleProperty/set_scrollable_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_scrollable_property.lo -MD -MP -MF src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_scrollable_property.Tpo -c -o src/c/getHandleProperty/libscigraphics_algo_la-set_scrollable_property.lo `test -f 'src/c/getHandleProperty/set_scrollable_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/set_scrollable_property.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_scrollable_property.Tpo src/c/getHandleProperty/$(DEPDIR)/libscigraphics_algo_la-set_scrollable_property.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/getHandleProperty/set_scrollable_property.c' object='src/c/getHandleProperty/libscigraphics_algo_la-set_scrollable_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_scrollable_property.lo `test -f 'src/c/getHandleProperty/set_scrollable_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/set_scrollable_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 c3c8e29..e6456eb 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -332,6 +332,7 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClCompile Include="src\c\getHandleProperty\get_rotation_angles_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_rotation_style_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_screen_position_property.c" />
+    <ClCompile Include="src\c\getHandleProperty\get_scrollable_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_segs_color_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_specular_color_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_sub_tics_property.c" />
@@ -368,6 +369,7 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClCompile Include="src\c\getHandleProperty\set_menubar_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_rect_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_resize_property.c" />
+    <ClCompile Include="src\c\getHandleProperty\set_scrollable_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_specular_color_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_image_type_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_tabtitle_property.c" />
index 6f154bc..e971ca6 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
     <Filter Include="Source Files">
     <ClCompile Include="src\c\getHandleProperty\get_tabtitle_property.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="src\c\getHandleProperty\set_scrollable_property.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="src\c\getHandleProperty\get_scrollable_property.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="includes\Axes.h">
index a2dac01..b16344a 100755 (executable)
@@ -1019,6 +1019,7 @@ function %h_p(h)
                 "Borders = "+sci2exp(b)
                 "Margins = "+sci2exp(h.margins)
                 "Groupname = "+sci2exp(h.groupname)
+                "Scrollable = "+sci2exp(h.scrollable)
                 "Userdata = "+fmtuser_data(u)
                 "Tag = "+h.tag
                 ]
index 506e312..f24d68b 100755 (executable)
@@ -245,7 +245,8 @@ static getHashTableCouple propertyGetTable[] =
     {"borders", get_borders_property},
     {"groupname", get_groupname_property},
     {"title_position", get_title_position_property},
-    {"title_scroll", get_title_scroll_property}
+    {"title_scroll", get_title_scroll_property},
+    {"scrollable", get_scrollable_property}
 };
 
 /*--------------------------------------------------------------------------*/
index 40e0094..765b362 100755 (executable)
@@ -247,7 +247,8 @@ static setHashTableCouple propertySetTable[] =
     {"groupname", set_groupname_property},
     {"title_position", set_title_position_property},
     {"title_scroll", set_title_scroll_property},
-    {"default_axes", set_default_axes_property}
+    {"default_axes", set_default_axes_property},
+    {"scrollable", set_scrollable_property}
 };
 
 /*--------------------------------------------------------------------------*/
index de260c3..fce32d5 100755 (executable)
@@ -217,5 +217,6 @@ int get_borders_property(void* _pvCtx, int iObjUID);
 int get_groupname_property(void* _pvCtx, int iObjUID);
 int get_title_position_property(void* _pvCtx, int iObjUID);
 int get_title_scroll_property(void* _pvCtx, int iObjUID);
+int get_scrollable_property(void* _pvCtx, int iObjUID);
 
 #endif /* _GET_HANDLE_PROPERTY_H_ */
diff --git a/scilab/modules/graphics/src/c/getHandleProperty/get_scrollable_property.c b/scilab/modules/graphics/src/c/getHandleProperty/get_scrollable_property.c
new file mode 100644 (file)
index 0000000..0347ac5
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * 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
+ *
+ */
+
+#include "getHandleProperty.h"
+#include "returnProperty.h"
+#include "Scierror.h"
+#include "localization.h"
+
+#include "getGraphicObjectProperty.h"
+#include "graphicObjectProperties.h"
+
+/*------------------------------------------------------------------------*/
+int get_scrollable_property(void* _pvCtx, int iObjUID)
+{
+    int iScrollable = 0;
+    int* piScrollable = &iScrollable;
+    getGraphicObjectProperty(iObjUID, __GO_UI_SCROLLABLE__, jni_bool, (void **)&piScrollable);
+    if (piScrollable == NULL)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "scrollable");
+        return -1;
+    }
+
+    if (iScrollable)
+    {
+        return sciReturnString(_pvCtx, "on");
+    }
+    else
+    {
+        return sciReturnString(_pvCtx, "off");
+    }
+}
index 74b65f5..4e2b9ed 100755 (executable)
@@ -219,5 +219,6 @@ int set_groupname_property(void* _pvCtx, int iObj, void* _pvData, int valueType,
 int set_title_position_property(void* _pvCtx, int iObj, void* _pvData, int valueType, int nbRow, int nbCol);
 int set_title_scroll_property(void* _pvCtx, int iObj, void* _pvData, int valueType, int nbRow, int nbCol);
 int set_default_axes_property(void* _pvCtx, int iObj, void* _pvData, int valueType, int nbRow, int nbCol);
+int set_scrollable_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_scrollable_property.c b/scilab/modules/graphics/src/c/getHandleProperty/set_scrollable_property.c
new file mode 100644 (file)
index 0000000..cc12b83
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * 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
+ *
+ */
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "Scierror.h"
+#include "localization.h"
+#include "SetPropertyStatus.h"
+#include "GetProperty.h"
+#include "BOOL.h"
+#include "stricmp.h"
+
+#include "setGraphicObjectProperty.h"
+#include "getGraphicObjectProperty.h"
+#include "graphicObjectProperties.h"
+
+/*------------------------------------------------------------------------*/
+int set_scrollable_property(void* _pvCtx, int iObjUID, void* _pvData, int valueType, int nbRow, int nbCol)
+{
+    BOOL bScrollable = FALSE;
+    if (valueType != sci_strings)
+    {
+        Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "scrollable");
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (stricmp((char*)_pvData, "on") == 0)
+    {
+        bScrollable = TRUE;
+    }
+    else if (stricmp((char*)_pvData, "off") == 0)
+    {
+        bScrollable = FALSE;
+    }
+    else
+    {
+        Scierror(999, _("Wrong value for '%s' property: %s, %s or %s expected.\n"), "scrollable", "'on'", "'off'");
+        return SET_PROPERTY_ERROR;
+    }
+
+    if (setGraphicObjectProperty(iObjUID, __GO_UI_SCROLLABLE__, &bScrollable, jni_bool, 1) == FALSE)
+    {
+        Scierror(999, _("'%s' property does not exist for this handle.\n"), "scrollable");
+        return SET_PROPERTY_ERROR;
+    }
+
+    return SET_PROPERTY_SUCCEED;
+}
index 374926b..887bc18 100644 (file)
@@ -73,7 +73,8 @@ static const char* propertiesNames[] =
     "borders",
     "groupname",
     "title_position",
-    "title_scroll"
+    "title_scroll",
+    "scrollable"
 };
 
 /*--------------------------------------------------------------------------*/
index 3d2363f..992df2e 100644 (file)
@@ -45,6 +45,7 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTWEIGHT__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FOREGROUNDCOLOR__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_SCROLLABLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_HORIZONTALALIGNMENT__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ICON__;
@@ -68,6 +69,7 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_VALID__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_VISIBLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_WAITBAR__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_SCROLLABLE__;
 import static org.scilab.modules.gui.utils.Debug.DEBUG;
 
 import java.awt.Component;
@@ -83,7 +85,6 @@ import java.util.Set;
 import java.util.UUID;
 
 import javax.swing.JComponent;
-import javax.swing.JPanel;
 import javax.swing.JSeparator;
 import javax.swing.SwingUtilities;
 
@@ -102,6 +103,7 @@ import org.scilab.modules.gui.bridge.console.SwingScilabConsole;
 import org.scilab.modules.gui.bridge.contextmenu.SwingScilabContextMenu;
 import org.scilab.modules.gui.bridge.editbox.SwingScilabEditBox;
 import org.scilab.modules.gui.bridge.frame.SwingScilabFrame;
+import org.scilab.modules.gui.bridge.frame.SwingScilabScrollableFrame;
 import org.scilab.modules.gui.bridge.frame.SwingScilabLayer;
 import org.scilab.modules.gui.bridge.label.SwingScilabLabel;
 import org.scilab.modules.gui.bridge.listbox.SwingScilabListBox;
@@ -435,15 +437,28 @@ public final class SwingView implements GraphicView {
             case Axes:
                 SwingScilabAxes axes = new SwingScilabAxes();
                 return axes;
-            case Frame:
-                SwingScilabFrame frame = new SwingScilabFrame();
-                frame.setId(id);
-                setDefaultProperties(frame, id);
-                Integer borderId = (Integer) GraphicController.getController().getProperty(id, __GO_UI_FRAME_BORDER__);
-                if (borderId != 0) {
-                    frame.setBorder(BorderConvertor.getBorder(borderId));
+            case Frame: {
+                Boolean scrollable = (Boolean) GraphicController.getController().getProperty(id, __GO_UI_SCROLLABLE__);
+                if (scrollable) {
+                    SwingScilabScrollableFrame frame = new SwingScilabScrollableFrame();
+                    frame.setId(id);
+                    setDefaultProperties(frame, id);
+                    Integer borderId = (Integer) GraphicController.getController().getProperty(id, __GO_UI_FRAME_BORDER__);
+                    if (borderId != 0) {
+                        frame.setBorder(BorderConvertor.getBorder(borderId));
+                    }
+                    return frame;
+                } else {
+                    SwingScilabFrame frame = new SwingScilabFrame();
+                    frame.setId(id);
+                    setDefaultProperties(frame, id);
+                    Integer borderId = (Integer) GraphicController.getController().getProperty(id, __GO_UI_FRAME_BORDER__);
+                    if (borderId != 0) {
+                        frame.setBorder(BorderConvertor.getBorder(borderId));
+                    }
+                    return frame;
                 }
-                return frame;
+            }
             case Image:
                 SwingScilabUiImage image = new SwingScilabUiImage();
                 image.setId(id);
@@ -752,7 +767,11 @@ public final class SwingView implements GraphicView {
                             updateLayerChildren(registeredObject, newChildren);
                             break;
                         case __GO_UI_FRAME__:
-                            updateFrameChildren(registeredObject, newChildren);
+                            if (registeredObject.getValue() instanceof SwingScilabFrame) {
+                                updateFrameChildren(registeredObject, newChildren);
+                            } else if (registeredObject.getValue() instanceof SwingScilabScrollableFrame) {
+                                updateScrollableFrameChildren(registeredObject, newChildren);
+                            }
                             break;
                         case __GO_UI_TAB__:
                             updateTabGroupChildren(registeredObject, newChildren);
@@ -941,7 +960,52 @@ public final class SwingView implements GraphicView {
      * @param newChildren the new children IDs list
      */
     private void updateFrameChildren(TypedObject updatedObject, Integer[] newChildren) {
-        Container updatedComponent = (SwingScilabFrame) updatedObject.getValue();
+        SwingScilabFrame updatedComponent = (SwingScilabFrame) updatedObject.getValue();
+        boolean needRevalidate = false;
+
+        // Add new children
+        for (Integer childId : newChildren) {
+            if (!updatedObject.hasChild(childId)) {
+
+                // Add the child
+                updatedObject.addChild(childId);
+
+                int childType = (Integer) GraphicController.getController().getProperty(childId, __GO_TYPE__);
+
+                /* Add an uicontrol */
+                if (childType == __GO_UICONTROL__) {
+                    updatedComponent.addMember(allObjects.get(childId).getValue());
+                    needRevalidate = true;
+                }
+            }
+        }
+
+        // Remove children which have been deleted
+        Set<Integer> newChildrenSet = new HashSet<Integer>(Arrays.asList(newChildren));
+        // Clone the children set to avoid concurrent accesses
+        Integer[] oldChildrenSet = updatedObject.getChildren().toArray(new Integer[updatedObject.getChildren().size()]);
+        for (Integer childId : oldChildrenSet) {
+            if (!newChildrenSet.contains(childId)) {
+
+                // Remove the child
+                updatedObject.removeChild(childId);
+
+                int childType = (Integer) GraphicController.getController().getProperty(childId, __GO_TYPE__);
+
+                /* Remove an uicontrol */
+                if (childType == __GO_UICONTROL__) {
+                    updatedComponent.remove((Component) allObjects.get(childId).getValue());
+                    needRevalidate = true;
+                }
+            }
+        }
+        if (needRevalidate && updatedComponent != null) {
+            updatedComponent.revalidate();
+        }
+    }
+
+    private void updateScrollableFrameChildren(TypedObject updatedObject, Integer[] newChildren) {
+        SwingScilabScrollableFrame updatedComponent = (SwingScilabScrollableFrame) updatedObject.getValue();
         boolean needRevalidate = false;
 
         // Add new children
@@ -955,7 +1019,7 @@ public final class SwingView implements GraphicView {
 
                 /* Add an uicontrol */
                 if (childType == __GO_UICONTROL__) {
-                    ((SwingScilabFrame) updatedComponent).addMember(allObjects.get(childId).getValue());
+                    updatedComponent.addMember(allObjects.get(childId).getValue());
                     needRevalidate = true;
                 }
             }
@@ -981,7 +1045,7 @@ public final class SwingView implements GraphicView {
             }
         }
         if (needRevalidate && updatedComponent != null) {
-            ((JPanel) updatedComponent).revalidate();
+            updatedComponent.revalidate();
         }
     }
 
@@ -991,7 +1055,7 @@ public final class SwingView implements GraphicView {
      * @param newChildren the new children IDs list
      */
     private void updateLayerChildren(TypedObject updatedObject, Integer[] newChildren) {
-        Container updatedComponent = (SwingScilabFrame) updatedObject.getValue();
+        SwingScilabLayer updatedComponent = (SwingScilabLayer) updatedObject.getValue();
 
         // Add new children
         for (Integer childId : newChildren) {
@@ -1006,7 +1070,12 @@ public final class SwingView implements GraphicView {
                 if (childType == __GO_UICONTROL__) {
                     int childStyle = (Integer) GraphicController.getController().getProperty(childId, __GO_STYLE__);
                     if (childStyle == __GO_UI_FRAME__) {
-                        ((SwingScilabLayer) updatedComponent).addMember((SwingScilabFrame) allObjects.get(childId).getValue());
+                        SwingViewObject obj = allObjects.get(childId).getValue();
+                        if (obj instanceof SwingScilabScrollableFrame) {
+                            updatedComponent.addMember((SwingScilabScrollableFrame)obj);
+                        } else {
+                            updatedComponent.addMember((SwingScilabFrame)obj);
+                        }
                     }
                 }
             }
@@ -1028,7 +1097,12 @@ public final class SwingView implements GraphicView {
                 if (childType == __GO_UICONTROL__) {
                     int childStyle = (Integer) GraphicController.getController().getProperty(childId, __GO_STYLE__);
                     if (childStyle == __GO_UI_FRAME__) {
-                        ((SwingScilabLayer) updatedComponent).removeMember((SwingScilabFrame) allObjects.get(childId).getValue());
+                        SwingViewObject obj = allObjects.get(childId).getValue();
+                        if (obj instanceof SwingScilabScrollableFrame) {
+                            updatedComponent.removeMember((SwingScilabScrollableFrame)obj);
+                        } else {
+                            updatedComponent.removeMember((SwingScilabFrame)obj);
+                        }
                     }
                 }
             }
index 7294c6d..d461990 100644 (file)
@@ -25,6 +25,7 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 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_TYPE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UICONTROL__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_BACKGROUNDCOLOR__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ENABLE__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTANGLE__;
@@ -34,8 +35,10 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FONTWEIGHT__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FOREGROUNDCOLOR__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME_BORDER__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_FRAME__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_GROUP_NAME__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_HORIZONTALALIGNMENT__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_LAYER__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_LISTBOXTOP__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_MAX__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_MIN__;
@@ -50,16 +53,16 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_USER_DATA__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_VALID__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_VISIBLE__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UICONTROL__;
-import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_LAYER__;
 
 import java.awt.BorderLayout;
 import java.awt.Color;
+import java.awt.Component;
 import java.awt.Font;
 import java.awt.GridBagLayout;
 import java.awt.GridLayout;
 
 import javax.swing.AbstractButton;
+import javax.swing.JComponent;
 import javax.swing.border.Border;
 
 import org.scilab.modules.graphic_objects.graphicController.GraphicController;
@@ -69,6 +72,7 @@ import org.scilab.modules.gui.bridge.checkbox.SwingScilabCheckBox;
 import org.scilab.modules.gui.bridge.editbox.SwingScilabEditBox;
 import org.scilab.modules.gui.bridge.frame.SwingScilabFrame;
 import org.scilab.modules.gui.bridge.frame.SwingScilabLayer;
+import org.scilab.modules.gui.bridge.frame.SwingScilabScrollableFrame;
 import org.scilab.modules.gui.bridge.groupmanager.GroupManager;
 import org.scilab.modules.gui.bridge.listbox.SwingScilabListBox;
 import org.scilab.modules.gui.bridge.popupmenu.SwingScilabPopupMenu;
@@ -360,7 +364,7 @@ public final class SwingViewWidget {
                     update(uiControl, __GO_UI_STRING__, GraphicController.getController().getProperty(uid, __GO_UI_STRING__));
                 }
                 break;
-            case __GO_POSITION__:
+            case __GO_POSITION__: {
 
                 /* Convert value according to units */
                 UicontrolUnits unitsProperty = UnitsConverter.stringToUnitsEnum((String) GraphicController.getController().getProperty(uid, __GO_UI_UNITS__));
@@ -368,6 +372,22 @@ public final class SwingViewWidget {
                 // Set dimensions before position because position is adjusted according to size
                 uiControl.setDims(new Size(dblValues[WIDTH_INDEX].intValue(), dblValues[HEIGHT_INDEX].intValue()));
                 uiControl.setPosition(new Position(dblValues[X_INDEX].intValue(), dblValues[Y_INDEX].intValue()));
+
+                Integer parent = (Integer)controller.getProperty(uid, __GO_PARENT__);
+                if (parent != 0) {
+                    Integer type = (Integer)controller.getProperty(parent, __GO_TYPE__);
+                    if (type == __GO_UICONTROL__) {
+
+                        Integer style = (Integer)controller.getProperty(parent, __GO_STYLE__);
+                        if (style == __GO_UI_FRAME__) {
+                            SwingViewObject obj = SwingView.getFromId(parent);
+                            if (obj instanceof SwingScilabScrollableFrame) {
+                                SwingScilabScrollableFrame frame = (SwingScilabScrollableFrame) SwingView.getFromId(parent);
+                                frame.updateChildPosition((JComponent)uiControl);
+                            }
+                        }
+                    }
+                }
                 // Manage sliders orientation
                 if (uiControl instanceof SwingScilabScroll) {
                     if (dblValues[WIDTH_INDEX].intValue() > dblValues[HEIGHT_INDEX].intValue()) {
@@ -383,6 +403,7 @@ public final class SwingViewWidget {
                     }
                 }
                 break;
+            }
             case __GO_UI_RELIEF__:
                 uiControl.setRelief((String) value);
                 break;
@@ -565,9 +586,9 @@ public final class SwingViewWidget {
             }
             case __GO_VISIBLE__ : {
                 boolean needUpdate = true;
-                if (uiControl instanceof SwingScilabFrame) {
-                    SwingScilabFrame frame = (SwingScilabFrame) uiControl;
-                    Integer parent = (Integer) controller.getProperty(frame.getId(), __GO_PARENT__);
+                if (uiControl instanceof SwingScilabFrame || uiControl instanceof SwingScilabScrollableFrame) {
+                    Component frame = (Component) uiControl;
+                    Integer parent = (Integer) controller.getProperty(uid, __GO_PARENT__);
                     if (parent != 0) {
                         Integer type = (Integer) controller.getProperty(parent, __GO_TYPE__);
                         if (type == __GO_UICONTROL__) {
@@ -578,7 +599,7 @@ public final class SwingViewWidget {
                                 SwingScilabLayer layer = (SwingScilabLayer) SwingView.getFromId(parent);
                                 Boolean isActive = layer.isLayerActive(frame);
                                 if (isActive != visible ) {
-                                    controller.setProperty(frame.getId(), __GO_VISIBLE__, isActive);
+                                    controller.setProperty(uid, __GO_VISIBLE__, isActive);
                                 }
 
                                 needUpdate = false;
@@ -607,8 +628,34 @@ public final class SwingViewWidget {
                     }
                 }
                 break;
-            case __GO_LAYOUT__:
-                if (uiControl instanceof SwingScilabFrame) {
+            case __GO_LAYOUT__: {
+                if (uiControl instanceof SwingScilabScrollableFrame) {
+                    SwingScilabScrollableFrame frame = (SwingScilabScrollableFrame) uiControl;
+                    LayoutType newLayout = LayoutType.intToEnum((Integer) value);
+                    switch (newLayout) {
+                        case BORDER: {
+                            Integer[] padding = (Integer[]) controller.getProperty(frame.getId(), __GO_BORDER_OPT_PADDING__);
+                            frame.setLayout(new BorderLayout(padding[0], padding[1]));
+                            break;
+                        }
+                        case GRIDBAG:
+                            frame.setLayout(new GridBagLayout());
+                            break;
+                        case GRID: {
+                            Integer[] padding = (Integer[]) controller.getProperty(frame.getId(), __GO_GRID_OPT_PADDING__);
+                            Integer[] grid = (Integer[]) controller.getProperty(frame.getId(), __GO_GRID_OPT_GRID__);
+                            if (grid[0] == 0 && grid[1] == 0) {
+                                grid[0] = 1;
+                            }
+                            frame.setLayout(new GridLayout(grid[0], grid[1], padding[0], padding[1]));
+                            break;
+                        }
+                        case NONE:
+                        default:
+                            frame.setLayout(null);
+                            break;
+                    }
+                } else if (uiControl instanceof SwingScilabFrame) {
                     SwingScilabFrame frame = (SwingScilabFrame) uiControl;
                     LayoutType newLayout = LayoutType.intToEnum((Integer) value);
                     switch (newLayout) {
@@ -634,16 +681,22 @@ public final class SwingViewWidget {
                             frame.setLayout(null);
                             break;
                     }
-                } else {
                 }
                 break;
+            }
             case __GO_UI_FRAME_BORDER__:
-                if (uiControl instanceof SwingScilabFrame) {
+                if (uiControl instanceof SwingScilabScrollableFrame) {
+                    SwingScilabScrollableFrame frame = (SwingScilabScrollableFrame) uiControl;
+                    Integer borderId = (Integer) value;
+                    Border border = BorderConvertor.getBorder(borderId);
+                    frame.setBorder(border);
+                } else if (uiControl instanceof SwingScilabFrame) {
                     SwingScilabFrame frame = (SwingScilabFrame) uiControl;
                     Integer borderId = (Integer) value;
                     Border border = BorderConvertor.getBorder(borderId);
                     frame.setBorder(border);
                 }
+
                 break;
             default:
                 //System.err.println("[SwingScilabWidget.update] Property not mapped: " + property);
index e30f219..9d887a1 100644 (file)
@@ -59,6 +59,7 @@ import org.scilab.modules.gui.bridge.canvas.SwingScilabCanvasImpl;
 import org.scilab.modules.gui.bridge.console.SwingScilabConsole;
 import org.scilab.modules.gui.bridge.contextmenu.SwingScilabContextMenu;
 import org.scilab.modules.gui.bridge.frame.SwingScilabFrame;
+import org.scilab.modules.gui.bridge.frame.SwingScilabScrollableFrame;
 import org.scilab.modules.gui.bridge.tab.SwingScilabDockablePanel;
 import org.scilab.modules.gui.bridge.tab.SwingScilabPanel;
 import org.scilab.modules.gui.colorchooser.ColorChooser;
@@ -72,7 +73,6 @@ import org.scilab.modules.gui.helpbrowser.HelpBrowser;
 import org.scilab.modules.gui.helpbrowser.ScilabHelpBrowser;
 import org.scilab.modules.gui.messagebox.MessageBox;
 import org.scilab.modules.gui.messagebox.ScilabMessageBox;
-import org.scilab.modules.gui.utils.BarUpdater;
 import org.scilab.modules.gui.utils.ClosingOperationsManager;
 import org.scilab.modules.gui.utils.ConfigManager;
 import org.scilab.modules.gui.utils.ImageExporter;
@@ -1246,7 +1246,9 @@ public class CallScilabBridge {
      */
     public static void requestFocus(int uicontrolUID) {
         SwingViewObject uicontrol = SwingView.getFromId(uicontrolUID);
-        if (uicontrol instanceof SwingScilabFrame) {
+        if (uicontrol instanceof SwingScilabScrollableFrame) {
+            ((SwingScilabScrollableFrame) uicontrol).requestFocus();
+        } else if (uicontrol instanceof SwingScilabFrame) {
             ((SwingScilabFrame) uicontrol).requestFocus();
         } else {
             ((Widget) uicontrol).requestFocus();
index 11ce7c5..70317ed 100644 (file)
@@ -10,6 +10,7 @@ import java.awt.Component;
 import java.util.ArrayList;
 
 import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.gui.SwingViewObject;
 
 public class SwingScilabLayer extends SwingScilabFrame {
     private static final long serialVersionUID = 9038916804095320758L;
@@ -34,11 +35,25 @@ public class SwingScilabLayer extends SwingScilabFrame {
 
     }
 
+    public void addMember(SwingScilabScrollableFrame member) {
+        String name = member.getId().toString();
+        member.setName(name);
+        layerName.add(name);
+        add(member, name);
+        revalidate();
+        //active the first child
+        if (getActiveLayer() == -1) {
+            setActiveLayer(1);
+        }
+
+    }
+
     public Integer getActiveLayer() {
-        SwingScilabFrame card = null;
+        Component card = null;
         for (Component comp : getComponents()) {
             if (comp.isVisible() == true) {
-                card = (SwingScilabFrame) comp;
+
+                card = comp;
                 break;
             }
         }
@@ -50,15 +65,15 @@ public class SwingScilabLayer extends SwingScilabFrame {
         return layerName.indexOf(card.getName()) + 1;
     }
 
-    private SwingScilabFrame getLayerFromIndex(Integer layer) {
+    private Component getLayerFromIndex(Integer layer) {
         if (layer < 1 || layer > getComponentCount()) {
             return null;
         }
 
-        return (SwingScilabFrame) getComponent(layer - 1);
+        return getComponent(layer - 1);
     }
 
-    private Integer getLayerIndex(SwingScilabFrame layer) {
+    private Integer getLayerIndex(Component layer) {
         for (int i = 0; i < getComponentCount(); i++) {
             if (getComponent(i) == layer) {
                 return i + 1;
@@ -73,7 +88,7 @@ public class SwingScilabLayer extends SwingScilabFrame {
     }
 
 
-    public Boolean isLayerActive(SwingScilabFrame layer) {
+    public Boolean isLayerActive(Component layer) {
         Integer index = getLayerIndex(layer);
         if (index == -1) {
             return false;
@@ -83,6 +98,23 @@ public class SwingScilabLayer extends SwingScilabFrame {
     }
 
 
+    public void removeMember(SwingScilabScrollableFrame member) {
+        layerName.remove(member.getId().toString());
+        remove(member);
+        revalidate();
+
+        //update model with new index
+        Integer active = getActiveLayer();
+        if (active == -1) {
+            if (setActiveLayer(1)) {
+                active = 1;
+            }
+        }
+
+        //update model with new index
+        GraphicController.getController().setProperty(getId(),  __GO_UI_VALUE__, new Double[] {active.doubleValue()});
+    }
+
     public void removeMember(SwingScilabFrame member) {
         layerName.remove(member.getId().toString());
         remove(member);
@@ -126,8 +158,8 @@ public class SwingScilabLayer extends SwingScilabFrame {
     }
 
     private void updateChildrenVisible(Integer previous, Integer next) {
-        SwingScilabFrame previousFrame = getLayerFromIndex(previous);
-        SwingScilabFrame nextFrame = getLayerFromIndex(next);
+        SwingViewObject previousFrame = (SwingViewObject)getLayerFromIndex(previous);
+        SwingViewObject nextFrame = (SwingViewObject) getLayerFromIndex(next);
 
         if (previousFrame != null) {
             GraphicController.getController().setProperty(previousFrame.getId(), __GO_VISIBLE__, false);
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/frame/SwingScilabScrollableFrame.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/frame/SwingScilabScrollableFrame.java
new file mode 100644 (file)
index 0000000..fe0a61f
--- /dev/null
@@ -0,0 +1,531 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007 - INRIA - Vincent Couvert
+ * Copyright (C) 2007 - INRIA - Marouane BEN JELLOUL
+ *
+ * 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
+ *
+ */
+
+package org.scilab.modules.gui.bridge.frame;
+
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_CHILDREN__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ENABLE__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_STRING__;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.GridLayout;
+import java.awt.Insets;
+import java.awt.LayoutManager;
+
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.ScrollPaneLayout;
+import javax.swing.SwingUtilities;
+import javax.swing.border.Border;
+
+import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.graphic_objects.graphicModel.GraphicModel;
+import org.scilab.modules.graphic_objects.uicontrol.Uicontrol;
+import org.scilab.modules.gui.SwingView;
+import org.scilab.modules.gui.SwingViewObject;
+import org.scilab.modules.gui.SwingViewWidget;
+import org.scilab.modules.gui.bridge.tab.SwingScilabPanel;
+import org.scilab.modules.gui.bridge.tab.SwingScilabTabGroup;
+import org.scilab.modules.gui.bridge.textbox.SwingScilabTextBox;
+import org.scilab.modules.gui.bridge.window.SwingScilabWindow;
+import org.scilab.modules.gui.dockable.Dockable;
+import org.scilab.modules.gui.events.callback.CommonCallBack;
+import org.scilab.modules.gui.frame.SimpleFrame;
+import org.scilab.modules.gui.menubar.MenuBar;
+import org.scilab.modules.gui.textbox.TextBox;
+import org.scilab.modules.gui.toolbar.ToolBar;
+import org.scilab.modules.gui.utils.Position;
+import org.scilab.modules.gui.utils.PositionConverter;
+import org.scilab.modules.gui.utils.ScilabRelief;
+import org.scilab.modules.gui.utils.Size;
+
+/**
+ * Swing implementation for Scilab frames in GUI
+ * @author Vincent COUVERT
+ * @author Marouane BEN JELLOUL
+ */
+public class SwingScilabScrollableFrame extends JScrollPane implements SwingViewObject, SimpleFrame {
+
+    private static final long serialVersionUID = -7401084975837285447L;
+
+    private Integer uid;
+    private JPanel panel = new JPanel();
+    //    private Dimension panelSize = new Dimension(0, 0);
+    //    private Point panelLoc = new Point(0, 0);
+
+    /**
+     * Constructor
+     */
+    public SwingScilabScrollableFrame() {
+        super();
+        setViewportView(panel);
+        // the Default layout is null so we have to set a Position and a Size of every Dockable we add to it
+        panel.setLayout(null);
+        setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+        setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
+    }
+
+    public JPanel getPanel() {
+        return panel;
+    }
+    /**
+     * Draws a Swing Scilab frame
+     * @see org.scilab.modules.gui.UIElement#draw()
+     */
+    public void draw() {
+        this.setVisible(true);
+        this.doLayout();
+    }
+
+    /**
+     * Gets the dimensions (width and height) of a swing Scilab frame
+     * @return the dimension of the frame
+     * @see org.scilab.modules.gui.UIElement#getDims()
+     */
+    public Size getDims() {
+        return new Size(this.getSize().width, this.getSize().height);
+    }
+
+    /**
+     * Gets the position (X-coordinate and Y-coordinate) of a swing Scilab frame
+     * @return the position of the frame
+     * @see org.scilab.modules.gui.UIElement#getPosition()
+     */
+    public Position getPosition() {
+        return PositionConverter.javaToScilab(getLocation(), getSize(), getParent());
+    }
+
+    /**
+     * Sets the dimensions (width and height) of a swing Scilab frame
+     * @param newSize the size we want to set to the frame
+     * @see org.scilab.modules.gui.UIElement#setDims(org.scilab.modules.gui.utils.Size)
+     */
+    public void setDims(Size newSize) {
+        setSize(newSize.getWidth(), newSize.getHeight());
+        panel.setMinimumSize(getSize());
+    }
+
+    /**
+     * Sets the position (X-coordinate and Y-coordinate) of a swing Scilab frame
+     * @param newPosition the position we want to set to the frame
+     * @see org.scilab.modules.gui.UIElement#setPosition(org.scilab.modules.gui.utils.Position)
+     */
+    public void setPosition(Position newPosition) {
+        Position javaPosition = PositionConverter.scilabToJava(newPosition, getDims(), getParent());
+        setLocation(javaPosition.getX(), javaPosition.getY());
+    }
+
+    /**
+     * Add a SwingViewObject (from SwingView.java) to container and returns its index
+     * @param member the member to add
+     */
+    public void addMember(SwingViewObject member) {
+        Uicontrol uicontrol = (Uicontrol) GraphicModel.getModel().getObjectFromId(member.getId());
+        if (getLayout() instanceof BorderLayout) {
+            switch (uicontrol.getBorderPositionAsEnum()) {
+                case BOTTOM:
+                    panel.add((Component) member, BorderLayout.SOUTH);
+                    break;
+                case TOP:
+                    panel.add((Component) member, BorderLayout.NORTH);
+                    break;
+                case LEFT:
+                    panel.add((Component) member, BorderLayout.WEST);
+                    break;
+                case RIGHT:
+                    panel.add((Component) member, BorderLayout.EAST);
+                    break;
+                case CENTER:
+                    panel.add((Component) member, BorderLayout.CENTER);
+                    break;
+                default:
+                    break;
+            }
+        } else if (getLayout() instanceof GridBagLayout) {
+            GridBagConstraints constraints = new GridBagConstraints();
+
+            // Grid
+            Integer[] grid = uicontrol.getGridBagGrid();
+            constraints.gridx = grid[0];
+            constraints.gridy = grid[1];
+            constraints.gridwidth = grid[2];
+            constraints.gridheight = grid[3];
+
+            // Weight
+            Double[] weight = uicontrol.getGridBagWeight();
+            constraints.weightx = weight[0];
+            constraints.weighty = weight[1];
+
+            // Anchor
+            switch (uicontrol.getGridBagAnchorAsEnum()) {
+                case LEFT :
+                    constraints.anchor = GridBagConstraints.WEST;
+                    break;
+                case UPPER :
+                    constraints.anchor = GridBagConstraints.NORTH;
+                    break;
+                case LOWER:
+                    constraints.anchor = GridBagConstraints.SOUTH;
+                    break;
+                case LOWER_LEFT:
+                    constraints.anchor = GridBagConstraints.SOUTHWEST;
+                    break;
+                case LOWER_RIGHT:
+                    constraints.anchor = GridBagConstraints.SOUTHEAST;
+                    break;
+                case RIGHT:
+                    constraints.anchor = GridBagConstraints.EAST;
+                    break;
+                case UPPER_LEFT:
+                    constraints.anchor = GridBagConstraints.NORTHWEST;
+                    break;
+                case UPPER_RIGHT:
+                    constraints.anchor = GridBagConstraints.NORTHEAST;
+                    break;
+                case CENTER :
+                default :
+                    constraints.anchor = GridBagConstraints.CENTER;
+                    break;
+            }
+
+            // Fill
+            switch (uicontrol.getGridBagFillAsEnum()) {
+                case BOTH :
+                    constraints.fill = GridBagConstraints.BOTH;
+                    break;
+                case HORIZONTAL:
+                    constraints.fill = GridBagConstraints.HORIZONTAL;
+                    break;
+                case VERTICAL:
+                    constraints.fill = GridBagConstraints.VERTICAL;
+                    break;
+                case NONE:
+                default:
+                    constraints.fill = GridBagConstraints.NONE;
+                    break;
+            }
+
+            // Insets
+            Double[] margins = uicontrol.getMargins();
+            constraints.insets = new Insets(
+                margins[0].intValue(), margins[1].intValue(),
+                margins[2].intValue(), margins[3].intValue());
+
+            // Padding
+            Integer[] padding = uicontrol.getGridBagPadding();
+            constraints.ipadx = padding[0];
+            constraints.ipady = padding[1];
+
+            panel.add((Component) member, constraints);
+            revalidate();
+        } else if (getLayout() instanceof GridLayout) {
+            this.panel.add((Component) member, 0);
+        } else {
+            //define width and height for panel
+            //and set preferred size
+
+            panel.add((Component) member);
+            updateChildPosition((JComponent)member);
+        }
+
+        SwingScilabPanel win = (SwingScilabPanel)SwingUtilities.getAncestorOfClass(SwingScilabPanel.class, this);
+        if (win != null) {
+            System.out.println("add member pack pack");
+            SwingScilabWindow parentWindow = SwingScilabWindow.allScilabWindows.get(win.getParentWindowId());
+            parentWindow.pack();
+        }
+    }
+
+    /**
+     * Add a member (dockable element) to container and returns its index
+     * @param member the member to add
+     * @return index of member in ArrayList
+     */
+    public int addMember(TextBox member) {
+        return this.addMember((SwingScilabTextBox) member.getAsSimpleTextBox());
+    }
+
+    /**
+     * Add a callback to the Frame
+     * @param callback the callback to set.
+     */
+    public void setCallback(CommonCallBack callback) {
+        // Nothing to do...
+    }
+
+    /**
+     * Setter for MenuBar
+     * @param menuBarToAdd the MenuBar associated to the Frame.
+     */
+    public void addMenuBar(MenuBar menuBarToAdd) {
+        /* Unimplemented for Frames */
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Setter for ToolBar
+     * @param toolBarToAdd the ToolBar associated to the Frame.
+     */
+    public void addToolBar(ToolBar toolBarToAdd) {
+        /* Unimplemented for Frames */
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Getter for MenuBar
+     * @return MenuBar: the MenuBar associated to the Frame.
+     */
+    public MenuBar getMenuBar() {
+        /* Unimplemented for Frames */
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Getter for ToolBar
+     * @return ToolBar: the ToolBar associated to the Frame.
+     */
+    public ToolBar getToolBar() {
+        /* Unimplemented for Frames */
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Get the text of the Frame
+     * @return the text of the frame
+     * @see org.scilab.modules.gui.frame.SimpleFrame#getText()
+     */
+    public String getText() {
+        return this.getName();
+    }
+
+    /**
+     * Set the text of the Frame
+     * @param text the text to set to the frame
+     * @see org.scilab.modules.gui.frame.SimpleFrame#setText()
+     */
+    public void setText(String text) {
+        this.setName(text);
+    }
+
+    /**
+     * Add a dockable element in the Frame (Not available for the moment)
+     * @param member the object we want to add to the Frame
+     * @return the index of the member in the Frame
+     * @see org.scilab.modules.gui.container.Container#addMember(org.scilab.modules.gui.dockable.Dockable)
+     */
+    public int addMember(Dockable member) {
+        /* Unimplemented for Frames */
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Set the Relief of the Frame
+     * @param reliefType the type of the relief to set (See ScilabRelief.java)
+     */
+    public void setRelief(String reliefType) {
+        if (org.scilab.modules.graphic_objects.console.Console.getConsole().getUseDeprecatedLF()) {
+            setBorder(ScilabRelief.getBorderFromRelief(reliefType));
+        }
+    }
+
+    /**
+     * Destroy the Frame
+     */
+    public void destroy() {
+        getParent().remove(this);
+        this.setVisible(false);
+    }
+
+    /**
+     * Setter for InfoBar
+     * @param infoBarToAdd the InfoBar associated to the Frame.
+     */
+    public void addInfoBar(TextBox infoBarToAdd) {
+        /* Unimplemented for Frames */
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Getter for InfoBar
+     * @return the InfoBar associated to the Frame.
+     */
+    public TextBox getInfoBar() {
+        /* Unimplemented for Frames */
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Set the horizontal alignment for the Slider text
+     * @param alignment the value for the alignment (See ScilabAlignment.java)
+     */
+    public void setHorizontalAlignment(String alignment) {
+        // Nothing to do here
+    }
+
+    /**
+     * Set the vertical alignment for the Slider text
+     * @param alignment the value for the alignment (See ScilabAlignment.java)
+     */
+    public void setVerticalAlignment(String alignment) {
+        // Nothing to do here
+    }
+
+    /**
+     * Set the UID
+     * @param id the UID
+     */
+    public void setId(Integer id) {
+        uid = id;
+    }
+
+    /**
+     * Get the UID
+     * @return the UID
+     */
+    public Integer getId() {
+        return uid;
+    }
+
+    /**
+     * Generic update method
+     * @param property property name
+     * @param value property value
+     */
+    public void update(int property, Object value) {
+        switch (property) {
+            case __GO_UI_STRING__: {
+                // Update tab title
+                Container parent = getParent();
+                if (parent instanceof SwingScilabTabGroup) {
+                    SwingScilabTabGroup tab = (SwingScilabTabGroup) parent;
+                    Component[] components = tab.getComponents();
+                    for (int i = 0; i < components.length ; ++i) {
+                        if (components[i] instanceof SwingScilabScrollableFrame && this.getId() == ((SwingScilabScrollableFrame) components[i]).getId()) {
+                            tab.setTitleAt(i, ((String[]) value)[0]);
+                            break;
+                        }
+                    }
+                }
+                break;
+            }
+            default :
+                SwingViewWidget.update(this, property, value);
+                break;
+        }
+    }
+
+    /**
+     * Set the enable status of the frame and its children
+     * @param status the status to set
+     */
+    public void setEnabled(boolean status) {
+        if (status) {
+            // Enable the frame
+            super.setEnabled(status);
+            // Enable its children according to their __GO_UI_ENABLE__ property
+            Integer[] children = (Integer[]) GraphicController.getController().getProperty(uid, __GO_CHILDREN__);
+            for (int kChild = 0; kChild < children.length; kChild++) {
+                Boolean childStatus = (Boolean) GraphicController.getController().getProperty(children[kChild], __GO_UI_ENABLE__);
+                SwingView.getFromId(children[kChild]).update(__GO_UI_ENABLE__, childStatus);
+            }
+        } else {
+            // Disable the frame
+            super.setEnabled(status);
+            // Disable its children
+            Component[] components = getComponents();
+            for (int compIndex = 0; compIndex < components.length; compIndex++) {
+                components[compIndex].setEnabled(false);
+            }
+        }
+    }
+
+    public void setLayout(LayoutManager layout) {
+        if (layout != null) {
+            if (layout instanceof ScrollPaneLayout) {
+                super.setLayout(layout);
+            } else if (panel != null) {
+                panel.setLayout(layout);
+            }
+        }
+    }
+
+    public LayoutManager getLayout() {
+        if (panel != null) {
+            return panel.getLayout();
+        }
+        return null;
+    }
+
+    public void updateChildPosition(JComponent child) {
+        /*        System.out.println("updateChildPosition");
+                Dimension size = child.getSize();
+                System.out.println("child size : " + size.toString());
+                Point loc = child.getLocation();
+                System.out.println("child loc : " + loc.toString());
+                if(Math.abs(loc.x + size.width) > panelSize.width) {
+                    System.out.println("update width from " + panelSize.width + " to " + Math.abs(loc.x + size.width));
+                    panelSize.width = Math.abs(loc.x + size.width);
+                }
+
+                if(Math.abs(loc.y + size.height) > panelSize.height) {
+                    System.out.println("update height from " + panelSize.height + " to " + Math.abs(loc.y + size.height));
+                    panelSize.height = Math.abs(loc.y + size.height);
+                }
+
+                if(loc.x < panelLoc.x) {
+                    System.out.println("update x from " + panelLoc.x + " to " + loc.x);
+                    panelLoc.x = loc.x;
+                }
+
+                if(loc.y < panelLoc.y) {
+                    System.out.println("update y from " + panelLoc.y + " to " + loc.y);
+                    panelLoc.y = loc.y;
+                }
+
+                panel.setPreferredSize(panelSize);
+                panel.setLocation(panelLoc);
+                Point newLoc = panel.getLocation();
+                System.out.println("newLoc : " + newLoc.toString());
+                System.out.println("view port location : " + getViewport().getViewPosition().toString());
+                System.out.println("view port size : " + getViewport().getViewSize().toString());
+                revalidate();
+        */
+    }
+
+    public void setBorder(Border border) {
+        if (panel != null) {
+            panel.setBorder(border);
+        }
+    }
+
+    public Border getBorder() {
+        if (panel != null) {
+            return panel.getBorder();
+        }
+
+        return null;
+    }
+
+    public void setBackground(Color bg) {
+        if (panel != null) {
+            panel.setBackground(bg);
+        }
+    }
+
+}
index 1384b68..a622af1 100644 (file)
@@ -14,7 +14,6 @@
 
 package org.scilab.modules.gui.bridge.pushbutton;
 
-import java.awt.Dimension;
 import java.awt.Font;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
@@ -25,7 +24,6 @@ import javax.swing.JButton;
 
 import org.scilab.modules.console.utils.ScilabSpecialTextUtilities;
 import org.scilab.modules.graphic_objects.console.Console;
-import org.scilab.modules.gui.SwingViewWidget;
 import org.scilab.modules.gui.SwingViewObject;
 import org.scilab.modules.gui.SwingViewWidget;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
index 5d911f9..291b422 100644 (file)
@@ -55,6 +55,7 @@ import org.scilab.modules.graphic_objects.utils.LayoutType;
 import org.scilab.modules.gui.SwingView;
 import org.scilab.modules.gui.SwingViewObject;
 import org.scilab.modules.gui.bridge.frame.SwingScilabFrame;
+import org.scilab.modules.gui.bridge.frame.SwingScilabScrollableFrame;
 import org.scilab.modules.gui.bridge.window.SwingScilabWindow;
 import org.scilab.modules.gui.events.callback.ScilabCloseCallBack;
 import org.scilab.modules.gui.toolbar.ToolBar;
@@ -384,15 +385,15 @@ public class SwingScilabCommonPanel {
             component.getWidgetPane().add((Component) member, constraints);
             component.getWidgetPane().revalidate();
         } else {
-            if (member instanceof SwingScilabFrame) {
+            if (member instanceof SwingScilabScrollableFrame || member instanceof SwingScilabFrame) {
                 component.getWidgetPane().add((Component) member, JLayeredPane.FRAME_CONTENT_LAYER);
             } else {
                 component.getWidgetPane().add((Component) member, JLayeredPane.DEFAULT_LAYER + 1);
             }
         }
     }
-    
-    protected static void  removeMember(SwingScilabPanel component,SwingViewObject member) {
+
+    protected static void  removeMember(SwingScilabPanel component, SwingViewObject member) {
         component.getWidgetPane().remove((Component) member);
     }
 }
index 413d188..f30bcab 100644 (file)
@@ -66,6 +66,7 @@ import org.scilab.modules.gui.bridge.checkbox.SwingScilabCheckBox;
 import org.scilab.modules.gui.bridge.console.SwingScilabConsole;
 import org.scilab.modules.gui.bridge.editbox.SwingScilabEditBox;
 import org.scilab.modules.gui.bridge.frame.SwingScilabFrame;
+import org.scilab.modules.gui.bridge.frame.SwingScilabScrollableFrame;
 import org.scilab.modules.gui.bridge.helpbrowser.SwingScilabHelpBrowser;
 import org.scilab.modules.gui.bridge.label.SwingScilabLabel;
 import org.scilab.modules.gui.bridge.listbox.SwingScilabListBox;
@@ -91,6 +92,7 @@ import org.scilab.modules.gui.events.GlobalEventWatcher;
 import org.scilab.modules.gui.events.ScilabEventListener;
 import org.scilab.modules.gui.events.callback.CommonCallBack;
 import org.scilab.modules.gui.frame.Frame;
+import org.scilab.modules.gui.frame.SimpleFrame;
 import org.scilab.modules.gui.helpbrowser.HelpBrowser;
 import org.scilab.modules.gui.label.Label;
 import org.scilab.modules.gui.listbox.ListBox;
@@ -689,7 +691,12 @@ public class SwingScilabDockablePanel extends View implements SimpleTab, FocusLi
      */
     @Override
     public int addMember(Frame member) {
-        return this.addMember((SwingScilabFrame) member.getAsSimpleFrame());
+        SimpleFrame frame = member.getAsSimpleFrame();
+        if (frame instanceof SwingScilabFrame) {
+            return this.addMember((SwingScilabFrame) member.getAsSimpleFrame());
+        } else {
+            return this.addMember((SwingScilabScrollableFrame) member.getAsSimpleFrame());
+        }
     }
 
     /**
@@ -697,6 +704,10 @@ public class SwingScilabDockablePanel extends View implements SimpleTab, FocusLi
      * @param member the member to add
      * @return index of member in ArrayList
      */
+    private int addMember(SwingScilabScrollableFrame member) {
+        return 0;
+    }
+
     private int addMember(SwingScilabFrame member) {
         return 0;
     }
@@ -707,13 +718,21 @@ public class SwingScilabDockablePanel extends View implements SimpleTab, FocusLi
      */
     @Override
     public void removeMember(Frame member) {
-        this.removeMember((SwingScilabFrame) member.getAsSimpleFrame());
+        SimpleFrame frame = member.getAsSimpleFrame();
+        if (frame instanceof SwingScilabFrame) {
+            this.removeMember((SwingScilabFrame) member.getAsSimpleFrame());
+        } else {
+            this.removeMember((SwingScilabScrollableFrame) member.getAsSimpleFrame());
+        }
     }
 
     /**
      * Remove a Frame from its container
      * @param member the Frame to remove
      */
+    private void removeMember(SwingScilabScrollableFrame member) {
+    }
+
     private void removeMember(SwingScilabFrame member) {
     }