svn-gvsig-desktop / branches / v2_0_0_prep / applications / appgvSIG / src / org / gvsig / app / project / documents / view / legend / gui / PanelEditSymbol.java @ 34114
History | View | Annotate | Download (3.97 KB)
1 | 11704 | jaume | /* 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 | 29598 | jpiera | package org.gvsig.app.project.documents.view.legend.gui; |
42 | 11704 | jaume | |
43 | import java.awt.BorderLayout; |
||
44 | import java.awt.Dimension; |
||
45 | |||
46 | import javax.swing.JButton; |
||
47 | import javax.swing.JPanel; |
||
48 | |||
49 | 29598 | jpiera | import org.gvsig.andami.PluginServices; |
50 | import org.gvsig.andami.ui.mdiManager.IWindow; |
||
51 | import org.gvsig.andami.ui.mdiManager.WindowInfo; |
||
52 | 20994 | jmvivo | import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
53 | |||
54 | 11704 | jaume | |
55 | |||
56 | /**
|
||
57 | * Panel creado para editar el s?mbolo seleccionado.
|
||
58 | *
|
||
59 | * @author Vicente Caballero Navarro
|
||
60 | */
|
||
61 | public class PanelEditSymbol extends JPanel implements IWindow { |
||
62 | private SingleSymbol panel = null; |
||
63 | private JButton bAceptar = null; // @jve:decl-index=0:visual-constraint="198,310" |
||
64 | private JPanel panelbutton = null; |
||
65 | private boolean ok=false; |
||
66 | //private FSymbol symbol;
|
||
67 | |||
68 | |||
69 | public PanelEditSymbol(){
|
||
70 | initialize(); |
||
71 | } |
||
72 | |||
73 | /**
|
||
74 | * This method initializes this
|
||
75 | *
|
||
76 | */
|
||
77 | private void initialize() { |
||
78 | this.setLayout(new BorderLayout()); |
||
79 | this.setSize(450, 343); |
||
80 | this.add(getPanel(), java.awt.BorderLayout.NORTH);
|
||
81 | this.add(getPanelbutton(),BorderLayout.SOUTH); |
||
82 | } |
||
83 | /**
|
||
84 | * DOCUMENT ME!
|
||
85 | *
|
||
86 | * @return DOCUMENT ME!
|
||
87 | */
|
||
88 | public WindowInfo getWindowInfo() {
|
||
89 | WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
|
||
90 | m_viewinfo.setTitle(PluginServices.getText(this, "simbolo")); |
||
91 | m_viewinfo.setWidth(getWidth()+10);
|
||
92 | m_viewinfo.setHeight(getHeight()); |
||
93 | return m_viewinfo;
|
||
94 | } |
||
95 | |||
96 | /**
|
||
97 | * This method initializes panel
|
||
98 | *
|
||
99 | * @return javax.swing.JPanel
|
||
100 | */
|
||
101 | private SingleSymbol getPanel() {
|
||
102 | if (panel == null) { |
||
103 | panel = new SingleSymbol();
|
||
104 | panel.setPreferredSize(new Dimension(400, 300)); |
||
105 | panel.setVisible(true);
|
||
106 | } |
||
107 | return panel;
|
||
108 | } |
||
109 | |||
110 | /**
|
||
111 | * This method initializes bAceptar
|
||
112 | *
|
||
113 | * @return javax.swing.JButton
|
||
114 | */
|
||
115 | private JButton getBAceptar() { |
||
116 | if (bAceptar == null) { |
||
117 | bAceptar = new JButton(); |
||
118 | bAceptar.setPreferredSize(new java.awt.Dimension(80,20)); |
||
119 | bAceptar.setText("Aceptar");
|
||
120 | bAceptar.addActionListener(new java.awt.event.ActionListener() {
|
||
121 | public void actionPerformed(java.awt.event.ActionEvent e) { |
||
122 | ok=true;
|
||
123 | PluginServices.getMDIManager().closeWindow(PanelEditSymbol.this); |
||
124 | } |
||
125 | }); |
||
126 | bAceptar.setSize(35, 20); |
||
127 | } |
||
128 | return bAceptar;
|
||
129 | } |
||
130 | |||
131 | public ISymbol getSymbol(){
|
||
132 | return panel.getSymbol();
|
||
133 | } |
||
134 | |||
135 | public void setSymbol(ISymbol s){ |
||
136 | ok=false;
|
||
137 | panel.setSymbol(s); |
||
138 | } |
||
139 | |||
140 | public boolean isOK(){ |
||
141 | return ok;
|
||
142 | } |
||
143 | /**
|
||
144 | * This method initializes panelbutton
|
||
145 | *
|
||
146 | * @return javax.swing.JPanel
|
||
147 | */
|
||
148 | private JPanel getPanelbutton() { |
||
149 | if (panelbutton == null) { |
||
150 | panelbutton = new JPanel(); |
||
151 | panelbutton.add(getBAceptar(), null);
|
||
152 | } |
||
153 | return panelbutton;
|
||
154 | } |
||
155 | |||
156 | public void setShapeType(int shapeType) { |
||
157 | getPanel().setShapeType(shapeType); |
||
158 | } |
||
159 | 26449 | jmvivo | |
160 | public Object getWindowProfile() { |
||
161 | return WindowInfo.DIALOG_PROFILE;
|
||
162 | } |
||
163 | |||
164 | 11704 | jaume | } // @jve:decl-index=0:visual-constraint="10,10" |