1 /*
2  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  * Copyright (C) 2013 - Marcos CARDINOT
4  *
5  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  *
7  * This file is hereby licensed under the terms of the GNU GPL v2.0,
8  * pursuant to article 5.3.4 of the CeCILL v.2.1.
9  * This file was originally licensed under the terms of the CeCILL v2.1,
10  * and continues to be available under such terms.
11  * For more information, see the COPYING file which you should have received
12  * along with this program.
13  *
14  */
15 package org.scilab.modules.gui.ged.graphic_objects.label;
16 
17 import javax.swing.JPanel;
18 import org.scilab.modules.gui.ged.MessagesGED;
19 import org.scilab.modules.gui.ged.graphic_objects.SimpleSection;
20 import org.scilab.modules.gui.ged.graphic_objects.properties.Label;
21 
22 /**
23 * Construction and startup of all components of the section: Position.
24 * @author Marcos CARDINOT <mcardinot@gmail.com>
25 */
26 public class Position extends SimpleSection {
27     private JPanel sectionPanel;
28     private static Position instance;
29     private Label label = new Label();
30 
31     /**
32     * Initializes the properties and the icons of the buttons.
33     * @param objectID Enters the identification of object.
34     */
Position(Integer objectID)35     public Position(Integer objectID) {
36         super(MessagesGED.position, "label");
37         instance = this;
38         sectionPanel = getSectionPanel();
39         initComponents(objectID);
40     }
41 
42     /**
43      * Get instance
44      * @return instance
45      */
getInstance()46     public static Position getInstance() {
47         return instance;
48     }
49 
50     /**
51     * Add all the properties in this section.
52     * @param objectID uid
53     */
54     @Override
initComponents(Integer objectID)55     public final void initComponents(Integer objectID) {
56         int row = 0;
57         final int leftmargin = 0; //to inner components
58         int column = 1; //first column
59 
60         //Components of the property: Auto Rotation.
61         label.autoRotation(sectionPanel, row++, column, leftmargin, objectID);
62 
63         //Components of the property: Auto Position.
64         label.autoPosition(sectionPanel, row++, column, leftmargin, objectID);
65 
66         //Components of the property: Position.
67         label.position(sectionPanel, row++, column, leftmargin, objectID);
68     }
69 }