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.axes.Axes;
17 import org.scilab.modules.gui.ged.graphic_objects.champ.Champ;
18 import org.scilab.modules.gui.ged.graphic_objects.datatip.Datatip;
19 import org.scilab.modules.gui.ged.graphic_objects.fec.Fec;
20 import org.scilab.modules.gui.ged.graphic_objects.figure.Figure;
21 import org.scilab.modules.gui.ged.graphic_objects.imageplot.Imageplot;
22 import org.scilab.modules.gui.ged.graphic_objects.label.Label;
23 import org.scilab.modules.gui.ged.graphic_objects.legend.Legend;
24 import org.scilab.modules.gui.ged.graphic_objects.polyline.Polyline;
25 import org.scilab.modules.gui.ged.graphic_objects.rectangle.Rectangle;
26 import org.scilab.modules.gui.ged.graphic_objects.segs.Segs;
27 import org.scilab.modules.gui.ged.graphic_objects.surface.Surface;
30 * Manager object exchange.
32 * @author Marcos CARDINOT <mcardinot@gmail.com>
34 public class SwapObject {
35 private static int lastType;
38 * Manager which property window will open.
39 * @param objectID Enters the identification of object.
41 public SwapObject(String objectID) {
42 Integer type = (Integer) GraphicController.getController().getProperty(objectID, GraphicObjectProperties.__GO_TYPE__);
45 case GraphicObjectProperties.__GO_POLYLINE__:
46 Polyline polyline = new Polyline(objectID);
47 SwingInspector.setPanel(polyline, MessagesGED.polyline);
49 case GraphicObjectProperties.__GO_PLOT3D__:
50 Surface plot3d = new Surface(objectID);
51 SwingInspector.setPanel(plot3d, MessagesGED.plot3d);
53 case GraphicObjectProperties.__GO_GRAYPLOT__:
54 Imageplot grayplot = new Imageplot(objectID);
55 SwingInspector.setPanel(grayplot, MessagesGED.grayplot);
57 case GraphicObjectProperties.__GO_FAC3D__:
58 Surface fac3d = new Surface(objectID);
59 SwingInspector.setPanel(fac3d, MessagesGED.fac3d);
61 case GraphicObjectProperties.__GO_MATPLOT__:
62 Imageplot matplot = new Imageplot(objectID);
63 SwingInspector.setPanel(matplot, MessagesGED.matplot);
65 case GraphicObjectProperties.__GO_LEGEND__:
66 Legend legend = new Legend(objectID);
67 SwingInspector.setPanel(legend, MessagesGED.legend);
69 case GraphicObjectProperties.__GO_LABEL__:
70 Label label = new Label(objectID);
71 SwingInspector.setPanel(label, MessagesGED.label);
73 case GraphicObjectProperties.__GO_ARC__:
75 case GraphicObjectProperties.__GO_CHAMP__:
76 Champ champ = new Champ(objectID);
77 SwingInspector.setPanel(champ, MessagesGED.champ);
79 case GraphicObjectProperties.__GO_FEC__:
80 Fec fec = new Fec(objectID);
81 SwingInspector.setPanel(fec, MessagesGED.fec);
83 case GraphicObjectProperties.__GO_RECTANGLE__:
84 Rectangle rectangle = new Rectangle(objectID);
85 SwingInspector.setPanel(rectangle, MessagesGED.rectangle);
87 case GraphicObjectProperties.__GO_SEGS__:
88 Segs segs = new Segs(objectID);
89 SwingInspector.setPanel(segs, MessagesGED.segs);
91 case GraphicObjectProperties.__GO_DATATIP__:
92 Datatip datatip = new Datatip(objectID);
93 SwingInspector.setPanel(datatip, MessagesGED.datatip);
95 case GraphicObjectProperties.__GO_AXES__:
96 Axes axes = new Axes(objectID);
97 SwingInspector.setPanel(axes, MessagesGED.axes);
101 Figure figure = new Figure(objectID);
102 SwingInspector.setPanel(figure, MessagesGED.figure);
103 } catch (NullPointerException e) { }
109 * Get the last type of object.
112 public static int getLastType() {