GED: General restructuring of lightGED 12/8012/1
Marcos CARDINOT [Tue, 17 Jul 2012 07:11:23 +0000 (04:11 -0300)]
New structures;
bugfixes - show/hide button; change window; change window; color changer;
Adequacy of imports and many others suggested adjustments.

Change-Id: I437b987c8b5ab3fd076d6ccfcc44495671f0bd8b

39 files changed:
scilab/modules/gui/Makefile.am
scilab/modules/gui/etc/graphics_menubar.xml
scilab/modules/gui/etc/graphics_toolbar.xml
scilab/modules/gui/images/icons/16x16/actions/color-fill.png [new file with mode: 0644]
scilab/modules/gui/images/icons/16x16/actions/tree-collapse.png [new file with mode: 0644]
scilab/modules/gui/images/icons/32x32/actions/tree-diagramm-delete.png [new file with mode: 0644]
scilab/modules/gui/images/icons/32x32/actions/tree-diagramm.png [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/editor/Editor.java
scilab/modules/gui/src/java/org/scilab/modules/gui/editor/EditorEventListener.java
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/ColorMapHandler.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/Inspector.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/MessagesGED.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/StartGED.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/SwapObject.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Axes.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/AxisRulers.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/ColorDialog.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/HideAxis.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Label.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Layout.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Position.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Roof.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Style.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/BaseProperties.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/ColorDialog.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/Curve.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/HideCurve.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/Layout.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/Roof.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/Style.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/BaseProperties.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/ColorDialog.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/Control.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/DataProperties.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/Figure.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/HideFigure.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/Layout.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/Roof.java [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/Style.java [new file with mode: 0644]

index d78eaf7..9533343 100644 (file)
@@ -262,7 +262,8 @@ libscigui_la_sci_gateway_DATA = sci_gateway/gui_gateway.xml
 # Generated with:
 #    $ find images/ -type f -printf "%p \\\\\n" -name *.svg -or -name *.gif -or -name *.jpg -or -name *.png |sort -u
 libscigui_la_iconsdir=$(mydatadir)/
-nobase_libscigui_la_icons_DATA = images/icons/16x16/actions/document-new.png \
+nobase_libscigui_la_icons_DATA = images/icons/16x16/actions/color-fill.png \
+images/icons/16x16/actions/document-new.png \
 images/icons/16x16/actions/document-open.png \
 images/icons/16x16/actions/document-open-sci.png \
 images/icons/16x16/actions/document-print.png \
@@ -300,6 +301,7 @@ images/icons/16x16/actions/short.png \
 images/icons/16x16/actions/SizeColumnsToFit.png \
 images/icons/16x16/actions/system-search.png \
 images/icons/16x16/actions/transform-rotate.png \
+images/icons/16x16/actions/tree-collapse.png \
 images/icons/16x16/actions/variable-from-selection.png \
 images/icons/16x16/actions/variable-new.png \
 images/icons/16x16/actions/view-refresh.png \
@@ -340,12 +342,9 @@ images/icons/16x16/status/folder-open.png \
 images/icons/16x16/status/line-found.png \
 images/icons/16x16/status/scilab-folder-open.png \
 images/icons/16x16/status/user-home-open.png \
-images/icons/256x256/apps/accessories-text-editor.png \
-images/icons/256x256/apps/puffin.png \
-images/icons/256x256/apps/rrze_table.png \
-images/icons/256x256/apps/system-search.png \
-images/icons/256x256/apps/utilities-system-monitor.png \
 images/icons/32x32/actions/edit-clear.png \
+images/icons/32x32/actions/tree-diagramm.png \
+images/icons/32x32/actions/tree-diagramm-delete.png \
 images/icons/32x32/apps/accessories-text-editor.png \
 images/icons/32x32/apps/datatips.png \
 images/icons/32x32/apps/graphic-window.png \
@@ -367,6 +366,11 @@ images/icons/64x40/mimetypes/application-x-scilab-plot2d.png \
 images/icons/64x40/mimetypes/application-x-scilab-plot3d.png \
 images/icons/64x40/mimetypes/application-x-scilab-Sgrayplot.png \
 images/icons/64x40/mimetypes/application-x-scilab-surf.png \
+images/icons/256x256/apps/accessories-text-editor.png \
+images/icons/256x256/apps/puffin.png \
+images/icons/256x256/apps/rrze_table.png \
+images/icons/256x256/apps/system-search.png \
+images/icons/256x256/apps/utilities-system-monitor.png \
 images/icons/aboutscilab.png \
 images/icons/check-icon.png \
 images/icons/close-tab-on.png \
index 2d9318c..07790b3 100644 (file)
     <submenu label="Stop datatip manager">
       <callback instruction='org.scilab.modules.gui.datatip.DatatipManagerMode.setDatatipManagerModeButtonOff' type="3"/>
     </submenu>
+    <separator/>
+    <submenu label="Scilab Graphic Editor - GED">
+      <submenu label="&amp;Quick Editor">
+        <callback instruction="org.scilab.modules.gui.ged.StartGED.quickGED" type="3"/>
+      </submenu>
+    </submenu>
   </menu>
   
   <!--
index 5cbf874..3187986 100644 (file)
   <button icon="datatips" tooltiptext="toggle datatip mode">
     <callback instruction="org.scilab.modules.gui.datatip.DatatipManagerMode.setDatatipManagerModeToggle" type="3"/>
   </button>
+  <!-- Scilab Graphic Editor -->
+  <button icon="plot" tooltiptext="Initialize the graphics editor">
+    <callback instruction="org.scilab.modules.gui.ged.StartGED.quickGED" type="3"/>
+  </button>
   <separator/>
   <!-- Help -->
   <button icon="help-browser" tooltiptext="Help Browser">
diff --git a/scilab/modules/gui/images/icons/16x16/actions/color-fill.png b/scilab/modules/gui/images/icons/16x16/actions/color-fill.png
new file mode 100644 (file)
index 0000000..85f8010
Binary files /dev/null and b/scilab/modules/gui/images/icons/16x16/actions/color-fill.png differ
diff --git a/scilab/modules/gui/images/icons/16x16/actions/tree-collapse.png b/scilab/modules/gui/images/icons/16x16/actions/tree-collapse.png
new file mode 100644 (file)
index 0000000..64a4bc7
Binary files /dev/null and b/scilab/modules/gui/images/icons/16x16/actions/tree-collapse.png differ
diff --git a/scilab/modules/gui/images/icons/32x32/actions/tree-diagramm-delete.png b/scilab/modules/gui/images/icons/32x32/actions/tree-diagramm-delete.png
new file mode 100644 (file)
index 0000000..9c0b08c
Binary files /dev/null and b/scilab/modules/gui/images/icons/32x32/actions/tree-diagramm-delete.png differ
diff --git a/scilab/modules/gui/images/icons/32x32/actions/tree-diagramm.png b/scilab/modules/gui/images/icons/32x32/actions/tree-diagramm.png
new file mode 100644 (file)
index 0000000..2c69b43
Binary files /dev/null and b/scilab/modules/gui/images/icons/32x32/actions/tree-diagramm.png differ
index dc38764..4e3cfc9 100644 (file)
@@ -28,7 +28,7 @@ import org.scilab.modules.gui.editor.SystemClipboard;
 import org.scilab.modules.gui.editor.PolylineHandler;
 import org.scilab.modules.gui.editor.LabelHandler;
 import org.scilab.modules.gui.editor.LegendHandler;
-
+import org.scilab.modules.gui.ged.Inspector;
 import org.scilab.modules.localization.Messages;
 
 
@@ -49,12 +49,12 @@ import org.scilab.modules.localization.Messages;
 public class Editor {
 
     JPopupMenu menu;
-    JMenuItem copy, cut, paste, delete, clear, hide, unhide, clipboardCopy, labelX, labelY, labelZ, insert, remove;
+    JMenuItem copy, cut, paste, delete, clear, hide, unhide, clipboardCopy, labelX, labelY, labelZ, insert, remove, ged;
     JMenu labels, legends;
 
     String selected = null;
     String figureUid = null;
-    Integer oriColor = 0;
+    private static Integer oriColor = 0;
     Integer[] lastClick = { 0, 0 };
 
     Component dialogComponent;
@@ -119,6 +119,9 @@ public class Editor {
         insert.setToolTipText(Messages.gettext("Insert a legend to current selected item"));
         remove = new JMenuItem(Messages.gettext("Remove"));
         remove.setToolTipText(Messages.gettext("Remove a legend of current selected item"));
+        ged = new JMenuItem("Open Quick Editor");
+        ged.setToolTipText(Messages.gettext("Initialize the graphics editor"));
+
 
         copy.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent actionEvent) {
@@ -198,6 +201,11 @@ public class Editor {
             }
         });
 
+        ged.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent actionEvent) {
+                onClickGED();
+            }
+        });
 
         labels.add(labelX);
         labels.add(labelY);
@@ -218,6 +226,7 @@ public class Editor {
         menu.addSeparator();
         menu.add(labels);
         menu.add(legends);
+        menu.add(ged);
 
     }
 
@@ -255,6 +264,24 @@ public class Editor {
     }
 
     /**
+    * Get current color of the polyline line/mark.
+    *
+    * @return Returns the current color of the polyline.
+    */
+    public static Integer getOriColor() {
+        return oriColor;
+    }
+
+    /**
+    * Set current color of the polyline line/mark.
+    *
+    * @param newScilabColor Color selected by user.
+    */
+    public static void setOriColor(Integer newScilabColor) {
+        oriColor = newScilabColor;
+    }
+
+    /**
     * Returns selected polyline unique identifier.
     * @return selected polyline uid or null if there isn't any selected.
     */
@@ -402,5 +429,11 @@ public class Editor {
         String axesTo = AxesHandler.clickedAxes(figureUid, lastClick);
         LegendHandler.removeLegend(axesTo, selected);
     }
-}
 
+    /**
+    * Starts the GED with the property of the Figure.
+    */
+    public void onClickGED() {
+       Inspector.createGuiInspector("figure" , figureUid);
+    }
+}
index 0557da0..fb50b24 100644 (file)
@@ -18,23 +18,26 @@ import java.awt.event.KeyListener;
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
 import java.awt.event.MouseMotionListener;
+import java.util.ArrayList;
 
 import org.scilab.modules.graphic_objects.graphicController.GraphicController;
 import org.scilab.modules.graphic_objects.graphicObject.GraphicObject.Type;
 import org.scilab.modules.graphic_objects.graphicObject.*;
 
-import org.scilab.modules.gui.editor.Editor;
-import org.scilab.modules.gui.editor.PolylineHandler;
-import org.scilab.modules.gui.editor.ObjectSearcher;
-
 import org.scilab.modules.gui.datatip.DatatipCreate;
-import org.scilab.modules.gui.datatip.MarkerCreate;
-import org.scilab.modules.gui.datatip.DatatipSelect;
 import org.scilab.modules.gui.datatip.DatatipDelete;
 import org.scilab.modules.gui.datatip.DatatipManagerMode;
+import org.scilab.modules.gui.datatip.DatatipSelect;
+import org.scilab.modules.gui.datatip.MarkerCreate;
 
-import java.util.ArrayList;
 import org.scilab.modules.gui.editor.AxesHandler;
