RadioButton uicontrols now use MVC 00/5100/3
Vincent COUVERT [Mon, 3 Oct 2011 12:00:11 +0000 (14:00 +0200)]
Change-Id: I31c4637ed355e9f0e2ca0f75a2bb61864fe41c25

scilab/modules/graphic_objects/includes/graphicObjectProperties.h
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/graphicModel/GraphicModel.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/graphicObject/GraphicObject.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/graphicObject/GraphicObjectProperties.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/uicontrol/Uicontrol.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/uicontrol/radiobutton/RadioButton.java [new file with mode: 0644]
scilab/modules/graphic_objects/src/scripts/propertiesMap.properties
scilab/modules/gui/src/c/CreateUIControl.c
scilab/modules/gui/src/java/org/scilab/modules/gui/SwingView.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/radiobutton/SwingScilabRadioButton.java

index 06bbbb9..cd32831 100644 (file)
 #define __GO_UI_FRAME__                    "frame"
 #define __GO_UI_IMAGERENDERER__            "imagerenderer"
 #define __GO_UI_PUSHBUTTON__               "pushbutton"
+#define __GO_UI_RADIOBUTTON__              "radiobutton"
 #define __GO_UI_TABLE__                    "table"
 #define __GO_UI_TEXT__                     "text"
 
index 090d478..b65b7f9 100644 (file)
@@ -34,6 +34,7 @@ import org.scilab.modules.graphic_objects.surface.Plot3d;
 import org.scilab.modules.graphic_objects.textObject.Text;
 import org.scilab.modules.graphic_objects.uicontrol.imagerenderer.ImageRenderer;
 import org.scilab.modules.graphic_objects.uicontrol.pushbutton.PushButton;
+import org.scilab.modules.graphic_objects.uicontrol.radiobutton.RadioButton;
 import org.scilab.modules.graphic_objects.uicontrol.table.Table;
 import org.scilab.modules.graphic_objects.uicontrol.uitext.UiText;
 import org.scilab.modules.graphic_objects.vectfield.Champ;
