Statistics
| Revision:

root / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / project / documents / view / legend / gui / PanelEditSymbol.java @ 11704

History | View | Annotate | Download (3.89 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package com.iver.cit.gvsig.project.documents.view.legend.gui;
42

    
43
import java.awt.BorderLayout;
44
import java.awt.Dimension;
45

    
46
import javax.swing.JButton;
47
import javax.swing.JPanel;
48

    
49
import com.iver.andami.PluginServices;
50
import com.iver.andami.ui.mdiManager.IWindow;
51
import com.iver.andami.ui.mdiManager.WindowInfo;
52
import com.iver.cit.gvsig.fmap.core.symbols.ISymbol;
53

    
54

    
55
/**
56
 * Panel creado para editar el s?mbolo seleccionado.
57
 *
58
 * @author Vicente Caballero Navarro
59
 */
60
public class PanelEditSymbol extends JPanel implements IWindow {
61
        private SingleSymbol panel = null;
62
        private JButton bAceptar = null;  //  @jve:decl-index=0:visual-constraint="198,310"
63
        private JPanel panelbutton = null;
64
        private boolean ok=false;
65
        //private FSymbol symbol;
66

    
67

    
68
        public PanelEditSymbol(){
69
                initialize();
70
        }
71

    
72
        /**
73
         * This method initializes this
74
         *
75
         */
76
        private void initialize() {
77
        this.setLayout(new BorderLayout());
78
        this.setSize(450, 343);
79
        this.add(getPanel(), java.awt.BorderLayout.NORTH);
80
                this.add(getPanelbutton(),BorderLayout.SOUTH);
81
        }
82
        /**
83
         * DOCUMENT ME!
84
         *
85
         * @return DOCUMENT ME!
86
         */
87
        public WindowInfo getWindowInfo() {
88
                WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
89
                m_viewinfo.setTitle(PluginServices.getText(this, "simbolo"));
90
                m_viewinfo.setWidth(getWidth()+10);
91
                m_viewinfo.setHeight(getHeight());
92
                return m_viewinfo;
93
        }
94

    
95
        /**
96
         * This method initializes panel
97
         *
98
         * @return javax.swing.JPanel
99
         */
100
        private SingleSymbol getPanel() {
101
                if (panel == null) {
102
                        panel = new SingleSymbol();
103
                        panel.setPreferredSize(new Dimension(400, 300));
104
                        panel.setVisible(true);
105
                }
106
                return panel;
107
        }
108

    
109
        /**
110
         * This method initializes bAceptar
111
         *
112
         * @return javax.swing.JButton
113
         */
114
        private JButton getBAceptar() {
115
                if (bAceptar == null) {
116
                        bAceptar = new JButton();
117
                        bAceptar.setPreferredSize(new java.awt.Dimension(80,20));
118
                        bAceptar.setText("Aceptar");
119
                        bAceptar.addActionListener(new java.awt.event.ActionListener() {
120
                                public void actionPerformed(java.awt.event.ActionEvent e) {
121
                                        ok=true;
122
                                        PluginServices.getMDIManager().closeWindow(PanelEditSymbol.this);
123
                                }
124
                        });
125
                        bAceptar.setSize(35, 20);
126
                }
127
                return bAceptar;
128
        }
129

    
130
        public ISymbol getSymbol(){
131
                return panel.getSymbol();
132
        }
133

    
134
        public void setSymbol(ISymbol s){
135
                ok=false;
136
                panel.setSymbol(s);
137
        }
138

    
139
        public boolean isOK(){
140
                return ok;
141
        }
142
        /**
143
         * This method initializes panelbutton
144
         *
145
         * @return javax.swing.JPanel
146
         */
147
        private JPanel getPanelbutton() {
148
                if (panelbutton == null) {
149
                        panelbutton = new JPanel();
150
                        panelbutton.add(getBAceptar(), null);
151
                }
152
                return panelbutton;
153
        }
154

    
155
        public void setShapeType(int shapeType) {
156
                getPanel().setShapeType(shapeType);
157
        }
158
}  //  @jve:decl-index=0:visual-constraint="10,10"