+import org.scilab.modules.gui.editor.Editor;
+import org.scilab.modules.gui.editor.PolylineHandler;
+import org.scilab.modules.gui.editor.ObjectSearcher;
+
+import org.scilab.modules.gui.ged.Inspector;
+import org.scilab.modules.gui.ged.SwapObject;
+
 
 /**
 * Event listener for the figure editor.
@@ -153,11 +156,18 @@ public class EditorEventListener implements KeyListener, MouseListener, MouseMot
     */
     public void mousePressed(MouseEvent arg0) {
         if (arg0.getButton() == 1) {
-            picked = ep.pick( windowUid, arg0.getX(), arg0.getY() );
+            picked = ep.pick(windowUid, arg0.getX(), arg0.getY());
             editor.setSelected(picked);
-        } else if (arg0.getButton() == 3) {
-
-        }
+            // Part responsible for the exchange of properties of the GED.
+            //If the GED is open, so the code is executed.
+            if (Inspector.window != null) {
+                if (picked == null) {
+                    new SwapObject("axes or figure", windowUid, (Integer) arg0.getX(), (Integer) arg0.getY());
+            } else {
+                    new SwapObject("curve", picked, 0, 0);
+               }
+            }
+        } else if (arg0.getButton() == 3) { }
     }
 
     /**
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/ColorMapHandler.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/ColorMapHandler.java
new file mode 100644 (file)
index 0000000..a1610a0
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged;
+
+import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
+
+/**
+* Handler's Color Map
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class ColorMapHandler {
+    private static final double MAXRGB = 255.0;
+
+    /**
+    * Get the index corresponding to an RGB code.
+    *
+    * @param red color.
+    * @param green color.
+    * @param blue color.
+    * @param figureID Enters the identification of Figure.
+    * @return Index of the color map corresponding to the color selected by the user.
+    */
+    public static Integer getScilabColor(double red, double green, double blue, String figureID) {
+        Double[] selectedColor = rgbTOscilab(red, green, blue);
+        Integer scilabColor = searchScilabColor(figureID, selectedColor);
+        return scilabColor;
+    }
+
+    /**
+    * Get the RGB code corresponding to an index.
+    *
+    * @param scilabColor Index of the color map corresponding to the color current.
+    * @param figureID Enters the identification of Figure.
+    * @return Code RGB.
+    */
+    public static Double[] getRGBcolor(String figureID, Integer scilabColor) {
+        Double[] scilabRGBcolor = searchRGBcolor(figureID, scilabColor);
+        Double[] rgbColor = scilabTOrgb(scilabRGBcolor[0], scilabRGBcolor[1], scilabRGBcolor[2]);
+        return rgbColor;
+    }
+
+    /**
+    * Converts the RGB code for scilabRGB.
+    *
+    * @param red color in RGB code.
+    * @param green color in RGB code.
+    * @param blue color in RGB code.
+    * @return Color in the new format.
+    */
+    private static Double[] rgbTOscilab(double red, double green, double blue) {
+        Double[] selectedColor = new Double[3];
+        selectedColor[0] = red / MAXRGB;
+        selectedColor[1] = green / MAXRGB;
+        selectedColor[2] = blue / MAXRGB;
+        return selectedColor;
+    }
+
+    /**
+    * Converts the scilabRGB code for RGB.
+    *
+    * @param redSci color.
+    * @param greenSci color.
+    * @param blueSci color.
+    * @return Color in the new format.
+    */
+    private static Double[] scilabTOrgb(Double redSci, Double greenSci, Double blueSci) {
+        Double[] rgbColor = new Double[3];
+        rgbColor[0] = redSci * MAXRGB;
+        rgbColor[1] = greenSci * MAXRGB;
+        rgbColor[2] = blueSci * MAXRGB;
+        return rgbColor;
+    }
+
+    /**
+    * Adds a new color in the colormap.
+    *
+    * @param size Enters the identification of Figure.
+    * @param colormap Current colormap.
+    * @param selectedColor Selected color by user.
+    * @return New color map with a color insert.
+    */
+    private static Double[] addNewColor(int size, Double[] colormap, Double[] selectedColor) {
+        int newsize = 3 * size + 3;
+        Double[] newColorMap = new Double[newsize];
+        newColorMap[size] = selectedColor[0];
+        newColorMap[2 * size + 1] = selectedColor[1];
+        newColorMap[3 * size + 2] = selectedColor[2];
+        for (int j = 0; j < newsize - 3; j++) {
+            for (int w = 0; w < 3; w++) {
+                if (newColorMap[j + w] == null) {
+                    newColorMap[j + w] = colormap[j];
+                    break;
+                }
+            }
+        }
+        return newColorMap;
+    }
+
+    /**
+    * Checks if there is a color in the color map, if it does not exist, will be added.
+    *
+    * @param figureID Enters the identification of Figure.
+    * @param selectedColor Selected color by user.
+    * @return Index of the color map corresponding to the color selected by the user.
+    */
+    private static Integer searchScilabColor(String figureID, Double[] selectedColor) {
+        int size = (Integer) GraphicController.getController()
+                   .getProperty(figureID, GraphicObjectProperties.__GO_COLORMAP_SIZE__);
+
+        Double[] colormap = (Double[]) GraphicController.getController()
+                            .getProperty(figureID, GraphicObjectProperties.__GO_COLORMAP__);
+
+        int scilabColor = 0;
+
+        if (size == 0) {
+            GraphicController.getController()
+            .setProperty(figureID, GraphicObjectProperties.__GO_COLORMAP__, selectedColor);
+            scilabColor = 1;
+        }
+
+        for (int i = 0; i < size; i++) {
+            if (selectedColor[0].equals(colormap[i])
+            && selectedColor[1].equals(colormap[size + i])
+            && selectedColor[2].equals(colormap[2 * size + i])) {
+                scilabColor = i + 1;
+                break;
+            } else {
+                if (i == size - 1) {
+                    Double[] newColorMap = addNewColor(size, colormap, selectedColor);
+                    GraphicController.getController()
+                            .setProperty(figureID, GraphicObjectProperties.__GO_COLORMAP__, newColorMap);
+                    scilabColor = i + 2;
+                }
+            }
+        }
+        return scilabColor;
+    }
+
+    /**
+    * Checks the RGB code of an index of a color map.
+    *
+    * @param figureID Enters the identification of Figure.
+    * @param scilabColor Index of the color map corresponding to the color current.
+    * @return Color in RGB format converted to the color map of the scilab.
+    */
+    private static Double[] searchRGBcolor(String figureID, Integer scilabColor) {
+        int size = (Integer) GraphicController.getController()
+                   .getProperty(figureID, GraphicObjectProperties.__GO_COLORMAP_SIZE__);
+
+        Double[] colormap = (Double[]) GraphicController.getController()
+                            .getProperty(figureID, GraphicObjectProperties.__GO_COLORMAP__);
+
+        Double[] scilabRGBcolor = new Double[3];
+        if (scilabColor < 1 || scilabColor > size) {
+            if (scilabColor.equals(-2) || scilabColor.equals(size + 2)) {
+                scilabRGBcolor[0] = 1.0;
+                scilabRGBcolor[1] = 1.0;
+                scilabRGBcolor[2] = 1.0;
+            } else {
+                scilabRGBcolor[0] = 0.0;
+                scilabRGBcolor[1] = 0.0;
+                scilabRGBcolor[2] = 0.0;
+            }
+        } else {
+            scilabRGBcolor[0] = colormap[scilabColor - 1];
+            scilabRGBcolor[1] = colormap[size + scilabColor - 1];
+            scilabRGBcolor[2] = colormap[2 * size + scilabColor - 1];
+        }
+        return scilabRGBcolor;
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/Inspector.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/Inspector.java
new file mode 100644 (file)
index 0000000..742db35
--- /dev/null
@@ -0,0 +1,239 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged;
+
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JToggleButton;
+import javax.swing.LayoutStyle;
+import javax.swing.SwingConstants;
+import javax.swing.ScrollPaneConstants;
+import javax.swing.WindowConstants;
+
+import org.scilab.modules.gui.ged.axes.HideAxis;
+import org.scilab.modules.gui.ged.curve.HideCurve;
+import org.scilab.modules.gui.ged.figure.HideFigure;
+
+/**
+* Main properties window - Light GED.
+* Receive the classes of graphic objects (JPanels).
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class Inspector extends JFrame {
+    public static String selectaux;
+    public static Inspector window;
+    public static JPanel pReceive;
+    public static JToggleButton bHideShow;
+    private JScrollPane desktop;
+    private JPanel pMenu;
+    private static String imagepath = System.getenv("SCI") + "/modules/gui/images/icons/";
+    public static String icon_color_fill = imagepath + "16x16/actions/color-fill.png";
+    public static String icon_collapse = imagepath + "16x16/actions/tree-collapse.png";
+    public static String icon_expand = imagepath + "16x16/actions/media-playback-start.png";
+    public static String icon_collapse_all = imagepath + "32x32/actions/tree-diagramm.png";
+    public static String icon_expand_all = imagepath + "32x32/actions/tree-diagramm-delete.png";
+
+    /**
+    * Constructor - Initializes the inspection window.
+    *
+    * @param select Indicates which property window will open.
+    * @param objectID Enters the identification of object.
+    */
+    public Inspector(String select , String objectID) {
+        guiComponents();
+        setIcons();
+        position();
+        initLayout();
+        new SwapObject(select, objectID, 1, 1);
+        selectaux = select;
+    }
+
+    /**
+    * If lightGED not yet started it creates a JFrame.
+    *
+    * @param select Indicates which property window will open initially.
+    * @param objectID Enters the identification of object.
+    * @return Shows the lightGED was generated.
+    */
+    public static Inspector createGuiInspector(String select , String objectID) {
+        if (window == null) {
+            window = new Inspector(select, objectID);
+        }
+        return window;
+    }
+
+    /**
+    * Manages the operation of the button show/hide for the current object.
+    *
+    * @param evt ActionEvent
+    */
+    private void bHideShowActionPerformed(ActionEvent evt) {
+        if (selectaux.equals("axes")) {
+            if (bHideShow.isSelected()) {
+                new HideAxis(true);
+            } else {
+                new HideAxis(false);
+            }
+        } else {
+            if (selectaux.equals("curve")) {
+                if (bHideShow.isSelected()) {
+                    new HideCurve(true);
+                } else {
+                    new HideCurve(false);
+                }
+            } else {
+                if (bHideShow.isSelected()) {
+                    new HideFigure(true);
+                } else {
+                    new HideFigure(false);
+                }
+            }
+        }
+    }
+
+    /**
+    * It has all the components of the main window.
+    */
+    private void guiComponents() {
+        pMenu = new JPanel();
+        bHideShow = new JToggleButton();
+        desktop = new JScrollPane();
+        pReceive = new JPanel();
+
+        setVisible(true);
+        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+        /**
+        * Implements an event button to close the window.
+        * Resets the variable responsible for identifying if the window is open.
+        */
+        addWindowListener(new WindowListener() {
+        public void windowClosing(WindowEvent evt) {
+            window = null;
+        }
+        public void windowClosed(WindowEvent evt) {
+            window = null;
+        }
+        public void windowOpened(WindowEvent evt) { }
+        public void windowIconified(WindowEvent evt) { }
+        public void windowDeiconified(WindowEvent evt) { }
+        public void windowActivated(WindowEvent evt) { }
+        public void windowDeactivated(WindowEvent evt) { }
+        });
+
+        setResizable(false);
+
+        pMenu.setBorder(BorderFactory.createEtchedBorder());
+        pMenu.setMaximumSize(new java.awt.Dimension(370, 30));
+        pMenu.setMinimumSize(new java.awt.Dimension(370, 30));
+        pMenu.setPreferredSize(new java.awt.Dimension(370, 30));
+
+        bHideShow.setToolTipText(MessagesGED.collapse_expand);
+        bHideShow.setAlignmentY(0.0F);
+        bHideShow.setContentAreaFilled(false);
+        bHideShow.setHorizontalTextPosition(SwingConstants.CENTER);
+        bHideShow.setMaximumSize(new Dimension(20, 20));
+        bHideShow.setMinimumSize(new Dimension(20, 20));
+        bHideShow.setPreferredSize(new Dimension(20, 20));
+        bHideShow.setRolloverEnabled(false);
+        bHideShow.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bHideShowActionPerformed(evt);
+            }
+        });
+
+        desktop.setBorder(null);
+        desktop.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+        desktop.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
+        desktop.setAlignmentX(0.0F);
+        desktop.setAlignmentY(0.0F);
+        desktop.setPreferredSize(new java.awt.Dimension(370, 584));
+
+        pReceive.setAlignmentX(0.0F);
+        pReceive.setAlignmentY(0.0F);
+        pReceive.setPreferredSize(new Dimension(370, 780));
+
+        desktop.setViewportView(pReceive);
+    }
+
+    /**
+    * Positioning all the components of the Inspector.
+    */
+    private void position() {
+        //Positioning the components of the menu.
+        GroupLayout pMenuLayout = new GroupLayout(pMenu);
+        pMenu.setLayout(pMenuLayout);
+        pMenuLayout.setHorizontalGroup(
+            pMenuLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pMenuLayout.createSequentialGroup()
+                .addGap(4, 4, 4)
+                .addComponent(bHideShow, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+        );
+        pMenuLayout.setVerticalGroup(
+            pMenuLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pMenuLayout.createSequentialGroup()
+                .addGap(2, 2, 2)
+                .addComponent(bHideShow, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+        );
+
+        //Positioning the inner panel
+        GroupLayout pReceiveLayout = new GroupLayout(pReceive);
+        pReceive.setLayout(pReceiveLayout);
+        pReceiveLayout.setHorizontalGroup(
+            pReceiveLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGap(0, 370, Short.MAX_VALUE)
+        );
+        pReceiveLayout.setVerticalGroup(
+            pReceiveLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGap(0, 780, Short.MAX_VALUE)
+        );
+    }
+
+    /**
+    * Creates layout of all components.
+    */
+    private void initLayout() {
+        GroupLayout layout = new GroupLayout(getContentPane());
+        getContentPane().setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addComponent(pMenu, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+            .addComponent(desktop, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addComponent(pMenu, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(desktop, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+        );
+        pack();
+    }
+
+    /**
+    * Insert the icons on buttons.
+    */
+    private void setIcons() {
+        bHideShow.setIcon(new ImageIcon(icon_collapse_all));
+        bHideShow.setSelectedIcon(new ImageIcon(icon_expand_all));
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/MessagesGED.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/MessagesGED.java
new file mode 100644 (file)
index 0000000..8c68d6b
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged;
+
+import org.scilab.modules.localization.Messages;
+
+/**
+ * All messages used in GED.
+ *
+ * @author cardinot
+ */
+public class MessagesGED {
+    //Inspector - Labels
+    public static final String collapse_expand = Messages.gettext("Collapse/Expand Properties");
+
+    //Base Properties - Labels
+    public static final String visible = Messages.gettext("Visible");
+    public static final String base_properties = Messages.gettext("Base Properties");
+    public static final String on = Messages.gettext("On");
+    public static final String off = Messages.gettext("Off");
+
+    //ColorDialog
+    public static final String choose_background_color = Messages.gettext("Choose Background Color");
+    public static final String choose_foreground_color = Messages.gettext("Choose Foreground Color");
+    public static final String choose_font_color = Messages.gettext("Choose Font Color");
+
+    //Style/Appearance - Labels
+    public static final String style_appearance = Messages.gettext("Style/Appearance");
+    public static final String background_color = Messages.gettext("Background Color");
+    public static final String foreground_color = Messages.gettext("Foreground Color");
+    public static final String line_style = Messages.gettext("Line Style");
+    public static final String solid = Messages.gettext("solid");
+    public static final String dash = Messages.gettext("dash");
+    public static final String dash_dot = Messages.gettext("dash dot");
+    public static final String longdash_dot = Messages.gettext("longdash dot");
+    public static final String bigdash_dot = Messages.gettext("bigdash dot");
+    public static final String bigdash_longdash = Messages.gettext("bigdash longdash");
+    public static final String dot = Messages.gettext("dot");
+    public static final String double_dot = Messages.gettext("double dot");
+    public static final String polyline_style = Messages.gettext("Polyline Style");
+    public static final String interpolated = Messages.gettext("interpolated");
+    public static final String staircase = Messages.gettext("staircase");
+    public static final String barplot = Messages.gettext("barplot");
+    public static final String bar = Messages.gettext("bar");
+    public static final String arrowed = Messages.gettext("arrowed");
+    public static final String filled = Messages.gettext("filled");
+
+    public static final String pixmap = Messages.gettext("Pixmap");
+    public static final String pixel_drawing_mode = Messages.gettext("Pixel Drawing Mode");
+    public static final String rotation_style = Messages.gettext("Rotation Style");
+    public static final String unary = Messages.gettext("unary");
+    public static final String multiple = Messages.gettext("multiple");
+
+    public static final String font_color = Messages.gettext("Font Color");
+    public static final String font_style = Messages.gettext("Font Style");
+
+    //Data - Labels
+    public static final String data = Messages.gettext("Data");
+    public static final String figure_id = Messages.gettext("Figure ID");
+    public static final String figure_name = Messages.gettext("Figure Name");
+    public static final String units = Messages.gettext("Units");
+
+    //Data - Tooltip
+    public static final String figure_id_tooltip = Messages.gettext("Number of current figure.");
+    public static final String figure_name_tooltip = Messages.gettext("Enter a figure name.");
+
+    //Control - Labels
+    public static final String control = Messages.gettext("Control");
+    public static final String auto_resize = Messages.gettext("Auto Resize");
+    public static final String x_position = Messages.gettext("X Position");
+    public static final String y_position = Messages.gettext("Y Position");
+    public static final String x_size = Messages.gettext("X Size");
+    public static final String y_size = Messages.gettext("Y Size");
+
+    //Control - Tooltip
+    public static final String x_position_tooltip = Messages.gettext("Enter a x position.");
+    public static final String y_position_tooltip = Messages.gettext("Enter a y position.");
+    public static final String x_size_tooltip = Messages.gettext("Enter a x size.");
+    public static final String y_size_tooltip = Messages.gettext("Enter a y size.");
+
+    //Axis Rulers - Labels
+    public static final String axis_rulers = Messages.gettext("Axis Rulers");
+    public static final String location = Messages.gettext("Location");
+    public static final String bottom = Messages.gettext("bottom");
+    public static final String middle = Messages.gettext("middle");
+    public static final String origin = Messages.gettext("origin");
+    public static final String top = Messages.gettext("top");
+    public static final String left = Messages.gettext("left");
+    public static final String right = Messages.gettext("right");
+    public static final String reverse = Messages.gettext("Reverse");
+
+    //Label - Labels
+    public static final String label = Messages.gettext("Label");
+    public static final String title_page = Messages.gettext("Title Page");
+    public static final String axis_title = Messages.gettext("Axis Title");
+
+    //Position - Labels
+    public static final String position = Messages.gettext("Position");
+    public static final String axes_bounds = Messages.gettext("Axes Bounds");
+    public static final String up = Messages.gettext("Up");
+    public static final String width = Messages.gettext("Width");
+    public static final String height = Messages.gettext("Height");
+    public static final String margins = Messages.gettext("Margins");
+}
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/StartGED.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/StartGED.java
new file mode 100644 (file)
index 0000000..a5f5d12
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged;
+
+import org.scilab.modules.gui.editor.EditorEventListener;
+
+/**
+ * Manages the action of the buttons on the toolbar and menubar.
+ *
+ * @author Marcos Cardinot
+ */
+ public class StartGED {
+
+    /**
+    * Initializes the lightGED.
+    */
+    public static void quickGED() {
+        Inspector.createGuiInspector("figure" , EditorEventListener.windowUid);
+    }
+}
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/SwapObject.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/SwapObject.java
new file mode 100644 (file)
index 0000000..0033900
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged;
+
+import java.awt.Dimension;
+import javax.swing.JPanel;
+import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
+import org.scilab.modules.gui.editor.AxesHandler;
+import org.scilab.modules.gui.ged.axes.Axes;
+import org.scilab.modules.gui.ged.curve.Curve;
+import org.scilab.modules.gui.ged.figure.Figure;
+
+/**
+* Manager object exchange.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class SwapObject {
+    /**
+    * Manager which property window will open.
+    *
+    * @param select Name of the object chosen.
+    * @param objectID Enters the identification of object.
+    * @param clickX x coordinate of mouse.
+    * @param clickY y coordinate of mouse.
+    */
+    public SwapObject(String select, String objectID, Integer clickX, Integer clickY) {
+        if (select.equals("curve")) {
+            curve(objectID);
+        } else {
+            Integer[] position = new Integer[2];
+            position[0] = clickX;
+            position[1] = clickY;
+            String axesID = AxesHandler.clickedAxes(objectID, position);
+            Double[] axesMargins = (Double[]) GraphicController.getController()
+                                   .getProperty(axesID, GraphicObjectProperties.__GO_MARGINS__);
+            Double left, right, top, bottom;
+
+            left = axesMargins[0];
+            right = axesMargins[1];
+            top = axesMargins[2];
+            bottom = axesMargins[3];
+
+            Integer[] axesSize = (Integer[])GraphicController.getController()
+                                 .getProperty(objectID, GraphicObjectProperties.__GO_AXES_SIZE__);
+            Integer x, y;
+
+            x = axesSize[0];
+            y = axesSize[1];
+
+            Double leftBorder, rightBorder, bottomBorder, topBorder;
+
+            leftBorder = left * x;
+            rightBorder = x - right * x;
+            bottomBorder = bottom * y;
+            topBorder = y - top * y;
+
+            if (position[0] > leftBorder && position[0] < rightBorder && position[1] > bottomBorder && position[1] < topBorder) {
+                axes(axesID);
+            } else {
+                figure(objectID);
+            }
+        }
+    }
+
+    /**
+    * Loads the properties of the axis.
+    *
+    * @param axesID Enters the identification of axis.
+    */
+    private void axes(String axesID) {
+        Inspector.pReceive.removeAll();
+        Inspector.pReceive.repaint();
+        Inspector.bHideShow.setSelected(false);
+        JPanel received = new Axes(axesID);
+        received.setBounds(2, 0, 348, 780);
+        received.setVisible(true);
+        Inspector.pReceive.add(received);
+        Inspector.pReceive.setPreferredSize(new Dimension(370, 780));
+        Inspector.selectaux = "axes";
+    }
+
+    /**
+    * Loads the properties of the curve.
+    *
+    * @param objectID Enters the identification of curve.
+    */
+    private void curve(String objectID) {
+        Inspector.pReceive.removeAll();
+        Inspector.pReceive.repaint();
+        Inspector.bHideShow.setSelected(false);
+        JPanel received = new Curve(objectID);
+        received.setBounds(2, 0, 348, 300);
+        received.setVisible(true);
+        Inspector.pReceive.add(received);
+        Inspector.pReceive.setPreferredSize(new Dimension(370, 300));
+        Inspector.selectaux = "curve";
+    }
+
+    /**
+    * Loads the properties of the figure.
+    *
+    * @param objectID Enters the identification of figure.
+    */
+    private void figure(String objectID) {
+        Inspector.pReceive.removeAll();
+        Inspector.pReceive.repaint();
+        Inspector.bHideShow.setSelected(false);
+        JPanel received = new Figure(objectID);
+        received.setBounds(2, 0, 348, 600);
+        received.setVisible(true);
+        Inspector.pReceive.add(received);
+        Inspector.pReceive.setPreferredSize(new Dimension(370, 600));
+        Inspector.selectaux = "figure";
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Axes.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Axes.java
new file mode 100644 (file)
index 0000000..7dacced
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.axes;
+
+/**
+* Properties of the Axes.
+* Last child.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class Axes extends Layout {
+    /**
+    * Initializes the components of the JPanel.
+    *
+    * @param objectID Enters the identification of Axis.
+    */
+    public Axes(String objectID) {
+        super(objectID);
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/AxisRulers.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/AxisRulers.java
new file mode 100644 (file)
index 0000000..2c1e422
--- /dev/null
@@ -0,0 +1,548 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.axes;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JToggleButton;
+
+import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
+import org.scilab.modules.gui.ged.Inspector;
+import org.scilab.modules.gui.ged.MessagesGED;
+
+/**
+* Construction and startup of all components of the section: Axis Rulers.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class AxisRulers extends Roof {
+    //Header - Axis Rulers
+    protected static JToggleButton bAxisRulers;
+    protected JLabel lAxisRulers;
+    protected JSeparator sAxisRulers;
+    public static JPanel pAxisRulers;
+    //Components of the property: Location
+    protected static JToggleButton bLocation;
+    protected JLabel lLocation;
+    protected JLabel cLocation;
+    protected static JPanel pLocation;
+    protected JLabel lLocationX;
+    protected JComboBox cLocationX;
+    protected JLabel lLocationY;
+    protected JComboBox cLocationY;
+    //Components of the property: Reverse
+    protected static JToggleButton bReverse;
+    protected JLabel lReverse;
+    protected JLabel cReverse;
+    protected static JPanel pReverse;
+    protected JLabel lReverseX;
+    protected JComboBox cReverseX;
+    protected JLabel lReverseY;
+    protected JComboBox cReverseY;
+    protected JLabel lReverseZ;
+    protected JComboBox cReverseZ;
+
+    protected String currentaxes = null;
+
+    /**
+    * Initializes the properties and the icons of the buttons.
+    *
+    * @param objectID Enters the identification of Axes.
+    */
+    public AxisRulers(String objectID) {
+        position();
+        setIconsAxisRulers();
+        initPropertiesAxisRulers(objectID);
+    }
+
+    /**
+    * It has all the components of the section Axis Rulers.
+    */
+    @Override
+    public void axisRulersComponents() {
+        //Header
+        bAxisRulers = new JToggleButton();
+        lAxisRulers = new JLabel();
+        sAxisRulers = new JSeparator();
+        pAxisRulers = new JPanel();
+        //Location
+        bLocation = new JToggleButton();
+        lLocation = new JLabel();
+        cLocation = new JLabel();
+        pLocation = new JPanel();
+        lLocationX = new JLabel();
+        cLocationX = new JComboBox();
+        lLocationY = new JLabel();
+        cLocationY = new JComboBox();
+        //Reverse
+        bReverse = new JToggleButton();
+        lReverse = new JLabel();
+        cReverse = new JLabel();
+        pReverse = new JPanel();
+        lReverseX = new JLabel();
+        cReverseX = new JComboBox();
+        lReverseY = new JLabel();
+        cReverseY = new JComboBox();
+        lReverseZ = new JLabel();
+        cReverseZ = new JComboBox();
+
+        //Components of the header: Axis Rulers
+        bAxisRulers.setBorder(null);
+        bAxisRulers.setBorderPainted(false);
+        bAxisRulers.setContentAreaFilled(false);
+        bAxisRulers.setMaximumSize(new Dimension(16, 16));
+        bAxisRulers.setMinimumSize(new Dimension(16, 16));
+        bAxisRulers.setPreferredSize(new Dimension(16, 16));
+        bAxisRulers.setRolloverEnabled(false);
+        bAxisRulers.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bAxisRulersActionPerformed(evt);
+            }
+        });
+
+        lAxisRulers.setText(MessagesGED.axis_rulers);
+
+        sAxisRulers.setPreferredSize(new Dimension(50, 2));
+
+        //Components of the property: Location.
+        lLocation.setBackground(new Color(255, 255, 255));
+        lLocation.setText(" " + MessagesGED.location);
+        lLocation.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lLocation.setOpaque(true);
+        lLocation.setPreferredSize(new Dimension(120, 16));
+
+        cLocation.setBackground(new Color(255, 255, 255));
+        cLocation.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cLocation.setOpaque(true);
+
+        bLocation.setSelected(true);
+        bLocation.setBorder(null);
+        bLocation.setBorderPainted(false);
+        bLocation.setContentAreaFilled(false);
+        bLocation.setMaximumSize(new Dimension(16, 16));
+        bLocation.setMinimumSize(new Dimension(16, 16));
+        bLocation.setPreferredSize(new Dimension(16, 16));
+        bLocation.setRolloverEnabled(false);
+        bLocation.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bLocationActionPerformed(evt);
+            }
+        });
+
+        pLocation.setVisible(false);
+
+        lLocationX.setBackground(new Color(255, 255, 255));
+        lLocationX.setText(" X");
+        lLocationX.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lLocationX.setOpaque(true);
+
+        cLocationX.setModel(new DefaultComboBoxModel(new String[] {
+            MessagesGED.bottom, MessagesGED.top, MessagesGED.middle, MessagesGED.origin
+        }));
+        cLocationX.setPreferredSize(new Dimension(89, 20));
+        cLocationX.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cLocationXActionPerformed(evt);
+            }
+        });
+
+        lLocationY.setBackground(new Color(255, 255, 255));
+        lLocationY.setText(" Y");
+        lLocationY.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lLocationY.setOpaque(true);
+
+        cLocationY.setModel(new DefaultComboBoxModel(new String[] {
+            MessagesGED.middle, MessagesGED.origin, MessagesGED.left, MessagesGED.right
+        }));
+        cLocationY.setPreferredSize(new Dimension(84, 20));
+        cLocationY.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cLocationYActionPerformed(evt);
+            }
+        });
+
+        titleLocation();
+
+        //Positioning the components of the property: Location.
+        GroupLayout pLocationLayout = new GroupLayout(pLocation);
+        pLocation.setLayout(pLocationLayout);
+        pLocationLayout.setHorizontalGroup(
+            pLocationLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pLocationLayout.createSequentialGroup()
+                .addComponent(lLocationX, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cLocationX, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pLocationLayout.createSequentialGroup()
+                .addComponent(lLocationY, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cLocationY, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+        );
+        pLocationLayout.setVerticalGroup(
+            pLocationLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pLocationLayout.createSequentialGroup()
+                .addGroup(pLocationLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lLocationX, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cLocationX, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pLocationLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lLocationY, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cLocationY, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+        );
+
+
+        //Components of the property: Reverse.
+        lReverse.setBackground(new Color(255, 255, 255));
+        lReverse.setText(" " + MessagesGED.reverse);
+        lReverse.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lReverse.setOpaque(true);
+        lReverse.setPreferredSize(new Dimension(120, 16));
+
+        cReverse.setBackground(new Color(255, 255, 255));
+        cReverse.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cReverse.setOpaque(true);
+
+        bReverse.setSelected(true);
+        bReverse.setBorder(null);
+        bReverse.setBorderPainted(false);
+        bReverse.setContentAreaFilled(false);
+        bReverse.setMaximumSize(new Dimension(16, 16));
+        bReverse.setMinimumSize(new Dimension(16, 16));
+        bReverse.setPreferredSize(new Dimension(16, 16));
+        bReverse.setRolloverEnabled(false);
+        bReverse.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bReverseActionPerformed(evt);
+            }
+        });
+
+        pReverse.setVisible(false);
+
+        lReverseX.setBackground(new Color(255, 255, 255));
+        lReverseX.setText(" X");
+        lReverseX.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lReverseX.setOpaque(true);
+
+        cReverseX.setModel(new DefaultComboBoxModel(new String[] {MessagesGED.off, MessagesGED.on}));
+        cReverseX.setPreferredSize(new Dimension(58, 20));
+        cReverseX.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cReverseXActionPerformed(evt);
+            }
+        });
+
+        lReverseY.setBackground(new Color(255, 255, 255));
+        lReverseY.setText(" Y");
+        lReverseY.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lReverseY.setOpaque(true);
+
+        cReverseY.setModel(new DefaultComboBoxModel(new String[] {MessagesGED.off, MessagesGED.on}));
+        cReverseY.setPreferredSize(new Dimension(58, 20));
+        cReverseY.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cReverseYActionPerformed(evt);
+            }
+        });
+
+        lReverseZ.setBackground(new Color(255, 255, 255));
+        lReverseZ.setText(" Z");
+        lReverseZ.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lReverseZ.setOpaque(true);
+
+        cReverseZ.setModel(new DefaultComboBoxModel(new String[] {MessagesGED.off, MessagesGED.on}));
+        cReverseZ.setPreferredSize(new Dimension(58, 20));
+        cReverseZ.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cReverseZActionPerformed(evt);
+            }
+        });
+        titleReverse();
+
+        //Positioning the components of the property: Reverse.
+        GroupLayout pReverseLayout = new GroupLayout(pReverse);
+        pReverse.setLayout(pReverseLayout);
+        pReverseLayout.setHorizontalGroup(
+            pReverseLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pReverseLayout.createSequentialGroup()
+                .addComponent(lReverseX, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cReverseX, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pReverseLayout.createSequentialGroup()
+                .addComponent(lReverseY, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cReverseY, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pReverseLayout.createSequentialGroup()
+                .addComponent(lReverseZ, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cReverseZ, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+        );
+        pReverseLayout.setVerticalGroup(
+            pReverseLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pReverseLayout.createSequentialGroup()
+                .addGroup(pReverseLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lReverseX, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cReverseX, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pReverseLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lReverseY, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cReverseY, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pReverseLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lReverseZ, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cReverseZ, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+        );
+    }
+
+    /**
+    * Positioning all the components of the Axis Rulers.
+    */
+    private void position() {
+        //Positioning all components.
+        GroupLayout pAxisRulersLayout = new GroupLayout(pAxisRulers);
+        pAxisRulers.setLayout(pAxisRulersLayout);
+        pAxisRulersLayout.setHorizontalGroup(
+            pAxisRulersLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pAxisRulersLayout.createSequentialGroup()
+                .addComponent(bLocation, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(2, 2, 2)
+                .addComponent(lLocation, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cLocation, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pAxisRulersLayout.createSequentialGroup()
+                .addComponent(bReverse, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(2, 2, 2)
+                .addComponent(lReverse, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cReverse, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pAxisRulersLayout.createSequentialGroup()
+                .addGap(18, 18, 18)
+                .addGroup(pAxisRulersLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(pLocation, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(pReverse, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+        );
+        pAxisRulersLayout.setVerticalGroup(
+            pAxisRulersLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pAxisRulersLayout.createSequentialGroup()
+                .addGroup(pAxisRulersLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(pAxisRulersLayout.createSequentialGroup()
+                        .addGap(3, 3, 3)
+                        .addComponent(bLocation, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                    .addComponent(lLocation, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cLocation, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addComponent(pLocation, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(5, 5, 5)
+                .addGroup(pAxisRulersLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(pAxisRulersLayout.createSequentialGroup()
+                        .addGap(3, 3, 3)
+                        .addComponent(bReverse, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                    .addComponent(lReverse, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cReverse, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addComponent(pReverse, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+        );
+    }
+
+    /**
+    * Loads the current properties of the section Axis Rulers.
+    *
+    * @param axesID Enters the identification of Axes.
+    */
+    private void initPropertiesAxisRulers(String axesID) {
+        if (axesID != null) {
+            currentaxes = axesID;
+            /** Get the current status of the property: Location */
+            int currentLocationX = (Integer) GraphicController.getController()
+                    .getProperty(currentaxes, GraphicObjectProperties.__GO_X_AXIS_LOCATION__);
+            cLocationX.setSelectedIndex(currentLocationX);
+            int currentLocationY = (Integer) GraphicController.getController()
+                    .getProperty(currentaxes, GraphicObjectProperties.__GO_Y_AXIS_LOCATION__);
+            cLocationY.setSelectedIndex(currentLocationY - 2);
+
+            /** Get the current status of the property: Reverse */
+            boolean currentReverseX = (Boolean) GraphicController.getController()
+                    .getProperty(currentaxes, GraphicObjectProperties.__GO_X_AXIS_REVERSE__);
+            if (currentReverseX) {
+                cReverseX.setSelectedIndex(1);
+            } else {
+                cReverseX.setSelectedIndex(0);
+            }
+            boolean currentReverseY = (Boolean) GraphicController.getController()
+                    .getProperty(currentaxes, GraphicObjectProperties.__GO_Y_AXIS_REVERSE__);
+            if (currentReverseX) {
+                cReverseY.setSelectedIndex(1);
+            } else {
+                cReverseY.setSelectedIndex(0);
+            }
+            boolean currentReverseZ = (Boolean) GraphicController.getController()
+                    .getProperty(currentaxes, GraphicObjectProperties.__GO_Z_AXIS_REVERSE__);
+            if (currentReverseX) {
+                cReverseZ.setSelectedIndex(1);
+            } else {
+                cReverseZ.setSelectedIndex(0);
+            }
+        }
+    }
+
+    /**
+    * Insert the icons on buttons.
+    */
+    private void setIconsAxisRulers() {
+        bAxisRulers.setIcon(new ImageIcon(Inspector.icon_collapse));
+        bAxisRulers.setSelectedIcon(new ImageIcon(Inspector.icon_expand));
+        bLocation.setIcon(new ImageIcon(Inspector.icon_collapse));
+        bLocation.setSelectedIcon(new ImageIcon(Inspector.icon_expand));
+        bReverse.setIcon(new ImageIcon(Inspector.icon_collapse));
+        bReverse.setSelectedIcon(new ImageIcon(Inspector.icon_expand));
+    }
+
+    /**
+    * Implement the action button to show/hide.
+    * 
+    * @param evt ActionEvent.
+    */
+    private void bAxisRulersActionPerformed(ActionEvent evt) {
+        if (bAxisRulers.isSelected()) {
+            pAxisRulers.setVisible(false);
+        } else {
+            pAxisRulers.setVisible(true);
+        }
+    }
+
+    /**
+    * Implement the action button to show/hide.
+    * 
+    * @param evt ActionEvent.
+    */
+    private void bLocationActionPerformed(ActionEvent evt) {
+        if (bLocation.isSelected()) {
+            pLocation.setVisible(false);
+        } else {
+            pLocation.setVisible(true);
+        }
+    }
+
+    /**
+    * Implement the action button to show/hide.
+    * 
+    * @param evt ActionEvent.
+    */
+    private void bReverseActionPerformed(ActionEvent evt) {
+        if (bReverse.isSelected()) {
+            pReverse.setVisible(false);
+        } else {
+            pReverse.setVisible(true);
+        }
+    }
+
+    /**
+    * Inserts the current situation of the location of the axis on the main label.
+    */
+    public void titleLocation(){
+        String titleLocationx = cLocationX.getSelectedItem().toString();
+        String titleLocationy = cLocationY.getSelectedItem().toString();
+        String titleLocation = titleLocationx + " , " + titleLocationy;
+        cLocation.setText(" [" + titleLocation + "]");
+    }
+
+    /**
+    * Inserts the current state of functionality: REVERSE in main label.
+    */
+    public void titleReverse(){
+        String titleReverseX = cReverseX.getSelectedItem().toString();
+        String titleReverseY = cReverseY.getSelectedItem().toString();
+        String titleReverseZ = cReverseZ.getSelectedItem().toString();
+        String titleReverse = titleReverseX + " , " + titleReverseY + " , " + titleReverseZ;
+        cReverse.setText(" [" + titleReverse + "]");
+    }
+
+    /**
+    * Updates the property: x Location.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cLocationXActionPerformed(ActionEvent evt) {
+        int setLocationX = cLocationX.getSelectedIndex();
+        GraphicController.getController()
+                .setProperty(currentaxes, GraphicObjectProperties.__GO_X_AXIS_LOCATION__, setLocationX);
+        titleLocation();
+    }
+
+    /**
+    * Updates the property: y Location.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cLocationYActionPerformed(ActionEvent evt) {
+        int setLocationY = cLocationY.getSelectedIndex();
+        GraphicController.getController()
+                .setProperty(currentaxes, GraphicObjectProperties.__GO_Y_AXIS_LOCATION__, setLocationY + 2);
+        titleLocation();
+    }
+
+    /**
+    * Updates the property: x Reverse.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cReverseXActionPerformed(ActionEvent evt) {
+        boolean setReverseX = true;
+        if (cReverseX.getSelectedIndex() == 0) {
+            setReverseX = false;
+        }
+        GraphicController.getController()
+                .setProperty(currentaxes, GraphicObjectProperties.__GO_X_AXIS_REVERSE__, setReverseX);
+        titleReverse();
+    }
+
+    /**
+    * Updates the property: y Reverse.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cReverseYActionPerformed(ActionEvent evt) {
+        boolean setReverseY = true;
+        if (cReverseY.getSelectedIndex() == 0) {
+            setReverseY = false;
+        }
+        GraphicController.getController()
+                .setProperty(currentaxes, GraphicObjectProperties.__GO_Y_AXIS_REVERSE__, setReverseY);
+        titleReverse();
+    }
+
+    /**
+    * Updates the property: z Reverse.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cReverseZActionPerformed(ActionEvent evt) {
+        boolean setReverseZ = true;
+        if (cReverseZ.getSelectedIndex() == 0) {
+            setReverseZ = false;
+        }
+        GraphicController.getController()
+                .setProperty(currentaxes, GraphicObjectProperties.__GO_Z_AXIS_REVERSE__, setReverseZ);
+        titleReverse();
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/ColorDialog.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/ColorDialog.java
new file mode 100644 (file)
index 0000000..cf5b680
--- /dev/null
@@ -0,0 +1,263 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.axes;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.GroupLayout;
+import javax.swing.JButton;
+import javax.swing.JColorChooser;
+import javax.swing.JDialog;
+import javax.swing.LayoutStyle;
+
+import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
+import org.scilab.modules.gui.ged.ColorMapHandler;
+import org.scilab.modules.gui.ged.MessagesGED;
+
+/**
+* Implementation of the windows to color selection.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class ColorDialog extends Style {
+    protected JColorChooser chooser;
+    protected JButton okBack;
+    protected Color choice;
+
+    protected JColorChooser chooser1;
+    protected JButton okFore;
+    protected Color choice1;
+
+    protected JColorChooser chooser2;
+    protected JButton okFont;
+    protected Color choice2;
+
+    /**
+    * Receives and passes the objectID to the parent class.
+    *
+    * @param objectID Enters the identification of Axes.
+    */
+    public ColorDialog(String objectID) {
+        super(objectID);
+    }
+
+    /**
+    * JDialog - Selection of background colors.
+    */
+    @Override
+    public void dialogBackgroundColor() {
+        backColorDialog = new JDialog();
+        chooser = new JColorChooser();
+        okBack = new JButton();
+
+        backColorDialog.setTitle(MessagesGED.choose_background_color);
+        backColorDialog.setMinimumSize(new Dimension(670, 450));
+        backColorDialog.setModal(true);
+        backColorDialog.setResizable(false);
+
+        okBack.setText("OK");
+        okBack.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                okBackActionPerformed(evt);
+            }
+        });
+
+        GroupLayout backColorDialogLayout = new GroupLayout(backColorDialog.getContentPane());
+        backColorDialog.getContentPane().setLayout(backColorDialogLayout);
+        backColorDialogLayout.setHorizontalGroup(
+            backColorDialogLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(backColorDialogLayout.createSequentialGroup()
+                .addComponent(chooser, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(0, 10, Short.MAX_VALUE))
+            .addGroup(GroupLayout.Alignment.TRAILING, backColorDialogLayout.createSequentialGroup()
+                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                .addComponent(okBack)
+                .addContainerGap())
+        );
+        backColorDialogLayout.setVerticalGroup(
+            backColorDialogLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(backColorDialogLayout.createSequentialGroup()
+                .addComponent(chooser, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(okBack)
+                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+        );
+    }
+
+    /**
+    * JDialog - Selection of foreground colors.
+    */
+    @Override
+    public void dialogForegroundColor() {        
+        foreColorDialog = new JDialog();
+        chooser1 = new JColorChooser();
+        okFore = new JButton();
+
+        foreColorDialog.setTitle(MessagesGED.choose_foreground_color);
+        foreColorDialog.setMinimumSize(new Dimension(670, 450));
+        foreColorDialog.setModal(true);
+        foreColorDialog.setResizable(false);
+
+        okFore.setText("OK");
+        okFore.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                okForeActionPerformed(evt);
+            }
+        });
+
+        GroupLayout foreColorDialogLayout = new GroupLayout(foreColorDialog.getContentPane());
+        foreColorDialog.getContentPane().setLayout(foreColorDialogLayout);
+        foreColorDialogLayout.setHorizontalGroup(
+            foreColorDialogLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(foreColorDialogLayout.createSequentialGroup()
+                .addComponent(chooser1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(0, 10, Short.MAX_VALUE))
+            .addGroup(GroupLayout.Alignment.TRAILING, foreColorDialogLayout.createSequentialGroup()
+                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                .addComponent(okFore)
+                .addContainerGap())
+        );
+        foreColorDialogLayout.setVerticalGroup(
+            foreColorDialogLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(foreColorDialogLayout.createSequentialGroup()
+                .addComponent(chooser1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(okFore)
+                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+        );
+    }
+
+    /**
+    * JDialog - Selection of font colors.
+    */
+    @Override
+    public void dialogFontColor() {
+        fontColorDialog = new JDialog();
+        chooser2 = new JColorChooser();
+        okFont = new JButton();
+
+        fontColorDialog.setTitle(MessagesGED.choose_font_color);
+        fontColorDialog.setMinimumSize(new Dimension(670, 450));
+        fontColorDialog.setModal(true);
+        fontColorDialog.setResizable(false);
+
+        okFont.setText("OK");
+        okFont.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                okFontActionPerformed(evt);
+            }
+        });
+
+        GroupLayout fontColorDialogLayout = new GroupLayout(fontColorDialog.getContentPane());
+        fontColorDialog.getContentPane().setLayout(fontColorDialogLayout);
+        fontColorDialogLayout.setHorizontalGroup(
+            fontColorDialogLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(fontColorDialogLayout.createSequentialGroup()
+                .addComponent(chooser2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(0, 10, Short.MAX_VALUE))
+            .addGroup(GroupLayout.Alignment.TRAILING, fontColorDialogLayout.createSequentialGroup()
+                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                .addComponent(okFont)
+                .addContainerGap())
+        );
+        fontColorDialogLayout.setVerticalGroup(
+            fontColorDialogLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(fontColorDialogLayout.createSequentialGroup()
+                .addComponent(chooser2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(okFont)
+                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+        );
+    }
+
+    /**
+    * Implement the action on the OK button to save the color chosen by the user.
+    *
+    * @param evt ActionEvent.
+    */
+    private void okBackActionPerformed(ActionEvent evt) {
+        choice = chooser.getColor();
+        double red = choice.getRed();
+        double green = choice.getGreen();
+        double blue = choice.getBlue();
+        Integer scilabColor = ColorMapHandler.getScilabColor(red, green, blue, parentFigure);
+        setBackgroungColor(scilabColor);
+        cBackColor.setBackground(choice);
+        backColorDialog.dispose();
+    }
+
+    /**
+    * Implement the action on the OK button to save the color chosen by the user.
+    *
+    * @param evt ActionEvent.
+    */
+    private void okForeActionPerformed(ActionEvent evt) {
+        choice1 = chooser1.getColor();
+        double red = choice1.getRed();
+        double green = choice1.getGreen();
+        double blue = choice1.getBlue();
+        Integer scilabColor = ColorMapHandler.getScilabColor(red, green, blue, parentFigure);
+        setForegroundColor(scilabColor);
+        cForeColor.setBackground(choice1);
+        foreColorDialog.dispose();
+    }
+
+    /**
+    * Implement the action on the OK button to save the color chosen by the user.
+    *
+    * @param evt ActionEvent.
+    */
+    private void okFontActionPerformed(ActionEvent evt) {
+        choice2 = chooser2.getColor();
+        double red = choice2.getRed();
+        double green = choice2.getGreen();
+        double blue = choice2.getBlue();
+        Integer scilabColor = ColorMapHandler.getScilabColor(red, green, blue, parentFigure);
+        setFontColor(scilabColor);
+        cFontColor.setBackground(choice2);
+        fontColorDialog.dispose();
+    }
+
+    /**
+    * Change the color of the object.
+    *
+    * @param scilabColor index of the color map.
+    */
+    private void setBackgroungColor(Integer scilabColor) {
+        GraphicController.getController()
+              .setProperty(currentaxes, GraphicObjectProperties.__GO_BACKGROUND__, scilabColor);
+    }
+    
+    /**
+    * Change the color of the object.
+    *
+    * @param scilabColor index of the color map.
+    */
+    private void setForegroundColor(Integer scilabColor) {
+        GraphicController.getController()
+              .setProperty(currentaxes, GraphicObjectProperties.__GO_LINE_COLOR__, scilabColor);
+    }
+    
+    /**
+    * Change the color of the object.
+    *
+    * @param scilabColor index of the color map.
+    */
+    private void setFontColor(Integer scilabColor) {
+        GraphicController.getController()
+              .setProperty(currentaxes, GraphicObjectProperties.__GO_FONT_COLOR__, scilabColor);
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/HideAxis.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/HideAxis.java
new file mode 100644 (file)
index 0000000..77ac71f
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.axes;
+
+/**
+ * Manages the operation of the button show/hide for the current axis.
+ *
+ * @author cardinot
+ */
+public class HideAxis {
+    public HideAxis(boolean hide) {
+        if (hide) {
+            AxisRulers.pAxisRulers.setVisible(false);
+            AxisRulers.bAxisRulers.setSelected(true);
+            AxisRulers.pLocation.setVisible(false);
+            AxisRulers.bLocation.setSelected(true);
+            AxisRulers.pReverse.setVisible(false);
+            AxisRulers.bReverse.setSelected(true);
+
+            Label.pLabel.setVisible(false);
+            Label.bLabel.setSelected(true);
+            Label.pAxisTitle.setVisible(false);
+            Label.bAxisTitle.setSelected(true);
+
+            Position.pPosition.setVisible(false);
+            Position.bPosition.setSelected(true);
+            Position.pAxesBounds.setVisible(false);
+            Position.bAxesBounds.setSelected(true);
+            Position.pMargins.setVisible(false);
+            Position.bMargins.setSelected(true);
+
+            Style.pStyle.setVisible(false);
+            Style.bStyle.setSelected(true);   
+        } else {
+            AxisRulers.pAxisRulers.setVisible(true);
+            AxisRulers.bAxisRulers.setSelected(false);
+
+            Label.pLabel.setVisible(true);
+            Label.bLabel.setSelected(false);
+
+            Position.pPosition.setVisible(true);
+            Position.bPosition.setSelected(false);
+
+            Style.pStyle.setVisible(true);
+            Style.bStyle.setSelected(false);
+        }
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Label.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Label.java
new file mode 100644 (file)
index 0000000..42664bb
--- /dev/null
@@ -0,0 +1,419 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.axes;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JTextField;
+import javax.swing.JToggleButton;
+
+import org.scilab.modules.gui.ged.Inspector;
+import org.scilab.modules.gui.ged.MessagesGED;
+import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
+
+/**
+* Construction and startup of all components of the section: Label.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class Label extends AxisRulers {
+    //Header - Label
+    protected static JToggleButton bLabel;
+    protected JLabel lLabel;
+    protected static JPanel pLabel;
+    protected JSeparator sLabel;
+    //Components of the property: Title Page
+    protected JLabel lTitlePage;
+    protected JTextField cTitlePage;
+    //Components of the property: Axis Title
+    protected static JToggleButton bAxisTitle;
+    protected JLabel lAxisTitle;
+    protected JLabel cAxisTitle;
+    protected static JPanel pAxisTitle;
+    protected JLabel lTitleX;
+    protected JTextField cTitleX;
+    protected JLabel lTitleY;
+    protected JTextField cTitleY;
+    protected JLabel lTitleZ;
+    protected JTextField cTitleZ;
+
+    /**
+    * Initializes the properties and the icons of the buttons.
+    *
+    * @param objectID Enters the identification of Axes.
+    */
+    public Label(String objectID) {
+        super(objectID);
+        position();
+        setIconsLabel();
+        initPropertiesLabel(objectID);
+    }
+
+    /**
+    * It has all the components of the section Label.
+    */
+    @Override
+    public void labelComponents() {
+        //Header
+        bLabel = new JToggleButton();
+        lLabel = new JLabel();
+        sLabel = new JSeparator();
+        pLabel = new JPanel();
+        //Title Page
+        lTitlePage = new JLabel();
+        cTitlePage = new JTextField();
+        //Axis Title
+        bAxisTitle = new JToggleButton();
+        lAxisTitle = new JLabel();
+        cAxisTitle = new JLabel();
+        pAxisTitle = new JPanel();
+        lTitleX = new JLabel();
+        cTitleX = new JTextField();
+        lTitleY = new JLabel();
+        cTitleY = new JTextField();
+        lTitleZ = new JLabel();
+        cTitleZ = new JTextField();
+
+        //Components of the header: Axis Rulers
+        bLabel.setBorder(null);
+        bLabel.setBorderPainted(false);
+        bLabel.setContentAreaFilled(false);
+        bLabel.setMaximumSize(new Dimension(16, 16));
+        bLabel.setMinimumSize(new Dimension(16, 16));
+        bLabel.setPreferredSize(new Dimension(16, 16));
+        bLabel.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bLabelActionPerformed(evt);
+            }
+        });
+
+        lLabel.setText(MessagesGED.label);
+
+        sLabel.setPreferredSize(new Dimension(50, 2));
+
+        //Components of the property: Title Page.
+        lTitlePage.setBackground(new Color(255, 255, 255));
+        lTitlePage.setText(" " + MessagesGED.title_page);
+        lTitlePage.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lTitlePage.setOpaque(true);
+        lTitlePage.setPreferredSize(new Dimension(120, 16));
+
+        cTitlePage.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cTitlePage.setPreferredSize(new Dimension(55, 20));
+        cTitlePage.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cTitlePageActionPerformed(evt);
+            }
+        });
+
+        //Components of the property: Axis Title.
+        bAxisTitle.setSelected(true);
+        bAxisTitle.setBorder(null);
+        bAxisTitle.setBorderPainted(false);
+        bAxisTitle.setContentAreaFilled(false);
+        bAxisTitle.setMaximumSize(new Dimension(16, 16));
+        bAxisTitle.setMinimumSize(new Dimension(16, 16));
+        bAxisTitle.setPreferredSize(new Dimension(16, 16));
+        bAxisTitle.setRolloverEnabled(false);
+        bAxisTitle.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bAxisTitleActionPerformed(evt);
+            }
+        });
+
+        lAxisTitle.setBackground(new Color(255, 255, 255));
+        lAxisTitle.setText(" " + MessagesGED.axis_title);
+        lAxisTitle.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lAxisTitle.setOpaque(true);
+        lAxisTitle.setPreferredSize(new Dimension(120, 16));
+
+        cAxisTitle.setBackground(new Color(255, 255, 255));
+        cAxisTitle.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cAxisTitle.setOpaque(true);
+
+        pAxisTitle.setVisible(false);
+
+        lTitleX.setBackground(new Color(255, 255, 255));
+        lTitleX.setText(" X");
+        lTitleX.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lTitleX.setOpaque(true);
+
+        cTitleX.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cTitleX.setPreferredSize(new Dimension(55, 20));
+        cTitleX.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cTitleXActionPerformed(evt);
+            }
+        });
+
+        lTitleY.setBackground(new Color(255, 255, 255));
+        lTitleY.setText(" Y");
+        lTitleY.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lTitleY.setOpaque(true);
+
+        cTitleY.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cTitleY.setPreferredSize(new Dimension(55, 20));
+        cTitleY.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cTitleYActionPerformed(evt);
+            }
+        });
+
+        lTitleZ.setBackground(new Color(255, 255, 255));
+        lTitleZ.setText(" Z");
+        lTitleZ.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lTitleZ.setOpaque(true);
+
+        cTitleZ.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cTitleZ.setPreferredSize(new Dimension(55, 20));
+        cTitleZ.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cTitleZActionPerformed(evt);
+            }
+        });
+
+        //Positioning the components of the property: Axis Title.
+        GroupLayout pAxisTitleLayout = new GroupLayout(pAxisTitle);
+        pAxisTitle.setLayout(pAxisTitleLayout);
+        pAxisTitleLayout.setHorizontalGroup(
+            pAxisTitleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pAxisTitleLayout.createSequentialGroup()
+                .addComponent(lTitleX, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cTitleX, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pAxisTitleLayout.createSequentialGroup()
+                .addComponent(lTitleY, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cTitleY, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pAxisTitleLayout.createSequentialGroup()
+                .addComponent(lTitleZ, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cTitleZ, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+        );
+        pAxisTitleLayout.setVerticalGroup(
+            pAxisTitleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pAxisTitleLayout.createSequentialGroup()
+                .addGroup(pAxisTitleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lTitleX, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cTitleX, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pAxisTitleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lTitleY, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cTitleY, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pAxisTitleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lTitleZ, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cTitleZ, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+        );
+    }
+
+    /**
+    * Positioning all the components of the Label.
+    */
+    private void position() {
+        //Positioning all components.
+        GroupLayout pLabelLayout = new GroupLayout(pLabel);
+        pLabel.setLayout(pLabelLayout);
+        pLabelLayout.setHorizontalGroup(
+            pLabelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pLabelLayout.createSequentialGroup()
+                .addComponent(bAxisTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(2, 2, 2)
+                .addComponent(lAxisTitle, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cAxisTitle, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pLabelLayout.createSequentialGroup()
+                .addGap(18, 18, 18)
+                .addGroup(pLabelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(pLabelLayout.createSequentialGroup()
+                        .addComponent(lTitlePage, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(cTitlePage, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+                    .addComponent(pAxisTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+        );
+        pLabelLayout.setVerticalGroup(
+            pLabelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pLabelLayout.createSequentialGroup()
+                .addGroup(pLabelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lTitlePage, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cTitlePage, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(6, 6, 6)
+                .addGroup(pLabelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(pLabelLayout.createSequentialGroup()
+                        .addGap(3, 3, 3)
+                        .addComponent(bAxisTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                    .addComponent(lAxisTitle, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cAxisTitle, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
+                .addGap(6, 6, 6)
+                .addComponent(pAxisTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+        );
+    }
+
+    /**
+    * Loads the current properties of the section Label.
+    *
+    * @param axesID Enters the identification of Axes.
+    */
+    private void initPropertiesLabel(String axesID) {
+        if (axesID != null) {
+            currentaxes = axesID;
+            /** Get the current status of the property: Title Page */
+            String titlePage = (String) GraphicController.getController()
+                    .getProperty(currentaxes, GraphicObjectProperties.__GO_TITLE__);
+
+            String[] textTitlePage = (String[])GraphicController.getController()
+                    .getProperty(titlePage, GraphicObjectProperties.__GO_TEXT_STRINGS__);
+            cTitlePage.setText(textTitlePage[0]);
+
+            /** Get the current status of the property: Axis Title */
+            String axisTitleX = (String) GraphicController.getController()
+                    .getProperty(currentaxes, GraphicObjectProperties.__GO_X_AXIS_LABEL__);
+
+            String[] textTitleX = (String[])GraphicController.getController()
+                    .getProperty(axisTitleX, GraphicObjectProperties.__GO_TEXT_STRINGS__);
+            cTitleX.setText(textTitleX[0]);
+
+            String axisTitleY = (String) GraphicController.getController()
+                    .getProperty(currentaxes, GraphicObjectProperties.__GO_Y_AXIS_LABEL__);
+
+            String[] textTitleY = (String[])GraphicController.getController()
+                    .getProperty(axisTitleY, GraphicObjectProperties.__GO_TEXT_STRINGS__);
+            cTitleY.setText(textTitleY[0]);
+
+            String axisTitleZ = (String) GraphicController.getController()
+                    .getProperty(currentaxes, GraphicObjectProperties.__GO_Z_AXIS_LABEL__);
+
+            String[] textTitleZ = (String[])GraphicController.getController()
+                    .getProperty(axisTitleZ, GraphicObjectProperties.__GO_TEXT_STRINGS__);
+            cTitleZ.setText(textTitleZ[0]);
+
+            titleAxis();
+        }
+    }
+
+    /**
+    * Insert the icons on buttons.
+    */
+    private final void setIconsLabel() {
+        bLabel.setIcon(new ImageIcon(Inspector.icon_collapse));
+        bLabel.setSelectedIcon(new ImageIcon(Inspector.icon_expand));
+        bAxisTitle.setIcon(new ImageIcon(Inspector.icon_collapse));
+        bAxisTitle.setSelectedIcon(new ImageIcon(Inspector.icon_expand));
+    }
+
+    /**
+    * Implement the action button to show/hide.
+    *
+    * @param evt ActionEvent.
+    */
+    private void bLabelActionPerformed(ActionEvent evt) {
+        if (bLabel.isSelected()) {
+            pLabel.setVisible(false);
+        } else {
+            pLabel.setVisible(true);
+        }
+    }
+
+    /**
+    * Implement the action button to show/hide.
+    *
+    * @param evt ActionEvent.
+    */
+    private void bAxisTitleActionPerformed(ActionEvent evt) {
+        if (bAxisTitle.isSelected()) {
+            pAxisTitle.setVisible(false);
+        } else {
+            pAxisTitle.setVisible(true);
+        }
+    }
+
+    /**
+    * Inserts the current state of functionality: AXIS TITLE in main label.
+    */
+    public void titleAxis() {
+        String titleAxisX = cTitleX.getText();
+        String titleAxisY = cTitleY.getText();
+        String titleAxisZ = cTitleZ.getText();
+        String titleAxis = titleAxisX + " , " + titleAxisY + " , " + titleAxisZ;
+        cAxisTitle.setText(" [" + titleAxis + "]");
+    }
+
+    /**
+    * Updates the property: x Title Axis.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cTitleXActionPerformed(ActionEvent evt) {
+        String axisTitleX = (String) GraphicController.getController()
+                .getProperty(currentaxes, GraphicObjectProperties.__GO_X_AXIS_LABEL__);
+        String[] text = new String[1];
+        text[0] = cTitleX.getText();
+        GraphicController.getController()
+                .setProperty(axisTitleX, GraphicObjectProperties.__GO_TEXT_STRINGS__, text);
+
+        titleAxis();
+    }
+
+    /**
+    * Updates the property: y Title Axis.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cTitleYActionPerformed(ActionEvent evt) {
+        String axisTitleY = (String) GraphicController.getController()
+                .getProperty(currentaxes, GraphicObjectProperties.__GO_Y_AXIS_LABEL__);
+        String[] text = new String[1];
+        text[0] = cTitleY.getText();
+        GraphicController.getController()
+                .setProperty(axisTitleY, GraphicObjectProperties.__GO_TEXT_STRINGS__, text);
+        titleAxis();
+    }
+
+    /**
+    * Updates the property: z Title Axis.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cTitleZActionPerformed(ActionEvent evt) {
+        String axisTitleZ = (String) GraphicController.getController()
+                .getProperty(currentaxes, GraphicObjectProperties.__GO_Z_AXIS_LABEL__);
+        String[] text = new String[1];
+        text[0] = cTitleZ.getText();
+        GraphicController.getController()
+                .setProperty(axisTitleZ, GraphicObjectProperties.__GO_TEXT_STRINGS__, text);
+        titleAxis();
+    }
+
+    /**
+    * Updates the property: Title Page.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cTitlePageActionPerformed(ActionEvent evt) {
+        String titlePage = (String) GraphicController.getController()
+                .getProperty(currentaxes, GraphicObjectProperties.__GO_TITLE__);
+        String[] text = new String[1];
+        text[0] = cTitlePage.getText();
+        GraphicController.getController()
+                .setProperty(titlePage, GraphicObjectProperties.__GO_TEXT_STRINGS__, text);
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Layout.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Layout.java
new file mode 100644 (file)
index 0000000..9aca682
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.axes;
+
+import javax.swing.GroupLayout;
+
+/**
+* Construction and startup of all components of the Axes.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class Layout extends ColorDialog {
+
+    /**
+    * Receives and passes the objectID to the parent class.
+    *
+    * @param objectID Enters the identification of Axes.
+    */
+    public Layout(String objectID) {
+        super(objectID);
+    }
+
+    /**
+    * Creates layout of all sections(Axis Rulers, Label, Position and Style/Appareance).
+    */
+    @Override
+    public void initLayout() {
+        GroupLayout layout = new GroupLayout(this);
+        this.setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(pAxisRulers, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addComponent(bAxisRulers, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+            .addGroup(layout.createSequentialGroup()
+                .addGap(21, 21, 21)
+                .addComponent(lAxisRulers))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(sAxisRulers, GroupLayout.PREFERRED_SIZE, 338, GroupLayout.PREFERRED_SIZE))
+            .addComponent(bLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(pLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(sLabel, GroupLayout.PREFERRED_SIZE, 338, GroupLayout.PREFERRED_SIZE))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(21, 21, 21)
+                .addComponent(lLabel))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(21, 21, 21)
+                .addComponent(lPosition))
+            .addComponent(bPosition, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(sPosition, GroupLayout.PREFERRED_SIZE, 338, GroupLayout.PREFERRED_SIZE))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(pPosition, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addGroup(layout.createSequentialGroup()
+                .addComponent(bStyle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(5, 5, 5)
+                .addComponent(lStyle))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(sStyle, GroupLayout.PREFERRED_SIZE, 338, GroupLayout.PREFERRED_SIZE))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(pStyle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(22, 22, 22)
+                        .addComponent(pAxisRulers, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                    .addComponent(bAxisRulers, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(2, 2, 2)
+                        .addComponent(lAxisRulers))
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(15, 15, 15)
+                        .addComponent(sAxisRulers, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE)))
+                .addGap(8, 8, 8)
+                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(bLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(20, 20, 20)
+                        .addComponent(pLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(13, 13, 13)
+                        .addComponent(sLabel, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE))
+                    .addComponent(lLabel))
+                .addGap(8, 8, 8)
+                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lPosition)
+                    .addComponent(bPosition, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(13, 13, 13)
+                        .addComponent(sPosition, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE))
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(20, 20, 20)
+                        .addComponent(pPosition, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+                .addGap(9, 9, 9)
+                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(bStyle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(lStyle)
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(13, 13, 13)
+                        .addComponent(sStyle, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE))
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(20, 20, 20)
+                        .addComponent(pStyle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))
+        );
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Position.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Position.java
new file mode 100644 (file)
index 0000000..f6e8ff5
--- /dev/null
@@ -0,0 +1,636 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.axes;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JTextField;
+import javax.swing.JToggleButton;
+
+import org.scilab.modules.gui.ged.Inspector;
+import org.scilab.modules.gui.ged.MessagesGED;
+import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
+
+/**
+* Construction and startup of all components of the section: Position.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class Position extends Label {
+    //Header - Label
+    protected static JToggleButton bPosition;
+    protected JLabel lPosition;
+    protected JSeparator sPosition;
+    protected static JPanel pPosition;
+    //Components of the property: Axes Bounds
+    protected static JToggleButton bAxesBounds;
+    protected JLabel lAxesBounds;
+    protected JLabel cAxesBounds;
+    protected static JPanel pAxesBounds;
+    protected JLabel lBoundsLeft;
+    protected JTextField cBoundsLeft;
+    protected JLabel lBoundsUp;
+    protected JTextField cBoundsUp;
+    protected JLabel lBoundsWidth;
+    protected JTextField cBoundsWidth;
+    protected JLabel lBoundsHeight;
+    protected JTextField cBoundsHeight;
+    //Components of the property: Margins
+    protected static JToggleButton bMargins;
+    protected JLabel lMargins;
+    protected JLabel cMargins;
+    protected static JPanel pMargins;
+    protected JLabel lMarginsLeft;
+    protected JTextField cMarginsLeft;
+    protected JLabel lMarginsRight;
+    protected JTextField cMarginsRight;
+    protected JLabel lMarginsTop;
+    protected JTextField cMarginsTop;
+    protected JLabel lMarginsBottom;
+    protected JTextField cMarginsBottom;
+
+    /**
+    * Initializes the properties and the icons of the buttons.
+    *
+    * @param objectID Enters the identification of Axes.
+    */
+    public Position(String objectID) {
+        super(objectID);
+        position();
+        setIconsPosition();
+        initPropertiesPosition(objectID);
+    }
+
+    /**
+    * It has all the components of the section Position.
+    */
+    @Override
+    public void positionComponents() {
+        //Header
+        bPosition = new JToggleButton();
+        lPosition = new JLabel();
+        sPosition = new JSeparator();
+        pPosition = new JPanel();
+        //Axes bounds
+        bAxesBounds = new JToggleButton();
+        lAxesBounds = new JLabel();
+        cAxesBounds = new JLabel();
+        pAxesBounds = new JPanel();
+        lBoundsLeft = new JLabel();
+        cBoundsLeft = new JTextField();
+        lBoundsUp = new JLabel();
+        cBoundsUp = new JTextField();
+        lBoundsWidth = new JLabel();
+        cBoundsWidth = new JTextField();
+        lBoundsHeight = new JLabel();
+        cBoundsHeight = new JTextField();
+        //Margins
+        bMargins = new JToggleButton();
+        lMargins = new JLabel();
+        cMargins = new JLabel();
+        pMargins = new JPanel();
+        lMarginsLeft = new JLabel();
+        cMarginsLeft = new JTextField();
+        lMarginsRight = new JLabel();
+        cMarginsRight = new JTextField();
+        lMarginsTop = new JLabel();
+        cMarginsTop = new JTextField();
+        lMarginsBottom = new JLabel();
+        cMarginsBottom = new JTextField();
+
+        //Components of the header: Position
+        bPosition.setBorder(null);
+        bPosition.setBorderPainted(false);
+        bPosition.setContentAreaFilled(false);
+        bPosition.setMaximumSize(new Dimension(16, 16));
+        bPosition.setMinimumSize(new Dimension(16, 16));
+        bPosition.setPreferredSize(new Dimension(16, 16));
+        bPosition.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bPositionActionPerformed(evt);
+            }
+        });
+
+        lPosition.setText(MessagesGED.position);
+
+        sPosition.setPreferredSize(new Dimension(50, 2));
+
+        //Components of the property: Axes Bounds.
+        pAxesBounds.setVisible(false);
+        bAxesBounds.setSelected(true);
+        bAxesBounds.setBorder(null);
+        bAxesBounds.setBorderPainted(false);
+        bAxesBounds.setContentAreaFilled(false);
+        bAxesBounds.setMaximumSize(new Dimension(16, 16));
+        bAxesBounds.setMinimumSize(new Dimension(16, 16));
+        bAxesBounds.setPreferredSize(new Dimension(16, 16));
+        bAxesBounds.setRolloverEnabled(false);
+        bAxesBounds.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bAxesBoundsActionPerformed(evt);
+            }
+        });
+
+        lAxesBounds.setBackground(new Color(255, 255, 255));
+        lAxesBounds.setText(" " + MessagesGED.axes_bounds);
+        lAxesBounds.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lAxesBounds.setOpaque(true);
+        lAxesBounds.setPreferredSize(new Dimension(120, 16));
+
+        cAxesBounds.setBackground(new Color(255, 255, 255));
+        cAxesBounds.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cAxesBounds.setOpaque(true);
+
+        lBoundsLeft.setBackground(new Color(255, 255, 255));
+        lBoundsLeft.setText(" " + MessagesGED.left);
+        lBoundsLeft.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lBoundsLeft.setOpaque(true);
+
+        cBoundsLeft.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cBoundsLeft.setPreferredSize(new Dimension(55, 20));
+        cBoundsLeft.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cBoundsLeftActionPerformed(evt);
+            }
+        });
+
+        lBoundsUp.setBackground(new Color(255, 255, 255));
+        lBoundsUp.setText(" " + MessagesGED.up);
+        lBoundsUp.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lBoundsUp.setOpaque(true);
+
+        cBoundsUp.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cBoundsUp.setPreferredSize(new Dimension(55, 20));
+        cBoundsUp.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cBoundsUpActionPerformed(evt);
+            }
+        });
+
+        lBoundsWidth.setBackground(new Color(255, 255, 255));
+        lBoundsWidth.setText(" " + MessagesGED.width);
+        lBoundsWidth.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lBoundsWidth.setOpaque(true);
+
+        cBoundsWidth.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cBoundsWidth.setPreferredSize(new Dimension(55, 20));
+        cBoundsWidth.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cBoundsWidthActionPerformed(evt);
+            }
+        });
+
+        lBoundsHeight.setBackground(new Color(255, 255, 255));
+        lBoundsHeight.setText(" " + MessagesGED.height);
+        lBoundsHeight.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lBoundsHeight.setOpaque(true);
+
+        cBoundsHeight.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cBoundsHeight.setPreferredSize(new Dimension(55, 20));
+        cBoundsHeight.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cBoundsHeightActionPerformed(evt);
+            }
+        });
+
+        titleBounds();
+
+        //Positioning the components of the property: Axes Bounds.
+        GroupLayout pAxesBoundsLayout = new GroupLayout(pAxesBounds);
+        pAxesBounds.setLayout(pAxesBoundsLayout);
+        pAxesBoundsLayout.setHorizontalGroup(
+            pAxesBoundsLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pAxesBoundsLayout.createSequentialGroup()
+                .addComponent(lBoundsLeft, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cBoundsLeft, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pAxesBoundsLayout.createSequentialGroup()
+                .addComponent(lBoundsUp, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cBoundsUp, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pAxesBoundsLayout.createSequentialGroup()
+                .addComponent(lBoundsWidth, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cBoundsWidth, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pAxesBoundsLayout.createSequentialGroup()
+                .addComponent(lBoundsHeight, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cBoundsHeight, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+        );
+        pAxesBoundsLayout.setVerticalGroup(
+            pAxesBoundsLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pAxesBoundsLayout.createSequentialGroup()
+                .addGroup(pAxesBoundsLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lBoundsLeft, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cBoundsLeft, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pAxesBoundsLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lBoundsUp, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cBoundsUp, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pAxesBoundsLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lBoundsWidth, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cBoundsWidth, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pAxesBoundsLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lBoundsHeight, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cBoundsHeight, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+        );
+        
+        //Components of the property: Margins.
+        bMargins.setSelected(true);
+        bMargins.setBorder(null);
+        bMargins.setBorderPainted(false);
+        bMargins.setContentAreaFilled(false);
+        bMargins.setMaximumSize(new Dimension(16, 16));
+        bMargins.setMinimumSize(new Dimension(16, 16));
+        bMargins.setPreferredSize(new Dimension(16, 16));
+        bMargins.setRolloverEnabled(false);
+        bMargins.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bMarginsActionPerformed(evt);
+            }
+        });
+
+        pMargins.setVisible(false);
+
+        lMargins.setBackground(new Color(255, 255, 255));
+        lMargins.setText(" " + MessagesGED.margins);
+        lMargins.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lMargins.setOpaque(true);
+        lMargins.setPreferredSize(new Dimension(120, 16));
+
+        cMargins.setBackground(new Color(255, 255, 255));
+        cMargins.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cMargins.setOpaque(true);
+
+        lMarginsLeft.setBackground(new Color(255, 255, 255));
+        lMarginsLeft.setText(" " + MessagesGED.left);
+        lMarginsLeft.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lMarginsLeft.setOpaque(true);
+
+        cMarginsLeft.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cMarginsLeft.setPreferredSize(new Dimension(55, 20));
+        cMarginsLeft.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cMarginsLeftActionPerformed(evt);
+            }
+        });
+
+        lMarginsRight.setBackground(new Color(255, 255, 255));
+        lMarginsRight.setText(" " + MessagesGED.right);
+        lMarginsRight.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lMarginsRight.setOpaque(true);
+
+        cMarginsRight.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cMarginsRight.setPreferredSize(new Dimension(55, 20));
+        cMarginsRight.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cMarginsRightActionPerformed(evt);
+            }
+        });
+
+        lMarginsTop.setBackground(new Color(255, 255, 255));
+        lMarginsTop.setText(" " + MessagesGED.top);
+        lMarginsTop.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lMarginsTop.setOpaque(true);
+
+        cMarginsTop.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cMarginsTop.setPreferredSize(new Dimension(55, 20));
+        cMarginsTop.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cMarginsTopActionPerformed(evt);
+            }
+        });
+
+        lMarginsBottom.setBackground(new Color(255, 255, 255));
+        lMarginsBottom.setText(" " + MessagesGED.bottom);
+        lMarginsBottom.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lMarginsBottom.setOpaque(true);
+
+        cMarginsBottom.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cMarginsBottom.setPreferredSize(new Dimension(55, 20));
+        cMarginsBottom.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cMarginsBottomActionPerformed(evt);
+            }
+        });
+
+        titleMargins();
+
+        //Positioning the components of the property: Margins.
+        GroupLayout pMarginsLayout = new GroupLayout(pMargins);
+        pMargins.setLayout(pMarginsLayout);
+        pMarginsLayout.setHorizontalGroup(
+            pMarginsLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pMarginsLayout.createSequentialGroup()
+                .addComponent(lMarginsLeft, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cMarginsLeft, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pMarginsLayout.createSequentialGroup()
+                .addComponent(lMarginsRight, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cMarginsRight, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pMarginsLayout.createSequentialGroup()
+                .addComponent(lMarginsTop, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cMarginsTop, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pMarginsLayout.createSequentialGroup()
+                .addComponent(lMarginsBottom, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cMarginsBottom, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+        );
+        pMarginsLayout.setVerticalGroup(
+            pMarginsLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pMarginsLayout.createSequentialGroup()
+                .addGroup(pMarginsLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lMarginsLeft, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cMarginsLeft, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pMarginsLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lMarginsRight, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cMarginsRight, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pMarginsLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lMarginsTop, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cMarginsTop, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pMarginsLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lMarginsBottom, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cMarginsBottom, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+        );
+    }
+
+    /**
+    * Positioning all the components of the Position.
+    */
+    private void position() {
+        //Positioning all components.
+        GroupLayout pPositionLayout = new GroupLayout(pPosition);
+        pPosition.setLayout(pPositionLayout);
+        pPositionLayout.setHorizontalGroup(
+            pPositionLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pPositionLayout.createSequentialGroup()
+                .addComponent(bAxesBounds, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(2, 2, 2)
+                .addComponent(lAxesBounds, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cAxesBounds, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pPositionLayout.createSequentialGroup()
+                .addComponent(bMargins, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(2, 2, 2)
+                .addComponent(lMargins, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cMargins, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pPositionLayout.createSequentialGroup()
+                .addGap(18, 18, 18)
+                .addGroup(pPositionLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(pAxesBounds, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(pMargins, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+        );
+        pPositionLayout.setVerticalGroup(
+            pPositionLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pPositionLayout.createSequentialGroup()
+                .addGroup(pPositionLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(bAxesBounds, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(lAxesBounds, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cAxesBounds, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addComponent(pAxesBounds, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addGroup(pPositionLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(bMargins, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addGroup(pPositionLayout.createSequentialGroup()
+                        .addGap(1, 1, 1)
+                        .addGroup(pPositionLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                            .addComponent(lMargins, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
+                            .addComponent(cMargins, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))))
+                .addGap(5, 5, 5)
+                .addComponent(pMargins, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+        );
+    }
+
+    /**
+    * Loads the current properties of the section Position.
+    *
+    * @param axesID Enters the identification of Axes.
+    */
+    private void initPropertiesPosition(String axesID) {
+        if (axesID != null) {
+            currentaxes = axesID;
+            /** Get the current status of the property: Axes Bounds */
+            Double[] currentBounds = (Double []) GraphicController.getController()
+                    .getProperty(currentaxes, GraphicObjectProperties.__GO_AXES_BOUNDS__);
+            cBoundsLeft.setText(currentBounds[0].toString());
+            cBoundsUp.setText(currentBounds[1].toString());
+            cBoundsWidth.setText(currentBounds[2].toString());
+            cBoundsHeight.setText(currentBounds[3].toString());
+            titleBounds();
+
+            /** Get the current status of the property: Margins */
+            Double[] currentMargins = (Double []) GraphicController.getController()
+                    .getProperty(currentaxes, GraphicObjectProperties.__GO_MARGINS__);
+            cMarginsLeft.setText(currentMargins[0].toString());
+            cMarginsRight.setText(currentMargins[1].toString());
+            cMarginsTop.setText(currentMargins[2].toString());
+            cMarginsBottom.setText(currentMargins[3].toString());
+            titleMargins();
+        }
+    }
+
+    /**
+    * Insert the icons on buttons.
+    */
+    private final void setIconsPosition() {
+        bPosition.setIcon(new ImageIcon(Inspector.icon_collapse));
+        bPosition.setSelectedIcon(new ImageIcon(Inspector.icon_expand));
+        bMargins.setIcon(new ImageIcon(Inspector.icon_collapse));
+        bMargins.setSelectedIcon(new ImageIcon(Inspector.icon_expand));
+        bAxesBounds.setIcon(new ImageIcon(Inspector.icon_collapse));
+        bAxesBounds.setSelectedIcon(new ImageIcon(Inspector.icon_expand));
+    }
+
+    /**
+    * Implement the action button to show/hide.
+    * 
+    * @param evt ActionEvent.
+    */
+    private void bLabelActionPerformed(ActionEvent evt) {
+        if (bLabel.isSelected()) {
+            pLabel.setVisible(false);
+        } else {
+            pLabel.setVisible(true);
+        }
+    }
+
+    /**
+    * Implement the action button to show/hide.
+    * 
+    * @param evt ActionEvent.
+    */
+    private void bPositionActionPerformed(ActionEvent evt) {
+        if (bPosition.isSelected()) {
+            pPosition.setVisible(false);
+        } else {
+            pPosition.setVisible(true);
+        }
+    }
+
+    /**
+    * Implement the action button to show/hide.
+    * 
+    * @param evt ActionEvent.
+    */
+    private void bAxesBoundsActionPerformed(ActionEvent evt) {
+        if (bAxesBounds.isSelected()) {
+            pAxesBounds.setVisible(false);
+        } else {
+            pAxesBounds.setVisible(true);
+        }
+    }
+
+    /**
+    * Implement the action button to show/hide.
+    * 
+    * @param evt ActionEvent.
+    */
+    private void bMarginsActionPerformed(ActionEvent evt) {
+        if (bMargins.isSelected()) {
+            pMargins.setVisible(false);
+        } else {
+            pMargins.setVisible(true);
+        }
+    }
+
+    /**
+    * Inserts the current state of functionality: AXES BOUNDS in main label.
+    */
+    public void titleBounds() {
+        String titleBoundsLeft = cBoundsLeft.getText();
+        String titleBoundsUp = cBoundsUp.getText();
+        String titleBoundsWidth = cBoundsWidth.getText();
+        String titleBoundsHeight = cBoundsHeight.getText();
+        String titleBounds = titleBoundsLeft + " , " + titleBoundsUp + " , "
+                             + titleBoundsWidth + " , " + titleBoundsHeight;
+        cAxesBounds.setText(" [" + titleBounds + "]");
+    }
+
+    /**
+    * Inserts the current state of functionality: MARGINS in main label.
+    */
+    public void titleMargins() {
+        String titleMarginsLeft = cMarginsLeft.getText();
+        String titleMarginsRight = cMarginsRight.getText();
+        String titleMarginsTop = cMarginsTop.getText();
+        String titleMarginsBottom = cMarginsBottom.getText();
+        String titleMargins = titleMarginsLeft + " , " + titleMarginsRight + " , "
+                             + titleMarginsTop + " , " + titleMarginsBottom;
+        cMargins.setText(" [" + titleMargins + "]");
+    }
+
+    /**
+    * Updates the property: Axes Bounds - Left.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cBoundsLeftActionPerformed(ActionEvent evt) {
+        Double[] value = new Double[4];
+        value[0] = Double.parseDouble(cBoundsLeft.getText());
+        value[1] = Double.parseDouble(cBoundsUp.getText());
+        value[2] = Double.parseDouble(cBoundsWidth.getText());
+        value[3] = Double.parseDouble(cBoundsHeight.getText());
+        GraphicController.getController()
+                .setProperty(currentaxes, GraphicObjectProperties.__GO_AXES_BOUNDS__, value);
+        titleBounds();
+    }
+
+    /**
+    * Updates the property: Axes Bounds - Up.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cBoundsUpActionPerformed(ActionEvent evt) {
+        cBoundsLeftActionPerformed(evt);
+    }
+
+    /**
+    * Updates the property: Axes Bounds - Width.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cBoundsWidthActionPerformed(ActionEvent evt) {
+        cBoundsLeftActionPerformed(evt);
+    }
+
+    /**
+    * Updates the property: Axes Bounds - Height.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cBoundsHeightActionPerformed(ActionEvent evt) {
+        cBoundsLeftActionPerformed(evt);
+    }
+
+    /**
+    * Updates the property: Margins - Left.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cMarginsLeftActionPerformed(ActionEvent evt) {
+        Double[] value = new Double[4];
+        value[0] = Double.parseDouble(cMarginsLeft.getText());
+        value[1] = Double.parseDouble(cMarginsRight.getText());
+        value[2] = Double.parseDouble(cMarginsTop.getText());
+        value[3] = Double.parseDouble(cMarginsBottom.getText());
+        GraphicController.getController()
+                .setProperty(currentaxes, GraphicObjectProperties.__GO_MARGINS__, value);
+
+        titleMargins();
+    }
+
+    /**
+    * Updates the property: Margins - Right.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cMarginsRightActionPerformed(ActionEvent evt) {
+        cMarginsLeftActionPerformed(evt);
+    }
+
+    /**
+    * Updates the property: Margins - Top.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cMarginsTopActionPerformed(ActionEvent evt) {
+        cMarginsLeftActionPerformed(evt);
+    }
+
+    /**
+    * Updates the property: Margins - Bottom.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cMarginsBottomActionPerformed(ActionEvent evt) {
+        cMarginsLeftActionPerformed(evt);
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Roof.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Roof.java
new file mode 100644 (file)
index 0000000..8886a5a
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.axes;
+
+import javax.swing.JPanel;
+
+/**
+ * Highest class - Prepares methods dependent on JPanel.
+ * @author cardinot
+ */
+public class Roof extends JPanel {
+
+    /**
+    * Build methods of overwriting.
+    */
+    public Roof() {
+        axisRulersComponents();
+        labelComponents();
+        positionComponents();
+        styleComponents();
+        initLayout();
+        dialogBackgroundColor();
+        dialogForegroundColor();
+        dialogFontColor();
+    }
+
+    /**
+    * It has all the components of the section Axis Rulers.
+    */
+    public void axisRulersComponents() { };
+
+    /**
+    * It has all the components of the section Label.
+    */
+    public void labelComponents() { };
+
+    /**
+    * It has all the components of the section Position.
+    */
+    public void positionComponents() { };
+
+    /**
+    * It has all the components of the section Style/Appareance.
+    */
+    public void styleComponents() { };
+
+    /**
+    * Creates layout of all sections.
+    */
+    public void initLayout() { };
+
+    /**
+    * JDialog - Selection of background colors.
+    */
+    public void dialogBackgroundColor() { };
+
+    /**
+    * JDialog - Selection of foreground colors.
+    */
+    public void dialogForegroundColor() { };
+
+    /**
+    * JDialog - Selection of font colors.
+    */
+    public void dialogFontColor() { };
+}
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Style.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/axes/Style.java
new file mode 100644 (file)
index 0000000..98cbf20
--- /dev/null
@@ -0,0 +1,512 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.axes;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JToggleButton;
+
+import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
+import org.scilab.modules.gui.ged.ColorMapHandler;
+import org.scilab.modules.gui.ged.Inspector;
+import org.scilab.modules.gui.ged.MessagesGED;
+
+/**
+* Construction and startup of all components of the section: Style/Appeareance.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class Style extends Position {
+    //Header - Style/Appearance
+    protected static JToggleButton bStyle;
+    protected JLabel lStyle;
+    protected JSeparator sStyle;
+    protected static JPanel pStyle;
+    //Components of the property: Background Color
+    protected JLabel lBackColor;
+    protected static JPanel pBackColor;
+    protected JLabel cBackColor;
+    protected static JButton bBackColor;
+    protected JDialog backColorDialog;
+    //Components of the property: Foreground Color
+    protected JLabel lForeColor;
+    protected static JPanel pForeColor;
+    protected JLabel cForeColor;
+    protected static JButton bForeColor;
+    protected JDialog foreColorDialog;
+    //Components of the property: Fontground Color
+    protected JLabel lFontColor;
+    protected static JPanel pFontColor;
+    protected JLabel cFontColor;
+    protected static JButton bFontColor;
+    protected JDialog fontColorDialog;
+    //Components of the property: Font Style
+    protected JLabel lFontStyle;
+    protected JComboBox cFontStyle;
+    //Components of the property: Visible
+    protected JLabel lVisible;
+    protected JComboBox cVisible;
+    protected String parentFigure = (String) GraphicController.getController()
+                                .getProperty(currentaxes, GraphicObjectProperties.__GO_PARENT_FIGURE__);
+
+    /**
+    * Receives and passes the objectID to the parent class.
+    *
+    * @param objectID Enters the identification of Axes.
+    */
+    public Style(String objectID) {
+        super(objectID);
+        position();
+        setIconsStyle();
+        initPropertiesStyle(objectID);
+    }
+
+    /**
+    * It has all the components of the section Style/Appeareance.
+    */
+    @Override
+    public void styleComponents() {
+        //Header
+        bStyle = new JToggleButton();
+        lStyle = new JLabel();
+        sStyle = new JSeparator();
+        pStyle = new JPanel();
+        //Background Color
+        lBackColor = new JLabel();
+        pBackColor = new JPanel();
+        bBackColor = new JButton();
+        cBackColor = new JLabel();
+        //Foreground Color
+        lForeColor = new JLabel();
+        pForeColor = new JPanel();
+        bForeColor = new JButton();
+        cForeColor = new JLabel();
+        //Font Color
+        lFontColor = new JLabel();
+        pFontColor = new JPanel();
+        bFontColor = new JButton();
+        cFontColor = new JLabel();
+        //Font Style
+        lFontStyle = new JLabel();
+        cFontStyle = new JComboBox();
+        //Visible
+        lVisible = new JLabel();
+        cVisible = new JComboBox();
+
+        //Components of the header: Style/Appeareance.
+        bStyle.setBorder(null);
+        bStyle.setBorderPainted(false);
+        bStyle.setContentAreaFilled(false);
+        bStyle.setMaximumSize(new Dimension(16, 16));
+        bStyle.setMinimumSize(new Dimension(16, 16));
+        bStyle.setPreferredSize(new Dimension(16, 16));
+        bStyle.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bStyleActionPerformed(evt);
+            }
+        });
+
+        lStyle.setText(MessagesGED.style_appearance);
+
+        sStyle.setPreferredSize(new Dimension(50, 2));
+
+        pStyle.setAlignmentX(0.0F);
+        pStyle.setAlignmentY(0.0F);
+
+        //Components of the property: Background Color.
+        lBackColor.setBackground(new Color(255, 255, 255));
+        lBackColor.setText(" " + MessagesGED.background_color);
+        lBackColor.setAlignmentX(0.5F);
+        lBackColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lBackColor.setOpaque(true);
+        lBackColor.setPreferredSize(new Dimension(153, 20));
+
+        pBackColor.setBackground(new Color(255, 255, 255));
+        pBackColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        pBackColor.setPreferredSize(new Dimension(157, 20));
+
+        bBackColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        bBackColor.setContentAreaFilled(false);
+        bBackColor.setPreferredSize(new Dimension(16, 16));
+        bBackColor.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bBackColorActionPerformed(evt);
+            }
+        });
+
+        cBackColor.setText(" ");
+        cBackColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cBackColor.setOpaque(true);
+
+        //Positioning the components of the property: Background Color.
+        GroupLayout pBackColorLayout = new GroupLayout(pBackColor);
+        pBackColor.setLayout(pBackColorLayout);
+        pBackColorLayout.setHorizontalGroup(
+            pBackColorLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pBackColorLayout.createSequentialGroup()
+                .addGap(35, 35, 35)
+                .addComponent(bBackColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(11, 11, 11)
+                .addComponent(cBackColor, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE))
+        );
+        pBackColorLayout.setVerticalGroup(
+            pBackColorLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pBackColorLayout.createSequentialGroup()
+                .addGap(1, 1, 1)
+                .addComponent(bBackColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pBackColorLayout.createSequentialGroup()
+                .addGap(3, 3, 3)
+                .addComponent(cBackColor, GroupLayout.PREFERRED_SIZE, 11, GroupLayout.PREFERRED_SIZE))
+        );
+
+        //Components of the property: Foreground Color.
+        lForeColor.setBackground(new Color(255, 255, 255));
+        lForeColor.setText(" " + MessagesGED.foreground_color);
+        lForeColor.setAlignmentX(0.5F);
+        lForeColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lForeColor.setOpaque(true);
+        lForeColor.setPreferredSize(new Dimension(153, 20));
+
+        pForeColor.setBackground(new Color(255, 255, 255));
+        pForeColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        pForeColor.setPreferredSize(new Dimension(157, 20));
+
+        bForeColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        bForeColor.setContentAreaFilled(false);
+        bForeColor.setPreferredSize(new Dimension(16, 16));
+        bForeColor.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bForeColorActionPerformed(evt);
+            }
+        });
+
+        cForeColor.setText(" ");
+        cForeColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cForeColor.setOpaque(true);
+
+        //Positioning the components of the property: Foreground Color.
+        GroupLayout pForeColorLayout = new GroupLayout(pForeColor);
+        pForeColor.setLayout(pForeColorLayout);
+        pForeColorLayout.setHorizontalGroup(
+            pForeColorLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pForeColorLayout.createSequentialGroup()
+                .addGap(35, 35, 35)
+                .addComponent(bForeColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(11, 11, 11)
+                .addComponent(cForeColor, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE))
+        );
+        pForeColorLayout.setVerticalGroup(
+            pForeColorLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pForeColorLayout.createSequentialGroup()
+                .addGap(1, 1, 1)
+                .addComponent(bForeColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pForeColorLayout.createSequentialGroup()
+                .addGap(3, 3, 3)
+                .addComponent(cForeColor, GroupLayout.PREFERRED_SIZE, 11, GroupLayout.PREFERRED_SIZE))
+        );
+
+        //Components of the property: Font Color.
+        lFontColor.setBackground(new Color(255, 255, 255));
+        lFontColor.setText(" " + MessagesGED.font_color);
+        lFontColor.setAlignmentX(0.5F);
+        lFontColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lFontColor.setOpaque(true);
+        lFontColor.setPreferredSize(new Dimension(153, 20));
+
+        pFontColor.setBackground(new Color(255, 255, 255));
+        pFontColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        pFontColor.setPreferredSize(new Dimension(157, 20));
+
+        bFontColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        bFontColor.setContentAreaFilled(false);
+        bFontColor.setPreferredSize(new Dimension(16, 16));
+        bFontColor.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bFontColorActionPerformed(evt);
+            }
+        });
+
+        cFontColor.setText(" ");
+        cFontColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cFontColor.setOpaque(true);
+
+        //Positioning the components of the property: Font Color.
+        GroupLayout pFontColorLayout = new GroupLayout(pFontColor);
+        pFontColor.setLayout(pFontColorLayout);
+        pFontColorLayout.setHorizontalGroup(
+            pFontColorLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pFontColorLayout.createSequentialGroup()
+                .addGap(35, 35, 35)
+                .addComponent(bFontColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(11, 11, 11)
+                .addComponent(cFontColor, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE))
+        );
+        pFontColorLayout.setVerticalGroup(
+            pFontColorLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pFontColorLayout.createSequentialGroup()
+                .addGap(1, 1, 1)
+                .addComponent(bFontColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pFontColorLayout.createSequentialGroup()
+                .addGap(3, 3, 3)
+                .addComponent(cFontColor, GroupLayout.PREFERRED_SIZE, 11, GroupLayout.PREFERRED_SIZE))
+        );
+
+        //Components of the property: Font Style.
+        lFontStyle.setBackground(new Color(255, 255, 255));
+        lFontStyle.setText(" " + MessagesGED.font_style);
+        lFontStyle.setAlignmentX(0.5F);
+        lFontStyle.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lFontStyle.setOpaque(true);
+        lFontStyle.setPreferredSize(new Dimension(153, 20));
+
+        cFontStyle.setModel(new DefaultComboBoxModel(new String[] { 
+            "Monospaced", "Symbol", "Serif", "Serif Italic", "Serif Bold", 
+            "Serif Bold Italic", "SansSerif", "SansSerif Italic", 
+            "SansSerif Bold", "SansSerif Bold Italic" 
+        }));
+        cFontStyle.setBorder(null);
+        cFontStyle.setEditor(null);
+        cFontStyle.setPreferredSize(new Dimension(150, 20));
+        cFontStyle.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cFontStyleActionPerformed(evt);
+            }
+        });
+
+        //Components of the property: Visible.
+        lVisible.setBackground(new Color(255, 255, 255));
+        lVisible.setText(" " + MessagesGED.visible);
+        lVisible.setAlignmentX(0.5F);
+        lVisible.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lVisible.setOpaque(true);
+        lVisible.setPreferredSize(new Dimension(153, 20));
+
+        cVisible.setModel(new DefaultComboBoxModel(new String[] {MessagesGED.off, MessagesGED.on}));
+        cVisible.setBorder(null);
+        cVisible.setEditor(null);
+        cVisible.setPreferredSize(new Dimension(150, 20));
+        cVisible.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cVisibleActionPerformed(evt);
+            }
+        });
+   }
+
+    /**
+    * Positioning all the components of the Style/Appearance.
+    */
+    private void position() {
+        //Positioning all components.
+        GroupLayout pStyleLayout = new GroupLayout(pStyle);
+        pStyle.setLayout(pStyleLayout);
+        pStyleLayout.setHorizontalGroup(
+            pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pStyleLayout.createSequentialGroup()
+                .addGap(18, 18, 18)
+                .addGroup(pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(pStyleLayout.createSequentialGroup()
+                        .addComponent(lBackColor, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(pBackColor, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+                    .addGroup(pStyleLayout.createSequentialGroup()
+                        .addComponent(lForeColor, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(pForeColor, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+                    .addGroup(pStyleLayout.createSequentialGroup()
+                        .addComponent(lFontColor, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(pFontColor, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+                    .addGroup(pStyleLayout.createSequentialGroup()
+                        .addComponent(lFontStyle, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(cFontStyle, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+                    .addGroup(pStyleLayout.createSequentialGroup()
+                        .addComponent(lVisible, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(cVisible, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))))
+        );
+        pStyleLayout.setVerticalGroup(
+            pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pStyleLayout.createSequentialGroup()
+                .addGroup(pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lBackColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(pBackColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(6, 6, 6)
+                .addGroup(pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lForeColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(pForeColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(6, 6, 6)
+                .addGroup(pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lFontColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(pFontColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(4, 4, 4)
+                .addGroup(pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lFontStyle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cFontStyle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(6, 6, 6)
+                .addGroup(pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lVisible, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cVisible, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+        );
+    }
+
+    /**
+    * Loads the current properties of the section Style/Appearance.
+    *
+    * @param axesID Enters the identification of Axes.
+    */
+    private void initPropertiesStyle(String axesID) {
+        if (axesID != null) {
+            currentaxes = axesID;
+
+            /** Get the current status of the property: Background Color */
+            Integer scilabBackgroundColor = (Integer) GraphicController.getController()
+                  .getProperty(currentaxes, GraphicObjectProperties.__GO_BACKGROUND__);
+            Double[] rgbBackgroundColor = ColorMapHandler.getRGBcolor(parentFigure, scilabBackgroundColor);
+            cBackColor.setBackground(new Color(rgbBackgroundColor[0].intValue(), rgbBackgroundColor[1].intValue(), rgbBackgroundColor[2].intValue()));
+
+            /** Get the current status of the property: Foreground Color */
+            Integer scilabForegroundColor = (Integer) GraphicController.getController()
+                  .getProperty(currentaxes, GraphicObjectProperties.__GO_LINE_COLOR__);
+            Double[] rgbForegroundColor = ColorMapHandler.getRGBcolor(parentFigure, scilabForegroundColor);
+            cForeColor.setBackground(new Color(rgbForegroundColor[0].intValue(), rgbForegroundColor[1].intValue(), rgbForegroundColor[2].intValue()));
+
+            /** Get the current status of the property: Font Color */
+            Integer scilabFontColor = (Integer) GraphicController.getController()
+                  .getProperty(currentaxes, GraphicObjectProperties.__GO_FONT_COLOR__);
+            Double[] rgbFontColor = ColorMapHandler.getRGBcolor(parentFigure, scilabFontColor);
+            cFontColor.setBackground(new Color(rgbFontColor[0].intValue(), rgbFontColor[1].intValue(), rgbFontColor[2].intValue()));
+
+            /** Get the current status of the property: Font Style */
+            int currentFontStyle = (Integer) GraphicController.getController()
+                    .getProperty(currentaxes, GraphicObjectProperties.__GO_FONT_STYLE__);
+            cFontStyle.setSelectedIndex(currentFontStyle);
+
+            /** Get the current status of the property: Visible */
+            boolean isVisible = (Boolean) GraphicController.getController()
+                    .getProperty(currentaxes, GraphicObjectProperties.__GO_VISIBLE__);
+            if (isVisible) {
+                cVisible.setSelectedIndex(1);
+            } else {
+                cVisible.setSelectedIndex(0);
+            }
+        }
+    }
+
+    /**
+    * Method that will be overwritten by ColorDialog.
+    */
+    @Override
+    public void dialogBackgroundColor() { }
+
+    /**
+    * Method that will be overwritten by ColorDialog.
+    */
+    @Override
+    public void dialogForegroundColor() { }
+
+    /**
+    * Method that will be overwritten by ColorDialog.
+    */
+    @Override
+    public void dialogFontColor() { }
+
+    /**
+    * Insert the icons on buttons.
+    */
+    private void setIconsStyle() {
+        bStyle.setIcon(new ImageIcon(Inspector.icon_collapse));
+        bStyle.setSelectedIcon(new ImageIcon(Inspector.icon_expand));
+        bBackColor.setIcon(new ImageIcon(Inspector.icon_color_fill));
+        bForeColor.setIcon(new ImageIcon(Inspector.icon_color_fill));
+        bFontColor.setIcon(new ImageIcon(Inspector.icon_color_fill));
+    }
+
+    /**
+    * Implement the action button to show/hide.
+    *
+    * @param evt ActionEvent.
+    */
+    private void bStyleActionPerformed(ActionEvent evt) {
+        if (bStyle.isSelected()) {
+            pStyle.setVisible(false);
+        } else {
+            pStyle.setVisible(true);
+        }
+    }
+
+    /**
+    * Implement the action button to open a JDialog with a JColorChoose.
+    *
+    * @param evt ActionEvent.
+    */
+    private void bBackColorActionPerformed(ActionEvent evt) {
+        backColorDialog.setVisible(true);
+    }
+
+    /**
+    * Implement the action button to open a JDialog with a JColorChoose.
+    *
+    * @param evt ActionEvent.
+    */
+    private void bForeColorActionPerformed(ActionEvent evt) {
+        foreColorDialog.setVisible(true);
+    }
+
+    /**
+    * Implement the action button to open a JDialog with a JColorChoose.
+    *
+    * @param evt ActionEvent.
+    */
+    private void bFontColorActionPerformed(ActionEvent evt) {
+        fontColorDialog.setVisible(true);
+    }
+
+    /**
+    * Updates the property: Font Style.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cFontStyleActionPerformed(ActionEvent evt) {
+        int setFontStyle = cFontStyle.getSelectedIndex();
+        GraphicController.getController()
+                .setProperty(currentaxes, GraphicObjectProperties.__GO_FONT_STYLE__, setFontStyle);
+    }
+
+    /**
+    * Updates the property: Visible.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cVisibleActionPerformed(ActionEvent evt) {
+        boolean setVisible = true;
+        if (cVisible.getSelectedIndex() == 0) {
+            setVisible = false;
+        }
+        GraphicController.getController()
+                .setProperty(currentaxes, GraphicObjectProperties.__GO_VISIBLE__, setVisible);
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/BaseProperties.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/BaseProperties.java
new file mode 100644 (file)
index 0000000..1856e6e
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.curve;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JToggleButton;
+
+import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
+
+import org.scilab.modules.gui.ged.Inspector;
+import org.scilab.modules.gui.ged.MessagesGED;
+
+/**
+* Construction and startup of all components of the section: Base Properties.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class BaseProperties extends Roof {
+    protected static JToggleButton bBaseProperties;
+    protected static JPanel pBaseProperties;
+    protected JSeparator sBaseProperties;
+    protected JLabel lBaseProperties;
+    protected JComboBox cVisible;
+    protected JLabel lVisible;
+    protected String currentcurve = null;
+
+    /**
+    * Initializes the properties and the icons of the buttons.
+    * @param objectID Enters the identification of curve.
+    */
+    public BaseProperties(String objectID){
+        initPropertiesBase(objectID);
+        position();
+        setIconsBaseProperties();
+    }
+
+    /**
+    * It has all the components of the section Base Properties.
+    */
+    @Override
+    public void basePropertiesComponents() {
+        bBaseProperties = new JToggleButton();
+        lBaseProperties = new JLabel();
+        sBaseProperties = new JSeparator();
+        pBaseProperties = new JPanel();
+        lVisible = new JLabel();
+        cVisible = new JComboBox();
+
+        //Components of the header: Base Properties.
+        bBaseProperties.setBorder(null);
+        bBaseProperties.setBorderPainted(false);
+        bBaseProperties.setContentAreaFilled(false);
+        bBaseProperties.setMaximumSize(new Dimension(16, 16));
+        bBaseProperties.setMinimumSize(new Dimension(16, 16));
+        bBaseProperties.setPreferredSize(new Dimension(16, 16));
+        bBaseProperties.setRolloverEnabled(false);
+        bBaseProperties.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bBasePropertiesActionPerformed(evt);
+            }
+        });
+
+        lBaseProperties.setText(MessagesGED.base_properties);
+
+        sBaseProperties.setPreferredSize(new Dimension(50, 2));
+
+        pBaseProperties.setAlignmentX(0.0F);
+        pBaseProperties.setAlignmentY(0.0F);
+
+        //Components of the property: Visible.
+        lVisible.setBackground(new Color(255, 255, 255));
+        lVisible.setText(" " + MessagesGED.visible);
+        lVisible.setAlignmentX(0.5F);
+        lVisible.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lVisible.setOpaque(true);
+        lVisible.setPreferredSize(new Dimension(153, 20));
+
+        cVisible.setModel(new DefaultComboBoxModel(new String[] {MessagesGED.off , MessagesGED.on}));
+        cVisible.setBorder(null);
+        cVisible.setEditor(null);
+        cVisible.setPreferredSize(new Dimension(150, 20));
+        cVisible.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cVisibleActionPerformed(evt);
+            }
+        });
+    }
+
+    /**
+    * Positioning all the components of the Basic Properties.
+    */
+    private void position() {
+        GroupLayout pBasePropertiesLayout = new GroupLayout(pBaseProperties);
+        pBaseProperties.setLayout(pBasePropertiesLayout);
+        pBasePropertiesLayout.setHorizontalGroup(
+            pBasePropertiesLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pBasePropertiesLayout.createSequentialGroup()
+                .addGap(18, 18, 18)
+                .addComponent(lVisible, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cVisible, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+        );
+        pBasePropertiesLayout.setVerticalGroup(
+            pBasePropertiesLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addComponent(lVisible, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+            .addComponent(cVisible, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+        );
+    }
+
+    /**
+    * Loads the current properties of the section Base Properties.
+    *
+    * @param objectID Enters the identification of curve.
+    */
+    public void initPropertiesBase(String objectID) {
+        if (objectID != null) {
+            currentcurve = objectID;
+            // Get the current status of the property: Visible
+            boolean isVisible = (Boolean) GraphicController.getController()
+                    .getProperty(currentcurve, GraphicObjectProperties.__GO_VISIBLE__);
+            if (isVisible) {
+                cVisible.setSelectedIndex(1);
+            } else {
+                cVisible.setSelectedIndex(0);
+            }
+        }
+    }
+
+    /**
+    * Insert the icons on buttons.
+    */
+    public void setIconsBaseProperties() {
+        bBaseProperties.setIcon(new ImageIcon(Inspector.icon_collapse));
+        bBaseProperties.setSelectedIcon(new ImageIcon(Inspector.icon_expand));
+    }
+
+    /**
+    * Implement the action button to show/hide.
+    */
+    private void bBasePropertiesActionPerformed(ActionEvent evt) {
+        if (bBaseProperties.isSelected()) {
+            pBaseProperties.setVisible(false);
+        } else {
+            pBaseProperties.setVisible(true);
+        }
+    }
+
+    /**
+    * Updates the property: Visible.
+    * @param evt ActionEvent.
+    */
+    private void cVisibleActionPerformed(ActionEvent evt) {
+        boolean setVisible = true;
+        if (cVisible.getSelectedIndex() == 0) {
+            setVisible = false;
+        }
+        GraphicController.getController()
+                .setProperty(currentcurve, GraphicObjectProperties.__GO_VISIBLE__, setVisible);
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/ColorDialog.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/ColorDialog.java
new file mode 100644 (file)
index 0000000..c5e6908
--- /dev/null
@@ -0,0 +1,192 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.curve;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.GroupLayout;
+import javax.swing.JButton;
+import javax.swing.JColorChooser;
+import javax.swing.JDialog;
+import javax.swing.LayoutStyle;
+
+import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
+
+import org.scilab.modules.gui.editor.Editor;
+import org.scilab.modules.gui.ged.ColorMapHandler;
+import org.scilab.modules.gui.ged.MessagesGED;
+
+/**
+* Implementation of the windows to color selection.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class ColorDialog extends Style {
+    protected static JColorChooser chooserBack;
+    protected static JButton okBack;
+    protected static Color choiceBack;
+
+    protected static JColorChooser chooserFore;
+    protected static JButton okFore;
+    protected static Color choiceFore;
+
+    /**
+    * Receives and passes the objectID to the parent class.
+    * @param objectID Enters the identification of curve.
+    */
+    public ColorDialog(String objectID) {
+        super(objectID);
+    }
+
+    /**
+    * JDialog - Selection of background colors.
+    */
+    @Override
+    public void dialogBackgroundColor() {
+        backcolorDialog = new JDialog();
+        chooserBack = new JColorChooser();
+        okBack = new JButton();
+
+        backcolorDialog.setTitle(MessagesGED.choose_background_color);
+        backcolorDialog.setMinimumSize(new Dimension(670, 450));
+        backcolorDialog.setModal(true);
+        backcolorDialog.setResizable(false);
+
+        okBack.setText("OK");
+        okBack.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                okBackActionPerformed(evt);
+            }
+        });
+
+        //Position settings.
+        GroupLayout backcolorDialogLayout = new GroupLayout(backcolorDialog.getContentPane());
+        backcolorDialog.getContentPane().setLayout(backcolorDialogLayout);
+        backcolorDialogLayout.setHorizontalGroup(
+            backcolorDialogLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(backcolorDialogLayout.createSequentialGroup()
+                .addComponent(chooserBack, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(0, 0, Short.MAX_VALUE))
+            .addGroup(GroupLayout.Alignment.TRAILING, backcolorDialogLayout.createSequentialGroup()
+                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                .addComponent(okBack)
+                .addContainerGap())
+        );
+        backcolorDialogLayout.setVerticalGroup(
+            backcolorDialogLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(backcolorDialogLayout.createSequentialGroup()
+                .addComponent(chooserBack, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(okBack)
+                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+        );
+    }
+
+    /**
+    * JDialog - Selection of foreground colors.
+    */
+    @Override
+    public void dialogForegroungColor() {
+        forecolorDialog = new JDialog();
+        chooserFore = new JColorChooser();
+        okFore = new JButton();
+
+        forecolorDialog.setTitle(MessagesGED.choose_foreground_color);
+        forecolorDialog.setMinimumSize(new Dimension(670, 450));
+        forecolorDialog.setModal(true);
+        forecolorDialog.setResizable(false);
+
+        okFore.setText("OK");
+        okFore.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                okForeActionPerformed(evt);
+            }
+        });
+
+        //Position settings.
+        GroupLayout forecolorDialogLayout = new GroupLayout(forecolorDialog.getContentPane());
+        forecolorDialog.getContentPane().setLayout(forecolorDialogLayout);
+        forecolorDialogLayout.setHorizontalGroup(
+            forecolorDialogLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(forecolorDialogLayout.createSequentialGroup()
+                .addComponent(chooserFore, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(0, 0, Short.MAX_VALUE))
+            .addGroup(GroupLayout.Alignment.TRAILING, forecolorDialogLayout.createSequentialGroup()
+                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                .addComponent(okFore)
+                .addContainerGap())
+        );
+        forecolorDialogLayout.setVerticalGroup(
+            forecolorDialogLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(forecolorDialogLayout.createSequentialGroup()
+                .addComponent(chooserFore, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(okFore)
+                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+        );
+    }
+
+    /**
+    * Implement the action on the OK button to save the color chosen by the user.
+    *
+    * @param evt ActionEvent.
+    */
+    private void okBackActionPerformed(ActionEvent evt) {
+        choiceBack = chooserBack.getColor();
+        double red = choiceBack.getRed();
+        double green = choiceBack.getGreen();
+        double blue = choiceBack.getBlue();
+        Integer scilabColor = ColorMapHandler.getScilabColor(red, green, blue, parentFigure);
+        setBackgroungColor(scilabColor);
+        cBackColor.setBackground(choiceBack);
+        backcolorDialog.dispose();
+    }
+
+    /**
+    * Implement the action on the OK button to save the color chosen by the user.
+    *
+    * @param evt ActionEvent.
+    */
+    private void okForeActionPerformed(ActionEvent evt) {
+        choiceFore = chooserFore.getColor();
+        double red = choiceFore.getRed();
+        double green = choiceFore.getGreen();
+        double blue = choiceFore.getBlue();
+        Integer scilabColor = ColorMapHandler.getScilabColor(red, green, blue, parentFigure);
+        setForegroundColor(scilabColor);
+        cForeColor.setBackground(choiceFore);
+        forecolorDialog.dispose();
+    }
+    
+    /**
+    * Change the color of the object.
+    *
+    * @param scilabColor index of the color map.
+    */
+    private void setBackgroungColor(Integer scilabColor) {
+        GraphicController.getController()
+              .setProperty(currentcurve, GraphicObjectProperties.__GO_BACKGROUND__, scilabColor);
+    }
+    
+    /**
+    * Change the color of the object.
+    *
+    * @param scilabColor index of the color map.
+    */
+    private void setForegroundColor(Integer scilabColor) {
+        Editor.setOriColor(scilabColor);
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/Curve.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/Curve.java
new file mode 100644 (file)
index 0000000..28fbe1d
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.curve;
+
+/**
+* Properties of the curve.
+* Last child.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class Curve extends Layout {
+    /**
+    * Initializes the components of the JPanel.
+    *
+    * @param objectID Enters the identification of curve.
+    */
+    public Curve(String objectID) {
+        super(objectID);
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/HideCurve.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/HideCurve.java
new file mode 100644 (file)
index 0000000..daa972c
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.curve;
+
+/**
+ * Manages the operation of the button show/hide for the current curve.
+ *
+ * @author cardinot
+ */
+public class HideCurve {
+    public HideCurve(boolean hide) {
+        if (hide) {
+            BaseProperties.pBaseProperties.setVisible(false);
+            BaseProperties.bBaseProperties.setSelected(true);
+
+            Style.pStyle.setVisible(false);
+            Style.bStyle.setSelected(true);
+        } else {
+            BaseProperties.pBaseProperties.setVisible(true);
+            BaseProperties.bBaseProperties.setSelected(false);
+
+            Style.pStyle.setVisible(true);
+            Style.bStyle.setSelected(false);
+        }
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/Layout.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/Layout.java
new file mode 100644 (file)
index 0000000..c737a3b
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.curve;
+
+import javax.swing.GroupLayout;
+
+/**
+* Construction and startup of all components of the Curve.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class Layout extends ColorDialog {
+
+    /**
+    * Receives and passes the objectID to the parent class.
+    * @param objectID Enters the identification of curve.
+    */
+    public Layout(String objectID) {
+        super(objectID);
+    }
+
+    /**
+    * Creates layout of all sections(Base Proprerties and Style/Appareance).
+    */
+    @Override
+    public void initLayout() {
+        GroupLayout layout = new GroupLayout(this);
+        this.setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(pBaseProperties, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(21, 21, 21)
+                .addComponent(lBaseProperties))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(12, 12, 12)
+                .addComponent(sBaseProperties, GroupLayout.PREFERRED_SIZE, 338, GroupLayout.PREFERRED_SIZE))
+            .addComponent(bBaseProperties, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+            .addGroup(layout.createSequentialGroup()
+                .addGap(21, 21, 21)
+                .addComponent(lStyle))
+            .addComponent(bStyle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(sStyle, GroupLayout.PREFERRED_SIZE, 338, GroupLayout.PREFERRED_SIZE))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(pStyle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(22, 22, 22)
+                        .addComponent(pBaseProperties, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(2, 2, 2)
+                        .addComponent(lBaseProperties))
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(15, 15, 15)
+                        .addComponent(sBaseProperties, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE))
+                    .addComponent(bBaseProperties, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(8, 8, 8)
+                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lStyle)
+                    .addComponent(bStyle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(13, 13, 13)
+                        .addComponent(sStyle, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE))
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(20, 20, 20)
+                        .addComponent(pStyle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))
+        );
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/Roof.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/Roof.java
new file mode 100644 (file)
index 0000000..76879b8
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.curve;
+
+import javax.swing.JPanel;
+
+/**
+ * Highest class - Prepares methods dependent on JPanel.
+ * @author cardinot
+ */
+public class Roof extends JPanel {
+
+    /**
+    * Build methods of overwriting.
+    */
+    public Roof() {
+        basePropertiesComponents();
+        styleComponents();
+        initLayout();
+        dialogBackgroundColor();
+        dialogForegroungColor();
+    }
+
+    /**
+    * It has all the components of the section Base Properties.
+    */
+    public void basePropertiesComponents() { };
+
+    /**
+    * It has all the components of the section Style/Appearance.
+    */
+    public void styleComponents() { };
+
+    /**
+    * Creates layout of all sections(Base Proprerties and Style/Appareance).
+    */
+    public void initLayout() { };
+
+    /**
+    * JDialog - Selection of background colors.
+    */
+    public void dialogBackgroundColor() { };
+
+    /**
+    * JDialog - Selection of foreground colors.
+    */
+    public void dialogForegroungColor() { };
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/Style.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/curve/Style.java
new file mode 100644 (file)
index 0000000..0e9ef88
--- /dev/null
@@ -0,0 +1,401 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.curve;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JToggleButton;
+
+import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
+
+import org.scilab.modules.gui.editor.Editor;
+import org.scilab.modules.gui.ged.ColorMapHandler;
+import org.scilab.modules.gui.ged.Inspector;
+import org.scilab.modules.gui.ged.MessagesGED;
+
+/**
+* Construction and startup of all components of the section: Style/Appeareance.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class Style extends BaseProperties {
+    protected JButton bBackColor;
+    protected JButton bForeColor;
+    protected static JToggleButton bStyle;
+    protected static JLabel cBackColor;
+    protected static JLabel cForeColor;
+    protected JComboBox cLine;
+    protected JComboBox cPolyline;
+    protected JLabel lBackColor;
+    protected JLabel lForeColor;
+    protected JLabel lLine;
+    protected JLabel lPolyline;
+    protected JLabel lStyle;
+    protected JPanel pBackColor;
+    protected JPanel pForeColor;
+    protected static JPanel pStyle;
+    protected JSeparator sStyle;
+    protected static JDialog backcolorDialog;
+    protected static JDialog forecolorDialog;
+    protected String parentFigure = (String) GraphicController.getController()
+                                .getProperty(currentcurve, GraphicObjectProperties.__GO_PARENT_FIGURE__);
+
+    /**
+    * Receives and passes the objectID to the parent class.
+    * @param objectID Enters the identification of curve.
+    */
+    public Style(String objectID) {
+        super(objectID);
+        initPropertiesStyle(objectID);
+        position();
+        setIconsStyle();
+    }
+
+    /**
+    * It has all the components of the section Style/Appeareance.
+    */
+    @Override
+    public void styleComponents() {
+        bStyle = new JToggleButton();
+        lStyle = new JLabel();
+        sStyle = new JSeparator();
+        pStyle = new JPanel();
+        lBackColor = new JLabel();
+        pBackColor = new JPanel();
+        bBackColor = new JButton();
+        cBackColor = new JLabel();
+        lForeColor = new JLabel();
+        pForeColor = new JPanel();
+        bForeColor = new JButton();
+        cForeColor = new JLabel();
+        lLine = new JLabel();
+        cLine = new JComboBox();
+        lPolyline = new JLabel();
+        cPolyline = new JComboBox();
+
+        //Components of the header: Style/Appeareance.
+        bStyle.setBorder(null);
+        bStyle.setBorderPainted(false);
+        bStyle.setContentAreaFilled(false);
+        bStyle.setMaximumSize(new Dimension(16, 16));
+        bStyle.setMinimumSize(new Dimension(16, 16));
+        bStyle.setPreferredSize(new Dimension(16, 16));
+        bStyle.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bStyleActionPerformed(evt);
+            }
+        });
+
+        lStyle.setText(MessagesGED.style_appearance);
+
+        sStyle.setPreferredSize(new Dimension(50, 2));
+
+        pStyle.setAlignmentX(0.0F);
+        pStyle.setAlignmentY(0.0F);
+
+        //Components of the property: Background Color.
+        lBackColor.setBackground(new Color(255, 255, 255));
+        lBackColor.setText(" " + MessagesGED.background_color);
+        lBackColor.setAlignmentX(0.5F);
+        lBackColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lBackColor.setOpaque(true);
+        lBackColor.setPreferredSize(new Dimension(153, 20));
+
+        pBackColor.setBackground(new Color(255, 255, 255));
+        pBackColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        pBackColor.setPreferredSize(new Dimension(157, 20));
+
+        bBackColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        bBackColor.setContentAreaFilled(false);
+        bBackColor.setPreferredSize(new Dimension(16, 16));
+        bBackColor.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bBackColorActionPerformed(evt);
+            }
+        });
+
+        cBackColor.setText(" ");
+        cBackColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cBackColor.setOpaque(true);
+
+        //Positioning the components of the property: Background Color.
+        GroupLayout pBackColorLayout = new GroupLayout(pBackColor);
+        pBackColor.setLayout(pBackColorLayout);
+        pBackColorLayout.setHorizontalGroup(
+            pBackColorLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pBackColorLayout.createSequentialGroup()
+                .addGap(35, 35, 35)
+                .addComponent(bBackColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(11, 11, 11)
+                .addComponent(cBackColor, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE))
+        );
+        pBackColorLayout.setVerticalGroup(
+            pBackColorLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pBackColorLayout.createSequentialGroup()
+                .addGap(1, 1, 1)
+                .addComponent(bBackColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pBackColorLayout.createSequentialGroup()
+                .addGap(3, 3, 3)
+                .addComponent(cBackColor, GroupLayout.PREFERRED_SIZE, 11, GroupLayout.PREFERRED_SIZE))
+        );
+
+        //Components of the property: Foreground Color.
+        lForeColor.setBackground(new Color(255, 255, 255));
+        lForeColor.setText(" " + MessagesGED.foreground_color);
+        lForeColor.setAlignmentX(0.5F);
+        lForeColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lForeColor.setOpaque(true);
+        lForeColor.setPreferredSize(new Dimension(153, 20));
+
+        pForeColor.setBackground(new Color(255, 255, 255));
+        pForeColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        pForeColor.setPreferredSize(new Dimension(157, 20));
+
+        bForeColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        bForeColor.setContentAreaFilled(false);
+        bForeColor.setPreferredSize(new Dimension(16, 16));
+        bForeColor.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bForeColorActionPerformed(evt);
+            }
+        });
+
+        cForeColor.setText(" ");
+        cForeColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cForeColor.setOpaque(true);
+
+       //Positioning the components of the property: Foreground Color.
+        GroupLayout pForeColorLayout = new GroupLayout(pForeColor);
+        pForeColor.setLayout(pForeColorLayout);
+        pForeColorLayout.setHorizontalGroup(
+            pForeColorLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pForeColorLayout.createSequentialGroup()
+                .addGap(35, 35, 35)
+                .addComponent(bForeColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(11, 11, 11)
+                .addComponent(cForeColor, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE))
+        );
+        pForeColorLayout.setVerticalGroup(
+            pForeColorLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pForeColorLayout.createSequentialGroup()
+                .addGap(1, 1, 1)
+                .addComponent(bForeColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pForeColorLayout.createSequentialGroup()
+                .addGap(3, 3, 3)
+                .addComponent(cForeColor, GroupLayout.PREFERRED_SIZE, 11, GroupLayout.PREFERRED_SIZE))
+        );
+
+       //Components of the property: Line Style.
+        lLine.setBackground(new Color(255, 255, 255));
+        lLine.setText(" " + MessagesGED.line_style);
+        lLine.setAlignmentX(0.5F);
+        lLine.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lLine.setOpaque(true);
+        lLine.setPreferredSize(new Dimension(153, 20));
+
+        cLine.setModel(new DefaultComboBoxModel(new String[] { 
+            MessagesGED.solid, MessagesGED.dash, MessagesGED.dash_dot, 
+            MessagesGED.longdash_dot, MessagesGED.bigdash_dot, 
+            MessagesGED.bigdash_longdash, MessagesGED.dot, MessagesGED.double_dot }));
+        cLine.setBorder(null);
+        cLine.setEditor(null);
+        cLine.setPreferredSize(new Dimension(150, 20));
+        cLine.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cLineActionPerformed(evt);
+            }
+        });
+
+       //Components of the property: Polyline Style.
+        lPolyline.setBackground(new Color(255, 255, 255));
+        lPolyline.setText(" " + MessagesGED.polyline_style);
+        lPolyline.setAlignmentX(0.5F);
+        lPolyline.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lPolyline.setOpaque(true);
+        lPolyline.setPreferredSize(new Dimension(153, 20));
+
+        cPolyline.setModel(new DefaultComboBoxModel(new String[] { 
+            MessagesGED.interpolated, MessagesGED.staircase, MessagesGED.barplot, 
+            MessagesGED.bar, MessagesGED.arrowed, MessagesGED.filled }));
+        cPolyline.setBorder(null);
+        cPolyline.setEditor(null);
+        cPolyline.setPreferredSize(new Dimension(150, 20));
+        cPolyline.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cPolylineActionPerformed(evt);
+            }
+        });
+   }
+
+    /**
+    * Positioning all the components of the Style/Appearance.
+    */
+    private void position() {
+       //Positioning all components.
+        GroupLayout pStyleLayout = new GroupLayout(pStyle);
+        pStyle.setLayout(pStyleLayout);
+        pStyleLayout.setHorizontalGroup(
+            pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pStyleLayout.createSequentialGroup()
+                .addGap(18, 18, 18)
+                .addGroup(pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(pStyleLayout.createSequentialGroup()
+                        .addComponent(lBackColor, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(pBackColor, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+                    .addGroup(pStyleLayout.createSequentialGroup()
+                        .addComponent(lForeColor, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(pForeColor, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+                    .addGroup(pStyleLayout.createSequentialGroup()
+                        .addComponent(lLine, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(cLine, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+                    .addGroup(pStyleLayout.createSequentialGroup()
+                        .addComponent(lPolyline, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(cPolyline, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))))
+        );
+        pStyleLayout.setVerticalGroup(
+            pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pStyleLayout.createSequentialGroup()
+                .addGroup(pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lBackColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(pBackColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lForeColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(pForeColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lLine, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cLine, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lPolyline, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cPolyline, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+        );
+    }
+
+    /**
+    * Loads the current properties of the section Style/Appearance.
+    *
+    * @param objectID Enters the identification of curve.
+    */
+    public void initPropertiesStyle(String objectID) {
+        if (objectID != null) {
+            currentcurve = objectID;
+
+            // Get the current status of the property: Background Color
+            Integer scilabBackgroundColor = (Integer) GraphicController.getController()
+                  .getProperty(currentcurve, GraphicObjectProperties.__GO_BACKGROUND__);
+            Double[] rgbBackgroundColor = ColorMapHandler.getRGBcolor(parentFigure, scilabBackgroundColor);
+            cBackColor.setBackground(new Color(rgbBackgroundColor[0].intValue(), rgbBackgroundColor[1].intValue(), rgbBackgroundColor[2].intValue()));
+
+            // Get the current status of the property: Foreground Color
+            Integer scilabForegroundColor = Editor.getOriColor();
+            Double[] rgbForegroundColor = ColorMapHandler.getRGBcolor(parentFigure, scilabForegroundColor);
+            cForeColor.setBackground(new Color(rgbForegroundColor[0].intValue(), rgbForegroundColor[1].intValue(), rgbForegroundColor[2].intValue()));
+
+            // Get the current status of the property: Line Style
+            int currentLineStyle = (Integer) GraphicController.getController()
+                    .getProperty(currentcurve, GraphicObjectProperties.__GO_LINE_STYLE__);
+            cLine.setSelectedIndex(currentLineStyle);
+
+            // Get the current status of the property: Polyline Style
+            int currentPolylineStyle = (Integer) GraphicController.getController()
+                    .getProperty(currentcurve, GraphicObjectProperties.__GO_POLYLINE_STYLE__);
+            cPolyline.setSelectedIndex(currentPolylineStyle);
+        }
+    }
+
+    /**
+    * Method that will be overwritten by ColorDialog.
+    */
+    public void dialogBackgroundColor() { }
+
+    /**
+    * Method that will be overwritten by ColorDialog.
+    */
+    public void dialogForegroungColor() { }
+
+    /**
+    * Insert the icons on buttons.
+    */
+    private void setIconsStyle() {
+        bStyle.setIcon(new ImageIcon(Inspector.icon_collapse));
+        bStyle.setSelectedIcon(new ImageIcon(Inspector.icon_expand));
+        bBackColor.setIcon(new ImageIcon(Inspector.icon_color_fill));
+        bForeColor.setIcon(new ImageIcon(Inspector.icon_color_fill));
+    }
+
+    /**
+    * Implement the action button to show/hide.
+    * @param evt ActionEvent. 
+    */
+    private void bStyleActionPerformed(ActionEvent evt) {
+        if (bStyle.isSelected()) {
+            pStyle.setVisible(false);
+        } else {
+            pStyle.setVisible(true);
+        }
+    }
+
+    /**
+    * Updates the property: Line Style.
+    * @param evt ActionEvent.
+    */
+    private void cLineActionPerformed(ActionEvent evt) {
+        int setLine = cLine.getSelectedIndex();
+        GraphicController.getController().setProperty(currentcurve, GraphicObjectProperties.__GO_LINE_STYLE__, setLine);
+    }
+
+    /**
+    * Updates the property: Polyline Style.
+    * @param evt ActionEvent.
+    */
+    private void cPolylineActionPerformed(ActionEvent evt) {
+        int setPolyline = cPolyline.getSelectedIndex();
+        GraphicController.getController()
+                .setProperty(currentcurve, GraphicObjectProperties.__GO_POLYLINE_STYLE__, setPolyline);
+    }
+
+    /**
+    * Updates the property: Background Color.
+    * @param evt ActionEvent.
+    */
+    private void bBackColorActionPerformed(ActionEvent evt) {
+        backcolorDialog.setVisible(true);
+    }
+
+    /**
+    * Updates the property: Foreground Color.
+    * @param evt ActionEvent.
+    */
+    private void bForeColorActionPerformed(ActionEvent evt) {
+        forecolorDialog.setVisible(true);
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/BaseProperties.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/BaseProperties.java
new file mode 100644 (file)
index 0000000..1c14954
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.figure;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JToggleButton;
+
+import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
+
+import org.scilab.modules.gui.ged.Inspector;
+import org.scilab.modules.gui.ged.MessagesGED;
+
+/**
+* Construction and startup of all components of the section: Base Properties.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class BaseProperties extends Roof {
+    protected static JToggleButton bBaseProperties;
+    protected static JPanel pBaseProperties;
+    protected JLabel lBaseProperties;
+    protected JSeparator sBaseProperties;
+    protected JComboBox cVisible;
+    private JLabel lVisible;
+
+    protected String currentfigure = null;
+
+    /**
+    * Initializes the properties and the icons of the buttons.
+    *
+    * @param objectID Enters the identification of Figure.
+    */
+    public BaseProperties(String objectID) {
+        position();
+        setIconsBaseProperties();
+        initPropertiesBase(objectID);
+    }
+
+    /**
+    * It has all the components of the section Base Properties.
+    */
+    @Override
+    public void basePropertiesComponents() {
+        pBaseProperties = new JPanel();
+        bBaseProperties = new JToggleButton();
+        lBaseProperties = new JLabel();
+        sBaseProperties = new JSeparator();
+        lVisible = new JLabel();
+        cVisible = new JComboBox();
+
+        //Components of the header: Base Properties.
+        pBaseProperties.setAlignmentX(0.0F);
+        pBaseProperties.setAlignmentY(0.0F);
+
+        bBaseProperties.setBorder(null);
+        bBaseProperties.setBorderPainted(false);
+        bBaseProperties.setContentAreaFilled(false);
+        bBaseProperties.setMaximumSize(new Dimension(16, 16));
+        bBaseProperties.setMinimumSize(new Dimension(16, 16));
+        bBaseProperties.setPreferredSize(new Dimension(16, 16));
+        bBaseProperties.setRolloverEnabled(false);
+        bBaseProperties.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bBasePropertiesActionPerformed(evt);
+            }
+        });
+
+        lBaseProperties.setText(MessagesGED.base_properties);
+
+        sBaseProperties.setPreferredSize(new Dimension(50, 2));
+
+        //Components of the property: Visible.
+        lVisible.setBackground(new Color(255, 255, 255));
+        lVisible.setText(" " + MessagesGED.visible);
+        lVisible.setAlignmentX(0.5F);
+        lVisible.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lVisible.setOpaque(true);
+        lVisible.setPreferredSize(new Dimension(153, 20));
+
+        cVisible.setModel(new DefaultComboBoxModel(new String[] {MessagesGED.off, MessagesGED.on}));
+        cVisible.setBorder(null);
+        cVisible.setEditor(null);
+        cVisible.setPreferredSize(new Dimension(150, 20));
+        cVisible.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cVisibleActionPerformed(evt);
+            }
+        });
+    }
+
+    /**
+    * Positioning all the components of the Basic Properties.
+    */
+    private void position() {
+        GroupLayout pBasePropertiesLayout = new GroupLayout(pBaseProperties);
+        pBaseProperties.setLayout(pBasePropertiesLayout);
+        pBasePropertiesLayout.setHorizontalGroup(
+            pBasePropertiesLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pBasePropertiesLayout.createSequentialGroup()
+                .addGap(18, 18, 18)
+                .addComponent(lVisible, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                .addGap(4, 4, 4)
+                .addComponent(cVisible, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+        );
+        pBasePropertiesLayout.setVerticalGroup(
+            pBasePropertiesLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pBasePropertiesLayout.createSequentialGroup()
+                .addGap(1, 1, 1)
+                .addComponent(lVisible, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addComponent(cVisible, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+        );
+    }
+
+    /**
+    * Loads the current properties of the section Base Properties.
+    *
+    * @param objectID Enters the identification of Figure.
+    */
+    private void initPropertiesBase(String objectID) {
+        if (objectID != null) {
+            currentfigure = objectID;
+            // Get the current status of the property: Visible
+            boolean isVisible = (Boolean) GraphicController.getController()
+                    .getProperty(currentfigure, GraphicObjectProperties.__GO_VISIBLE__);
+            if (isVisible) {
+                cVisible.setSelectedIndex(1);
+            } else {
+                cVisible.setSelectedIndex(0);
+            }
+        }
+    }
+
+    /**
+    * Insert the icons on buttons.
+    */
+    private final void setIconsBaseProperties() {
+        bBaseProperties.setIcon(new ImageIcon(Inspector.icon_collapse));
+        bBaseProperties.setSelectedIcon(new ImageIcon(Inspector.icon_expand));
+    }
+
+    /**
+    * Implement the action button to show/hide.
+    */
+    private void bBasePropertiesActionPerformed(ActionEvent evt) {
+        if (bBaseProperties.isSelected()) {
+            pBaseProperties.setVisible(false);
+        } else {
+            pBaseProperties.setVisible(true);
+        }
+    }
+
+    /**
+    * Updates the property: Visible.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cVisibleActionPerformed(ActionEvent evt) {
+        boolean setVisible = true;
+        if (cVisible.getSelectedIndex() == 0) {
+            setVisible = false;
+        }
+        GraphicController.getController()
+                .setProperty(currentfigure, GraphicObjectProperties.__GO_VISIBLE__, setVisible);
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/ColorDialog.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/ColorDialog.java
new file mode 100644 (file)
index 0000000..d04869c
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.figure;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.GroupLayout;
+import javax.swing.JButton;
+import javax.swing.JColorChooser;
+import javax.swing.JDialog;
+import javax.swing.LayoutStyle;
+
+import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
+
+import org.scilab.modules.gui.ged.ColorMapHandler;
+import org.scilab.modules.gui.ged.MessagesGED;
+
+/**
+* Implementation of the windows to color selection.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class ColorDialog extends Style {
+    private JColorChooser chooser;
+    private JButton ok;
+    private Color choice;
+
+    /**
+    * Receives and passes the objectID to the parent class.
+    *
+    * @param objectID Enters the identification of Figure.
+    */
+    public ColorDialog(String objectID) {
+        super(objectID);
+    }
+
+    /**
+    * JDialog - Selection of background colors.
+    */
+    @Override
+    public void dialogColor() {
+        colorDialog = new JDialog();
+        chooser = new JColorChooser();
+        ok = new JButton();
+
+        colorDialog.setTitle(MessagesGED.choose_background_color);
+        colorDialog.setMinimumSize(new Dimension(670, 450));
+        colorDialog.setModal(true);
+        colorDialog.setResizable(false);
+
+        ok.setText("OK");
+        ok.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                okActionPerformed(evt);
+            }
+        });
+
+        //Position settings.
+        GroupLayout colorDialogLayout = new GroupLayout(colorDialog.getContentPane());
+        colorDialog.getContentPane().setLayout(colorDialogLayout);
+        colorDialogLayout.setHorizontalGroup(
+            colorDialogLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(colorDialogLayout.createSequentialGroup()
+                .addComponent(chooser, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(0, 0, Short.MAX_VALUE))
+            .addGroup(GroupLayout.Alignment.TRAILING, colorDialogLayout.createSequentialGroup()
+                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                .addComponent(ok)
+                .addContainerGap())
+        );
+        colorDialogLayout.setVerticalGroup(
+            colorDialogLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(colorDialogLayout.createSequentialGroup()
+                .addComponent(chooser, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(ok)
+                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+        );
+    }
+
+    /**
+    * Implement the action on the OK button to save the color chosen by the user.
+    *
+    * @param evt ActionEvent.
+    */
+    private void okActionPerformed(ActionEvent evt) {
+        choice = chooser.getColor();
+        double red = choice.getRed();
+        double green = choice.getGreen();
+        double blue = choice.getBlue();
+        Integer scilabColor = ColorMapHandler.getScilabColor(red, green, blue, currentfigure);
+        setColor(scilabColor);
+        cColor.setBackground(choice);
+        colorDialog.dispose();
+    }
+
+    /**
+    * Change the color of the object.
+    *
+    * @param scilabColor index of the color map.
+    */
+    private void setColor(Integer scilabColor) {
+        GraphicController.getController()
+              .setProperty(currentfigure, GraphicObjectProperties.__GO_BACKGROUND__, scilabColor);
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/Control.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/Control.java
new file mode 100644 (file)
index 0000000..c27cb81
--- /dev/null
@@ -0,0 +1,372 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.figure;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JTextField;
+import javax.swing.JToggleButton;
+
+import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
+
+import org.scilab.modules.gui.ged.Inspector;
+import org.scilab.modules.gui.ged.MessagesGED;
+
+/**
+* Construction and startup of all components of the section: Control.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class Control extends BaseProperties {
+    protected static JToggleButton bControl;
+    protected static JPanel pControl;
+    protected JLabel lControl;
+    protected JSeparator sControl;
+    protected JComboBox cAutoResize;
+    protected JLabel lAutoResize;
+    protected JLabel lxposition;
+    protected JTextField cxposition;
+    protected JLabel lyposition;
+    protected JTextField cyposition;
+    protected JTextField cxsize;
+    protected JLabel lxsize;
+    protected JTextField cysize;
+    protected JLabel lysize;
+
+
+    /**
+    * Receives and passes the objectID to the parent class.
+    * @param objectID Enters the identification of Figure.
+    */
+    public Control(String objectID) {
+        super(objectID);
+        position();
+        setIconsControl();
+        initPropertiesControl(objectID);
+    }
+
+    /**
+    * It has all the components of the section Control.
+    */
+    @Override
+    public void controlComponents() {
+        bControl = new JToggleButton();
+        lControl = new JLabel();
+        sControl = new JSeparator();
+        pControl = new JPanel();
+        lAutoResize = new JLabel();
+        cAutoResize = new JComboBox();
+        lxposition = new JLabel();
+        cxposition = new JTextField();
+        lyposition = new JLabel();
+        cyposition = new JTextField();
+        lxsize = new JLabel();
+        cxsize = new JTextField();
+        lysize = new JLabel();
+        cysize = new JTextField();
+
+        //Components of the header: Control.
+        pControl.setAlignmentX(0.0F);
+        pControl.setAlignmentY(0.0F);
+
+        bControl.setBorder(null);
+        bControl.setBorderPainted(false);
+        bControl.setContentAreaFilled(false);
+        bControl.setMaximumSize(new Dimension(16, 16));
+        bControl.setMinimumSize(new Dimension(16, 16));
+        bControl.setPreferredSize(new Dimension(16, 16));
+        bControl.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bControlActionPerformed(evt);
+            }
+        });
+
+        lControl.setText(MessagesGED.control);
+
+        sControl.setPreferredSize(new Dimension(50, 2));
+
+        //Components of the property: Auto Resize.
+        lAutoResize.setBackground(new Color(255, 255, 255));
+        lAutoResize.setText(" " + MessagesGED.auto_resize);
+        lAutoResize.setAlignmentX(0.5F);
+        lAutoResize.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lAutoResize.setOpaque(true);
+        lAutoResize.setPreferredSize(new Dimension(153, 20));
+
+        cAutoResize.setModel(new DefaultComboBoxModel(new String[] {MessagesGED.off, MessagesGED.on}));
+        cAutoResize.setBorder(null);
+        cAutoResize.setEditor(null);
+        cAutoResize.setPreferredSize(new Dimension(150, 20));
+        cAutoResize.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cAutoResizeActionPerformed(evt);
+            }
+        });
+
+       //Components of the property: Position X.
+        lxposition.setBackground(new Color(255, 255, 255));
+        lxposition.setText(" " + MessagesGED.x_position);
+        lxposition.setAlignmentX(0.5F);
+        lxposition.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lxposition.setOpaque(true);
+        lxposition.setPreferredSize(new Dimension(153, 20));
+
+        cxposition.setToolTipText(MessagesGED.x_position_tooltip);
+        cxposition.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cxposition.setPreferredSize(new Dimension(150, 20));
+        cxposition.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cxpositionActionPerformed(evt);
+            }
+        });
+
+        //Components of the property: Position Y.
+        lyposition.setBackground(new Color(255, 255, 255));
+        lyposition.setText(" " + MessagesGED.y_position);
+        lyposition.setAlignmentX(0.5F);
+        lyposition.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lyposition.setOpaque(true);
+        lyposition.setPreferredSize(new Dimension(153, 20));
+
+        cyposition.setToolTipText(MessagesGED.y_position_tooltip);
+        cyposition.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cyposition.setPreferredSize(new Dimension(150, 20));
+        cyposition.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cypositionActionPerformed(evt);
+            }
+        });
+
+       //Components of the property: Size X.
+        lxsize.setBackground(new Color(255, 255, 255));
+        lxsize.setText(" " + MessagesGED.x_size);
+        lxsize.setAlignmentX(0.5F);
+        lxsize.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lxsize.setOpaque(true);
+        lxsize.setPreferredSize(new Dimension(153, 20));
+
+        cxsize.setToolTipText(MessagesGED.x_size_tooltip);
+        cxsize.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cxsize.setPreferredSize(new Dimension(150, 20));
+        cxsize.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cxsizeActionPerformed(evt);
+            }
+        });
+
+       //Components of the property: Size Y.
+        lysize.setBackground(new Color(255, 255, 255));
+        lysize.setText(" " + MessagesGED.y_size);
+        lysize.setAlignmentX(0.5F);
+        lysize.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lysize.setOpaque(true);
+        lysize.setPreferredSize(new Dimension(153, 20));
+
+        cysize.setToolTipText(MessagesGED.y_size_tooltip);
+        cysize.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cysize.setPreferredSize(new Dimension(150, 20));
+        cysize.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cysizeActionPerformed(evt);
+            }
+        });
+   }
+
+    /**
+    * Positioning all the components of the Control.
+    */
+    private void position() {
+        GroupLayout pControlLayout = new GroupLayout(pControl);
+        pControl.setLayout(pControlLayout);
+        pControlLayout.setHorizontalGroup(
+            pControlLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pControlLayout.createSequentialGroup()
+                .addGap(18, 18, 18)
+                .addGroup(pControlLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(pControlLayout.createSequentialGroup()
+                        .addComponent(lAutoResize, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(cAutoResize, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+                    .addGroup(pControlLayout.createSequentialGroup()
+                        .addComponent(lxposition, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(cxposition, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+                    .addGroup(pControlLayout.createSequentialGroup()
+                        .addComponent(lyposition, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(cyposition, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+                    .addGroup(pControlLayout.createSequentialGroup()
+                        .addComponent(lxsize, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(cxsize, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+                    .addGroup(pControlLayout.createSequentialGroup()
+                        .addComponent(lysize, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(cysize, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))))
+        );
+        pControlLayout.setVerticalGroup(
+            pControlLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pControlLayout.createSequentialGroup()
+                .addGroup(pControlLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lAutoResize, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cAutoResize, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pControlLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lxposition, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cxposition, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pControlLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lyposition, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cyposition, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pControlLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lxsize, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cxsize, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(5, 5, 5)
+                .addGroup(pControlLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lysize, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cysize, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+        );
+    }
+
+    /**
+    * Loads the current properties of the section Control.
+    *
+    * @param objectID Enters the identification of Figure.
+    */
+    public void initPropertiesControl(String objectID) {
+        if (objectID != null) {
+            currentfigure = objectID;
+            /** Get the current status of the property: Auto Resize */
+            boolean isAutoResize = (Boolean) GraphicController.getController()
+                    .getProperty(currentfigure, GraphicObjectProperties.__GO_AUTORESIZE__);
+            if (isAutoResize) {
+                cAutoResize.setSelectedIndex(1);
+            } else {
+               cAutoResize.setSelectedIndex(0);
+            }
+            /** Get the current status of the property: Position */
+            Integer[] currentPosition = (Integer[]) GraphicController.getController()
+                        .getProperty(currentfigure, GraphicObjectProperties.__GO_POSITION__);
+            String currentXposition;
+            currentXposition = currentPosition[0].toString();
+            cxposition.setText(currentXposition);
+            String currentYposition;
+            currentYposition = currentPosition[1].toString();
+            cyposition.setText(currentXposition);
+            /** Get the current status of the property: Size */
+            Integer[] currentSize = (Integer[]) GraphicController.getController()
+                    .getProperty(currentfigure, GraphicObjectProperties.__GO_SIZE__);
+            String currentXsize;
+            currentXsize = currentSize[0].toString();
+            cxsize.setText(currentXsize);
+            String currentYsize;
+            currentYsize = currentSize[1].toString();
+            cysize.setText(currentXsize);
+        }
+    }
+
+    /**
+    * Insert the icons on buttons.
+    */
+    private void setIconsControl() {
+        bControl.setIcon(new ImageIcon(Inspector.icon_collapse));
+        bControl.setSelectedIcon(new ImageIcon(Inspector.icon_expand));
+    }
+
+    /**
+    * Implement the action button to show/hide.
+    *
+    * @param evt ActionEvent.
+    */
+    private void bControlActionPerformed(ActionEvent evt) {
+        if (bControl.isSelected()) {
+            pControl.setVisible(false);
+        } else {
+            pControl.setVisible(true);
+        }
+    }
+
+    /**
+    * Updates the property: Auto Resize.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cAutoResizeActionPerformed(ActionEvent evt) {
+        boolean setAutoResize = true;
+        if (cAutoResize.getSelectedIndex() == 0) {
+            setAutoResize = false;
+        }
+        GraphicController.getController()
+                .setProperty(currentfigure, GraphicObjectProperties.__GO_AUTORESIZE__, setAutoResize);
+    }
+
+    /**
+    * Updates the property: xPosition.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cxpositionActionPerformed(ActionEvent evt) {
+        int setXposition = Integer.parseInt(cxposition.getText());
+        int setYposition = Integer.parseInt(cyposition.getText());
+        Integer[] setPosition = new Integer[2];
+        setPosition[0] = setXposition;
+        setPosition[1] = setYposition;
+        GraphicController.getController()
+                .setProperty(currentfigure, GraphicObjectProperties.__GO_POSITION__, setPosition);
+    }
+
+    /**
+    * Updates the property: yPosition.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cypositionActionPerformed(ActionEvent evt) {
+        cxpositionActionPerformed(evt);
+    }
+
+    /**
+    * Updates the property: xSize.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cxsizeActionPerformed(ActionEvent evt) {
+        int setXsize = Integer.parseInt(cxsize.getText());
+        int setYsize = Integer.parseInt(cysize.getText());
+        Integer[] setSize = new Integer[2];
+        setSize[0] = setXsize;
+        setSize[1] = setYsize;
+        GraphicController.getController()
+                .setProperty(currentfigure, GraphicObjectProperties.__GO_SIZE__, setSize);
+    }
+
+    /**
+    * Updates the property: ySize.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cysizeActionPerformed(ActionEvent evt) {
+        cxsizeActionPerformed(evt);
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/DataProperties.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/DataProperties.java
new file mode 100644 (file)
index 0000000..ce1b1d7
--- /dev/null
@@ -0,0 +1,263 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.figure;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JTextField;
+import javax.swing.JToggleButton;
+
+import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
+
+import org.scilab.modules.gui.ged.Inspector;
+import org.scilab.modules.gui.ged.MessagesGED;
+
+/**
+* Construction and startup of all components of the section: DataProperties.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class DataProperties extends Control {
+    protected static JToggleButton bData;
+    protected static JPanel pData;
+    protected JLabel lData;
+    protected JSeparator sData;
+    protected JTextField cFigureID;
+    protected JLabel lFigureID;
+    protected JTextField cFigureName;
+    protected JLabel lFigureName;
+    protected JComboBox cUnits;
+    protected JLabel lUnits;
+
+    /**
+    * Receives and passes the objectID to the parent class.
+    *
+    * @param objectID Enters the identification of Figure.
+    */
+    public DataProperties(String objectID) {
+        super(objectID);
+        position();
+        setIconsData();
+        initPropertiesData(objectID);
+    }
+
+    /**
+    * It has all the components of the section Control.
+    */
+    @Override
+    public void dataComponents() {
+        pData = new JPanel();
+        bData = new JToggleButton();
+        lData = new JLabel();
+        sData = new JSeparator();
+        lFigureID = new JLabel();
+        cFigureID = new JTextField();
+        lFigureName = new JLabel();
+        cFigureName = new JTextField();
+        lUnits = new JLabel();
+        cUnits = new JComboBox();
+
+        //Components of the header: DataProperties.
+        pData.setAlignmentX(0.0F);
+        pData.setAlignmentY(0.0F);
+
+        bData.setBorder(null);
+        bData.setBorderPainted(false);
+        bData.setContentAreaFilled(false);
+        bData.setMaximumSize(new Dimension(16, 16));
+        bData.setMinimumSize(new Dimension(16, 16));
+        bData.setPreferredSize(new Dimension(16, 16));
+        bData.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bDataActionPerformed(evt);
+            }
+        });
+
+        lData.setText(MessagesGED.data);
+
+        sData.setPreferredSize(new Dimension(50, 2));
+
+        //Components of the property: Figure ID.
+        lFigureID.setBackground(new Color(255, 255, 255));
+        lFigureID.setText(" " + MessagesGED.figure_id);
+        lFigureID.setAlignmentX(0.5F);
+        lFigureID.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lFigureID.setOpaque(true);
+        lFigureID.setPreferredSize(new Dimension(153, 20));
+
+        cFigureID.setBackground(new Color(238, 238, 238));
+        cFigureID.setEditable(true);
+        cFigureID.setToolTipText(MessagesGED.figure_id_tooltip);
+        cFigureID.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cFigureID.setPreferredSize(new Dimension(150, 20));
+        cFigureID.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cFigureIDActionPerformed(evt);
+            }
+        });
+
+        //Components of the property: Figure Name.
+        lFigureName.setBackground(new Color(255, 255, 255));
+        lFigureName.setText(" " + MessagesGED.figure_name);
+        lFigureName.setAlignmentX(0.5F);
+        lFigureName.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lFigureName.setOpaque(true);
+        lFigureName.setPreferredSize(new Dimension(153, 20));
+
+        cFigureName.setToolTipText(MessagesGED.figure_name_tooltip);
+        cFigureName.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cFigureName.setPreferredSize(new Dimension(150, 20));
+        cFigureName.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cFigureNameActionPerformed(evt);
+            }
+        });
+
+       //Components of the property: Units.
+        lUnits.setBackground(new Color(255, 255, 255));
+        lUnits.setText(" " + MessagesGED.units);
+        lUnits.setAlignmentX(0.5F);
+        lUnits.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lUnits.setOpaque(true);
+        lUnits.setPreferredSize(new Dimension(153, 20));
+
+        cUnits.setModel(new DefaultComboBoxModel(new String[] { 
+            "Inches", "Centimeters", "Normalized",
+            "Points", "Pixels", "Characters"}));
+        cUnits.setSelectedIndex(4);
+        cUnits.setBorder(null);
+        cUnits.setEditor(null);
+        cUnits.setPreferredSize(new Dimension(150, 20));
+   }
+
+    /**
+    * Positioning all the components of the DataProperties.
+    */
+    private void position() {
+        GroupLayout pDataLayout = new GroupLayout(pData);
+        pData.setLayout(pDataLayout);
+        pDataLayout.setHorizontalGroup(
+            pDataLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pDataLayout.createSequentialGroup()
+                .addGap(18, 18, 18)
+                .addGroup(pDataLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(pDataLayout.createSequentialGroup()
+                        .addComponent(lFigureID, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(cFigureID, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+                    .addGroup(pDataLayout.createSequentialGroup()
+                        .addComponent(lFigureName, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(cFigureName, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+                    .addGroup(pDataLayout.createSequentialGroup()
+                        .addComponent(lUnits, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(cUnits, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))))
+        );
+        pDataLayout.setVerticalGroup(
+            pDataLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pDataLayout.createSequentialGroup()
+                .addGroup(pDataLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lFigureID, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addGroup(pDataLayout.createSequentialGroup()
+                        .addGap(1, 1, 1)
+                        .addComponent(cFigureID, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+                .addGap(6, 6, 6)
+                .addGroup(pDataLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lFigureName, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addGroup(pDataLayout.createSequentialGroup()
+                        .addGap(1, 1, 1)
+                        .addComponent(cFigureName, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+                .addGap(6, 6, 6)
+                .addGroup(pDataLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(pDataLayout.createSequentialGroup()
+                        .addGap(1, 1, 1)
+                        .addComponent(lUnits, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                    .addComponent(cUnits, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+        );
+    }
+
+    /**
+    * Loads the current properties of the section DataProperties.
+    *
+    * @param objectID Enters the identification of Figure.
+    */
+    public void initPropertiesData(String objectID) {
+        if (objectID != null) {
+            currentfigure = objectID;
+            /** Get the current status of the property: Figure ID */
+            Integer currentFigureID = (Integer) GraphicController.getController()
+                    .getProperty(currentfigure, GraphicObjectProperties.__GO_ID__);
+            String figureID;
+            figureID = currentFigureID.toString();
+            cFigureID.setText(figureID);
+            /** Get the current status of the property: Figure Name */
+            String figureName = (String) GraphicController.getController()
+                    .getProperty(currentfigure, GraphicObjectProperties.__GO_NAME__);
+            cFigureName.setText(figureName);
+        }
+    }
+
+    /**
+    * Insert the icons on buttons.
+    */
+    private void setIconsData() {
+        bData.setSelectedIcon(new ImageIcon(Inspector.icon_expand));
+        bData.setIcon(new ImageIcon(Inspector.icon_collapse));
+    }
+
+    /**
+    * Implement the action button to show/hide.
+    *
+    * @param evt ActionEvent.
+    */
+    private void bDataActionPerformed(ActionEvent evt) {
+        if (bData.isSelected()) {
+            pData.setVisible(false);
+        } else {
+            pData.setVisible(true);
+        }
+    }
+
+    /**
+    * Updates the property: Figure ID.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cFigureIDActionPerformed(ActionEvent evt) {
+        int setfigureID = Integer.parseInt(cFigureID.getText());
+        GraphicController.getController()
+                .setProperty(currentfigure, GraphicObjectProperties.__GO_ID__, setfigureID);
+    }
+
+    /**
+    * Updates the property: Figure Name.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cFigureNameActionPerformed(ActionEvent evt) {
+        GraphicController.getController()
+                .setProperty(currentfigure, GraphicObjectProperties.__GO_NAME__, cFigureName.getText());
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/Figure.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/Figure.java
new file mode 100644 (file)
index 0000000..35571f9
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.figure;
+
+/**
+* Properties of the Figure.
+* Last child.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class Figure extends Layout {
+    /**
+    * Initializes the components of the JPanel.
+    *
+    * @param objectID Enters the identification of figure.
+    */
+    public Figure(String objectID) {
+        super(objectID);
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/HideFigure.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/HideFigure.java
new file mode 100644 (file)
index 0000000..d7a2d42
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.figure;
+
+/**
+ * Manages the operation of the button show/hide for the current Figure.
+ *
+ * @author cardinot
+ */
+public class HideFigure {
+    public HideFigure(boolean hide) {
+        if (hide) {
+            BaseProperties.pBaseProperties.setVisible(false);
+            BaseProperties.bBaseProperties.setSelected(true);
+
+            Control.pControl.setVisible(false);
+            Control.bControl.setSelected(true);
+
+            DataProperties.pData.setVisible(false);
+            DataProperties.bData.setSelected(true);
+
+            Style.pStyle.setVisible(false);
+            Style.bStyle.setSelected(true);
+        } else {
+            BaseProperties.pBaseProperties.setVisible(true);
+            BaseProperties.bBaseProperties.setSelected(false);
+
+            Control.pControl.setVisible(true);
+            Control.bControl.setSelected(false);
+
+            DataProperties.pData.setVisible(true);
+            DataProperties.bData.setSelected(false);
+
+            Style.pStyle.setVisible(true);
+            Style.bStyle.setSelected(false);
+        }
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/Layout.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/Layout.java
new file mode 100644 (file)
index 0000000..b67e4dc
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.figure;
+
+import javax.swing.GroupLayout;
+
+/**
+* Construction and startup of all components of the Figure.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class Layout extends ColorDialog {
+
+    /**
+    * Receives and passes the objectID to the parent class.
+    *
+    * @param objectID Enters the identification of Figure.
+    */
+    public Layout(String objectID) {
+        super(objectID);
+    }
+
+    /**
+    * Creates layout of all sections(Base Proprerties, Control, Data and Style/Appareance).
+    */
+    @Override
+    public void initLayout() {
+        GroupLayout layout = new GroupLayout(this);
+        this.setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addComponent(bBaseProperties, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+            .addGroup(layout.createSequentialGroup()
+                .addGap(21, 21, 21)
+                .addComponent(lBaseProperties))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(12, 12, 12)
+                .addComponent(sBaseProperties, GroupLayout.PREFERRED_SIZE, 338, GroupLayout.PREFERRED_SIZE))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(pBaseProperties, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(20, 20, 20)
+                .addComponent(lControl))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(sControl, GroupLayout.PREFERRED_SIZE, 338, GroupLayout.PREFERRED_SIZE))
+            .addComponent(bControl, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(pControl, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(pData, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addComponent(bData, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+            .addGroup(layout.createSequentialGroup()
+                .addGap(20, 20, 20)
+                .addComponent(lData))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(sData, GroupLayout.PREFERRED_SIZE, 338, GroupLayout.PREFERRED_SIZE))
+            .addGroup(layout.createSequentialGroup()
+                .addComponent(bStyle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(5, 5, 5)
+                .addComponent(lStyle))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(pStyle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addGroup(layout.createSequentialGroup()
+                .addGap(10, 10, 10)
+                .addComponent(sStyle, GroupLayout.PREFERRED_SIZE, 338, GroupLayout.PREFERRED_SIZE))
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(bBaseProperties, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(2, 2, 2)
+                        .addComponent(lBaseProperties))
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(15, 15, 15)
+                        .addComponent(sBaseProperties, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE))
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(22, 22, 22)
+                        .addComponent(pBaseProperties, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+                .addGap(5, 5, 5)
+                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(2, 2, 2)
+                        .addComponent(lControl))
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(15, 15, 15)
+                        .addComponent(sControl, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE))
+                    .addComponent(bControl, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(22, 22, 22)
+                        .addComponent(pControl, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+                .addGap(5, 5, 5)
+                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(22, 22, 22)
+                        .addComponent(pData, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                    .addComponent(bData, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(2, 2, 2)
+                        .addComponent(lData))
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(15, 15, 15)
+                        .addComponent(sData, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE)))
+                .addGap(5, 5, 5)
+                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(bStyle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(2, 2, 2)
+                        .addComponent(lStyle))
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(22, 22, 22)
+                        .addComponent(pStyle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(15, 15, 15)
+                        .addComponent(sStyle, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE))))
+        );
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/Roof.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/Roof.java
new file mode 100644 (file)
index 0000000..aa2cfc2
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.figure;
+
+import javax.swing.JPanel;
+
+/**
+ * Highest class - Prepares methods dependent on JPanel.
+ * @author cardinot
+ */
+public class Roof extends JPanel {
+
+    /**
+    * Build methods of overwriting.
+    */
+    public Roof() {
+        basePropertiesComponents();
+        controlComponents();
+        dataComponents();
+        styleComponents();
+        initLayout();
+        dialogColor();
+    }
+
+    /**
+    * It has all the components of the section Base Properties.
+    */
+    public void basePropertiesComponents() { };
+
+    /**
+    * It has all the components of the section Control.
+    */
+    public void controlComponents() { };
+
+    /**
+    * It has all the components of the section Data.
+    */
+    public void dataComponents() { };
+
+    /**
+    * It has all the components of the section Style/Appareance.
+    */
+    public void styleComponents() { };
+
+    /**
+    * Creates layout of all sections.
+    */
+    public void initLayout() { };
+
+    /**
+    * JDialog - Selection of background colors.
+    */
+    public void dialogColor() { };
+}
\ No newline at end of file
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/Style.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/ged/figure/Style.java
new file mode 100644 (file)
index 0000000..5ccc758
--- /dev/null
@@ -0,0 +1,382 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Marcos Cardinot
+ *
+ * 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.gui.ged.figure;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JToggleButton;
+
+import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
+
+import org.scilab.modules.gui.ged.ColorMapHandler;
+import org.scilab.modules.gui.ged.Inspector;
+import org.scilab.modules.gui.ged.MessagesGED;
+
+/**
+* Construction and startup of all components of the section: Style/Appeareance.
+*
+* @author Marcos Cardinot <mcardinot@gmail.com>
+*/
+public class Style extends DataProperties {
+    protected static JToggleButton bStyle;
+    protected static JPanel pStyle;
+    protected JPanel pColor;
+    protected JButton bColor;
+    protected JLabel lStyle;
+    protected JSeparator sStyle;
+    protected JLabel lColor;
+    protected JLabel cColor;
+    protected JComboBox cPixmap;
+    protected JLabel lPixmap;
+    protected JComboBox cPixelDrawing;
+    protected JLabel lPixelDrawing;
+    protected JComboBox cRotationStyle;
+    protected JLabel lRotationStyle;
+    protected JDialog colorDialog;
+
+    /**
+    * Receives and passes the objectID to the parent class.
+    *
+    * @param objectID Enters the identification of Figure.
+    */
+    public Style(String objectID) {
+        super(objectID);
+        position();
+        setIconsStyle();
+        initPropertiesStyle(objectID);
+    }
+
+    /**
+    * It has all the components of the section Style/Appeareance.
+    */
+    @Override
+    public void styleComponents() {
+        pStyle = new JPanel();
+        bStyle = new JToggleButton();
+        lStyle = new JLabel();
+        sStyle = new JSeparator();
+        pColor = new JPanel();
+        bColor = new JButton();
+        cColor = new JLabel();
+        lColor = new JLabel();
+        lPixmap = new JLabel();
+        cPixmap = new JComboBox();
+        lPixelDrawing = new JLabel();
+        cPixelDrawing = new JComboBox();
+        lRotationStyle = new JLabel();
+        cRotationStyle = new JComboBox();
+
+        //Components of the header: Style/Appeareance.
+        pStyle.setAlignmentX(0.0F);
+        pStyle.setAlignmentY(0.0F);
+
+        bStyle.setBorder(null);
+        bStyle.setBorderPainted(false);
+        bStyle.setContentAreaFilled(false);
+        bStyle.setMaximumSize(new Dimension(16, 16));
+        bStyle.setMinimumSize(new Dimension(16, 16));
+        bStyle.setPreferredSize(new Dimension(16, 16));
+        bStyle.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bStyleActionPerformed(evt);
+            }
+        });
+
+        lStyle.setText(MessagesGED.style_appearance);
+
+        sStyle.setPreferredSize(new Dimension(50, 2));
+
+       //Components of the property: Color.
+        pColor.setBackground(new Color(255, 255, 255));
+        pColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        pColor.setPreferredSize(new Dimension(157, 20));
+
+
+        bColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        bColor.setContentAreaFilled(false);
+        bColor.setPreferredSize(new Dimension(16, 16));
+        bColor.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                bColorActionPerformed(evt);
+            }
+        });
+
+        cColor.setText(" ");
+        cColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        cColor.setOpaque(true);
+
+        lColor.setBackground(new Color(255, 255, 255));
+        lColor.setText(" " + MessagesGED.background_color);
+        lColor.setAlignmentX(0.5F);
+        lColor.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lColor.setOpaque(true);
+        lColor.setPreferredSize(new Dimension(153, 20));
+
+       //Positioning the components of the property: Color.
+        GroupLayout pColorLayout = new GroupLayout(pColor);
+        pColor.setLayout(pColorLayout);
+        pColorLayout.setHorizontalGroup(
+            pColorLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pColorLayout.createSequentialGroup()
+                .addGap(35, 35, 35)
+                .addComponent(bColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGap(11, 11, 11)
+                .addComponent(cColor, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE))
+        );
+        pColorLayout.setVerticalGroup(
+            pColorLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pColorLayout.createSequentialGroup()
+                .addGap(1, 1, 1)
+                .addComponent(bColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addGroup(pColorLayout.createSequentialGroup()
+                .addGap(3, 3, 3)
+                .addComponent(cColor, GroupLayout.PREFERRED_SIZE, 11, GroupLayout.PREFERRED_SIZE))
+        );
+
+       //Components of the property: Pixmap.
+        lPixmap.setBackground(new Color(255, 255, 255));
+        lPixmap.setText(" " + MessagesGED.pixmap);
+        lPixmap.setAlignmentX(0.5F);
+        lPixmap.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lPixmap.setOpaque(true);
+        lPixmap.setPreferredSize(new Dimension(153, 20));
+
+        cPixmap.setModel(new DefaultComboBoxModel(new String[] {MessagesGED.off, MessagesGED.on}));
+        cPixmap.setBorder(null);
+        cPixmap.setEditor(null);
+        cPixmap.setPreferredSize(new Dimension(150, 20));
+        cPixmap.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cPixmapActionPerformed(evt);
+            }
+        });
+
+       //Components of the property: Pixel Drawing Mode.
+        lPixelDrawing.setBackground(new Color(255, 255, 255));
+        lPixelDrawing.setText(" " + MessagesGED.pixel_drawing_mode);
+        lPixelDrawing.setAlignmentX(0.5F);
+        lPixelDrawing.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lPixelDrawing.setOpaque(true);
+        lPixelDrawing.setPreferredSize(new Dimension(153, 20));
+
+        cPixelDrawing.setModel(new DefaultComboBoxModel(new String[] { 
+            "clear", "and", "andReverse", "copy", "andInverted",
+            "noop", "xor", "or", "nor", "equiv", "invert", "orReverse",
+            "copyInverted", "orInverted", "nand", "set" }));
+        cPixelDrawing.setSelectedIndex(3);
+        cPixelDrawing.setBorder(null);
+        cPixelDrawing.setEditor(null);
+        cPixelDrawing.setPreferredSize(new Dimension(150, 20));
+        cPixelDrawing.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cPixelDrawingActionPerformed(evt);
+            }
+        });
+
+       //Components of the property: Rotation Style.
+        lRotationStyle.setBackground(new Color(255, 255, 255));
+        lRotationStyle.setText(" " + MessagesGED.rotation_style);
+        lRotationStyle.setAlignmentX(0.5F);
+        lRotationStyle.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
+        lRotationStyle.setOpaque(true);
+        lRotationStyle.setPreferredSize(new Dimension(153, 20));
+
+        cRotationStyle.setModel(new DefaultComboBoxModel(new String[] { 
+            MessagesGED.unary, MessagesGED.multiple }));
+        cRotationStyle.setBorder(null);
+        cRotationStyle.setEditor(null);
+        cRotationStyle.setPreferredSize(new Dimension(150, 20));
+        cRotationStyle.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent evt) {
+                cRotationStyleActionPerformed(evt);
+            }
+        });
+   }
+
+    /**
+    * Positioning all the components of the Style/Appearance.
+    */
+    private void position() {
+        GroupLayout pStyleLayout = new GroupLayout(pStyle);
+        pStyle.setLayout(pStyleLayout);
+        pStyleLayout.setHorizontalGroup(
+            pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pStyleLayout.createSequentialGroup()
+                .addGap(18, 18, 18)
+                .addGroup(pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(pStyleLayout.createSequentialGroup()
+                        .addComponent(lColor, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(pColor, GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE))
+                    .addGroup(pStyleLayout.createSequentialGroup()
+                        .addComponent(lPixmap, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(cPixmap, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+                    .addGroup(pStyleLayout.createSequentialGroup()
+                        .addComponent(lPixelDrawing, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(cPixelDrawing, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))
+                    .addGroup(pStyleLayout.createSequentialGroup()
+                        .addComponent(lRotationStyle, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE)
+                        .addGap(4, 4, 4)
+                        .addComponent(cRotationStyle, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE))))
+        );
+        pStyleLayout.setVerticalGroup(
+            pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(pStyleLayout.createSequentialGroup()
+                .addGroup(pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(pColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(6, 6, 6)
+                .addGroup(pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(pStyleLayout.createSequentialGroup()
+                        .addGap(1, 1, 1)
+                        .addComponent(lPixmap, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                    .addComponent(cPixmap, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(7, 7, 7)
+                .addGroup(pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(pStyleLayout.createSequentialGroup()
+                        .addGap(1, 1, 1)
+                        .addComponent(lPixelDrawing, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                    .addComponent(cPixelDrawing, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                .addGap(7, 7, 7)
+                .addGroup(pStyleLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(pStyleLayout.createSequentialGroup()
+                        .addGap(1, 1, 1)
+                        .addComponent(lRotationStyle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                    .addComponent(cRotationStyle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
+        );
+    }
+
+    /**
+    * Loads the current properties of the section Style/Appearance.
+    *
+    * @param figureUid Enters the identification of Figure.
+    */
+    public void initPropertiesStyle(String figureUid) {
+        if (figureUid != null) {
+            currentfigure = figureUid;
+
+            /** Get the current status of the property: Background Color */
+            Integer scilabColor = (Integer) GraphicController.getController()
+                  .getProperty(currentfigure, GraphicObjectProperties.__GO_BACKGROUND__);
+            Double[] rgbColor = ColorMapHandler.getRGBcolor(currentfigure,scilabColor);
+            cColor.setBackground(new Color(rgbColor[0].intValue(), rgbColor[1].intValue(), rgbColor[2].intValue()));
+
+            /** Get the current status of the property: Pixmap */
+            boolean currentPixmap = (Boolean) GraphicController.getController()
+                    .getProperty(currentfigure, GraphicObjectProperties.__GO_PIXMAP__);
+            if (currentPixmap) {
+                cPixmap.setSelectedIndex(1);
+            } else {
+               cPixmap.setSelectedIndex(0);
+            }
+
+            /** Get the current status of the property: Pixel Drawing Mode */
+            Integer currentPixelDrawingMode = (Integer) GraphicController.getController()
+                    .getProperty(currentfigure, GraphicObjectProperties.__GO_PIXEL_DRAWING_MODE__);
+            cPixelDrawing.setSelectedIndex(currentPixelDrawingMode);
+
+            /** Get the current status of the property: Rotation Style */
+            Integer currentRotationStyle = (Integer) GraphicController.getController()
+                    .getProperty(currentfigure, GraphicObjectProperties.__GO_ROTATION_TYPE__);
+            cRotationStyle.setSelectedIndex(currentRotationStyle);
+        }
+    }
+
+    /**
+    * Method that will be overwritten by ColorDialog.
+    */
+    public void dialogColor() { }
+
+    /**
+    * Insert the icons on buttons.
+    */
+    private void setIconsStyle() {
+        bStyle.setIcon(new ImageIcon(Inspector.icon_collapse));
+        bStyle.setSelectedIcon(new ImageIcon(Inspector.icon_expand));
+        bColor.setIcon(new ImageIcon(Inspector.icon_color_fill));
+    }
+
+   /**
+   * Implement the action button to show/hide.
+   *
+   * @param evt ActionEvent.
+   */
+    private void bStyleActionPerformed(ActionEvent evt) {
+        if (bStyle.isSelected()) {
+            pStyle.setVisible(false);
+        } else {
+            pStyle.setVisible(true);
+        }
+    }
+
+    /**
+    * Updates the property: Color.
+    *
+    * @param evt ActionEvent.
+    */
+    private void bColorActionPerformed(ActionEvent evt) {
+        colorDialog.setVisible(true);
+        colorDialog.setModal(true);
+    }
+
+    /**
+    * Updates the property: Pixmap.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cPixmapActionPerformed(ActionEvent evt) {
+        boolean setPixmap = true;
+        if (cPixmap.getSelectedIndex() == 0) {
+            setPixmap = false;
+        }
+        GraphicController.getController()
+                .setProperty(currentfigure, GraphicObjectProperties.__GO_PIXMAP__, setPixmap);
+    }
+
+    /**
+    * Updates the property: Pixel Drawing Mode.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cPixelDrawingActionPerformed(ActionEvent evt) {
+        int setPixelDrawing = cPixelDrawing.getSelectedIndex();
+        GraphicController.getController()
+                .setProperty(currentfigure, GraphicObjectProperties.__GO_PIXEL_DRAWING_MODE__, setPixelDrawing);
+    }
+
+    /**
+    * Updates the property: Rotation Style.
+    *
+    * @param evt ActionEvent.
+    */
+    private void cRotationStyleActionPerformed(ActionEvent evt) {
+        int setRotationStyle = cRotationStyle.getSelectedIndex();
+        GraphicController.getController()
+                .setProperty(currentfigure, GraphicObjectProperties.__GO_ROTATION_TYPE__, setRotationStyle);
+    }
+}
\ No newline at end of file