svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.symbology / org.gvsig.symbology.swing / org.gvsig.symbology.swing.api / src / main / java / org / gvsig / app / gui / styling / PictureMarker.java @ 46589
History | View | Annotate | Download (16.5 KB)
1 | 40560 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | 40435 | jjdelcerro | *
|
4 | 40560 | jjdelcerro | * Copyright (C) 2007-2013 gvSIG Association.
|
5 | 40435 | jjdelcerro | *
|
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 | 40560 | jjdelcerro | * as published by the Free Software Foundation; either version 3
|
9 | 40435 | jjdelcerro | * 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 | 40560 | jjdelcerro | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 | * MA 02110-1301, USA.
|
||
20 | 40435 | jjdelcerro | *
|
21 | 40560 | jjdelcerro | * For any additional information, do not hesitate to contact us
|
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | 40435 | jjdelcerro | */
|
24 | package org.gvsig.app.gui.styling; |
||
25 | |||
26 | 45523 | jjdelcerro | import java.awt.Color; |
27 | 40435 | jjdelcerro | import java.awt.event.ActionEvent; |
28 | import java.awt.event.ActionListener; |
||
29 | 45527 | jjdelcerro | import java.awt.event.ItemEvent; |
30 | 40435 | jjdelcerro | import java.awt.geom.Point2D; |
31 | import java.io.File; |
||
32 | import java.net.URL; |
||
33 | import java.util.ArrayList; |
||
34 | 45523 | jjdelcerro | import java.util.List; |
35 | 40435 | jjdelcerro | |
36 | import javax.swing.JPanel; |
||
37 | 45527 | jjdelcerro | import javax.swing.JPopupMenu; |
38 | 45523 | jjdelcerro | import javax.swing.SpinnerNumberModel; |
39 | import javax.swing.event.ChangeEvent; |
||
40 | 45526 | fdiaz | import org.gvsig.expressionevaluator.Expression; |
41 | 45523 | jjdelcerro | import org.gvsig.expressionevaluator.swing.ExpressionEvaluatorSwingLocator; |
42 | import org.gvsig.expressionevaluator.swing.ExpressionEvaluatorSwingManager; |
||
43 | import org.gvsig.expressionevaluator.swing.ExpressionPickerController; |
||
44 | import org.gvsig.fmap.dal.feature.FeatureStore; |
||
45 | import org.gvsig.fmap.dal.swing.DALSwingLocator; |
||
46 | import org.gvsig.fmap.dal.swing.DataSwingManager; |
||
47 | 40435 | jjdelcerro | import org.gvsig.fmap.mapcontext.MapContextLocator; |
48 | import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
||
49 | import org.gvsig.fmap.mapcontext.rendering.symbols.IWarningSymbol; |
||
50 | import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException; |
||
51 | import org.gvsig.i18n.Messages; |
||
52 | import org.gvsig.symbology.SymbologyLocator; |
||
53 | 45523 | jjdelcerro | import org.gvsig.symbology.SymbologyManager; |
54 | 40435 | jjdelcerro | import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IPictureMarkerSymbol; |
55 | 45523 | jjdelcerro | import org.gvsig.tools.swing.api.ToolsSwingLocator; |
56 | import org.gvsig.tools.swing.api.ToolsSwingManager; |
||
57 | import org.gvsig.tools.swing.api.pickercontroller.ColorPickerController; |
||
58 | import org.gvsig.tools.swing.api.pickercontroller.FilePickerController; |
||
59 | import org.gvsig.tools.util.URLUtils; |
||
60 | import org.slf4j.Logger; |
||
61 | import org.slf4j.LoggerFactory; |
||
62 | 40435 | jjdelcerro | |
63 | /**
|
||
64 | 45523 | jjdelcerro | * PictureMarker allows the user to store and modify the properties that define
|
65 | * a
|
||
66 | 40435 | jjdelcerro | * <b>picture marker symbol</b>.<p>
|
67 | * <p>
|
||
68 | * This functionality is carried out thanks to a tab (simple marker)which is
|
||
69 | 45523 | jjdelcerro | * included in the panel to edit the properities of a symbol (SymbolEditor)how
|
70 | * is explained in AbstractTypeSymbolEditor.
|
||
71 | 40435 | jjdelcerro | * <p>
|
72 | * First of all, in the above mentioned tab the user will have options to change
|
||
73 | 45523 | jjdelcerro | * the files from where the pictures for the symbol are taken (one for the
|
74 | * symbol when it is not selected in the map and the other when it is done)
|
||
75 | * .<p>
|
||
76 | 40435 | jjdelcerro | * <p>
|
77 | * Secondly, the user will have options to modify the pictures which had been
|
||
78 | 45523 | jjdelcerro | * selected before (width and offset) .
|
79 | 40435 | jjdelcerro | *
|
80 | 45523 | jjdelcerro | * @see AbstractTypeSymbolEditor
|
81 | * @author gvSIG Team
|
||
82 | 40435 | jjdelcerro | */
|
83 | 45523 | jjdelcerro | @SuppressWarnings("UseSpecificCatch") |
84 | public class PictureMarker |
||
85 | extends AbstractTypeSymbolEditor
|
||
86 | implements ActionListener { |
||
87 | |||
88 | protected static final Logger LOGGER = LoggerFactory.getLogger(PictureMarker.class); |
||
89 | 40435 | jjdelcerro | |
90 | public static final double MARKER_IMAGE_DEFAULT_WIDTH = 18; |
||
91 | |||
92 | 45527 | jjdelcerro | private final PictureMarkerView view = new PictureMarkerView(); |
93 | 40435 | jjdelcerro | |
94 | 45523 | jjdelcerro | protected List<JPanel> tabs = new ArrayList<>(); |
95 | 40435 | jjdelcerro | |
96 | 45523 | jjdelcerro | //TODO: Comentarizado hasta que mask est? acabado
|
97 | // protected Mask mask;
|
||
98 | private FilePickerController picturePicker;
|
||
99 | private FilePickerController selectedPicturePicker;
|
||
100 | private ColorPickerController colorLinePicker;
|
||
101 | private ExpressionPickerController xoffsetExpPicker;
|
||
102 | private ExpressionPickerController yoffsetExpPicker;
|
||
103 | private ExpressionPickerController rotationExpPicker;
|
||
104 | private ExpressionPickerController colorExpPicker;
|
||
105 | 45527 | jjdelcerro | private ExpressionPickerController sizeExpPicker;
|
106 | 40435 | jjdelcerro | |
107 | 45523 | jjdelcerro | public PictureMarker(SymbolEditor owner) {
|
108 | super(owner);
|
||
109 | initComponents(); |
||
110 | } |
||
111 | 40435 | jjdelcerro | |
112 | 45523 | jjdelcerro | private void translate() { |
113 | ToolsSwingManager toolsSwingManager = ToolsSwingLocator.getToolsSwingManager(); |
||
114 | toolsSwingManager.translate(view.lblLabelFileName); |
||
115 | toolsSwingManager.translate(view.lblLabelRotationExpression); |
||
116 | toolsSwingManager.translate(view.lblLabelSelFileName); |
||
117 | toolsSwingManager.translate(view.lblLabelSize); |
||
118 | toolsSwingManager.translate(view.lblLabelX); |
||
119 | toolsSwingManager.translate(view.lblLabelXExpression); |
||
120 | toolsSwingManager.translate(view.lblLabelY); |
||
121 | toolsSwingManager.translate(view.lblLabelYExpression); |
||
122 | } |
||
123 | 40435 | jjdelcerro | |
124 | 45523 | jjdelcerro | /**
|
125 | * Initializes the parameters that define a picturmarker.To do it, a tab is
|
||
126 | * created inside the SymbolEditor panel with default values for the
|
||
127 | * different attributes of the picture marker.
|
||
128 | */
|
||
129 | private void initComponents() { |
||
130 | 40435 | jjdelcerro | |
131 | 45523 | jjdelcerro | ToolsSwingManager toolsSwingManager = ToolsSwingLocator.getToolsSwingManager(); |
132 | ExpressionEvaluatorSwingManager expressionSwingManager = ExpressionEvaluatorSwingLocator.getManager(); |
||
133 | 40435 | jjdelcerro | |
134 | 45523 | jjdelcerro | this.translate();
|
135 | |||
136 | this.picturePicker = toolsSwingManager.createFilePickerController(view.txtPictureFile, view.btnPictureFile);
|
||
137 | 45527 | jjdelcerro | JPopupMenu menu = view.txtPictureFile.getComponentPopupMenu();
|
138 | menu.add(expressionSwingManager.createJExpressionBuilderAction(view.txtPictureFile)); |
||
139 | menu.add(expressionSwingManager.createUniqueTemporalFileAction(view.txtPictureFile,"picture",".png")); |
||
140 | |||
141 | 45523 | jjdelcerro | this.selectedPicturePicker = toolsSwingManager.createFilePickerController(view.txtSelPictureFile, view.btnSelPictureFile);
|
142 | 45527 | jjdelcerro | menu = view.txtSelPictureFile.getComponentPopupMenu(); |
143 | menu.add(expressionSwingManager.createJExpressionBuilderAction(view.txtSelPictureFile)); |
||
144 | menu.add(expressionSwingManager.createUniqueTemporalFileAction(view.txtSelPictureFile,"picture",".png")); |
||
145 | 45523 | jjdelcerro | this.picturePicker.addChangeListener((ChangeEvent e) -> { |
146 | if (this.picturePicker.get() == null) { |
||
147 | this.selectedPicturePicker.setEnabled(false); |
||
148 | } |
||
149 | }); |
||
150 | view.txtSize.setModel(new SpinnerNumberModel(5, 0d, Double.POSITIVE_INFINITY, 0.5)); |
||
151 | view.txtX.setModel(new SpinnerNumberModel(0, Integer.MIN_VALUE, Integer.MAX_VALUE, 1)); |
||
152 | view.txtY.setModel(new SpinnerNumberModel(0, Integer.MIN_VALUE, Integer.MAX_VALUE, 1)); |
||
153 | 40435 | jjdelcerro | |
154 | |||
155 | 45523 | jjdelcerro | this.colorLinePicker = toolsSwingManager.createColorPickerController(view.txtColorLine, view.btnColorLine);
|
156 | 40435 | jjdelcerro | |
157 | 45526 | fdiaz | |
158 | 45527 | jjdelcerro | this.sizeExpPicker = expressionSwingManager.createExpressionPickerController(
|
159 | view.txtSizeExp, |
||
160 | view.btnSizeExpression, |
||
161 | view.btnSizeExpressionBookmarks, |
||
162 | view.btnSizeExpressionHistory |
||
163 | ); |
||
164 | 45523 | jjdelcerro | this.xoffsetExpPicker = expressionSwingManager.createExpressionPickerController(
|
165 | view.txtXOffset, |
||
166 | view.btnXOffsetExpression, |
||
167 | view.btnXOffsetExpressionBookmarks, |
||
168 | view.btnXOffsetExpressionHistory |
||
169 | ); |
||
170 | this.yoffsetExpPicker = expressionSwingManager.createExpressionPickerController(
|
||
171 | view.txtYOffset, |
||
172 | view.btnYOffsetExpression, |
||
173 | view.btnYOffsetExpressionBookmarks, |
||
174 | view.btnYOffsetExpressionHistory |
||
175 | ); |
||
176 | this.rotationExpPicker = expressionSwingManager.createExpressionPickerController(
|
||
177 | view.txtRotation, |
||
178 | view.btnRotationExpression, |
||
179 | view.btnRotationExpressionBookmarks, |
||
180 | view.btnRotationExpressionHistory |
||
181 | ); |
||
182 | this.colorExpPicker = expressionSwingManager.createExpressionPickerController(
|
||
183 | view.txtColorLineExp, |
||
184 | view.btnColorLineExpression, |
||
185 | view.btnColorLineExpressionBookmarks, |
||
186 | view.btnColorLineExpressionHistory |
||
187 | ); |
||
188 | 45527 | jjdelcerro | this.picturePicker.addChangeListener((ChangeEvent e) -> {fireSymbolChangedEvent();}); |
189 | this.selectedPicturePicker.addChangeListener((ChangeEvent e) -> {fireSymbolChangedEvent();}); |
||
190 | 45526 | fdiaz | |
191 | view.txtSize.addChangeListener((ChangeEvent e) -> {fireSymbolChangedEvent();});
|
||
192 | view.txtX.addChangeListener((ChangeEvent e) -> {fireSymbolChangedEvent();});
|
||
193 | view.txtY.addChangeListener((ChangeEvent e) -> {fireSymbolChangedEvent();});
|
||
194 | this.colorLinePicker.addChangeListener((ChangeEvent e) -> {fireSymbolChangedEvent();}); |
||
195 | 45527 | jjdelcerro | view.chkDrawLineToOffset.addItemListener((ItemEvent e) -> {
|
196 | fireSymbolChangedEvent(); |
||
197 | }); |
||
198 | |||
199 | this.sizeExpPicker.addChangeListener((ChangeEvent e) -> {fireSymbolChangedEvent();}); |
||
200 | 45526 | fdiaz | this.xoffsetExpPicker.addChangeListener((ChangeEvent e) -> {fireSymbolChangedEvent();}); |
201 | this.yoffsetExpPicker.addChangeListener((ChangeEvent e) -> {fireSymbolChangedEvent();}); |
||
202 | this.rotationExpPicker.addChangeListener((ChangeEvent e) -> {fireSymbolChangedEvent();}); |
||
203 | this.colorExpPicker.addChangeListener((ChangeEvent e) -> {fireSymbolChangedEvent();}); |
||
204 | 45527 | jjdelcerro | view.setName(this.getName());
|
205 | 45523 | jjdelcerro | tabs.add(view); |
206 | } |
||
207 | 40435 | jjdelcerro | |
208 | 45523 | jjdelcerro | @Override
|
209 | public ISymbol getLayer() {
|
||
210 | try {
|
||
211 | IPictureMarkerSymbol layer = null;
|
||
212 | 40435 | jjdelcerro | |
213 | 45523 | jjdelcerro | if (this.getPictureFile()!=null ) { |
214 | SymbologyManager symbologyManager = SymbologyLocator.getSymbologyManager(); |
||
215 | layer = symbologyManager.createPictureMarkerSymbol( |
||
216 | this.getPictureURL(),
|
||
217 | this.getSelectedPictureURL()
|
||
218 | ); |
||
219 | 45527 | jjdelcerro | layer.setFeature(this.getSampleFeature());
|
220 | 45523 | jjdelcerro | layer.setSize(getSize()); |
221 | layer.setOffset(new Point2D.Double(getX(),getY())); |
||
222 | 45526 | fdiaz | layer.setLineToOffsetColor(this.colorLinePicker.get());
|
223 | 45527 | jjdelcerro | layer.setDrawLineToOffset(view.chkDrawLineToOffset.isSelected()); |
224 | |||
225 | layer.setLineToOffsetColorExpression(getPhrase(this.colorExpPicker.get()));
|
||
226 | 45526 | fdiaz | layer.setOffsetXExpression(getPhrase(this.xoffsetExpPicker.get()));
|
227 | layer.setOffsetYExpression(getPhrase(this.yoffsetExpPicker.get()));
|
||
228 | layer.setRotationExpression(getPhrase(this.rotationExpPicker.get()));
|
||
229 | 45527 | jjdelcerro | layer.setSizeExpression(getPhrase(this.sizeExpPicker.get()));
|
230 | 45523 | jjdelcerro | } |
231 | 40435 | jjdelcerro | |
232 | 45523 | jjdelcerro | return layer;
|
233 | } catch (Exception e) { |
||
234 | IWarningSymbol warning |
||
235 | = (IWarningSymbol) MapContextLocator.getSymbolManager() |
||
236 | .getWarningSymbol( |
||
237 | SymbolDrawingException.STR_UNSUPPORTED_SET_OF_SETTINGS, |
||
238 | Messages.getText("failed_acessing_files"),
|
||
239 | SymbolDrawingException.UNSUPPORTED_SET_OF_SETTINGS); |
||
240 | return warning;
|
||
241 | 40435 | jjdelcerro | |
242 | 45523 | jjdelcerro | } |
243 | 40435 | jjdelcerro | |
244 | 45523 | jjdelcerro | } |
245 | 45526 | fdiaz | |
246 | private String getPhrase(Expression expression){ |
||
247 | if(expression == null){ |
||
248 | return null; |
||
249 | } |
||
250 | return expression.getPhrase();
|
||
251 | } |
||
252 | 40435 | jjdelcerro | |
253 | 45523 | jjdelcerro | @Override
|
254 | public String getName() { |
||
255 | return Messages.getText("picture_marker_symbol"); |
||
256 | } |
||
257 | 40435 | jjdelcerro | |
258 | 45523 | jjdelcerro | @Override
|
259 | public JPanel[] getTabs() { |
||
260 | return tabs.toArray(new JPanel[tabs.size()]); |
||
261 | } |
||
262 | 40435 | jjdelcerro | |
263 | 45523 | jjdelcerro | @Override
|
264 | public void refreshControls(ISymbol layer) { |
||
265 | try {
|
||
266 | if (layer == null) { |
||
267 | 45527 | jjdelcerro | setValues(1d, 0d, 0d, null, null, "", "", "", null, "", "", false); |
268 | 45523 | jjdelcerro | } else {
|
269 | IPictureMarkerSymbol sym = (IPictureMarkerSymbol) layer; |
||
270 | setValues( |
||
271 | sym.getSize(), |
||
272 | sym.getOffset().getX(), |
||
273 | sym.getOffset().getY(), |
||
274 | sym.getSource(), |
||
275 | 45526 | fdiaz | sym.getSelectedSource(), |
276 | 45527 | jjdelcerro | sym.getSizeExpression(), |
277 | 45526 | fdiaz | sym.getOffsetXExpression(), |
278 | sym.getOffsetYExpression(), |
||
279 | sym.getLineToOffsetColor(), |
||
280 | sym.getLineToOffsetColorExpression(), |
||
281 | sym.getRotationExpression(), |
||
282 | sym.isDrawLineToOffset() |
||
283 | 45523 | jjdelcerro | ); |
284 | } |
||
285 | } catch (Exception ex) { |
||
286 | LOGGER.warn("Can't refresh picture marker symbol panel.", ex);
|
||
287 | } |
||
288 | } |
||
289 | 40435 | jjdelcerro | |
290 | 45526 | fdiaz | protected void setValues( |
291 | double size,
|
||
292 | double xOffset,
|
||
293 | double yOffset,
|
||
294 | URL picture,
|
||
295 | URL selectedPicture,
|
||
296 | 45527 | jjdelcerro | String sizeExpression,
|
297 | 45526 | fdiaz | String offsetXExpression,
|
298 | String offsetYExpression,
|
||
299 | Color lineToOffsetColor,
|
||
300 | String lineToOffsetColorExpression,
|
||
301 | String rotationExpression,
|
||
302 | boolean isDrawLineToOffset) {
|
||
303 | |||
304 | 45523 | jjdelcerro | setSize(size); |
305 | setX(xOffset); |
||
306 | setY(yOffset); |
||
307 | |||
308 | setPicture(picture); |
||
309 | setSelectedPicture(selectedPicture); |
||
310 | 45526 | fdiaz | |
311 | 45527 | jjdelcerro | sizeExpPicker.coerceAndSet(sizeExpression); |
312 | 45526 | fdiaz | xoffsetExpPicker.coerceAndSet(offsetXExpression); |
313 | yoffsetExpPicker.coerceAndSet(offsetYExpression); |
||
314 | rotationExpPicker.coerceAndSet(rotationExpression); |
||
315 | colorLinePicker.coerceAndSet(lineToOffsetColor); |
||
316 | colorExpPicker.coerceAndSet(lineToOffsetColorExpression); |
||
317 | view.chkDrawLineToOffset.setSelected(isDrawLineToOffset); |
||
318 | |||
319 | 45523 | jjdelcerro | } |
320 | 40435 | jjdelcerro | |
321 | 45523 | jjdelcerro | @Override
|
322 | public EditorTool[] getEditorTools() { |
||
323 | return null; |
||
324 | 40435 | jjdelcerro | |
325 | 45523 | jjdelcerro | } |
326 | 40435 | jjdelcerro | |
327 | 45523 | jjdelcerro | @Override
|
328 | public void actionPerformed(ActionEvent e) { |
||
329 | } |
||
330 | 40435 | jjdelcerro | |
331 | 45523 | jjdelcerro | @Override
|
332 | public boolean canManageSymbol(ISymbol symbol) { |
||
333 | return symbol instanceof IPictureMarkerSymbol; |
||
334 | } |
||
335 | 40435 | jjdelcerro | |
336 | 45523 | jjdelcerro | protected String getPictureFileName() { |
337 | File f = this.picturePicker.get(); |
||
338 | if( f == null ) { |
||
339 | return null; |
||
340 | } |
||
341 | return f.getAbsolutePath();
|
||
342 | } |
||
343 | 40435 | jjdelcerro | |
344 | 45523 | jjdelcerro | protected String getSelectedPictureFileName() { |
345 | File f = this.selectedPicturePicker.get(); |
||
346 | if( f == null ) { |
||
347 | return null; |
||
348 | } |
||
349 | return f.getAbsolutePath();
|
||
350 | } |
||
351 | 40435 | jjdelcerro | |
352 | 45523 | jjdelcerro | protected URL getPictureURL() { |
353 | return URLUtils.toURL(this.picturePicker.get()); |
||
354 | } |
||
355 | 40435 | jjdelcerro | |
356 | 45523 | jjdelcerro | protected URL getSelectedPictureURL() { |
357 | return URLUtils.toURL(this.selectedPicturePicker.get()); |
||
358 | } |
||
359 | 40435 | jjdelcerro | |
360 | 45523 | jjdelcerro | protected File getPictureFile() { |
361 | File f = this.picturePicker.get(); |
||
362 | return f;
|
||
363 | } |
||
364 | 40435 | jjdelcerro | |
365 | 45523 | jjdelcerro | protected File getSelectedPictureFile() { |
366 | File f = this.selectedPicturePicker.get(); |
||
367 | return f;
|
||
368 | } |
||
369 | 40435 | jjdelcerro | |
370 | 45523 | jjdelcerro | protected double getSize() { |
371 | SpinnerNumberModel model = (SpinnerNumberModel) view.txtSize.getModel(); |
||
372 | return model.getNumber().doubleValue();
|
||
373 | } |
||
374 | 40435 | jjdelcerro | |
375 | 45523 | jjdelcerro | protected double getX() { |
376 | SpinnerNumberModel model = (SpinnerNumberModel) view.txtX.getModel(); |
||
377 | return model.getNumber().doubleValue();
|
||
378 | } |
||
379 | 40435 | jjdelcerro | |
380 | 45523 | jjdelcerro | protected double getY() { |
381 | SpinnerNumberModel model = (SpinnerNumberModel) view.txtY.getModel(); |
||
382 | return model.getNumber().doubleValue();
|
||
383 | } |
||
384 | 40435 | jjdelcerro | |
385 | 45523 | jjdelcerro | protected void setPicture(URL picture) { |
386 | this.picturePicker.set(URLUtils.toFile(picture));
|
||
387 | } |
||
388 | 40435 | jjdelcerro | |
389 | 45523 | jjdelcerro | protected void setSelectedPicture(URL selectedPicture) { |
390 | this.selectedPicturePicker.set(URLUtils.toFile(selectedPicture));
|
||
391 | } |
||
392 | 40435 | jjdelcerro | |
393 | 45523 | jjdelcerro | protected void setSize(double d) { |
394 | SpinnerNumberModel model = (SpinnerNumberModel) view.txtSize.getModel(); |
||
395 | model.setValue(d); |
||
396 | } |
||
397 | 40435 | jjdelcerro | |
398 | 45523 | jjdelcerro | protected void setX(double d) { |
399 | SpinnerNumberModel model = (SpinnerNumberModel) view.txtX.getModel(); |
||
400 | model.setValue(d); |
||
401 | } |
||
402 | 40435 | jjdelcerro | |
403 | 45523 | jjdelcerro | protected void setY(double d) { |
404 | SpinnerNumberModel model = (SpinnerNumberModel) view.txtY.getModel(); |
||
405 | model.setValue(d); |
||
406 | } |
||
407 | 40435 | jjdelcerro | |
408 | 45523 | jjdelcerro | protected Color getColorLine() { |
409 | return this.colorLinePicker.get(); |
||
410 | } |
||
411 | |||
412 | protected void setColorLine(Color color) { |
||
413 | this.colorLinePicker.set(color);
|
||
414 | |||
415 | } |
||
416 | 40435 | jjdelcerro | |
417 | 45523 | jjdelcerro | @Override
|
418 | public void setFeatureStore(FeatureStore store) { |
||
419 | 45527 | jjdelcerro | if( store==null ) { |
420 | return;
|
||
421 | } |
||
422 | 45523 | jjdelcerro | super.setFeatureStore(store);
|
423 | DataSwingManager dataSwingManager = DALSwingLocator.getDataSwingManager(); |
||
424 | 46589 | jjdelcerro | dataSwingManager.configureExpressionBuilder(this.xoffsetExpPicker.getConfig(), store);
|
425 | dataSwingManager.configureExpressionBuilder(this.yoffsetExpPicker.getConfig(), store);
|
||
426 | dataSwingManager.configureExpressionBuilder(this.rotationExpPicker.getConfig(), store);
|
||
427 | 45523 | jjdelcerro | } |
428 | |||
429 | |||
430 | } |