2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2012 2013 - Marcos CARDINOT
5 * This file must be used under the terms of the CeCILL.
6 * This source file is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at
9 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
12 package org.scilab.modules.gui.ged;
14 import org.scilab.modules.graphic_objects.graphicController.GraphicController;
15 import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
16 import org.scilab.modules.gui.ged.graphic_objects.arc.Arc;
17 import org.scilab.modules.gui.ged.graphic_objects.axes.Axes;
18 import org.scilab.modules.gui.ged.graphic_objects.champ.Champ;
19 import org.scilab.modules.gui.ged.graphic_objects.datatip.Datatip;
20 import org.scilab.modules.gui.ged.graphic_objects.fec.Fec;
21 import org.scilab.modules.gui.ged.graphic_objects.figure.Figure;
22 import org.scilab.modules.gui.ged.graphic_objects.imageplot.Imageplot;
23 import org.scilab.modules.gui.ged.graphic_objects.label.Label;
24 import org.scilab.modules.gui.ged.graphic_objects.legend.Legend;
25 import org.scilab.modules.gui.ged.graphic_objects.polyline.Polyline;
26 import org.scilab.modules.gui.ged.graphic_objects.rectangle.Rectangle;
27 import org.scilab.modules.gui.ged.graphic_objects.segs.Segs;
28 import org.scilab.modules.gui.ged.graphic_objects.surface.Surface;
31 * Manager object exchange.
33 * @author Marcos CARDINOT <mcardinot@gmail.com>
35 public class SwapObject {
36 private static int lastType;
39 * Manager which property window will open.
40 * @param objectID Enters the identification of object.
42 public SwapObject(String objectID) {
43 Integer type = (Integer) GraphicController.getController().getProperty(objectID, GraphicObjectProperties.__GO_TYPE__);
46 case GraphicObjectProperties.__GO_POLYLINE__:
47 Polyline polyline = new Polyline(objectID);
48 SwingInspector.setPanel(polyline, MessagesGED.polyline);
50 case GraphicObjectProperties.__GO_PLOT3D__:
51 Surface plot3d = new Surface(objectID);
52 SwingInspector.setPanel(plot3d, MessagesGED.plot3d);
54 case GraphicObjectProperties.__GO_GRAYPLOT__:
55 Imageplot grayplot = new Imageplot(objectID);
56 SwingInspector.setPanel(grayplot, MessagesGED.grayplot);
58 case GraphicObjectProperties.__GO_FAC3D__:
59 Surface fac3d = new Surface(objectID);
60 SwingInspector.setPanel(fac3d, MessagesGED.fac3d);
62 case GraphicObjectProperties.__GO_MATPLOT__:
63 Imageplot matplot = new Imageplot(objectID);
64 SwingInspector.setPanel(matplot, MessagesGED.matplot);
66 case GraphicObjectProperties.__GO_LEGEND__:
67 Legend legend = new Legend(objectID);
68 SwingInspector.setPanel(legend, MessagesGED.legend);
70 case GraphicObjectProperties.__GO_LABEL__:
71 Label label = new Label(objectID);
72 SwingInspector.setPanel(label, MessagesGED.label);
74 case GraphicObjectProperties.__GO_ARC__:
75 Arc arc = new Arc(objectID);
76 SwingInspector.setPanel(arc, MessagesGED.arc);
78 case GraphicObjectProperties.__GO_CHAMP__:
79 Champ champ = new Champ(objectID);
80 SwingInspector.setPanel(champ, MessagesGED.champ);
82 case GraphicObjectProperties.__GO_FEC__:
83 Fec fec = new Fec(objectID);
84 SwingInspector.setPanel(fec, MessagesGED.fec);
86 case GraphicObjectProperties.__GO_RECTANGLE__:
87 Rectangle rectangle = new Rectangle(objectID);
88 SwingInspector.setPanel(rectangle, MessagesGED.rectangle);
90 case GraphicObjectProperties.__GO_SEGS__:
91 Segs segs = new Segs(objectID);
92 SwingInspector.setPanel(segs, MessagesGED.segs);
94 case GraphicObjectProperties.__GO_DATATIP__:
95 Datatip datatip = new Datatip(objectID);
96 SwingInspector.setPanel(datatip, MessagesGED.datatip);
98 case GraphicObjectProperties.__GO_AXES__:
99 Axes axes = new Axes(objectID);
100 SwingInspector.setPanel(axes, MessagesGED.axes);
104 Figure figure = new Figure(objectID);
105 SwingInspector.setPanel(figure, MessagesGED.figure);
106 } catch (NullPointerException e) { }
112 * Get the last type of object.
115 public static int getLastType() {