@@ -194,6 +195,8 @@ public final class GraphicModel {
                 return new ImageRenderer();
             case PUSHBUTTON:
                 return new PushButton();
+            case RADIOBUTTON:
+                return new RadioButton();
             case TABLE:
                 return new Table();
             case UITEXT:
index 469a259..b1731f0 100644 (file)
@@ -29,64 +29,66 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
  * @author Vincent COUVERT
  */
 public abstract class GraphicObject implements Cloneable {
-       /** User data array default size */
-       public static final int USER_DATA_DEFAULT_SIZE = 0;
+    /** User data array default size */
+    public static final int USER_DATA_DEFAULT_SIZE = 0;
 
     /** Graphic objects types */
-       public enum Type { ARC, AXES, AXIS, CHAMP, COMPOUND, FAC3D, FEC, FIGURE, GRAYPLOT,
-               LABEL, LEGEND, MATPLOT, PLOT3D, POLYLINE, RECTANGLE, SEGS, TEXT, IMAGERENDERER, PUSHBUTTON, TABLE, UITEXT, UNKNOWNOBJECT };
-       
-       /** GraphicObject properties */
-       public enum GraphicObjectPropertyType { PARENT, CHILDREN, CHILDREN_COUNT, VISIBLE, USERDATA, USERDATASIZE, TYPE, REFERENCED, VALID, DATA,
-               PARENT_FIGURE, PARENT_AXES, HASLEGENDCHILD, LEGENDCHILD, SELECTEDCHILD, TAG, UNKNOWNPROPERTY };
-
-       /** Identifier */
-       private String identifier;
-       
-       /** Parent object is known by its UID */
-       private String parent;
-
-       /** Child objects list. Known by their UID */
-       private List <String> children;
-
-       /** Specifies whether the object is visible or not */
-       private boolean visible;
-
-       /** Specifies if the "handle" is referenced in scilab */
-       private boolean referenced;
-       
-       /** Specifies if the "handle" is valid, i.e included in a rendered object */
-       private boolean valid;
-       
-       /** User data */
-       private Object userData;
-
-       /** Tag */
-       private String tag;
-
-       /**
-        * Identifier of the selected child
-        * This was previously implemented as a list, but is used in practice
-        * to store only the identifier of the currently selected child.
-        * To do: use a list if required
-        */
-       private String selectedChild;
-
-       /** Constructor */
-       public GraphicObject() {
-               identifier = null;
-               parent = "";
-               children = new LinkedList<String>();
-               visible = true;
-               userData = null;
-               valid = true;
-               referenced = false;
-               selectedChild = "";
-               tag = "";
-       }
-
-       public GraphicObject clone() {
-           GraphicObject copy = null;
+    public enum Type { ARC, AXES, AXIS, CHAMP, COMPOUND, FAC3D, FEC, FIGURE, GRAYPLOT,
+        LABEL, LEGEND, MATPLOT, PLOT3D, POLYLINE, RECTANGLE, SEGS, TEXT, IMAGERENDERER, PUSHBUTTON, RADIOBUTTON, TABLE, UITEXT, UNKNOWNOBJECT 
+    };
+
+    /** GraphicObject properties */
+    public enum GraphicObjectPropertyType { PARENT, CHILDREN, CHILDREN_COUNT, VISIBLE, USERDATA, USERDATASIZE, TYPE, REFERENCED, VALID, DATA,
+        PARENT_FIGURE, PARENT_AXES, HASLEGENDCHILD, LEGENDCHILD, SELECTEDCHILD, TAG, UNKNOWNPROPERTY 
+    };
+
+    /** Identifier */
+    private String identifier;
+
+    /** Parent object is known by its UID */
+    private String parent;
+
+    /** Child objects list. Known by their UID */
+    private List <String> children;
+
+    /** Specifies whether the object is visible or not */
+    private boolean visible;
+
+    /** Specifies if the "handle" is referenced in scilab */
+    private boolean referenced;
+
+    /** Specifies if the "handle" is valid, i.e included in a rendered object */
+    private boolean valid;
+
+    /** User data */
+    private Object userData;
+
+    /** Tag */
+    private String tag;
+
+    /**
+     * Identifier of the selected child
+     * This was previously implemented as a list, but is used in practice
+     * to store only the identifier of the currently selected child.
+     * To do: use a list if required
+     */
+    private String selectedChild;
+
+    /** Constructor */
+    public GraphicObject() {
+        identifier = null;
+        parent = "";
+        children = new LinkedList<String>();
+        visible = true;
+        userData = null;
+        valid = true;
+        referenced = false;
+        selectedChild = "";
+        tag = "";
+    }
+
+    public GraphicObject clone() {
+        GraphicObject copy = null;
         try {
             copy = (GraphicObject) super.clone();
         } catch (CloneNotSupportedException e) {
@@ -94,30 +96,30 @@ public abstract class GraphicObject implements Cloneable {
             e.printStackTrace();
         }
 
-            /*
-             * Creating an empty list is done to avoid
-             * still referencing the original object's own list,
-             * which occurs when the Figure model is cloned.
-             */
-            copy.setChildren(new LinkedList<String>());
+        /*
+         * Creating an empty list is done to avoid
+         * still referencing the original object's own list,
+         * which occurs when the Figure model is cloned.
+         */
+        copy.setChildren(new LinkedList<String>());
 
-            /*
-             * Avoids keeping the Figure model as a parent
-             * when the Axes model is cloned.
-             */
-            copy.setParent("");
+        /*
+         * Avoids keeping the Figure model as a parent
+         * when the Axes model is cloned.
+         */
+        copy.setParent("");
 
-            /*
-             * Sets no object as the selected child.
-             */
-            copy.setSelectedChild("");
+        /*
+         * Sets no object as the selected child.
+         */
+        copy.setSelectedChild("");
 
-           return (GraphicObject) copy;
-       }
+        return (GraphicObject) copy;
+    }
 
     abstract public void accept(IVisitor visitor);
-       
-       /**
+
+    /**
      * Returns the enum associated to a type name
      * @param typeName the property name
      * @return the type enum
@@ -161,6 +163,8 @@ public abstract class GraphicObject implements Cloneable {
             return Type.IMAGERENDERER;
         } else if (typeName.equals(__GO_UI_PUSHBUTTON__)) {
             return Type.PUSHBUTTON;
+        } else if (typeName.equals(__GO_UI_RADIOBUTTON__)) {
+            return Type.RADIOBUTTON;
         } else if (typeName.equals(__GO_UI_TABLE__)) {
             return Type.TABLE;
         } else if (typeName.equals(__GO_UI_TEXT__)) {
@@ -168,158 +172,158 @@ public abstract class GraphicObject implements Cloneable {
         } else {
             return Type.UNKNOWNOBJECT;
         }
-       }
-
-       /**
-        * Returns the enum associated to a property name
-        * @param propertyName the property name
-        * @return the property enum
-        */
-       public Object getPropertyFromName(String propertyName) {
-               if (propertyName.equals(__GO_PARENT__)) {
-                       return  GraphicObjectPropertyType.PARENT;
-               } else if (propertyName.equals(__GO_CHILDREN__)) {
-                       return GraphicObjectPropertyType.CHILDREN;
-               } else if (propertyName.equals(__GO_CHILDREN_COUNT__)) {
-                       return GraphicObjectPropertyType.CHILDREN_COUNT;
-               } else if (propertyName.equals(__GO_VISIBLE__)) {
-                       return GraphicObjectPropertyType.VISIBLE;
-               } else if (propertyName.equals(__GO_USER_DATA__)) {
-                       return GraphicObjectPropertyType.USERDATA;
-               } else if (propertyName.equals(__GO_USER_DATA_SIZE__)) {
-                       return GraphicObjectPropertyType.USERDATASIZE;
-               } else if (propertyName.equals(__GO_REFERENCED__)) {
-                       return GraphicObjectPropertyType.REFERENCED;
-               } else if (propertyName.equals(__GO_VALID__)) {
-                       return GraphicObjectPropertyType.VALID;
-               } else if (propertyName.equals(__GO_PARENT_FIGURE__)) {
-                       return GraphicObjectPropertyType.PARENT_FIGURE;
-               } else if (propertyName.equals(__GO_PARENT_AXES__)) {
-                       return GraphicObjectPropertyType.PARENT_AXES;
-               } else if (propertyName.equals(__GO_PARENT_AXES__)) {
-                       return GraphicObjectPropertyType.PARENT_AXES;
-               } else if (propertyName.equals(__GO_HAS_LEGEND_CHILD__)) {
-                       return GraphicObjectPropertyType.HASLEGENDCHILD;
-               } else if (propertyName.equals(__GO_LEGEND_CHILD__)) {
-                       return GraphicObjectPropertyType.LEGENDCHILD;
-               } else if (propertyName.equals(__GO_SELECTED_CHILD__)) {
-                       return GraphicObjectPropertyType.SELECTEDCHILD;
-               } else if (propertyName.equals(__GO_TYPE__)) {
-                       return GraphicObjectPropertyType.TYPE;
-               }  else if (propertyName.equals(__GO_DATA_MODEL__)) {
-                       return GraphicObjectPropertyType.DATA;
-               }  else if (propertyName.equals(__GO_TAG__)) {
-                       return GraphicObjectPropertyType.TAG;
-               }  else {
-                       return GraphicObjectPropertyType.UNKNOWNPROPERTY;
-               }
-       }
-
-       /**
-        * Fast property get method
-        * @param property the property to get
-        * @return the property value
-        */
-       public Object getProperty(Object property) {
-               if (property == GraphicObjectPropertyType.PARENT) {
-                       return getParent();
-               } else if (property == GraphicObjectPropertyType.CHILDREN) {
-                       return getChildren();
-               } else if (property == GraphicObjectPropertyType.CHILDREN_COUNT) {
-                       return getChildren().length;
-               } else if (property == GraphicObjectPropertyType.VISIBLE) {
-                       return getVisible();
-               } else if (property == GraphicObjectPropertyType.USERDATA) {
-                       return getUserData();
-               } else if (property == GraphicObjectPropertyType.USERDATASIZE) {
-                       return getUserDataSize();
-               } else if (property == GraphicObjectPropertyType.PARENT_FIGURE) {
-                       return getParentFigure();
-               } else if (property == GraphicObjectPropertyType.PARENT_AXES) {
-                       return getParentAxes();
-               } else if (property == GraphicObjectPropertyType.HASLEGENDCHILD) {
-                       return getHasLegendChild();
-               } else if (property == GraphicObjectPropertyType.LEGENDCHILD) {
-                       return getLegendChild();
-               } else if (property == GraphicObjectPropertyType.SELECTEDCHILD) {
-                       return getSelectedChild();
-               } else if (property == GraphicObjectPropertyType.TYPE) {
+    }
+
+    /**
+     * Returns the enum associated to a property name
+     * @param propertyName the property name
+     * @return the property enum
+     */
+    public Object getPropertyFromName(String propertyName) {
+        if (propertyName.equals(__GO_PARENT__)) {
+            return  GraphicObjectPropertyType.PARENT;
+        } else if (propertyName.equals(__GO_CHILDREN__)) {
+            return GraphicObjectPropertyType.CHILDREN;
+        } else if (propertyName.equals(__GO_CHILDREN_COUNT__)) {
+            return GraphicObjectPropertyType.CHILDREN_COUNT;
+        } else if (propertyName.equals(__GO_VISIBLE__)) {
+            return GraphicObjectPropertyType.VISIBLE;
+        } else if (propertyName.equals(__GO_USER_DATA__)) {
+            return GraphicObjectPropertyType.USERDATA;
+        } else if (propertyName.equals(__GO_USER_DATA_SIZE__)) {
+            return GraphicObjectPropertyType.USERDATASIZE;
+        } else if (propertyName.equals(__GO_REFERENCED__)) {
+            return GraphicObjectPropertyType.REFERENCED;
+        } else if (propertyName.equals(__GO_VALID__)) {
+            return GraphicObjectPropertyType.VALID;
+        } else if (propertyName.equals(__GO_PARENT_FIGURE__)) {
+            return GraphicObjectPropertyType.PARENT_FIGURE;
+        } else if (propertyName.equals(__GO_PARENT_AXES__)) {
+            return GraphicObjectPropertyType.PARENT_AXES;
+        } else if (propertyName.equals(__GO_PARENT_AXES__)) {
+            return GraphicObjectPropertyType.PARENT_AXES;
+        } else if (propertyName.equals(__GO_HAS_LEGEND_CHILD__)) {
+            return GraphicObjectPropertyType.HASLEGENDCHILD;
+        } else if (propertyName.equals(__GO_LEGEND_CHILD__)) {
+            return GraphicObjectPropertyType.LEGENDCHILD;
+        } else if (propertyName.equals(__GO_SELECTED_CHILD__)) {
+            return GraphicObjectPropertyType.SELECTEDCHILD;
+        } else if (propertyName.equals(__GO_TYPE__)) {
+            return GraphicObjectPropertyType.TYPE;
+        }  else if (propertyName.equals(__GO_DATA_MODEL__)) {
+            return GraphicObjectPropertyType.DATA;
+        }  else if (propertyName.equals(__GO_TAG__)) {
+            return GraphicObjectPropertyType.TAG;
+        }  else {
+            return GraphicObjectPropertyType.UNKNOWNPROPERTY;
+        }
+    }
+
+    /**
+     * Fast property get method
+     * @param property the property to get
+     * @return the property value
+     */
+    public Object getProperty(Object property) {
+        if (property == GraphicObjectPropertyType.PARENT) {
+            return getParent();
+        } else if (property == GraphicObjectPropertyType.CHILDREN) {
+            return getChildren();
+        } else if (property == GraphicObjectPropertyType.CHILDREN_COUNT) {
+            return getChildren().length;
+        } else if (property == GraphicObjectPropertyType.VISIBLE) {
+            return getVisible();
+        } else if (property == GraphicObjectPropertyType.USERDATA) {
+            return getUserData();
+        } else if (property == GraphicObjectPropertyType.USERDATASIZE) {
+            return getUserDataSize();
+        } else if (property == GraphicObjectPropertyType.PARENT_FIGURE) {
+            return getParentFigure();
+        } else if (property == GraphicObjectPropertyType.PARENT_AXES) {
+            return getParentAxes();
+        } else if (property == GraphicObjectPropertyType.HASLEGENDCHILD) {
+            return getHasLegendChild();
+        } else if (property == GraphicObjectPropertyType.LEGENDCHILD) {
+            return getLegendChild();
+        } else if (property == GraphicObjectPropertyType.SELECTEDCHILD) {
+            return getSelectedChild();
+        } else if (property == GraphicObjectPropertyType.TYPE) {
             return getType();
         }  else if (property == GraphicObjectPropertyType.DATA) {
-                       return getIdentifier();
+            return getIdentifier();
         }  else if (property == GraphicObjectPropertyType.TAG) {
-                       return getTag();
+            return getTag();
         }  else if (property == GraphicObjectPropertyType.UNKNOWNPROPERTY) {
-                       return null;
-               } else {
-                       return null;
-               }
-       }
-
-       /**
-        * Fast property set method
-        * @param property the property to set
-        * @param value the property value
-        * @return true if the property has been set, false otherwise
-        */
-       public boolean setProperty(Object property, Object value) {
-               if (property == GraphicObjectPropertyType.PARENT) {
-                       setParent((String) value);
-               } else if (property == GraphicObjectPropertyType.CHILDREN) {
-                       setChildren((List<String>) value);
-               } else if (property == GraphicObjectPropertyType.VISIBLE) {
-                       setVisible((Boolean) value);
-               } else if (property == GraphicObjectPropertyType.USERDATA) {
-                       setUserData(value);
-               } else if (property == GraphicObjectPropertyType.USERDATASIZE) {
-                       return false;
-               } else if (property == GraphicObjectPropertyType.SELECTEDCHILD) {
-                       setSelectedChild((String) value);
+            return null;
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Fast property set method
+     * @param property the property to set
+     * @param value the property value
+     * @return true if the property has been set, false otherwise
+     */
+    public boolean setProperty(Object property, Object value) {
+        if (property == GraphicObjectPropertyType.PARENT) {
+            setParent((String) value);
+        } else if (property == GraphicObjectPropertyType.CHILDREN) {
+            setChildren((List<String>) value);
+        } else if (property == GraphicObjectPropertyType.VISIBLE) {
+            setVisible((Boolean) value);
+        } else if (property == GraphicObjectPropertyType.USERDATA) {
+            setUserData(value);
+        } else if (property == GraphicObjectPropertyType.USERDATASIZE) {
+            return false;
+        } else if (property == GraphicObjectPropertyType.SELECTEDCHILD) {
+            setSelectedChild((String) value);
         } else if (property == GraphicObjectPropertyType.DATA) {
-                       return true;
+            return true;
         } else if (property == GraphicObjectPropertyType.TAG) {
-                       setTag((String) value);
-               } else if (property == GraphicObjectPropertyType.UNKNOWNPROPERTY) {
-                       return false;
-               }
-
-               return true;
-       }
-
-       /**
-        * Returns a null property
-        * @param property property name
-        * @return null property
-        */
-       public Object getNullProperty(String property) {
-               return null;
-       }
-
-       /**
-        * Void property get method
-        * @param property the property name
-        */
-       public Object getPropertyVoid(String property) {
-               // TODO
-               return null;
-       }
-
-       /* TODO */
-       /**
-        * Void property set method
-        * @param property the property name
-        * @param value the property value
-        */
-       public void setPropertyVoid(String property, Object value) {
-               // TODO
-       }
-       
-       /**
-        * @return the children
-        */
-       public String[] getChildren() {
+            setTag((String) value);
+        } else if (property == GraphicObjectPropertyType.UNKNOWNPROPERTY) {
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * Returns a null property
+     * @param property property name
+     * @return null property
+     */
+    public Object getNullProperty(String property) {
+        return null;
+    }
+
+    /**
+     * Void property get method
+     * @param property the property name
+     */
+    public Object getPropertyVoid(String property) {
+        // TODO
+        return null;
+    }
+
+    /* TODO */
+    /**
+     * Void property set method
+     * @param property the property name
+     * @param value the property value
+     */
+    public void setPropertyVoid(String property, Object value) {
+        // TODO
+    }
+
+    /**
+     * @return the children
+     */
+    public String[] getChildren() {
         return children.toArray(new String[children.size()]);
-       }
+    }
 
     /**
      * Adds a child.
@@ -339,197 +343,197 @@ public abstract class GraphicObject implements Cloneable {
         children.remove(child);
     }
 
-       /**
-        * @param children the children to set
-        */
-       public void setChildren(List<String> children) {
-               this.children = children;
-       }
-
-       /**
-        * @return the identifier
-        */
-       public String getIdentifier() {
-               return identifier;
-       }
-
-       /**
-        * @param identifier the identifier to set
-        */
-       public void setIdentifier(String identifier) {
-               this.identifier = identifier;
-       }
-
-       /**
-        * @return the parent
-        */
-       public String getParent() {
-               return parent;
-       }
-
-       /**
-        * @param parent the parent to set
-        */
-       public void setParent(String parent) {
-               this.parent = parent;
-       }
-
-       /**
-        * @return the userData
-        */
-       public Object getUserData() {
-               return userData;
-       }
-
-       /**
-        * @param userData the userData to set
-        */
-       public void setUserData(Object userData) {
-           this.userData = userData;
-       }
-
-       /**
-        * @return the userDataSize
-        */
-       public Integer getUserDataSize() {
-               return 0;
-       }
-
-       /**
-        * @return the tag
-        */
-       public String getTag() {
-               return tag;
-       }
-
-       /**
-        * @param tag the tag to set
-        */
-       public void setTag(String tag) {
-           this.tag = tag;
-       }
-       /**
-        * Get parent Figure method
-        * Returns the identifier of the object's parent Figure
-        * If the object is a Figure, then returns its own identifier.
-        * To be done: use a member variable storing the up-to-date current parent Figure,
-        * returned instead of recursively ascending the hierarchy at each call.
-        * @return the parent Figure identifier
-        */
-       public String getParentFigure() {
-                if (this instanceof Figure) {
-                        return getIdentifier();
-                } else {
-                       if (getParent() != null && GraphicController.getController().getObjectFromId(getParent()) != null) {
-                               return GraphicController.getController().getObjectFromId(getParent()).getParentFigure();
-                       } else {
-                               return null;
-                       }
-                }
-       }
-
-       /**
-        * Get parent Axes method
-        * Returns the identifier of the object's parent Axes
-        * If the object is an Axes, then returns its own identifier.
-        * To be done: use a member variable storing the up-to-date current parent Axes,
-        * returned instead of recursively ascending the hierarchy at each call.
-        * @return the parent Axes identifier
-        */
-       public String getParentAxes() {
-                if (this instanceof Axes) {
-                        return getIdentifier();
-                } else {
-                       if (getParent() != null && GraphicController.getController().getObjectFromId(getParent()) != null) {
-                               return GraphicController.getController().getObjectFromId(getParent()).getParentAxes();
-                       } else {
-                               return null;
-                       }
-                }
-       }
-
-       /**
-        * Get has legend child method
-        * Returns a boolean indicating whether one of the object's direct children
-        * is a Legend object. Only one Legend is supposed to be present in the list.
-        * To be done: storing the property and updating it only when a Legend object
-        * is inserted or deleted instead of searching the children list when the
-        * property is queried.
-        * @return a Boolean indicating whether the object has a child Legend object or not
-        */
-       public Boolean getHasLegendChild() {
-               for (int i = 0; i < children.size(); i++) {
-                       GraphicObject currentObject = GraphicController.getController().getObjectFromId(children.get(i));
-
-                       if (currentObject instanceof Legend) {
-                               return true;
-                       }
-               }
-
-               return false;
-       }
-
-        /**
-         * Returns the identifier of the object's direct child that is a Legend object.
-         * It returns an empty string if the object has no Legend in its children list
-         * (one Legend is supposed to be present at most).
-         * @return the object's child Legend object identifier, or an empty string if no child Legend found.
-         */
-       public String getLegendChild() {
-               for (int i = 0; i < children.size(); i++) {
-                       GraphicObject currentObject = GraphicController.getController().getObjectFromId(children.get(i));
-
-                       if (currentObject instanceof Legend) {
-                               return currentObject.getIdentifier();
-                       }
-               }
-
-                /* No child legend found */
-                return "";
-       }
-
-       /**
-        * Get selected child method
-        * @return the selected child
-        */
-       public String getSelectedChild() {
-               return selectedChild;
-       }
-
-       /**
-        * Set selected child method
-        * @param selectedChild the selected child to set
-        */
-       public void setSelectedChild(String selectedChild) {
-               this.selectedChild = selectedChild;
-       }
-
-       /**
-        * Get visible method
-        * @return the visible
-        */
-       public Boolean getVisible() {
-               return visible;
-       }
-
-       /**
-        * Set visible method
-        * @param visible the visible to set
-        */
-       public void setVisible(Boolean visible) {
-               this.visible = visible;
-       }
-       
-       /**
-        * Each type should name itself
-        * @return Type as String
-        */
-       // TODO : Should be public abstract.
-       //public abstract String getType();
-       public String getType() {
-           return "???";
-       }
-       
+    /**
+     * @param children the children to set
+     */
+    public void setChildren(List<String> children) {
+        this.children = children;
+    }
+
+    /**
+     * @return the identifier
+     */
+    public String getIdentifier() {
+        return identifier;
+    }
+
+    /**
+     * @param identifier the identifier to set
+     */
+    public void setIdentifier(String identifier) {
+        this.identifier = identifier;
+    }
+
+    /**
+     * @return the parent
+     */
+    public String getParent() {
+        return parent;
+    }
+
+    /**
+     * @param parent the parent to set
+     */
+    public void setParent(String parent) {
+        this.parent = parent;
+    }
+
+    /**
+     * @return the userData
+     */
+    public Object getUserData() {
+        return userData;
+    }
+
+    /**
+     * @param userData the userData to set
+     */
+    public void setUserData(Object userData) {
+        this.userData = userData;
+    }
+
+    /**
+     * @return the userDataSize
+     */
+    public Integer getUserDataSize() {
+        return 0;
+    }
+
+    /**
+     * @return the tag
+     */
+    public String getTag() {
+        return tag;
+    }
+
+    /**
+     * @param tag the tag to set
+     */
+    public void setTag(String tag) {
+        this.tag = tag;
+    }
+    /**
+     * Get parent Figure method
+     * Returns the identifier of the object's parent Figure
+     * If the object is a Figure, then returns its own identifier.
+     * To be done: use a member variable storing the up-to-date current parent Figure,
+     * returned instead of recursively ascending the hierarchy at each call.
+     * @return the parent Figure identifier
+     */
+    public String getParentFigure() {
+        if (this instanceof Figure) {
+            return getIdentifier();
+        } else {
+            if (getParent() != null && GraphicController.getController().getObjectFromId(getParent()) != null) {
+                return GraphicController.getController().getObjectFromId(getParent()).getParentFigure();
+            } else {
+                return null;
+            }
+        }
+    }
+
+    /**
+     * Get parent Axes method
+     * Returns the identifier of the object's parent Axes
+     * If the object is an Axes, then returns its own identifier.
+     * To be done: use a member variable storing the up-to-date current parent Axes,
+     * returned instead of recursively ascending the hierarchy at each call.
+     * @return the parent Axes identifier
+     */
+    public String getParentAxes() {
+        if (this instanceof Axes) {
+            return getIdentifier();
+        } else {
+            if (getParent() != null && GraphicController.getController().getObjectFromId(getParent()) != null) {
+                return GraphicController.getController().getObjectFromId(getParent()).getParentAxes();
+            } else {
+                return null;
+            }
+        }
+    }
+
+    /**
+     * Get has legend child method
+     * Returns a boolean indicating whether one of the object's direct children
+     * is a Legend object. Only one Legend is supposed to be present in the list.
+     * To be done: storing the property and updating it only when a Legend object
+     * is inserted or deleted instead of searching the children list when the
+     * property is queried.
+     * @return a Boolean indicating whether the object has a child Legend object or not
+     */
+    public Boolean getHasLegendChild() {
+        for (int i = 0; i < children.size(); i++) {
+            GraphicObject currentObject = GraphicController.getController().getObjectFromId(children.get(i));
+
+            if (currentObject instanceof Legend) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Returns the identifier of the object's direct child that is a Legend object.
+     * It returns an empty string if the object has no Legend in its children list
+     * (one Legend is supposed to be present at most).
+     * @return the object's child Legend object identifier, or an empty string if no child Legend found.
+     */
+    public String getLegendChild() {
+        for (int i = 0; i < children.size(); i++) {
+            GraphicObject currentObject = GraphicController.getController().getObjectFromId(children.get(i));
+
+            if (currentObject instanceof Legend) {
+                return currentObject.getIdentifier();
+            }
+        }
+
+        /* No child legend found */
+        return "";
+    }
+
+    /**
+     * Get selected child method
+     * @return the selected child
+     */
+    public String getSelectedChild() {
+        return selectedChild;
+    }
+
+    /**
+     * Set selected child method
+     * @param selectedChild the selected child to set
+     */
+    public void setSelectedChild(String selectedChild) {
+        this.selectedChild = selectedChild;
+    }
+
+    /**
+     * Get visible method
+     * @return the visible
+     */
+    public Boolean getVisible() {
+        return visible;
+    }
+
+    /**
+     * Set visible method
+     * @param visible the visible to set
+     */
+    public void setVisible(Boolean visible) {
+        this.visible = visible;
+    }
+
+    /**
+     * Each type should name itself
+     * @return Type as String
+     */
+    // TODO : Should be public abstract.
+    //public abstract String getType();
+    public String getType() {
+        return "???";
+    }
+
     /**
      * isValid method
      * @return valid
@@ -545,7 +549,7 @@ public abstract class GraphicObject implements Cloneable {
     public void setValid(Boolean valid) {
         this.valid = valid;
     }
-    
+
     /**
      * isReferenced method
      * @return referenced 
index 3ba824c..9948605 100644 (file)
@@ -292,6 +292,7 @@ public static final String __GO_STYLE__ =                  "Style";
 public static final String __GO_UI_FRAME__ =               "frame";
 public static final String __GO_UI_IMAGERENDERER__ =       "imagerenderer";
 public static final String __GO_UI_PUSHBUTTON__ =          "pushbutton";
+public static final String __GO_UI_RADIOBUTTON__ =         "radiobutton";
 public static final String __GO_UI_TABLE__ =               "table";
 public static final String __GO_UI_TEXT__ =                "text";
 
index 1ec438f..8bb9d94 100644 (file)
@@ -33,6 +33,7 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_MIN__;
 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_RADIOBUTTON__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_RELIEF__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ROWNAMES__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ROWNAMES_SIZE__;
@@ -62,7 +63,7 @@ public class Uicontrol extends GraphicObject {
     private static final double DEFAULT_RED_BACKGROUND = 0.8;
     private static final double DEFAULT_GREEN_BACKGROUND = 0.8;
     private static final double DEFAULT_BLUE_BACKGROUND = 0.8;
-    
+
     private static final double DEFAULT_X = 20.0;
     private static final double DEFAULT_Y = 40.0;
     private static final double DEFAULT_WIDTH = 40.0;
@@ -76,630 +77,640 @@ public class Uicontrol extends GraphicObject {
     private static final String DEFAULTRELIEF = "raised";
 
     private UicontrolStyle style;
-       private Double[] backgroundColor = {DEFAULT_RED_BACKGROUND, DEFAULT_GREEN_BACKGROUND, DEFAULT_BLUE_BACKGROUND};
-       private String[] columnnames = {""};
-       private boolean enable = true;
-       private String fontAngle = DEFAULTFONTANGLE;
-       private String fontName = DEFAULTFONTNAME;
-       private double fontSize = DEFAULTFONTSIZE;
-       private String fontUnits = "points";
-       private String fontWeight = DEFAULTFONTWEIGHT;
-       private Double[] foregroundColor = {0.0, 0.0, 0.0};
-       private String horizontalAlignment = "center";
-       private Integer[] listboxTop; 
-       private int max = 1; 
-       private int min; 
-       private Double[] position = {DEFAULT_X, DEFAULT_Y, DEFAULT_WIDTH, DEFAULT_HEIGHT};
-       private String relief = DEFAULTRELIEF;
-       private String[] rownames = {""};
-       private Double[] scale = {1.0, 1.0};
-       private Double[] shear = {0.0, 0.0};
-       private Double[] sliderStep = {0.01, 0.1};
-       private String[] string = {""};
-       private String[] tabledata = {""};
-       private String units = "pixels";
-       private Integer[] value; 
-       private String verticalAlignment = "middle";
-
-       /**
-        * All uicontrol properties
-        */
-       private enum UicontrolProperty {
-               STYLE,
-               BACKGROUNDCOLOR,
-               COLUMNNAMES,
-               COLUMNNAMES_SIZE,
-               ENABLE,
-               FONTANGLE,
-               FONTNAME,
-               FONTSIZE,
-               FONTUNITS,
-               FONTWEIGHT,
-               FOREGROUNDCOLOR,
-               HORIZONTALALIGNMENT,
-               LISTBOXTOP,
-               LISTBOXTOP_SIZE,
-               MAX,
-               MIN,
-               POSITION,
-               SCALE,
-               SHEAR,
-               SLIDERSTEP,
-               STRING,
-               STRING_SIZE,
-               RELIEF,
-               ROWNAMES,
-               ROWNAMES_SIZE,
-               TABLEDATA,
-               TABLEDATA_SIZE,
-               UNITS,
-               VALUE,
-               VALUE_SIZE,
-               VERTICALALIGNMENT
-       };
-
-       /**
-        * All uicontrol styles
-        */
-       private enum UicontrolStyle {
-               IMAGERENDERER,
-               PUSHBUTTON,
-               TABLE,
-               TEXT
-       };
-
-       /**
-        * Constructor
-        */
-       public Uicontrol() {
-               super();
-       }
-       
-       /**
-        * Get style as a string
-        * @param style the uicontrol style
-        * @return the uicontrol style as a string
-        */
-       private String styleEnumToString(UicontrolStyle style) {
-               if (style == UicontrolStyle.TABLE) {
-                       return __GO_UI_TABLE__;
-               }
-               if (style == UicontrolStyle.IMAGERENDERER) {
-                       return __GO_UI_IMAGERENDERER__;
-               }
-               if (style == UicontrolStyle.PUSHBUTTON) {
-                       return __GO_UI_PUSHBUTTON__;
-               }
-        if (style == UicontrolStyle.TEXT) {
-            return __GO_UI_TEXT__;
+    private Double[] backgroundColor = {DEFAULT_RED_BACKGROUND, DEFAULT_GREEN_BACKGROUND, DEFAULT_BLUE_BACKGROUND};
+    private String[] columnnames = {""};
+    private boolean enable = true;
+    private String fontAngle = DEFAULTFONTANGLE;
+    private String fontName = DEFAULTFONTNAME;
+    private double fontSize = DEFAULTFONTSIZE;
+    private String fontUnits = "points";
+    private String fontWeight = DEFAULTFONTWEIGHT;
+    private Double[] foregroundColor = {0.0, 0.0, 0.0};
+    private String horizontalAlignment = "center";
+    private Integer[] listboxTop; 
+    private int max = 1; 
+    private int min; 
+    private Double[] position = {DEFAULT_X, DEFAULT_Y, DEFAULT_WIDTH, DEFAULT_HEIGHT};
+    private String relief = DEFAULTRELIEF;
+    private String[] rownames = {""};
+    private Double[] scale = {1.0, 1.0};
+    private Double[] shear = {0.0, 0.0};
+    private Double[] sliderStep = {0.01, 0.1};
+    private String[] string = {""};
+    private String[] tabledata = {""};
+    private String units = "pixels";
+    private Integer[] value; 
+    private String verticalAlignment = "middle";
+
+    /**
+     * All uicontrol properties
+     */
+    private enum UicontrolProperty {
+        STYLE,
+        BACKGROUNDCOLOR,
+        COLUMNNAMES,
+        COLUMNNAMES_SIZE,
+        ENABLE,
+        FONTANGLE,
+        FONTNAME,
+        FONTSIZE,
+        FONTUNITS,
+        FONTWEIGHT,
+        FOREGROUNDCOLOR,
+        HORIZONTALALIGNMENT,
+        LISTBOXTOP,
+        LISTBOXTOP_SIZE,
+        MAX,
+        MIN,
+        POSITION,
+        SCALE,
+        SHEAR,
+        SLIDERSTEP,
+        STRING,
+        STRING_SIZE,
+        RELIEF,
+        ROWNAMES,
+        ROWNAMES_SIZE,
+        TABLEDATA,
+        TABLEDATA_SIZE,
+        UNITS,
+        VALUE,
+        VALUE_SIZE,
+        VERTICALALIGNMENT
+    };
+
+    /**
+     * All uicontrol styles
+     */
+    private enum UicontrolStyle {
+        IMAGERENDERER,
+        PUSHBUTTON,
+        RADIOBUTTON,
+        TABLE,
+        TEXT
+    };
+
+    /**
+     * Constructor
+     */
+    public Uicontrol() {
+        super();
+    }
+
+    /**
+     * Get style as a string
+     * @param style the uicontrol style
+     * @return the uicontrol style as a string
+     */
+    private String styleEnumToString(UicontrolStyle style) {
+        String stringStyle = null;
+        switch(style) {
+        case TABLE:
+            stringStyle = __GO_UI_TABLE__;
+            break;
+        case IMAGERENDERER:
+            stringStyle = __GO_UI_IMAGERENDERER__;
+            break;
+        case PUSHBUTTON:
+            stringStyle = __GO_UI_PUSHBUTTON__;
+            break;
+        case RADIOBUTTON:
+            stringStyle = __GO_UI_RADIOBUTTON__;
+            break;
+        case TEXT:
+            stringStyle = __GO_UI_TEXT__;
+            break;
+        default:
+            stringStyle = null;
+            break;
+        }
+        return stringStyle;
+    }
+
+    /**
+     * Get style as an enum element
+     * @param style the uicontrol style
+     * @return the uicontrol style as an enum element
+     */
+    private UicontrolStyle stringToStyleEnum(String style) {
+        UicontrolStyle enumStyle = null;
+        if (style.equals(__GO_UI_TABLE__)) {
+            enumStyle = UicontrolStyle.TABLE;
+        } else if (style.equals(__GO_UI_IMAGERENDERER__)) {
+            enumStyle = UicontrolStyle.IMAGERENDERER;
+        } else if (style.equals(__GO_UI_PUSHBUTTON__)) {
+            enumStyle = UicontrolStyle.PUSHBUTTON;
+        } else if (style.equals(__GO_UI_RADIOBUTTON__)) {
+            enumStyle = UicontrolStyle.RADIOBUTTON;
+        } else if (style.equals(__GO_UI_TEXT__)) {
+            enumStyle = UicontrolStyle.TEXT;
+        }
+        return enumStyle;
+    }
+
+    /**
+     * Get this object type
+     * @return uicontrol
+     * @see org.scilab.modules.graphic_objects.graphicObject.GraphicObject#getType()
+     */
+    public String getType() {
+        return __GO_UICONTROL__;
+    }
+
+    /**
+     * Returns the enum associated to a property name
+     * @param propertyName the property name
+     * @return the property enum
+     */
+    public Object getPropertyFromName(String propertyName) {
+        if (propertyName.equals(__GO_STYLE__)) {
+            return UicontrolProperty.STYLE;
+        } else if (propertyName.equals(__GO_UI_BACKGROUNDCOLOR__)) {
+            return UicontrolProperty.BACKGROUNDCOLOR;
+        } else if (propertyName.equals(__GO_UI_COLUMNNAMES__)) {
+            return UicontrolProperty.COLUMNNAMES;
+        } else if (propertyName.equals(__GO_UI_COLUMNNAMES_SIZE__)) {
+            return UicontrolProperty.COLUMNNAMES_SIZE;
+        } else if (propertyName.equals(__GO_UI_ENABLE__)) {
+            return UicontrolProperty.ENABLE;
+        } else if (propertyName.equals(__GO_UI_FONTANGLE__)) {
+            return UicontrolProperty.FONTANGLE;
+        } else if (propertyName.equals(__GO_UI_FONTNAME__)) {
+            return UicontrolProperty.FONTNAME;
+        } else if (propertyName.equals(__GO_UI_FONTSIZE__)) {
+            return UicontrolProperty.FONTSIZE;
+        } else if (propertyName.equals(__GO_UI_FONTUNITS__)) {
+            return UicontrolProperty.FONTUNITS;
+        } else if (propertyName.equals(__GO_UI_FONTWEIGHT__)) {
+            return UicontrolProperty.FONTWEIGHT;
+        } else if (propertyName.equals(__GO_UI_FOREGROUNDCOLOR__)) {
+            return UicontrolProperty.FOREGROUNDCOLOR;
+        } else if (propertyName.equals(__GO_UI_HORIZONTALALIGNMENT__)) {
+            return UicontrolProperty.HORIZONTALALIGNMENT;
+        } else if (propertyName.equals(__GO_UI_LISTBOXTOP__)) {
+            return UicontrolProperty.LISTBOXTOP;
+        } else if (propertyName.equals(__GO_UI_LISTBOXTOP_SIZE__)) {
+            return UicontrolProperty.LISTBOXTOP_SIZE;
+        } else if (propertyName.equals(__GO_UI_MAX__)) {
+            return UicontrolProperty.MAX;
+        } else if (propertyName.equals(__GO_UI_MIN__)) {
+            return UicontrolProperty.MIN;
+        } else if (propertyName.equals(__GO_POSITION__)) {
+            return UicontrolProperty.POSITION;
+        } else if (propertyName.equals(__GO_UI_RELIEF__)) {
+            return UicontrolProperty.RELIEF;
+        } else if (propertyName.equals(__GO_UI_ROWNAMES__)) {
+            return UicontrolProperty.ROWNAMES;
+        } else if (propertyName.equals(__GO_UI_ROWNAMES_SIZE__)) {
+            return UicontrolProperty.ROWNAMES_SIZE;
+        } else if (propertyName.equals(__GO_UI_SCALE__)) {
+            return UicontrolProperty.SCALE;
+        } else if (propertyName.equals(__GO_UI_SHEAR__)) {
+            return UicontrolProperty.SHEAR;
+        } else if (propertyName.equals(__GO_UI_SLIDERSTEP__)) {
+            return UicontrolProperty.SLIDERSTEP;
+        } else if (propertyName.equals(__GO_UI_STRING__)) {
+            return UicontrolProperty.STRING;
+        } else if (propertyName.equals(__GO_UI_STRING_SIZE__)) {
+            return UicontrolProperty.STRING_SIZE;
+        } else if (propertyName.equals(__GO_UI_TABLEDATA__)) {
+            return UicontrolProperty.TABLEDATA;
+        } else if (propertyName.equals(__GO_UI_TABLEDATA_SIZE__)) {
+            return UicontrolProperty.TABLEDATA_SIZE;
+        } else if (propertyName.equals(__GO_UI_UNITS__)) {
+            return UicontrolProperty.UNITS;
+        } else if (propertyName.equals(__GO_UI_VALUE__)) {
+            return UicontrolProperty.VALUE;
+        } else if (propertyName.equals(__GO_UI_VALUE_SIZE__)) {
+            return UicontrolProperty.VALUE_SIZE;
+        } else if (propertyName.equals(__GO_UI_VERTICALALIGNMENT__)) {
+            return UicontrolProperty.VERTICALALIGNMENT;
+        } else {
+            return super.getPropertyFromName(propertyName);
         }
-               return null;
-       }
-
-       /**
-        * Get style as an enum element
-        * @param style the uicontrol style
-        * @return the uicontrol style as an enum element
-        */
-       private UicontrolStyle stringToStyleEnum(String style) {
-               if (style.equals(__GO_UI_TABLE__)) {
-                       return UicontrolStyle.TABLE;
-               }
-               if (style.equals(__GO_UI_IMAGERENDERER__)) {
-                       return UicontrolStyle.IMAGERENDERER;
-               }
-               if (style.equals(__GO_UI_PUSHBUTTON__)) {
-                       return UicontrolStyle.PUSHBUTTON;
-               }
-        if (style.equals(__GO_UI_TEXT__)) {
-            return UicontrolStyle.TEXT;
+    }
+
+    /**
+     * Fast property get method
+     * @param property the property to get
+     * @return the property value
+     */
+    public Object getProperty(Object property) {
+        if (property == UicontrolProperty.STYLE) {
+            return getStyle();
+        } else if (property == UicontrolProperty.BACKGROUNDCOLOR) {
+            return getBackgroundColor();
+        } else if (property == UicontrolProperty.COLUMNNAMES) {
+            return getColumnNames();
+        } else if (property == UicontrolProperty.COLUMNNAMES_SIZE) {
+            return getColumnNames().length;
+        } else if (property == UicontrolProperty.ENABLE) {
+            return getEnable();
+        } else if (property == UicontrolProperty.FONTANGLE) {
+            return getFontAngle();
+        } else if (property == UicontrolProperty.FONTNAME) {
+            return getFontName();
+        } else if (property == UicontrolProperty.FONTSIZE) {
+            return getFontSize();
+        } else if (property == UicontrolProperty.FONTUNITS) {
+            return getFontUnits();
+        } else if (property == UicontrolProperty.FONTWEIGHT) {
+            return getFontWeight();
+        } else if (property == UicontrolProperty.FOREGROUNDCOLOR) {
+            return getForegroundColor();
+        } else if (property == UicontrolProperty.HORIZONTALALIGNMENT) {
+            return getHorizontalAlignment();
+        } else if (property == UicontrolProperty.LISTBOXTOP) {
+            return getListboxTop();
+        } else if (property == UicontrolProperty.LISTBOXTOP_SIZE) {
+            return getListboxTopSize();
+        } else if (property == UicontrolProperty.MAX) {
+            return getMax();
+        } else if (property == UicontrolProperty.MIN) {
+            return getMin();
+        } else if (property == UicontrolProperty.POSITION) {
+            return getUiPosition();
+        } else if (property == UicontrolProperty.RELIEF) {
+            return getRelief();
+        } else if (property == UicontrolProperty.ROWNAMES) {
+            return getRowNames();
+        } else if (property == UicontrolProperty.ROWNAMES_SIZE) {
+            return getRowNames().length;
+        } else if (property == UicontrolProperty.SCALE) {
+            return getScale();
+        } else if (property == UicontrolProperty.SHEAR) {
+            return getShear();
+        } else if (property == UicontrolProperty.SLIDERSTEP) {
+            return getSliderStep();
+        } else if (property == UicontrolProperty.STRING) {
+            return getString();
+        } else if (property == UicontrolProperty.STRING_SIZE) {
+            return getString().length;
+        } else if (property == UicontrolProperty.TABLEDATA) {
+            return getTableData();
+        } else if (property == UicontrolProperty.TABLEDATA_SIZE) {
+            return getTableData().length;
+        } else if (property == UicontrolProperty.UNITS) {
+            return getUnits();
+        } else if (property == UicontrolProperty.VALUE) {
+            return getUiValue();
+        } else if (property == UicontrolProperty.VALUE_SIZE) {
+            return getUiValueSize();
+        } else if (property == UicontrolProperty.VERTICALALIGNMENT) {
+            return getVerticalAlignment();
+        } else {
+            return super.getProperty(property); 
         }
-               return null;
-       }
-       
-       /**
-        * Get this object type
-        * @return uicontrol
-        * @see org.scilab.modules.graphic_objects.graphicObject.GraphicObject#getType()
-        */
-       public String getType() {
-               return __GO_UICONTROL__;
-       }
-
-       /**
-        * Returns the enum associated to a property name
-        * @param propertyName the property name
-        * @return the property enum
-        */
-       public Object getPropertyFromName(String propertyName) {
-               if (propertyName.equals(__GO_STYLE__)) {
-                       return UicontrolProperty.STYLE;
-               } else if (propertyName.equals(__GO_UI_BACKGROUNDCOLOR__)) {
-                       return UicontrolProperty.BACKGROUNDCOLOR;
-               } else if (propertyName.equals(__GO_UI_COLUMNNAMES__)) {
-                       return UicontrolProperty.COLUMNNAMES;
-               } else if (propertyName.equals(__GO_UI_COLUMNNAMES_SIZE__)) {
-                       return UicontrolProperty.COLUMNNAMES_SIZE;
-               } else if (propertyName.equals(__GO_UI_ENABLE__)) {
-                       return UicontrolProperty.ENABLE;
-               } else if (propertyName.equals(__GO_UI_FONTANGLE__)) {
-                       return UicontrolProperty.FONTANGLE;
-               } else if (propertyName.equals(__GO_UI_FONTNAME__)) {
-                       return UicontrolProperty.FONTNAME;
-               } else if (propertyName.equals(__GO_UI_FONTSIZE__)) {
-                       return UicontrolProperty.FONTSIZE;
-               } else if (propertyName.equals(__GO_UI_FONTUNITS__)) {
-                       return UicontrolProperty.FONTUNITS;
-               } else if (propertyName.equals(__GO_UI_FONTWEIGHT__)) {
-                       return UicontrolProperty.FONTWEIGHT;
-               } else if (propertyName.equals(__GO_UI_FOREGROUNDCOLOR__)) {
-                       return UicontrolProperty.FOREGROUNDCOLOR;
-               } else if (propertyName.equals(__GO_UI_HORIZONTALALIGNMENT__)) {
-                       return UicontrolProperty.HORIZONTALALIGNMENT;
-               } else if (propertyName.equals(__GO_UI_LISTBOXTOP__)) {
-                       return UicontrolProperty.LISTBOXTOP;
-               } else if (propertyName.equals(__GO_UI_LISTBOXTOP_SIZE__)) {
-                       return UicontrolProperty.LISTBOXTOP_SIZE;
-               } else if (propertyName.equals(__GO_UI_MAX__)) {
-                       return UicontrolProperty.MAX;
-               } else if (propertyName.equals(__GO_UI_MIN__)) {
-                       return UicontrolProperty.MIN;
-               } else if (propertyName.equals(__GO_POSITION__)) {
-                       return UicontrolProperty.POSITION;
-               } else if (propertyName.equals(__GO_UI_RELIEF__)) {
-                       return UicontrolProperty.RELIEF;
-               } else if (propertyName.equals(__GO_UI_ROWNAMES__)) {
-                       return UicontrolProperty.ROWNAMES;
-               } else if (propertyName.equals(__GO_UI_ROWNAMES_SIZE__)) {
-                       return UicontrolProperty.ROWNAMES_SIZE;
-               } else if (propertyName.equals(__GO_UI_SCALE__)) {
-                       return UicontrolProperty.SCALE;
-               } else if (propertyName.equals(__GO_UI_SHEAR__)) {
-                       return UicontrolProperty.SHEAR;
-               } else if (propertyName.equals(__GO_UI_SLIDERSTEP__)) {
-                       return UicontrolProperty.SLIDERSTEP;
-               } else if (propertyName.equals(__GO_UI_STRING__)) {
-                       return UicontrolProperty.STRING;
-               } else if (propertyName.equals(__GO_UI_STRING_SIZE__)) {
-                       return UicontrolProperty.STRING_SIZE;
-               } else if (propertyName.equals(__GO_UI_TABLEDATA__)) {
-                       return UicontrolProperty.TABLEDATA;
-               } else if (propertyName.equals(__GO_UI_TABLEDATA_SIZE__)) {
-                       return UicontrolProperty.TABLEDATA_SIZE;
-               } else if (propertyName.equals(__GO_UI_UNITS__)) {
-                       return UicontrolProperty.UNITS;
-               } else if (propertyName.equals(__GO_UI_VALUE__)) {
-                       return UicontrolProperty.VALUE;
-               } else if (propertyName.equals(__GO_UI_VALUE_SIZE__)) {
-                       return UicontrolProperty.VALUE_SIZE;
-               } else if (propertyName.equals(__GO_UI_VERTICALALIGNMENT__)) {
-                       return UicontrolProperty.VERTICALALIGNMENT;
-               } else {
-                       return super.getPropertyFromName(propertyName);
-               }
-       }
-
-       /**
-        * Fast property get method
-        * @param property the property to get
-        * @return the property value
-        */
-       public Object getProperty(Object property) {
-               if (property == UicontrolProperty.STYLE) {
-                       return getStyle();
-               } else if (property == UicontrolProperty.BACKGROUNDCOLOR) {
-                       return getBackgroundColor();
-               } else if (property == UicontrolProperty.COLUMNNAMES) {
-                       return getColumnNames();
-               } else if (property == UicontrolProperty.COLUMNNAMES_SIZE) {
-                       return getColumnNames().length;
-               } else if (property == UicontrolProperty.ENABLE) {
-                       return getEnable();
-               } else if (property == UicontrolProperty.FONTANGLE) {
-                       return getFontAngle();
-               } else if (property == UicontrolProperty.FONTNAME) {
-                       return getFontName();
-               } else if (property == UicontrolProperty.FONTSIZE) {
-                       return getFontSize();
-               } else if (property == UicontrolProperty.FONTUNITS) {
-                       return getFontUnits();
-               } else if (property == UicontrolProperty.FONTWEIGHT) {
-                       return getFontWeight();
-               } else if (property == UicontrolProperty.FOREGROUNDCOLOR) {
-                       return getForegroundColor();
-               } else if (property == UicontrolProperty.HORIZONTALALIGNMENT) {
-                       return getHorizontalAlignment();
-               } else if (property == UicontrolProperty.LISTBOXTOP) {
-                       return getListboxTop();
-               } else if (property == UicontrolProperty.LISTBOXTOP_SIZE) {
-                       return getListboxTopSize();
-               } else if (property == UicontrolProperty.MAX) {
-                       return getMax();
-               } else if (property == UicontrolProperty.MIN) {
-                       return getMin();
-               } else if (property == UicontrolProperty.POSITION) {
-                       return getUiPosition();
-               } else if (property == UicontrolProperty.RELIEF) {
-                       return getRelief();
-               } else if (property == UicontrolProperty.ROWNAMES) {
-                       return getRowNames();
-               } else if (property == UicontrolProperty.ROWNAMES_SIZE) {
-                       return getRowNames().length;
-               } else if (property == UicontrolProperty.SCALE) {
-                       return getScale();
-               } else if (property == UicontrolProperty.SHEAR) {
-                       return getShear();
-               } else if (property == UicontrolProperty.SLIDERSTEP) {
-                       return getSliderStep();
-               } else if (property == UicontrolProperty.STRING) {
-                       return getString();
-               } else if (property == UicontrolProperty.STRING_SIZE) {
-                       return getString().length;
-               } else if (property == UicontrolProperty.TABLEDATA) {
-                       return getTableData();
-               } else if (property == UicontrolProperty.TABLEDATA_SIZE) {
-                       return getTableData().length;
-               } else if (property == UicontrolProperty.UNITS) {
-                       return getUnits();
-               } else if (property == UicontrolProperty.VALUE) {
-                       return getUiValue();
-               } else if (property == UicontrolProperty.VALUE_SIZE) {
-                       return getUiValueSize();
-               } else if (property == UicontrolProperty.VERTICALALIGNMENT) {
-                       return getVerticalAlignment();
-               } else {
-                       return super.getProperty(property); 
-               }
-       }
-
-       /**
-        * Fast property set method
-        * @param property the property to set
-        * @param value the property value
-        * @return true if the property has been set, false otherwise
-        */
-       public boolean setProperty(Object property, Object value) {
-               if (property == UicontrolProperty.STYLE) {
-                       setStyle((String) value);
-               } else if (property == UicontrolProperty.BACKGROUNDCOLOR) {
-                       setBackgroundColor((Double[]) value);
-               } else if (property == UicontrolProperty.COLUMNNAMES) {
-                       setColumnNames((String[]) value);
-               } else if (property == UicontrolProperty.ENABLE) {
-                       setEnable((Boolean) value);
-               } else if (property == UicontrolProperty.FONTANGLE) {
-                       setFontAngle((String) value);
-               } else if (property == UicontrolProperty.FONTNAME) {
-                       setFontName((String) value);
-               } else if (property == UicontrolProperty.FONTSIZE) {
-                       setFontSize((Double) value);
-               } else if (property == UicontrolProperty.FONTUNITS) {
-                       setFontUnits((String) value);
-               } else if (property == UicontrolProperty.FONTWEIGHT) {
-                       setFontWeight((String) value);
-               } else if (property == UicontrolProperty.FOREGROUNDCOLOR) {
-                       setForegroundColor((Double[]) value);
-               } else if (property == UicontrolProperty.HORIZONTALALIGNMENT) {
-                       setHorizontalAlignment((String) value);
-               } else if (property == UicontrolProperty.LISTBOXTOP) {
-                       setListboxTop((Integer[]) value);
-               } else if (property == UicontrolProperty.MAX) {
-                       setMax((Integer) value);
-               } else if (property == UicontrolProperty.MIN) {
-                       setMin((Integer) value);
-               } else if (property == UicontrolProperty.POSITION) {
-                       setUiPosition((Double[]) value);
-               } else if (property == UicontrolProperty.RELIEF) {
-                       setRelief((String) value);
-               } else if (property == UicontrolProperty.ROWNAMES) {
-                       setRowNames((String[]) value);
-               } else if (property == UicontrolProperty.SCALE) {
-                       setScale((Double[]) value);
-               } else if (property == UicontrolProperty.SHEAR) {
-                       setShear((Double[]) value);
-               } else if (property == UicontrolProperty.SLIDERSTEP) {
-                       setSliderStep((Double[]) value);
-               } else if (property == UicontrolProperty.STRING) {
-                       setString((String[]) value);
-               } else if (property == UicontrolProperty.TABLEDATA) {
-                       setTableData((String[]) value);
-               } else if (property == UicontrolProperty.UNITS) {
-                       setUnits((String) value);
-               } else if (property == UicontrolProperty.VALUE) {
-                       setUiValue((Integer[]) value);
-               } else if (property == UicontrolProperty.VERTICALALIGNMENT) {
-                       setVerticalAlignment((String) value);
-               } else {
-                       return super.setProperty(property, value);
-               }
-
-               return true;
-       }
-
-       /**
-        * Get the style
-        * @return the style
-        */
-       public String getStyle() {
-               return styleEnumToString(this.style);
-       }
-
-       /**
-        * Set the style
-        * @param style the style
-        */
-       public void setStyle(String style) {
-               this.style = stringToStyleEnum(style);
-       }
-
-       /* Background Color */
-       public Double[] getBackgroundColor() {
-               return this.backgroundColor;
-       }
-
-       public void setBackgroundColor(Double[] colors) {
-               this.backgroundColor = colors;
-       }
-
-       /**
-        * Get the column names
-        * @return the column names
-        */
-       public String[] getColumnNames() {
-               return this.columnnames;
-       }
-
-       /**
-        * Set the column names
-        * @param columnnames the columnnames
-        */
-       public void setColumnNames(String[] columnnames) {
-               this.columnnames = columnnames;
-       }
-
-       /* Enable */
-       public boolean getEnable() {
-               return this.enable;
-       }
-
-       public void setEnable(boolean status) {
-               this.enable = status;
-       }
-
-       /* FontAngle */
-       public String getFontAngle() {
-               return this.fontAngle;
-       }
-
-       public void setFontAngle(String fontAngle) {
-               this.fontAngle = fontAngle;
-       }
-
-       /* FontName */
-       public String getFontName() {
-               return this.fontName;
-       }
-
-       public void setFontName(String fontName) {
-               this.fontName = fontName;
-       }
-
-       /* FontSize */
-       public double getFontSize() {
-               return this.fontSize;
-       }
-
-       public void setFontSize(double fontSize) {
-               this.fontSize = fontSize;
-       }
-
-       /* FontUnits */
-       public String getFontUnits() {
-               return this.fontUnits;
-       }
-
-       public void setFontUnits(String fontUnits) {
-               this.fontUnits = fontUnits;
-       }
-
-       /* FontWeight */
-       public String getFontWeight() {
-               return this.fontWeight;
-       }
-
-       public void setFontWeight(String fontWeight) {
-               this.fontWeight = fontWeight;
-       }
-
-       /* Foreground Color */
-       public Double[] getForegroundColor() {
-               return this.foregroundColor;
-       }
-
-       public void setForegroundColor(Double[] colors) {
-               this.foregroundColor = colors;
-       }
-
-       /* Horizontal Alignment */
-       public String getHorizontalAlignment() {
-               return this.horizontalAlignment;
-       }
-
-       public void setHorizontalAlignment(String alignment) {
-               this.horizontalAlignment = alignment;
-       }
-
-       /* Listbox Top */
-       public Integer getListboxTopSize() {
-               return (listboxTop != null ? listboxTop.length : 0); 
-       }
-
-       public Integer[] getListboxTop() {
-               return this.listboxTop;
-       }
-
-       public void setListboxTop(Integer[] listboxTop) {
-               this.listboxTop = listboxTop;
-       }
-
-       /* Max */
-       public Integer getMax() {
-               return this.max;
-       }
-
-       public void setMax(Integer max) {
-               this.max = max;
-       }
-
-       /* Min */
-       public Integer getMin() {
-               return this.min;
-       }
-
-       public void setMin(Integer min) {
-               this.min = min;
-       }
-       
-       /* Position */
-       public Double[] getUiPosition() {
-               return this.position;
-       }
-
-       public void setUiPosition(Double[] position) {
-               this.position = position;
-       }
-
-       /* Relief */
-       public String getRelief() {
-               return this.relief;
-       }
-
-       public void setRelief(String relief) {
-               this.relief = relief;
-       }
-
-       /**
-        * Get the row names
-        * @return the row names
-        */
-       public String[] getRowNames() {
-               return this.rownames;
-       }
-
-       /**
-        * Set the row names
-        * @param rownames the rownames
-        */
-       public void setRowNames(String[] rownames) {
-               this.rownames = rownames;
-       }
-
-       /**
-        * Get the string
-        * @return the string
-        */
-       public String[] getString() {
-               return this.string;
-       }
-
-       /**
-        * Set the string
-        * @param string the string
-        */
-       public void setString(String[] string) {
-               this.string = string;
-       }
-
-       /**
-        * Get the scale
-        * @return the scale
-        **/
-       public Double[] getScale() {
-               return this.scale;
-       }
-
-       /**
-        * Set the scale
-        * @param scale the scale
-        **/
-       public void setScale(Double[] scale) {
-               this.scale = scale;
-       }
-
-       /**
-        * Get the shear
-        * @return the shear
-        **/
-       public Double[] getShear() {
-               return this.shear;
-       }
-
-       /**
-        * Set the shear
-        * @param shear the shear
-        **/
-       public void setShear(Double[] shear) {
-               this.shear = shear;
-       }
-
-       /* Slider Step */
-       public Double[] getSliderStep() {
-               return this.sliderStep;
-       }
-
-       public void setSliderStep(Double[] sliderStep) {
-               this.sliderStep = sliderStep;
-       }
-
-       /**
-        * Get the table data
-        * @return the table data
-        */
-       public String[] getTableData() {
-               return this.tabledata;
-       }
-
-       /**
-        * Set the table data
-        * @param tabledata the table data
-        */
-       public void setTableData(String[] tabledata) {
-               this.tabledata = tabledata;
-       }
-
-       /* Units */
-       public String getUnits() {
-               return this.units;
-       }
-
-       public void setUnits(String units) {
-               this.units = units;
-       }
-
-       /* Value */
-       public Integer getUiValueSize() {
-               return (value != null ? value.length : 0); 
-       }
-       
-       public Integer[] getUiValue() {
-               return this.value;
-       }
-
-       public void setUiValue(Integer[] value) {
-               this.value = value;
-       }
-
-       /* Vertical Alignment */
-       public String getVerticalAlignment() {
-               return this.verticalAlignment;
-       }
-
-       public void setVerticalAlignment(String alignment) {
-               this.verticalAlignment = alignment;
-       }
-
-       public void accept(IVisitor visitor) {
-
-       }
+    }
+
+    /**
+     * Fast property set method
+     * @param property the property to set
+     * @param value the property value
+     * @return true if the property has been set, false otherwise
+     */
+    public boolean setProperty(Object property, Object value) {
+        if (property == UicontrolProperty.STYLE) {
+            setStyle((String) value);
+        } else if (property == UicontrolProperty.BACKGROUNDCOLOR) {
+            setBackgroundColor((Double[]) value);
+        } else if (property == UicontrolProperty.COLUMNNAMES) {
+            setColumnNames((String[]) value);
+        } else if (property == UicontrolProperty.ENABLE) {
+            setEnable((Boolean) value);
+        } else if (property == UicontrolProperty.FONTANGLE) {
+            setFontAngle((String) value);
+        } else if (property == UicontrolProperty.FONTNAME) {
+            setFontName((String) value);
+        } else if (property == UicontrolProperty.FONTSIZE) {
+            setFontSize((Double) value);
+        } else if (property == UicontrolProperty.FONTUNITS) {
+            setFontUnits((String) value);
+        } else if (property == UicontrolProperty.FONTWEIGHT) {
+            setFontWeight((String) value);
+        } else if (property == UicontrolProperty.FOREGROUNDCOLOR) {
+            setForegroundColor((Double[]) value);
+        } else if (property == UicontrolProperty.HORIZONTALALIGNMENT) {
+            setHorizontalAlignment((String) value);
+        } else if (property == UicontrolProperty.LISTBOXTOP) {
+            setListboxTop((Integer[]) value);
+        } else if (property == UicontrolProperty.MAX) {
+            setMax((Integer) value);
+        } else if (property == UicontrolProperty.MIN) {
+            setMin((Integer) value);
+        } else if (property == UicontrolProperty.POSITION) {
+            setUiPosition((Double[]) value);
+        } else if (property == UicontrolProperty.RELIEF) {
+            setRelief((String) value);
+        } else if (property == UicontrolProperty.ROWNAMES) {
+            setRowNames((String[]) value);
+        } else if (property == UicontrolProperty.SCALE) {
+            setScale((Double[]) value);
+        } else if (property == UicontrolProperty.SHEAR) {
+            setShear((Double[]) value);
+        } else if (property == UicontrolProperty.SLIDERSTEP) {
+            setSliderStep((Double[]) value);
+        } else if (property == UicontrolProperty.STRING) {
+            setString((String[]) value);
+        } else if (property == UicontrolProperty.TABLEDATA) {
+            setTableData((String[]) value);
+        } else if (property == UicontrolProperty.UNITS) {
+            setUnits((String) value);
+        } else if (property == UicontrolProperty.VALUE) {
+            setUiValue((Integer[]) value);
+        } else if (property == UicontrolProperty.VERTICALALIGNMENT) {
+            setVerticalAlignment((String) value);
+        } else {
+            return super.setProperty(property, value);
+        }
+
+        return true;
+    }
+
+    /**
+     * Get the style
+     * @return the style
+     */
+    public String getStyle() {
+        return styleEnumToString(this.style);
+    }
+
+    /**
+     * Set the style
+     * @param style the style
+     */
+    public void setStyle(String style) {
+        this.style = stringToStyleEnum(style);
+    }
+
+    /* Background Color */
+    public Double[] getBackgroundColor() {
+        return this.backgroundColor;
+    }
+
+    public void setBackgroundColor(Double[] colors) {
+        this.backgroundColor = colors;
+    }
+
+    /**
+     * Get the column names
+     * @return the column names
+     */
+    public String[] getColumnNames() {
+        return this.columnnames;
+    }
+
+    /**
+     * Set the column names
+     * @param columnnames the columnnames
+     */
+    public void setColumnNames(String[] columnnames) {
+        this.columnnames = columnnames;
+    }
+
+    /* Enable */
+    public boolean getEnable() {
+        return this.enable;
+    }
+
+    public void setEnable(boolean status) {
+        this.enable = status;
+    }
+
+    /* FontAngle */
+    public String getFontAngle() {
+        return this.fontAngle;
+    }
+
+    public void setFontAngle(String fontAngle) {
+        this.fontAngle = fontAngle;
+    }
+
+    /* FontName */
+    public String getFontName() {
+        return this.fontName;
+    }
+
+    public void setFontName(String fontName) {
+        this.fontName = fontName;
+    }
+
+    /* FontSize */
+    public double getFontSize() {
+        return this.fontSize;
+    }
+
+    public void setFontSize(double fontSize) {
+        this.fontSize = fontSize;
+    }
+
+    /* FontUnits */
+    public String getFontUnits() {
+        return this.fontUnits;
+    }
+
+    public void setFontUnits(String fontUnits) {
+        this.fontUnits = fontUnits;
+    }
+
+    /* FontWeight */
+    public String getFontWeight() {
+        return this.fontWeight;
+    }
+
+    public void setFontWeight(String fontWeight) {
+        this.fontWeight = fontWeight;
+    }
+
+    /* Foreground Color */
+    public Double[] getForegroundColor() {
+        return this.foregroundColor;
+    }
+
+    public void setForegroundColor(Double[] colors) {
+        this.foregroundColor = colors;
+    }
+
+    /* Horizontal Alignment */
+    public String getHorizontalAlignment() {
+        return this.horizontalAlignment;
+    }
+
+    public void setHorizontalAlignment(String alignment) {
+        this.horizontalAlignment = alignment;
+    }
+
+    /* Listbox Top */
+    public Integer getListboxTopSize() {
+        return (listboxTop != null ? listboxTop.length : 0); 
+    }
+
+    public Integer[] getListboxTop() {
+        return this.listboxTop;
+    }
+
+    public void setListboxTop(Integer[] listboxTop) {
+        this.listboxTop = listboxTop;
+    }
+
+    /* Max */
+    public Integer getMax() {
+        return this.max;
+    }
+
+    public void setMax(Integer max) {
+        this.max = max;
+    }
+
+    /* Min */
+    public Integer getMin() {
+        return this.min;
+    }
+
+    public void setMin(Integer min) {
+        this.min = min;
+    }
+
+    /* Position */
+    public Double[] getUiPosition() {
+        return this.position;
+    }
+
+    public void setUiPosition(Double[] position) {
+        this.position = position;
+    }
+
+    /* Relief */
+    public String getRelief() {
+        return this.relief;
+    }
+
+    public void setRelief(String relief) {
+        this.relief = relief;
+    }
+
+    /**
+     * Get the row names
+     * @return the row names
+     */
+    public String[] getRowNames() {
+        return this.rownames;
+    }
+
+    /**
+     * Set the row names
+     * @param rownames the rownames
+     */
+    public void setRowNames(String[] rownames) {
+        this.rownames = rownames;
+    }
+
+    /**
+     * Get the string
+     * @return the string
+     */
+    public String[] getString() {
+        return this.string;
+    }
+
+    /**
+     * Set the string
+     * @param string the string
+     */
+    public void setString(String[] string) {
+        this.string = string;
+    }
+
+    /**
+     * Get the scale
+     * @return the scale
+     **/
+    public Double[] getScale() {
+        return this.scale;
+    }
+
+    /**
+     * Set the scale
+     * @param scale the scale
+     **/
+    public void setScale(Double[] scale) {
+        this.scale = scale;
+    }
+
+    /**
+     * Get the shear
+     * @return the shear
+     **/
+    public Double[] getShear() {
+        return this.shear;
+    }
+
+    /**
+     * Set the shear
+     * @param shear the shear
+     **/
+    public void setShear(Double[] shear) {
+        this.shear = shear;
+    }
+
+    /* Slider Step */
+    public Double[] getSliderStep() {
+        return this.sliderStep;
+    }
+
+    public void setSliderStep(Double[] sliderStep) {
+        this.sliderStep = sliderStep;
+    }
+
+    /**
+     * Get the table data
+     * @return the table data
+     */
+    public String[] getTableData() {
+        return this.tabledata;
+    }
+
+    /**
+     * Set the table data
+     * @param tabledata the table data
+     */
+    public void setTableData(String[] tabledata) {
+        this.tabledata = tabledata;
+    }
+
+    /* Units */
+    public String getUnits() {
+        return this.units;
+    }
+
+    public void setUnits(String units) {
+        this.units = units;
+    }
+
+    /* Value */
+    public Integer getUiValueSize() {
+        return (value != null ? value.length : 0); 
+    }
+
+    public Integer[] getUiValue() {
+        return this.value;
+    }
+
+    public void setUiValue(Integer[] value) {
+        this.value = value;
+    }
+
+    /* Vertical Alignment */
+    public String getVerticalAlignment() {
+        return this.verticalAlignment;
+    }
+
+    public void setVerticalAlignment(String alignment) {
+        this.verticalAlignment = alignment;
+    }
+
+    public void accept(IVisitor visitor) {
+
+    }
 
 }
diff --git a/scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/uicontrol/radiobutton/RadioButton.java b/scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/uicontrol/radiobutton/RadioButton.java
new file mode 100644 (file)
index 0000000..c4b7595
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - DIGITEO - Vincent COUVERT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.graphic_objects.uicontrol.radiobutton;
+
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_RADIOBUTTON__;
+
+import org.scilab.modules.graphic_objects.uicontrol.Uicontrol;
+
+/**
+ * @author Bruno JOFRET
+ */
+public class RadioButton extends Uicontrol {
+
+    /**
+     * Constructor
+     */
+    public RadioButton() {
+        super();
+        setStyle(__GO_UI_RADIOBUTTON__);
+        setRelief("flat");
+
+        // Default value is the min value (not checked)
+        Integer[] value = new Integer[1];
+        value[0] = getMin();
+        setUiValue(value);
+    }
+
+}
index f39aead..52a87e6 100644 (file)
 @DECLARE@ __GO_UI_FRAME__ @EQUAL@               "frame" @END@
 @DECLARE@ __GO_UI_IMAGERENDERER__ @EQUAL@       "imagerenderer" @END@
 @DECLARE@ __GO_UI_PUSHBUTTON__ @EQUAL@          "pushbutton" @END@
+@DECLARE@ __GO_UI_RADIOBUTTON__ @EQUAL@         "radiobutton" @END@
 @DECLARE@ __GO_UI_TABLE__ @EQUAL@               "table" @END@
 @DECLARE@ __GO_UI_TEXT__ @EQUAL@                "text" @END@
 
index b5e7c03..a5f4924 100644 (file)
@@ -45,16 +45,19 @@ char *CreateUIControl(char *style)
     if (style == NULL || strcmp(style, "pushbutton")==0)
     {
         pobjUID = createGraphicObject(__GO_UI_PUSHBUTTON__);
-        //pUICONTROL_FEATURE(pobj)->relief = RAISED_RELIEF;
-    }
-    else if (strcmp(style,"text")==0)
-    {
-        pobjUID = createGraphicObject(__GO_UI_TEXT__);
     }
     else if (strcmp(style,"imagerenderer")==0)
     {
         pobjUID = createGraphicObject(__GO_UI_IMAGERENDERER__);
     }
+    else if (strcmp(style,"radiobutton")==0)
+    {
+        pobjUID = createGraphicObject(__GO_UI_RADIOBUTTON__);
+    }
+    else if (strcmp(style,"text")==0)
+    {
+        pobjUID = createGraphicObject(__GO_UI_TEXT__);
+    }
     else if (strcmp(style,"table")==0)
     {
         pobjUID = createGraphicObject(__GO_UI_TABLE__);
index 2a0e9f5..46e7d3c 100644 (file)
@@ -30,6 +30,7 @@ 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_IMAGERENDERER__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_PUSHBUTTON__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_RADIOBUTTON__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_RELIEF__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_STRING__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_TABLE__;
@@ -59,6 +60,7 @@ import org.scilab.modules.graphic_objects.graphicView.GraphicView;
 import org.scilab.modules.gui.bridge.imagerenderer.SwingScilabImageRenderer;
 import org.scilab.modules.gui.bridge.label.SwingScilabLabel;
 import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
+import org.scilab.modules.gui.bridge.radiobutton.SwingScilabRadioButton;
 import org.scilab.modules.gui.bridge.tab.SwingScilabTab;
 import org.scilab.modules.gui.bridge.uitable.SwingScilabUiTable;
 import org.scilab.modules.gui.bridge.window.SwingScilabWindow;
@@ -112,6 +114,7 @@ public final class SwingView implements GraphicView {
         Figure,
         ImageRenderer,
         PushButton,
+        RadioButton,
         Table,
         Text
     } 
@@ -179,17 +182,15 @@ public final class SwingView implements GraphicView {
         DEBUG("SwingView", "StyleToEnum(" + style + ")");
         if (style.equals(__GO_FIGURE__)) {
             return UielementType.Figure;
-        }
-        if (style.equals(__GO_UI_IMAGERENDERER__)) {
+        } else if (style.equals(__GO_UI_IMAGERENDERER__)) {
             return UielementType.ImageRenderer;
-        }
-        if (style.equals(__GO_UI_PUSHBUTTON__)) {
+        } else if (style.equals(__GO_UI_PUSHBUTTON__)) {
             return UielementType.PushButton;
-        }
-        if (style.equals(__GO_UI_TABLE__)) {
+        } else if (style.equals(__GO_UI_RADIOBUTTON__)) {
+            return UielementType.RadioButton;
+        } else if (style.equals(__GO_UI_TABLE__)) {
             return UielementType.Table;
-        }
-        if (style.equals(__GO_UI_TEXT__)) {
+        } else if (style.equals(__GO_UI_TEXT__)) {
             return UielementType.Text;
         }
         return null;
@@ -257,23 +258,15 @@ public final class SwingView implements GraphicView {
             imageRenderer.setId(id);
             return imageRenderer;
         case PushButton:
-            SwingScilabPushButton button = new SwingScilabPushButton();
-            button.setId(id);
-            SwingScilabWidget.update(button, __GO_UI_BACKGROUNDCOLOR__, (Double[]) GraphicController.getController().getProperty(id, __GO_UI_BACKGROUNDCOLOR__));
-            SwingScilabWidget.update(button, __GO_UI_ENABLE__, (Boolean) GraphicController.getController().getProperty(id, __GO_UI_ENABLE__));
-            SwingScilabWidget.update(button, __GO_UI_ENABLE__, (Boolean) GraphicController.getController().getProperty(id, __GO_UI_ENABLE__));
-            SwingScilabWidget.update(button, __GO_UI_FONTANGLE__, (String) GraphicController.getController().getProperty(id, __GO_UI_FONTANGLE__));
-            SwingScilabWidget.update(button, __GO_UI_FONTNAME__, (String) GraphicController.getController().getProperty(id, __GO_UI_FONTNAME__));
-            SwingScilabWidget.update(button, __GO_UI_FONTSIZE__, (Double) GraphicController.getController().getProperty(id, __GO_UI_FONTSIZE__));
-            SwingScilabWidget.update(button, __GO_UI_FONTWEIGHT__, (String) GraphicController.getController().getProperty(id, __GO_UI_FONTWEIGHT__));
-            SwingScilabWidget.update(button, __GO_UI_FOREGROUNDCOLOR__, (Double[]) GraphicController.getController().getProperty(id, __GO_UI_FOREGROUNDCOLOR__));
-            SwingScilabWidget.update(button, __GO_UI_HORIZONTALALIGNMENT__, (String) GraphicController.getController().getProperty(id, __GO_UI_HORIZONTALALIGNMENT__));
-            SwingScilabWidget.update(button, __GO_UI_RELIEF__, (String) GraphicController.getController().getProperty(id, __GO_UI_RELIEF__));
-            SwingScilabWidget.update(button, __GO_UI_STRING__, (String[]) GraphicController.getController().getProperty(id, __GO_UI_STRING__));
-            SwingScilabWidget.update(button, __GO_UI_VERTICALALIGNMENT__, (String) GraphicController.getController().getProperty(id, __GO_UI_VERTICALALIGNMENT__));
-            SwingScilabWidget.update(button, __GO_POSITION__, (Double[]) GraphicController.getController().getProperty(id, __GO_POSITION__));
-            SwingScilabWidget.update(button, __GO_VISIBLE__, (Boolean) GraphicController.getController().getProperty(id, __GO_VISIBLE__));
-            return button;
+            SwingScilabPushButton pushButton = new SwingScilabPushButton();
+            pushButton.setId(id);
+            setDefaultProperties(pushButton, id);
+            return pushButton;
+        case RadioButton:
+            SwingScilabRadioButton radioButton = new SwingScilabRadioButton();
+            radioButton.setId(id);
+            setDefaultProperties(radioButton, id);
+            return radioButton;
         case Table:
             SwingScilabUiTable table = new SwingScilabUiTable();
             table.setId(id);
@@ -281,25 +274,48 @@ public final class SwingView implements GraphicView {
         case Text:
             SwingScilabLabel text = new SwingScilabLabel();
             text.setId(id);
-            SwingScilabWidget.update(text, __GO_UI_BACKGROUNDCOLOR__, (Double[]) GraphicController.getController().getProperty(id, __GO_UI_BACKGROUNDCOLOR__));
-            SwingScilabWidget.update(text, __GO_UI_ENABLE__, (Boolean) GraphicController.getController().getProperty(id, __GO_UI_ENABLE__));
-            SwingScilabWidget.update(text, __GO_UI_ENABLE__, (Boolean) GraphicController.getController().getProperty(id, __GO_UI_ENABLE__));
-            SwingScilabWidget.update(text, __GO_UI_FONTANGLE__, (String) GraphicController.getController().getProperty(id, __GO_UI_FONTANGLE__));
-            SwingScilabWidget.update(text, __GO_UI_FONTNAME__, (String) GraphicController.getController().getProperty(id, __GO_UI_FONTNAME__));
-            SwingScilabWidget.update(text, __GO_UI_FONTSIZE__, (Double) GraphicController.getController().getProperty(id, __GO_UI_FONTSIZE__));
-            SwingScilabWidget.update(text, __GO_UI_FONTWEIGHT__, (String) GraphicController.getController().getProperty(id, __GO_UI_FONTWEIGHT__));
-            SwingScilabWidget.update(text, __GO_UI_FOREGROUNDCOLOR__, (Double[]) GraphicController.getController().getProperty(id, __GO_UI_FOREGROUNDCOLOR__));
-            SwingScilabWidget.update(text, __GO_UI_HORIZONTALALIGNMENT__, (String) GraphicController.getController().getProperty(id, __GO_UI_HORIZONTALALIGNMENT__));
-            SwingScilabWidget.update(text, __GO_UI_RELIEF__, (String) GraphicController.getController().getProperty(id, __GO_UI_RELIEF__));
-            SwingScilabWidget.update(text, __GO_UI_STRING__, (String[]) GraphicController.getController().getProperty(id, __GO_UI_STRING__));
-            SwingScilabWidget.update(text, __GO_UI_VERTICALALIGNMENT__, (String) GraphicController.getController().getProperty(id, __GO_UI_VERTICALALIGNMENT__));
-            SwingScilabWidget.update(text, __GO_POSITION__, (Double[]) GraphicController.getController().getProperty(id, __GO_POSITION__));
-            SwingScilabWidget.update(text, __GO_VISIBLE__, (Boolean) GraphicController.getController().getProperty(id, __GO_VISIBLE__));
+            setDefaultProperties(text, id);
             return text;
         default:
             return null;
         }
     }
+    
+    /**
+     * Initialize all poperties according to model
+     * @param uicontrolObject the uicontrol
+     * @param id the uicontrol id
+     */
+    private void setDefaultProperties(SwingViewObject uicontrolObject, String id) {
+        SwingScilabWidget.update((Widget) uicontrolObject, __GO_UI_BACKGROUNDCOLOR__, 
+                (Double[]) GraphicController.getController().getProperty(id, __GO_UI_BACKGROUNDCOLOR__));
+        SwingScilabWidget.update((Widget) uicontrolObject, __GO_UI_ENABLE__, 
+                (Boolean) GraphicController.getController().getProperty(id, __GO_UI_ENABLE__));
+        SwingScilabWidget.update((Widget) uicontrolObject, __GO_UI_ENABLE__, 
+                (Boolean) GraphicController.getController().getProperty(id, __GO_UI_ENABLE__));
+        SwingScilabWidget.update((Widget) uicontrolObject, __GO_UI_FONTANGLE__, 
+                (String) GraphicController.getController().getProperty(id, __GO_UI_FONTANGLE__));
+        SwingScilabWidget.update((Widget) uicontrolObject, __GO_UI_FONTNAME__, 
+                (String) GraphicController.getController().getProperty(id, __GO_UI_FONTNAME__));
+        SwingScilabWidget.update((Widget) uicontrolObject, __GO_UI_FONTSIZE__, 
+                (Double) GraphicController.getController().getProperty(id, __GO_UI_FONTSIZE__));
+        SwingScilabWidget.update((Widget) uicontrolObject, __GO_UI_FONTWEIGHT__, 
+                (String) GraphicController.getController().getProperty(id, __GO_UI_FONTWEIGHT__));
+        SwingScilabWidget.update((Widget) uicontrolObject, __GO_UI_FOREGROUNDCOLOR__, 
+                (Double[]) GraphicController.getController().getProperty(id, __GO_UI_FOREGROUNDCOLOR__));
+        SwingScilabWidget.update((Widget) uicontrolObject, __GO_UI_HORIZONTALALIGNMENT__, 
+                (String) GraphicController.getController().getProperty(id, __GO_UI_HORIZONTALALIGNMENT__));
+        SwingScilabWidget.update((Widget) uicontrolObject, __GO_UI_RELIEF__, 
+                (String) GraphicController.getController().getProperty(id, __GO_UI_RELIEF__));
+        SwingScilabWidget.update((Widget) uicontrolObject, __GO_UI_STRING__, 
+                (String[]) GraphicController.getController().getProperty(id, __GO_UI_STRING__));
+        SwingScilabWidget.update((Widget) uicontrolObject, __GO_UI_VERTICALALIGNMENT__, 
+                (String) GraphicController.getController().getProperty(id, __GO_UI_VERTICALALIGNMENT__));
+        SwingScilabWidget.update((Widget) uicontrolObject, __GO_POSITION__, 
+                (Double[]) GraphicController.getController().getProperty(id, __GO_POSITION__));
+        SwingScilabWidget.update((Widget) uicontrolObject, __GO_VISIBLE__, 
+                (Boolean) GraphicController.getController().getProperty(id, __GO_VISIBLE__));   
+    }
 
     @Override
     public void deleteObject(String id) {
index 4ff7c02..974f3bb 100644 (file)
@@ -15,6 +15,8 @@ package org.scilab.modules.gui.bridge.radiobutton;
 
 import javax.swing.JRadioButton;
 
+import org.scilab.modules.gui.SwingScilabWidget;
+import org.scilab.modules.gui.SwingViewObject;
 import org.scilab.modules.gui.events.callback.CallBack;
 import org.scilab.modules.gui.menubar.MenuBar;
 import org.scilab.modules.gui.radiobutton.SimpleRadioButton;
@@ -32,189 +34,215 @@ import org.scilab.modules.gui.utils.Size;
  * @author Vincent COUVERT
  * @author Marouane BEN JELLOUL
  */
-public class SwingScilabRadioButton extends JRadioButton implements SimpleRadioButton {
-
-       private static final long serialVersionUID = -4094092157137686082L;
-
-       private CallBack callback;
-
-       /**
-        * Constructor
-        */
-       public SwingScilabRadioButton() {
-               super();
-               /* Avoid the L&F to erase user background settings */
-               setContentAreaFilled(false);
-               setOpaque(true);
-       }
-       
-       /**
-        * Draws a swing Scilab RadioButton
-        * @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 RadioButton
-        * @return the dimensions of the RadioButton
-        * @see org.scilab.modules.gui.uielement.UIElement#getDims()
-        */
-       public Size getDims() {
-               return new Size(super.getSize().width, super.getSize().height);
-       }
-
-       /**
-        * Gets the position (X-coordinate and Y-coordinate) of a swing Scilab RadioButton
-        * @return the position of the RadioButton
-        * @see org.scilab.modules.gui.uielement.UIElement#getPosition()
-        */
-       public Position getPosition() {
-               return PositionConverter.javaToScilab(getLocation(), getSize(), getParent());
-       }
-       
-       /**
-        * Sets the dimensions (width and height) of a swing Scilab RadioButton
-        * @param newSize the dimensions to set to the RadioButton
-        * @see org.scilab.modules.gui.uielement.UIElement#setDims(org.scilab.modules.gui.utils.Size)
-        */
-       public void setDims(Size newSize) {
-               super.setSize(newSize.getWidth(), newSize.getHeight());
-       }
-
-       /**
-        * Sets the position (X-coordinate and Y-coordinate) of a swing Scilab RadioButton
-        * @param newPosition the position to set to the RadioButton
-        * @see org.scilab.modules.gui.uielement.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 callback to the RadioButton
-        * @param callback the callback to set.
-        */
-       public void setCallback(CallBack callback) {
-               if (this.callback != null) {
-                       removeActionListener(this.callback);
-               }
-               this.callback = callback;
-               addActionListener(this.callback);
-       }
-
-       /**
-        * Setter for MenuBar
-        * @param menuBarToAdd the MenuBar associated to the Tab.
-        */
-       public void addMenuBar(MenuBar menuBarToAdd) {
-               /* Unimplemented for RadioButtones */
-               throw new UnsupportedOperationException();
-       }
-
-       /**
-        * Setter for ToolBar
-        * @param toolBarToAdd the ToolBar associated to the Tab.
-        */
-       public void addToolBar(ToolBar toolBarToAdd) {
-               /* Unimplemented for RadioButtones */
-               throw new UnsupportedOperationException();
-       }
-
-       /**
-        * Getter for MenuBar
-        * @return MenuBar: the MenuBar associated to the Tab.
-        */
-       public MenuBar getMenuBar() {
-               /* Unimplemented for RadioButtones */
-               throw new UnsupportedOperationException();
-       }
-
-       /**
-        * Getter for ToolBar
-        * @return ToolBar: the ToolBar associated to the Tab.
-        */
-       public ToolBar getToolBar() {
-               /* Unimplemented for RadioButtones */
-               throw new UnsupportedOperationException();
-       }
-       
-       /**
-        * Set the horizontal alignment for the RadioButton text
-        * @param alignment the value for the alignment (See ScilabAlignment.java)
-        */
-       public void setHorizontalAlignment(String alignment) {
-               setHorizontalAlignment(ScilabAlignment.toSwingAlignment(alignment));
-       }
-
-       /**
-        * Set the vertical alignment for the RadioButton text
-        * @param alignment the value for the alignment (See ScilabAlignment.java)
-        */
-       public void setVerticalAlignment(String alignment) {
-               setVerticalAlignment(ScilabAlignment.toSwingAlignment(alignment));
-       }
-       
-       /**
-        * Set if the RadioButton is checked or not
-        * @param status true to set the RadioButton checked
-        */
-       public void setChecked(boolean status) {
-               /* Remove the listener to avoid the callback to be executed */
-               if (this.callback != null) {
-                       removeActionListener(this.callback);
-               }
-
-               setSelected(status);
-
-               /* Put back the listener */
-               if (this.callback != null) {
-                       addActionListener(this.callback);
-               }
-       }
-       
-       /**
-        * Get the status of the RadioButton
-        * @return true if the RadioButton is checked
-        */
-       public boolean isChecked() {
-               return isSelected();
-       }
-
-       /**
-        * Set the Relief of the RadioButton
-        * @param reliefType the type of the relief to set (See ScilabRelief.java)
-        */
-       public void setRelief(String reliefType) {
-               setBorder(ScilabRelief.getBorderFromRelief(reliefType));
-       }
-
-       /**
-        * Destroy the RadioButton
-        */
-       public void destroy() {
-               ScilabSwingUtilities.removeFromParent(this);
-       }
-       
-       /**
-        * Setter for InfoBar
-        * @param infoBarToAdd the InfoBar associated to the RadioButton.
-        */
-       public void addInfoBar(TextBox infoBarToAdd) {
-               /* Unimplemented for RadioButtons */
-               throw new UnsupportedOperationException();
-       }
-
-       /**
-        * Getter for InfoBar
-        * @return the InfoBar associated to the RadioButton.
-        */
-       public TextBox getInfoBar() {
-               /* Unimplemented for RadioButtons */
-               throw new UnsupportedOperationException();
-       }
-
+public class SwingScilabRadioButton extends JRadioButton implements SwingViewObject, SimpleRadioButton {
+
+    private static final long serialVersionUID = -4094092157137686082L;
+
+    private String uid;
+
+    private CallBack callback;
+
+    /**
+     * Constructor
+     */
+    public SwingScilabRadioButton() {
+        super();
+        /* Avoid the L&F to erase user background settings */
+        setContentAreaFilled(false);
+        setOpaque(true);
+    }
+
+    /**
+     * Draws a swing Scilab RadioButton
+     * @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 RadioButton
+     * @return the dimensions of the RadioButton
+     * @see org.scilab.modules.gui.uielement.UIElement#getDims()
+     */
+    public Size getDims() {
+        return new Size(super.getSize().width, super.getSize().height);
+    }
+
+    /**
+     * Gets the position (X-coordinate and Y-coordinate) of a swing Scilab RadioButton
+     * @return the position of the RadioButton
+     * @see org.scilab.modules.gui.uielement.UIElement#getPosition()
+     */
+    public Position getPosition() {
+        return PositionConverter.javaToScilab(getLocation(), getSize(), getParent());
+    }
+
+    /**
+     * Sets the dimensions (width and height) of a swing Scilab RadioButton
+     * @param newSize the dimensions to set to the RadioButton
+     * @see org.scilab.modules.gui.uielement.UIElement#setDims(org.scilab.modules.gui.utils.Size)
+     */
+    public void setDims(Size newSize) {
+        super.setSize(newSize.getWidth(), newSize.getHeight());
+    }
+
+    /**
+     * Sets the position (X-coordinate and Y-coordinate) of a swing Scilab RadioButton
+     * @param newPosition the position to set to the RadioButton
+     * @see org.scilab.modules.gui.uielement.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 callback to the RadioButton
+     * @param callback the callback to set.
+     */
+    public void setCallback(CallBack callback) {
+        if (this.callback != null) {
+            removeActionListener(this.callback);
+        }
+        this.callback = callback;
+        addActionListener(this.callback);
+    }
+
+    /**
+     * Setter for MenuBar
+     * @param menuBarToAdd the MenuBar associated to the Tab.
+     */
+    public void addMenuBar(MenuBar menuBarToAdd) {
+        /* Unimplemented for RadioButtones */
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Setter for ToolBar
+     * @param toolBarToAdd the ToolBar associated to the Tab.
+     */
+    public void addToolBar(ToolBar toolBarToAdd) {
+        /* Unimplemented for RadioButtones */
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Getter for MenuBar
+     * @return MenuBar: the MenuBar associated to the Tab.
+     */
+    public MenuBar getMenuBar() {
+        /* Unimplemented for RadioButtones */
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Getter for ToolBar
+     * @return ToolBar: the ToolBar associated to the Tab.
+     */
+    public ToolBar getToolBar() {
+        /* Unimplemented for RadioButtones */
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Set the horizontal alignment for the RadioButton text
+     * @param alignment the value for the alignment (See ScilabAlignment.java)
+     */
+    public void setHorizontalAlignment(String alignment) {
+        setHorizontalAlignment(ScilabAlignment.toSwingAlignment(alignment));
+    }
+
+    /**
+     * Set the vertical alignment for the RadioButton text
+     * @param alignment the value for the alignment (See ScilabAlignment.java)
+     */
+    public void setVerticalAlignment(String alignment) {
+        setVerticalAlignment(ScilabAlignment.toSwingAlignment(alignment));
+    }
+
+    /**
+     * Set if the RadioButton is checked or not
+     * @param status true to set the RadioButton checked
+     */
+    public void setChecked(boolean status) {
+        /* Remove the listener to avoid the callback to be executed */
+        if (this.callback != null) {
+            removeActionListener(this.callback);
+        }
+
+        setSelected(status);
+
+        /* Put back the listener */
+        if (this.callback != null) {
+            addActionListener(this.callback);
+        }
+    }
+
+    /**
+     * Get the status of the RadioButton
+     * @return true if the RadioButton is checked
+     */
+    public boolean isChecked() {
+        return isSelected();
+    }
+
+    /**
+     * Set the Relief of the RadioButton
+     * @param reliefType the type of the relief to set (See ScilabRelief.java)
+     */
+    public void setRelief(String reliefType) {
+        setBorder(ScilabRelief.getBorderFromRelief(reliefType));
+    }
+
+    /**
+     * Destroy the RadioButton
+     */
+    public void destroy() {
+        ScilabSwingUtilities.removeFromParent(this);
+    }
+
+    /**
+     * Setter for InfoBar
+     * @param infoBarToAdd the InfoBar associated to the RadioButton.
+     */
+    public void addInfoBar(TextBox infoBarToAdd) {
+        /* Unimplemented for RadioButtons */
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Getter for InfoBar
+     * @return the InfoBar associated to the RadioButton.
+     */
+    public TextBox getInfoBar() {
+        /* Unimplemented for RadioButtons */
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Set the UID
+     * @param id the UID
+     */
+    public void setId(String id) {
+        uid = id;
+    }
+
+    /**
+     * Get the UID
+     * @return the UID
+     */
+    public String getId() {
+        return uid;
+    }
+
+    /**
+     * Generic update method
+     * @param property property name
+     * @param value property value
+     */
+    public void update(String property, Object value) {
+        SwingScilabWidget.update(this, property, value);
+    }
 }