Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / main / java / org / gvsig / app / project / documents / view / legend / gui / PanelEditSymbol.java @ 40558

History | View | Annotate | Download (3.71 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.app.project.documents.view.legend.gui;
25

    
26
import java.awt.BorderLayout;
27
import java.awt.Dimension;
28

    
29
import javax.swing.JButton;
30
import javax.swing.JPanel;
31

    
32
import org.gvsig.andami.PluginServices;
33
import org.gvsig.andami.ui.mdiManager.IWindow;
34
import org.gvsig.andami.ui.mdiManager.WindowInfo;
35
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
36

    
37

    
38

    
39
/**
40
 * Panel creado para editar el s?mbolo seleccionado.
41
 *
42
 * @author Vicente Caballero Navarro
43
 */
44
public class PanelEditSymbol extends JPanel implements IWindow {
45
        private SingleSymbol panel = null;
46
        private JButton bAceptar = null;  //  @jve:decl-index=0:visual-constraint="198,310"
47
        private JPanel panelbutton = null;
48
        private boolean ok=false;
49
        //private FSymbol symbol;
50

    
51

    
52
        public PanelEditSymbol(){
53
                initialize();
54
        }
55

    
56
        /**
57
         * This method initializes this
58
         *
59
         */
60
        private void initialize() {
61
        this.setLayout(new BorderLayout());
62
        this.setSize(450, 343);
63
        this.add(getPanel(), java.awt.BorderLayout.NORTH);
64
                this.add(getPanelbutton(),BorderLayout.SOUTH);
65
        }
66
        /**
67
         * DOCUMENT ME!
68
         *
69
         * @return DOCUMENT ME!
70
         */
71
        public WindowInfo getWindowInfo() {
72
                WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
73
                m_viewinfo.setTitle(PluginServices.getText(this, "simbolo"));
74
                m_viewinfo.setWidth(getWidth()+10);
75
                m_viewinfo.setHeight(getHeight());
76
                return m_viewinfo;
77
        }
78

    
79
        /**
80
         * This method initializes panel
81
         *
82
         * @return javax.swing.JPanel
83
         */
84
        private SingleSymbol getPanel() {
85
                if (panel == null) {
86
                        panel = new SingleSymbol();
87
                        panel.setPreferredSize(new Dimension(400, 300));
88
                        panel.setVisible(true);
89
                }
90
                return panel;
91
        }
92

    
93
        /**
94
         * This method initializes bAceptar
95
         *
96
         * @return javax.swing.JButton
97
         */
98
        private JButton getBAceptar() {
99
                if (bAceptar == null) {
100
                        bAceptar = new JButton();
101
                        bAceptar.setPreferredSize(new java.awt.Dimension(80,20));
102
                        bAceptar.setText("Aceptar");
103
                        bAceptar.addActionListener(new java.awt.event.ActionListener() {
104
                                public void actionPerformed(java.awt.event.ActionEvent e) {
105
                                        ok=true;
106
                                        PluginServices.getMDIManager().closeWindow(PanelEditSymbol.this);
107
                                }
108
                        });
109
                        bAceptar.setSize(35, 20);
110
                }
111
                return bAceptar;
112
        }
113

    
114
        public ISymbol getSymbol(){
115
                return panel.getSymbol();
116
        }
117

    
118
        public void setSymbol(ISymbol s){
119
                ok=false;
120
                panel.setSymbol(s);
121
        }
122

    
123
        public boolean isOK(){
124
                return ok;
125
        }
126
        /**
127
         * This method initializes panelbutton
128
         *
129
         * @return javax.swing.JPanel
130
         */
131
        private JPanel getPanelbutton() {
132
                if (panelbutton == null) {
133
                        panelbutton = new JPanel();
134
                        panelbutton.add(getBAceptar(), null);
135
                }
136
                return panelbutton;
137
        }
138

    
139
        public void setShapeType(int shapeType) {
140
                getPanel().setShapeType(shapeType);
141
        }
142

    
143
        public Object getWindowProfile() {
144
                return WindowInfo.DIALOG_PROFILE;
145
        }
146

    
147
}  //  @jve:decl-index=0:visual-constraint="10,10"