Revision 11055
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/SimpleMarker.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.2 2007-03-09 11:25:00 jaume |
|
46 |
* Revision 1.3 2007-04-04 16:01:14 jaume |
|
47 |
* *** empty log message *** |
|
48 |
* |
|
49 |
* Revision 1.2 2007/03/09 11:25:00 jaume |
|
47 | 50 |
* Advanced symbology (start committing) |
48 | 51 |
* |
49 | 52 |
* Revision 1.1.2.4 2007/02/21 07:35:14 jaume |
... | ... | |
85 | 88 |
|
86 | 89 |
import de.ios.framework.swing.JDecimalField; |
87 | 90 |
|
91 |
/** |
|
92 |
* |
|
93 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
|
94 |
* |
|
95 |
*/ |
|
88 | 96 |
public class SimpleMarker extends AbstractTypeSymbolEditorPanel implements ActionListener{ |
89 | 97 |
|
90 | 98 |
private ArrayList tabs = new ArrayList(); |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/CharacterMarker.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.3 2007-03-30 12:54:11 jaume
|
|
46 |
* Revision 1.4 2007-04-04 16:01:13 jaume
|
|
47 | 47 |
* *** empty log message *** |
48 | 48 |
* |
49 |
* Revision 1.3 2007/03/30 12:54:11 jaume |
|
50 |
* *** empty log message *** |
|
51 |
* |
|
49 | 52 |
* Revision 1.2 2007/03/09 11:25:00 jaume |
50 | 53 |
* Advanced symbology (start committing) |
51 | 54 |
* |
... | ... | |
113 | 116 |
import com.iver.cit.gvsig.fmap.core.symbols.ISymbol; |
114 | 117 |
import com.iver.utiles.swing.JComboBox; |
115 | 118 |
|
119 |
/** |
|
120 |
* |
|
121 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
|
122 |
* |
|
123 |
*/ |
|
116 | 124 |
public class CharacterMarker extends AbstractTypeSymbolEditorPanel implements ActionListener { |
117 | 125 |
|
118 | 126 |
private ArrayList tabs = new ArrayList(); |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/SymbolPreviewer.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.2 2007-03-09 11:25:00 jaume |
|
46 |
* Revision 1.3 2007-04-04 16:01:14 jaume |
|
47 |
* *** empty log message *** |
|
48 |
* |
|
49 |
* Revision 1.2 2007/03/09 11:25:00 jaume |
|
47 | 50 |
* Advanced symbology (start committing) |
48 | 51 |
* |
49 | 52 |
* Revision 1.1.2.3 2007/02/21 07:35:14 jaume |
... | ... | |
105 | 108 |
import com.iver.andami.PluginServices; |
106 | 109 |
import com.iver.cit.gvsig.fmap.core.symbols.ISymbol; |
107 | 110 |
|
111 |
/** |
|
112 |
* |
|
113 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
|
114 |
* |
|
115 |
*/ |
|
108 | 116 |
public class SymbolPreviewer extends JPanel { |
109 | 117 |
private int hGap = 5, vGap = 5; |
110 | 118 |
private ISymbol symbol; |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/SimpleFill.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.4 2007-03-30 09:39:45 jaume
|
|
46 |
* Revision 1.5 2007-04-04 16:01:14 jaume
|
|
47 | 47 |
* *** empty log message *** |
48 | 48 |
* |
49 |
* Revision 1.4 2007/03/30 09:39:45 jaume |
|
50 |
* *** empty log message *** |
|
51 |
* |
|
49 | 52 |
* Revision 1.3 2007/03/28 16:44:08 jaume |
50 | 53 |
* *** empty log message *** |
51 | 54 |
* |
... | ... | |
109 | 112 |
import com.lowagie.tools.plugins.treeview.OutlinelistTreeNode; |
110 | 113 |
|
111 | 114 |
import de.ios.framework.swing.JDecimalField; |
112 |
|
|
115 |
/** |
|
116 |
* |
|
117 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
|
118 |
* |
|
119 |
*/ |
|
113 | 120 |
public class SimpleFill extends AbstractTypeSymbolEditorPanel implements ActionListener, ChangeListener { |
114 | 121 |
private static final String NAME = PluginServices. |
115 | 122 |
getText(SimpleFill.class, "simple_fill"); |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/SimpleLine.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.4 2007-03-26 15:05:26 jaume
|
|
46 |
* Revision 1.5 2007-04-04 16:01:13 jaume
|
|
47 | 47 |
* *** empty log message *** |
48 | 48 |
* |
49 |
* Revision 1.4 2007/03/26 15:05:26 jaume |
|
50 |
* *** empty log message *** |
|
51 |
* |
|
49 | 52 |
* Revision 1.3 2007/03/21 08:03:03 jaume |
50 | 53 |
* refactored to use ISymbol instead of FSymbol |
51 | 54 |
* |
... | ... | |
107 | 110 |
|
108 | 111 |
import de.ios.framework.swing.JDecimalField; |
109 | 112 |
|
113 |
/** |
|
114 |
* |
|
115 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
|
116 |
* |
|
117 |
*/ |
|
110 | 118 |
public class SimpleLine extends AbstractTypeSymbolEditorPanel implements ActionListener { |
111 | 119 |
|
112 | 120 |
private ColorChooserPanel jccColor; |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/StyleSelector.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2005 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 |
|
|
42 |
/* CVS MESSAGES: |
|
43 |
* |
|
44 |
* $Id$ |
|
45 |
* $Log$ |
|
46 |
* Revision 1.4 2007-04-04 16:01:14 jaume |
|
47 |
* *** empty log message *** |
|
48 |
* |
|
49 |
* Revision 1.2 2007/03/09 11:25:00 jaume |
|
50 |
* Advanced symbology (start committing) |
|
51 |
* |
|
52 |
* Revision 1.1.2.4 2007/02/21 07:35:14 jaume |
|
53 |
* *** empty log message *** |
|
54 |
* |
|
55 |
* Revision 1.1.2.3 2007/02/08 15:43:04 jaume |
|
56 |
* some bug fixes in the editor and removed unnecessary imports |
|
57 |
* |
|
58 |
* Revision 1.1.2.2 2007/01/30 18:10:10 jaume |
|
59 |
* start commiting labeling stuff |
|
60 |
* |
|
61 |
* Revision 1.1.2.1 2007/01/26 13:49:03 jaume |
|
62 |
* *** empty log message *** |
|
63 |
* |
|
64 |
* |
|
65 |
*/ |
|
1 | 66 |
package com.iver.cit.gvsig.gui.styling; |
2 | 67 |
|
3 | 68 |
import java.awt.Color; |
... | ... | |
8 | 73 |
import java.util.prefs.Preferences; |
9 | 74 |
|
10 | 75 |
import javax.swing.BoxLayout; |
76 |
import javax.swing.JComponent; |
|
11 | 77 |
import javax.swing.JLabel; |
12 | 78 |
import javax.swing.JList; |
13 | 79 |
import javax.swing.JPanel; |
... | ... | |
163 | 229 |
|
164 | 230 |
pnl.setBackground(bgColor); |
165 | 231 |
StylePreviewer sp = new StylePreviewer(); |
232 |
sp.setShowOutline(false); |
|
166 | 233 |
sp.setAlignmentX(Component.CENTER_ALIGNMENT); |
167 | 234 |
sp.setPreferredSize(new Dimension(50, 50)); |
168 | 235 |
sp.setStyle(sty); |
... | ... | |
188 | 255 |
selectedElement = selectedValue; |
189 | 256 |
} |
190 | 257 |
|
258 |
protected void propertiesPressed() { |
|
259 |
StyleEditor se = new StyleEditor((IStyle) selectedElement); |
|
260 |
PluginServices.getMDIManager().addWindow(se); |
|
261 |
} |
|
262 |
|
|
263 |
/** |
|
264 |
* This method initializes jPanel1 |
|
265 |
* |
|
266 |
* @return javax.swing.JPanel |
|
267 |
*/ |
|
268 |
protected JComponent getJPanelPreview() { |
|
269 |
if (jPanelPreview == null) { |
|
270 |
jPanelPreview = new SymbolPreviewer(); |
|
271 |
jPanelPreview.setPreferredSize(new java.awt.Dimension(100,100)); |
|
272 |
jPanelPreview.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED)); |
|
273 |
} |
|
274 |
return jPanelPreview; |
|
275 |
} |
|
191 | 276 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/StyleEditor.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2005 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 |
|
|
42 |
package com.iver.cit.gvsig.gui.styling; |
|
43 |
|
|
44 |
import java.awt.BorderLayout; |
|
45 |
import java.awt.Component; |
|
46 |
import java.awt.Dimension; |
|
47 |
import java.awt.FlowLayout; |
|
48 |
|
|
49 |
import javax.swing.BorderFactory; |
|
50 |
import javax.swing.BoxLayout; |
|
51 |
import javax.swing.ButtonGroup; |
|
52 |
import javax.swing.JLabel; |
|
53 |
import javax.swing.JPanel; |
|
54 |
import javax.swing.JSeparator; |
|
55 |
import javax.swing.JTextField; |
|
56 |
import javax.swing.JToggleButton; |
|
57 |
|
|
58 |
import org.gvsig.gui.beans.AcceptCancelPanel; |
|
59 |
import org.gvsig.gui.beans.swing.JButton; |
|
60 |
|
|
61 |
import com.iver.andami.PluginServices; |
|
62 |
import com.iver.andami.ui.mdiManager.IWindow; |
|
63 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
|
64 |
import com.iver.cit.gvsig.fmap.core.SymbologyFactory; |
|
65 |
import com.iver.cit.gvsig.fmap.core.styles.ILabelStyle; |
|
66 |
import com.iver.cit.gvsig.fmap.core.styles.IStyle; |
|
67 |
|
|
68 |
/** |
|
69 |
* |
|
70 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
|
71 |
* |
|
72 |
*/ |
|
73 |
/** |
|
74 |
* |
|
75 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
|
76 |
* |
|
77 |
*/ |
|
78 |
public class StyleEditor extends JPanel implements IWindow { |
|
79 |
|
|
80 |
private JPanel pnlNorth = null; |
|
81 |
private JPanel jPanel = null; |
|
82 |
private JPanel pnlCenter = null; |
|
83 |
private AcceptCancelPanel pnlButtons = null; |
|
84 |
private JLabel lblTitle; |
|
85 |
private StylePreviewer preview; |
|
86 |
private JPanel pnlTools; |
|
87 |
private JToggleButton btnPan; |
|
88 |
private JToggleButton btnNewTextArea; |
|
89 |
private JTextField txtDesc; |
|
90 |
private JButton btnBackground; |
|
91 |
|
|
92 |
|
|
93 |
public StyleEditor(IStyle style) { |
|
94 |
if (style!=null) { |
|
95 |
IStyle sty = SymbologyFactory.createStyleFromXML(style.getXMLEntity(), style.getDescription()); |
|
96 |
getStylePreviewer().setStyle(sty); |
|
97 |
String desc = sty.getDescription(); |
|
98 |
getTxtDesc().setText(desc); |
|
99 |
} else { |
|
100 |
getTxtDesc().setText(PluginServices.getText(this, "new_style")); |
|
101 |
} |
|
102 |
initialize(); |
|
103 |
} |
|
104 |
|
|
105 |
/** |
|
106 |
* This method initializes this |
|
107 |
* |
|
108 |
*/ |
|
109 |
private void initialize() { |
|
110 |
this.setLayout(new BorderLayout()); |
|
111 |
this.setSize(417,284); |
|
112 |
this.add(getPnlNorth(), java.awt.BorderLayout.NORTH); |
|
113 |
this.add(getPnlCenter(), java.awt.BorderLayout.CENTER); |
|
114 |
this.add(getPnlButtons(), java.awt.BorderLayout.SOUTH); |
|
115 |
} |
|
116 |
|
|
117 |
|
|
118 |
|
|
119 |
/** |
|
120 |
* This method initializes pnlNorth |
|
121 |
* |
|
122 |
* @return javax.swing.JPanel |
|
123 |
*/ |
|
124 |
private JPanel getPnlNorth() { |
|
125 |
if (pnlNorth == null) { |
|
126 |
pnlNorth = new JPanel(new FlowLayout(FlowLayout.LEADING)); |
|
127 |
lblTitle = new JLabel(PluginServices.getText(this, "editing")); |
|
128 |
pnlNorth.add(lblTitle); |
|
129 |
pnlNorth.add(getTxtDesc()); |
|
130 |
} |
|
131 |
return pnlNorth; |
|
132 |
} |
|
133 |
|
|
134 |
private JTextField getTxtDesc() { |
|
135 |
if (txtDesc == null) { |
|
136 |
txtDesc = new JTextField(30); |
|
137 |
|
|
138 |
} |
|
139 |
|
|
140 |
return txtDesc; |
|
141 |
} |
|
142 |
|
|
143 |
/** |
|
144 |
* This method initializes jPanel1 |
|
145 |
* |
|
146 |
* @return javax.swing.JPanel |
|
147 |
*/ |
|
148 |
private JPanel getPnlCenter() { |
|
149 |
if (pnlCenter == null) { |
|
150 |
pnlCenter = new JPanel(new BorderLayout()); |
|
151 |
JPanel aux = new JPanel(); |
|
152 |
aux.add(getStylePreviewer()); |
|
153 |
pnlCenter.add(getStylePreviewer(), BorderLayout.CENTER); |
|
154 |
pnlCenter.add(getPnlTools(), BorderLayout.EAST); |
|
155 |
} |
|
156 |
return pnlCenter; |
|
157 |
} |
|
158 |
|
|
159 |
private JPanel getPnlTools() { |
|
160 |
if (pnlTools == null) { |
|
161 |
pnlTools = new JPanel(); |
|
162 |
pnlTools.setBorder(BorderFactory.createTitledBorder(PluginServices.getText(this, "tools"))); |
|
163 |
pnlTools.setLayout(new BoxLayout(pnlTools, BoxLayout.Y_AXIS)); |
|
164 |
pnlTools.add(getBtnPan()); |
|
165 |
pnlTools.add(getBtnNewTextArea()); |
|
166 |
pnlTools.add(new JSeparator(JSeparator.HORIZONTAL)); |
|
167 |
pnlTools.add(getBtnBackground()); |
|
168 |
|
|
169 |
ButtonGroup group = new ButtonGroup(); |
|
170 |
group.add(getBtnPan()); |
|
171 |
group.add(getBtnNewTextArea()); |
|
172 |
} |
|
173 |
|
|
174 |
return pnlTools; |
|
175 |
} |
|
176 |
|
|
177 |
private Component getBtnBackground() { |
|
178 |
if (btnBackground == null) { |
|
179 |
btnBackground = new JButton("background"); |
|
180 |
|
|
181 |
} |
|
182 |
|
|
183 |
return btnBackground; |
|
184 |
} |
|
185 |
|
|
186 |
private JToggleButton getBtnNewTextArea() { |
|
187 |
if (btnNewTextArea == null) { |
|
188 |
btnNewTextArea = new JToggleButton("new_text"); |
|
189 |
} |
|
190 |
return btnNewTextArea; |
|
191 |
} |
|
192 |
|
|
193 |
private JToggleButton getBtnPan() { |
|
194 |
if (btnPan == null) { |
|
195 |
btnPan = new JToggleButton("pan"); |
|
196 |
|
|
197 |
} |
|
198 |
|
|
199 |
return btnPan; |
|
200 |
} |
|
201 |
|
|
202 |
private StylePreviewer getStylePreviewer() { |
|
203 |
if (preview == null) { |
|
204 |
preview = new StylePreviewer(); |
|
205 |
preview.setShowOutline(true); |
|
206 |
} |
|
207 |
|
|
208 |
return preview; |
|
209 |
} |
|
210 |
|
|
211 |
/** |
|
212 |
* This method initializes pnlButtons |
|
213 |
* |
|
214 |
* @return javax.swing.JPanel |
|
215 |
*/ |
|
216 |
private JPanel getPnlButtons() { |
|
217 |
if (pnlButtons == null) { |
|
218 |
pnlButtons = new AcceptCancelPanel(); |
|
219 |
} |
|
220 |
return pnlButtons; |
|
221 |
} |
|
222 |
|
|
223 |
public WindowInfo getWindowInfo() { |
|
224 |
WindowInfo wi = new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.RESIZABLE); |
|
225 |
wi.setTitle(PluginServices.getText(this, "edit_style")); |
|
226 |
wi.setWidth(getWidth()+10); |
|
227 |
wi.setHeight(getHeight()); |
|
228 |
return wi; |
|
229 |
} |
|
230 |
} // @jve:decl-index=0:visual-constraint="10,10" |
|
0 | 231 |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/JLineStyleComboBox.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2005 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 |
|
|
1 | 42 |
package com.iver.cit.gvsig.gui.styling; |
2 | 43 |
|
3 | 44 |
import java.awt.BasicStroke; |
... | ... | |
11 | 52 |
import com.iver.cit.gvsig.fmap.core.styles.IStyle; |
12 | 53 |
import com.iver.cit.gvsig.fmap.core.styles.SimpleLineStyle; |
13 | 54 |
import com.iver.utiles.swing.JComboBox; |
14 |
|
|
55 |
/** |
|
56 |
* |
|
57 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
|
58 |
* |
|
59 |
*/ |
|
15 | 60 |
public class JLineStyleComboBox extends JComboBox { |
16 | 61 |
private static final int PREDEFINED_STYLE_COUNT = 6; |
17 | 62 |
private static final int LINE_WIDTH = 10; |
... | ... | |
42 | 87 |
DOT_WIDTH, |
43 | 88 |
DOT_WIDTH }; // line + line + dot + dot |
44 | 89 |
} |
45 |
|
|
90 |
|
|
46 | 91 |
{ |
47 | 92 |
BasicStroke dummy = new BasicStroke(); |
48 | 93 |
endCap = dummy.getEndCap(); |
49 | 94 |
lineJoin = dummy.getLineJoin(); |
50 | 95 |
miterlimit = dummy.getMiterLimit(); |
51 | 96 |
} |
52 |
|
|
97 |
|
|
53 | 98 |
ILineStyle[] styles = new ILineStyle[PREDEFINED_STYLE_COUNT]; |
54 |
|
|
99 |
|
|
55 | 100 |
private ListCellRenderer renderer = new DefaultListCellRenderer() { |
56 | 101 |
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
57 | 102 |
Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); |
58 | 103 |
if (value == null) |
59 | 104 |
return c; |
60 |
|
|
105 |
|
|
61 | 106 |
final IStyle style = (IStyle) value; |
62 | 107 |
StylePreviewer sp = new StylePreviewer(); |
63 | 108 |
sp.setPreferredSize(getSize()); |
... | ... | |
65 | 110 |
return sp; |
66 | 111 |
}; |
67 | 112 |
}; |
68 |
|
|
113 |
|
|
69 | 114 |
private void refreshStyles() { |
70 | 115 |
for (int i = 0; i < styles.length; i++) { |
71 | 116 |
styles[i] = new SimpleLineStyle(width, endCap, lineJoin, miterlimit, dash[i], width*5); |
... | ... | |
82 | 127 |
setRenderer(renderer); |
83 | 128 |
refreshStyles(); |
84 | 129 |
} |
85 |
|
|
130 |
|
|
86 | 131 |
public JLineStyleComboBox(Object[] elements) { |
87 | 132 |
super(elements); |
88 | 133 |
setRenderer(renderer); |
89 | 134 |
refreshStyles(); |
90 | 135 |
} |
91 |
|
|
136 |
|
|
92 | 137 |
public void setLineWidth(int width) { |
93 | 138 |
this.width = width; |
94 | 139 |
refreshStyles(); |
95 | 140 |
} |
96 |
|
|
97 |
|
|
141 |
|
|
142 |
|
|
98 | 143 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/SLDListBoxCellRenderer.java | ||
---|---|---|
66 | 66 |
import org.w3c.dom.Element; |
67 | 67 |
import org.w3c.dom.svg.SVGDocument; |
68 | 68 |
|
69 |
/** |
|
70 |
* |
|
71 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
|
72 |
* |
|
73 |
*/ |
|
69 | 74 |
public class SLDListBoxCellRenderer extends JPanel implements ListCellRenderer { |
70 | 75 |
|
71 | 76 |
private String str; |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/StyleSelectorListModel.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2005 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 |
|
|
42 |
/* CVS MESSAGES: |
|
43 |
* |
|
44 |
* $Id$ |
|
45 |
* $Log$ |
|
46 |
* Revision 1.2 2007-04-04 16:01:14 jaume |
|
47 |
* *** empty log message *** |
|
48 |
* |
|
49 |
* Revision 1.2 2007/03/09 11:25:00 jaume |
|
50 |
* Advanced symbology (start committing) |
|
51 |
* |
|
52 |
* Revision 1.1.2.4 2007/02/21 07:35:14 jaume |
|
53 |
* *** empty log message *** |
|
54 |
* |
|
55 |
* Revision 1.1.2.3 2007/02/08 15:43:04 jaume |
|
56 |
* some bug fixes in the editor and removed unnecessary imports |
|
57 |
* |
|
58 |
* Revision 1.1.2.2 2007/01/30 18:10:10 jaume |
|
59 |
* start commiting labeling stuff |
|
60 |
* |
|
61 |
* Revision 1.1.2.1 2007/01/26 13:49:03 jaume |
|
62 |
* *** empty log message *** |
|
63 |
* |
|
64 |
* |
|
65 |
*/ |
|
1 | 66 |
package com.iver.cit.gvsig.gui.styling; |
2 | 67 |
|
3 | 68 |
import java.io.File; |
... | ... | |
16 | 81 |
import com.iver.utiles.XMLEntity; |
17 | 82 |
import com.iver.utiles.xmlEntity.generate.XmlTag; |
18 | 83 |
|
84 |
/** |
|
85 |
* |
|
86 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
|
87 |
* |
|
88 |
*/ |
|
19 | 89 |
public class StyleSelectorListModel extends SymbolSelectorListModel { |
20 | 90 |
|
21 | 91 |
public static final String STYLE_FILE_EXTENSION = ".style"; |
... | ... | |
58 | 128 |
} |
59 | 129 |
return elements; |
60 | 130 |
} |
61 |
|
|
62 | 131 |
|
132 |
|
|
63 | 133 |
public void add(Object o) { |
64 | 134 |
TreeSet map = new TreeSet(new Comparator() { |
65 | 135 |
|
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/SymbolSelectorListModel.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.6 2007-04-02 00:08:05 jaume
|
|
46 |
* Revision 1.7 2007-04-04 16:01:14 jaume
|
|
47 | 47 |
* *** empty log message *** |
48 | 48 |
* |
49 |
* Revision 1.6 2007/04/02 00:08:05 jaume |
|
50 |
* *** empty log message *** |
|
51 |
* |
|
49 | 52 |
* Revision 1.2 2007/03/28 16:44:08 jaume |
50 | 53 |
* *** empty log message *** |
51 | 54 |
* |
... | ... | |
119 | 122 |
import com.iver.utiles.listManager.ListModel; |
120 | 123 |
import com.iver.utiles.xmlEntity.generate.XmlTag; |
121 | 124 |
|
125 |
/** |
|
126 |
* |
|
127 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
|
128 |
* |
|
129 |
*/ |
|
122 | 130 |
public class SymbolSelectorListModel implements ListModel { |
123 | 131 |
|
124 | 132 |
private String fileExtension; |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/SelectorFilter.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.1 2007-03-09 11:25:00 jaume |
|
46 |
* Revision 1.2 2007-04-04 16:01:13 jaume |
|
47 |
* *** empty log message *** |
|
48 |
* |
|
49 |
* Revision 1.1 2007/03/09 11:25:00 jaume |
|
47 | 50 |
* Advanced symbology (start committing) |
48 | 51 |
* |
49 | 52 |
* Revision 1.1.2.3 2007/02/21 07:35:14 jaume |
... | ... | |
59 | 62 |
*/ |
60 | 63 |
package com.iver.cit.gvsig.gui.styling; |
61 | 64 |
|
62 |
|
|
65 |
/** |
|
66 |
* |
|
67 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
|
68 |
* |
|
69 |
*/ |
|
63 | 70 |
public interface SelectorFilter { |
64 | 71 |
public boolean accepts(Object obj); |
65 | 72 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/MarkerFill.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.5 2007-03-28 16:44:08 jaume
|
|
46 |
* Revision 1.6 2007-04-04 16:01:14 jaume
|
|
47 | 47 |
* *** empty log message *** |
48 | 48 |
* |
49 |
* Revision 1.5 2007/03/28 16:44:08 jaume |
|
50 |
* *** empty log message *** |
|
51 |
* |
|
49 | 52 |
* Revision 1.4 2007/03/13 16:57:35 jaume |
50 | 53 |
* Added MultiVariable legend |
51 | 54 |
* |
... | ... | |
119 | 122 |
import com.iver.utiles.XMLEntity; |
120 | 123 |
|
121 | 124 |
import de.ios.framework.swing.JDecimalField; |
122 |
|
|
125 |
/** |
|
126 |
* |
|
127 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
|
128 |
* |
|
129 |
*/ |
|
123 | 130 |
public class MarkerFill extends AbstractTypeSymbolEditorPanel implements ActionListener { |
124 | 131 |
private static final double DEFAULT_SEPARATION = 20; |
125 | 132 |
private static final double DEFAULT_OFFSET = 10; |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/StylePreviewer.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2005 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 |
|
|
42 |
/* CVS MESSAGES: |
|
43 |
* |
|
44 |
* $Id$ |
|
45 |
* $Log$ |
|
46 |
* Revision 1.2 2007-04-04 16:01:14 jaume |
|
47 |
* *** empty log message *** |
|
48 |
* |
|
49 |
* Revision 1.2 2007/03/09 11:25:00 jaume |
|
50 |
* Advanced symbology (start committing) |
|
51 |
* |
|
52 |
* Revision 1.1.2.4 2007/02/21 07:35:14 jaume |
|
53 |
* *** empty log message *** |
|
54 |
* |
|
55 |
* Revision 1.1.2.3 2007/02/08 15:43:04 jaume |
|
56 |
* some bug fixes in the editor and removed unnecessary imports |
|
57 |
* |
|
58 |
* Revision 1.1.2.2 2007/01/30 18:10:10 jaume |
|
59 |
* start commiting labeling stuff |
|
60 |
* |
|
61 |
* Revision 1.1.2.1 2007/01/26 13:49:03 jaume |
|
62 |
* *** empty log message *** |
|
63 |
* |
|
64 |
* |
|
65 |
*/ |
|
1 | 66 |
package com.iver.cit.gvsig.gui.styling; |
2 | 67 |
|
3 | 68 |
import java.awt.Color; |
... | ... | |
14 | 79 |
import com.iver.cit.gvsig.fmap.core.styles.IStyle; |
15 | 80 |
import com.iver.cit.gvsig.fmap.core.symbols.ISymbol; |
16 | 81 |
|
82 |
/** |
|
83 |
* |
|
84 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
|
85 |
* |
|
86 |
*/ |
|
17 | 87 |
public class StylePreviewer extends SymbolPreviewer{ |
18 | 88 |
private int hGap = 5, vGap = 5; |
19 | 89 |
private IStyle style; |
90 |
private boolean showOutline; |
|
20 | 91 |
|
21 | 92 |
|
22 | 93 |
public StylePreviewer() { |
... | ... | |
27 | 98 |
public IStyle getStyle() { |
28 | 99 |
return style; |
29 | 100 |
} |
30 |
|
|
101 |
|
|
31 | 102 |
public ISymbol getSymbol() { |
32 | 103 |
throw new Error(PluginServices.getText(this, "undefined_for_StylePreviewer_use") |
33 | 104 |
+" getStyle() "+ |
34 | 105 |
PluginServices.getText(this, "instead") ); |
35 |
|
|
106 |
|
|
36 | 107 |
} |
37 |
|
|
108 |
|
|
38 | 109 |
public void setSymbol(ISymbol symbol) { |
39 | 110 |
throw new Error(PluginServices.getText(this, "undefined_for_StylePreviewer_use") |
40 | 111 |
+" setStyle(IStyle) "+ |
41 | 112 |
PluginServices.getText(this, "instead") ); |
42 |
|
|
113 |
|
|
43 | 114 |
} |
44 |
|
|
45 | 115 |
|
116 |
|
|
46 | 117 |
public void setStyle(IStyle style) { |
47 | 118 |
this.style = style; |
48 | 119 |
repaint(); |
... | ... | |
55 | 126 |
r = new Rectangle(0, 0, (int) (r.getWidth()-(hGap*2)), (int) (r.getHeight()-(vGap*2))); |
56 | 127 |
|
57 | 128 |
if (style != null) { |
58 |
style.drawInsideRectangle(g2, r); |
|
129 |
if (showOutline) { |
|
130 |
// this is a trick for the editor |
|
131 |
style.drawOutline(g2, r); |
|
132 |
} else { |
|
133 |
style.drawInsideRectangle(g2, r); |
|
134 |
} |
|
59 | 135 |
} else { |
60 | 136 |
String noneSelected = "["+PluginServices.getText(this, "preview_not_available")+"]"; |
61 | 137 |
FontMetrics fm = g2.getFontMetrics(); |
... | ... | |
68 | 144 |
g2.drawString(noneSelected, (r.x*scale) - (hGap/2), r.height/2+vGap*scale); |
69 | 145 |
} |
70 | 146 |
} |
147 |
|
|
148 |
/** |
|
149 |
* Allows to choose between paint styles Outline or the style itself. |
|
150 |
* @param b |
|
151 |
*/ |
|
152 |
public void setShowOutline(boolean b) { |
|
153 |
this.showOutline = b; |
|
154 |
} |
|
71 | 155 |
} |
Also available in: Unified diff