Revision 11297
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/legend/gui/DotDensity.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.4 2007-04-20 07:24:56 jaume
|
|
46 |
* Revision 1.5 2007-04-20 07:54:39 jaume
|
|
47 | 47 |
* *** empty log message *** |
48 | 48 |
* |
49 |
* Revision 1.4 2007/04/20 07:24:56 jaume |
|
50 |
* *** empty log message *** |
|
51 |
* |
|
49 | 52 |
* Revision 1.3 2007/04/17 06:53:46 bsanchez |
50 | 53 |
* - Corregido fallo de Double.MIN_VALUE por Double.NEGATIVE_INFINITY comentado por Victor Olaya. |
51 | 54 |
* |
... | ... | |
374 | 377 |
// combine both the DotDensitySymbol and the SimpleFillSymbol in |
375 | 378 |
// MultiLayerSymbol so they will be paint as a unique ISymbol |
376 | 379 |
MultiLayerFillSymbol symbol = new MultiLayerFillSymbol(); |
377 |
// symbol.setMultiLayerSymbolType(FShape.POLYGON); |
|
378 | 380 |
symbol.setDescription( |
379 | 381 |
"DotDensitySymbol" + PluginServices.getText(this, "in_layer") + |
380 | 382 |
": '"+layer.getName()+"'"); |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/SymbolLayerManager.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.3 2007-03-09 11:25:00 jaume |
|
46 |
* Revision 1.4 2007-04-20 07:54:38 jaume |
|
47 |
* *** empty log message *** |
|
48 |
* |
|
49 |
* Revision 1.3 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 |
... | ... | |
102 | 105 |
import javax.swing.BorderFactory; |
103 | 106 |
import javax.swing.DefaultListCellRenderer; |
104 | 107 |
import javax.swing.ImageIcon; |
108 |
import javax.swing.JCheckBox; |
|
105 | 109 |
import javax.swing.JList; |
106 | 110 |
import javax.swing.JPanel; |
107 | 111 |
import javax.swing.JScrollPane; |
... | ... | |
146 | 150 |
|
147 | 151 |
private void initialize() { |
148 | 152 |
this.setLayout(new BorderLayout()); |
149 |
this.setSize(new java.awt.Dimension(155,106)); |
|
150 | 153 |
this.add(getJScrollPane(), java.awt.BorderLayout.CENTER); |
151 | 154 |
this.add(getPnlButtons(), java.awt.BorderLayout.SOUTH); |
152 | 155 |
} |
... | ... | |
154 | 157 |
private JScrollPane getJScrollPane() { |
155 | 158 |
if (scroll == null) { |
156 | 159 |
scroll = new JScrollPane(); |
157 |
scroll.setPreferredSize(new Dimension(120, 160));
|
|
160 |
scroll.setPreferredSize(new Dimension(150, 160));
|
|
158 | 161 |
scroll.setViewportView(getJListLayers()); |
159 | 162 |
} |
160 | 163 |
return scroll; |
... | ... | |
174 | 177 |
}); |
175 | 178 |
jListLayers.setModel(new SymbolLayerListModel()); |
176 | 179 |
jListLayers.setCellRenderer(new DefaultListCellRenderer() { |
177 |
|
|
178 | 180 |
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
179 |
ISymbol sym = (ISymbol) value; |
|
180 |
|
|
181 |
JPanel pnl = new JPanel(); |
|
182 |
LayoutManager layout = new FlowLayout(FlowLayout.LEFT, 3, 3); |
|
183 |
pnl.setLayout(layout); |
|
184 |
Color bgColor = (isSelected) ? cellSelectedBGColor |
|
185 |
: Color.WHITE; |
|
186 |
pnl.setBackground(bgColor); |
|
187 |
SymbolPreviewer sp = new SymbolPreviewer(); |
|
188 |
sp.setBorder(BorderFactory.createLineBorder(Color.BLACK)); |
|
189 |
sp.setAlignmentX(Component.LEFT_ALIGNMENT); |
|
190 |
sp.setPreferredSize(new Dimension(80, 30)); |
|
191 |
sp.setSize(new Dimension(80, 30)); |
|
192 |
sp.setSymbol(sym); |
|
193 |
sp.setBackground(Color.WHITE); |
|
194 |
pnl.add(sp); |
|
195 |
XMLEntity xml = sym.getXMLEntity(); |
|
196 |
String source; |
|
197 |
if (xml.contains("locked")) |
|
198 |
source = xml.getBooleanProperty("locked") ? |
|
199 |
"images/locked.png" : |
|
200 |
"images/unlocked.png"; |
|
201 |
else |
|
202 |
source = "images/unlocked.png"; |
|
203 |
|
|
204 |
ImageIcon icon = new ImageIcon(getClass(). |
|
205 |
getClassLoader().getResource(source)); |
|
206 |
JButton btnLock = new JButton(icon); |
|
207 |
btnLock.setSize(btnDimension); |
|
208 |
btnLock.setPreferredSize(btnDimension); |
|
209 |
btnLock.setActionCommand("LOCK"); |
|
210 |
btnLock.setBackground(bgColor); |
|
211 |
btnLock.setAlignmentX(Component.CENTER_ALIGNMENT); |
|
212 |
pnl.add(btnLock); |
|
213 |
pnl.setPreferredSize(LIST_CELL_SIZE); |
|
214 |
return pnl; |
|
181 |
return new SymbolLayerComponent((ISymbol) value, index, isSelected); |
|
215 | 182 |
} |
216 |
|
|
217 | 183 |
}); |
218 |
|
|
219 | 184 |
jListLayers.addMouseListener(new MouseAdapter() { |
220 | 185 |
public void mouseClicked(MouseEvent e) { |
221 | 186 |
if (e.getClickCount() == 2 && e.getButton() == MouseEvent.BUTTON1) { |
... | ... | |
377 | 342 |
getJScrollPane().setViewportView(getJListLayers()); |
378 | 343 |
super.validate(); |
379 | 344 |
} |
345 |
|
|
346 |
private class SymbolLayerComponent extends JPanel { |
|
347 |
public SymbolLayerComponent(ISymbol sym, int index, boolean isSelected) { |
|
348 |
LayoutManager layout = new FlowLayout(FlowLayout.LEFT, 3, 3); |
|
349 |
setLayout(layout); |
|
350 |
Color bgColor = (isSelected) ? cellSelectedBGColor |
|
351 |
: Color.WHITE; |
|
352 |
setBackground(bgColor); |
|
353 |
JCheckBox chkVisible = new JCheckBox("", symbol.getLayer(index).isShapeVisible()); |
|
354 |
chkVisible.setBackground(bgColor); |
|
355 |
add(chkVisible); |
|
356 |
SymbolPreviewer sp = new SymbolPreviewer(); |
|
357 |
sp.setBorder(BorderFactory.createLineBorder(Color.BLACK)); |
|
358 |
sp.setAlignmentX(Component.LEFT_ALIGNMENT); |
|
359 |
sp.setPreferredSize(new Dimension(80, 30)); |
|
360 |
sp.setSize(new Dimension(80, 30)); |
|
361 |
sp.setSymbol(sym); |
|
362 |
sp.setBackground(Color.WHITE); |
|
363 |
add(sp); |
|
364 |
XMLEntity xml = sym.getXMLEntity(); |
|
365 |
String source; |
|
366 |
if (xml.contains("locked")) |
|
367 |
source = xml.getBooleanProperty("locked") ? |
|
368 |
"images/locked.png" : |
|
369 |
"images/unlocked.png"; |
|
370 |
else |
|
371 |
source = "images/unlocked.png"; |
|
372 |
|
|
373 |
ImageIcon icon = new ImageIcon(getClass(). |
|
374 |
getClassLoader().getResource(source)); |
|
375 |
JButton btnLock = new JButton(icon); |
|
376 |
btnLock.setSize(btnDimension); |
|
377 |
btnLock.setPreferredSize(btnDimension); |
|
378 |
btnLock.setActionCommand("LOCK"); |
|
379 |
btnLock.setBackground(bgColor); |
|
380 |
btnLock.setAlignmentX(Component.CENTER_ALIGNMENT); |
|
381 |
add(btnLock); |
|
382 |
setPreferredSize(LIST_CELL_SIZE); |
|
383 |
|
|
384 |
} |
|
385 |
} |
|
380 | 386 |
} |
381 | 387 |
|
382 | 388 |
|
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/CharacterMarker.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.6 2007-04-19 14:22:20 jaume
|
|
46 |
* Revision 1.7 2007-04-20 07:54:38 jaume
|
|
47 | 47 |
* *** empty log message *** |
48 | 48 |
* |
49 |
* Revision 1.6 2007/04/19 14:22:20 jaume |
|
50 |
* *** empty log message *** |
|
51 |
* |
|
49 | 52 |
* Revision 1.5 2007/04/05 16:08:34 jaume |
50 | 53 |
* Styled labeling stuff |
51 | 54 |
* |
... | ... | |
103 | 106 |
import java.awt.event.ActionEvent; |
104 | 107 |
import java.awt.event.ActionListener; |
105 | 108 |
import java.awt.geom.Point2D; |
109 |
import java.math.BigDecimal; |
|
106 | 110 |
import java.math.BigInteger; |
107 | 111 |
import java.util.ArrayList; |
108 | 112 |
|
... | ... | |
263 | 267 |
private JNumberField getNumberAngle() { |
264 | 268 |
if (numberAngle == null) { |
265 | 269 |
numberAngle = new JNumberField(5); |
270 |
numberAngle.setValue(new BigInteger(String.valueOf(0))); |
|
266 | 271 |
} |
267 | 272 |
|
268 | 273 |
return numberAngle; |
... | ... | |
391 | 396 |
getJListSymbols().setSelectedIndex(sym.getUnicode()); |
392 | 397 |
getNumberAngle().setText(String.valueOf(sym.getRotation()/DEGREE_TO_RADIANS)); |
393 | 398 |
getColorChooser().setColor(sym.getColor()); |
399 |
|
|
394 | 400 |
// TODO mask |
395 | 401 |
} catch (IndexOutOfBoundsException ioEx) { |
396 | 402 |
NotificationManager.addWarning("Symbol layer index out of bounds", ioEx); |
... | ... | |
417 | 423 |
getTxtXOffset().getValue().doubleValue(), |
418 | 424 |
-getTxtYOffset().getValue().doubleValue())); |
419 | 425 |
layer.setRotation(getNumberAngle().getValue().doubleValue()*DEGREE_TO_RADIANS); |
426 |
|
|
427 |
layer.setScaleX(getUnitScaleFactor()); |
|
420 | 428 |
return layer; |
421 | 429 |
} |
422 | 430 |
|
... | ... | |
456 | 464 |
this.font = font; |
457 | 465 |
this.glyph = glyph; |
458 | 466 |
} |
459 |
|
|
460 | 467 |
} |
461 | 468 |
|
462 | 469 |
public void actionPerformed(ActionEvent e) { |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/SymbolEditor.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.4 2007-03-28 16:44:08 jaume
|
|
46 |
* Revision 1.5 2007-04-20 07:54:38 jaume
|
|
47 | 47 |
* *** empty log message *** |
48 | 48 |
* |
49 |
* Revision 1.4 2007/03/28 16:44:08 jaume |
|
50 |
* *** empty log message *** |
|
51 |
* |
|
49 | 52 |
* Revision 1.3 2007/03/27 09:49:03 jaume |
50 | 53 |
* *** empty log message *** |
51 | 54 |
* |
... | ... | |
300 | 303 |
public WindowInfo getWindowInfo() { |
301 | 304 |
if (wi == null) { |
302 | 305 |
wi = new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.RESIZABLE); |
303 |
wi.setWidth(600);
|
|
306 |
wi.setWidth(650);
|
|
304 | 307 |
wi.setHeight(400); |
305 | 308 |
wi.setTitle(PluginServices.getText(this, "symbol_property_editor")); |
306 | 309 |
} |
... | ... | |
361 | 364 |
private SymbolPreviewer getSymbolPreviewer() { |
362 | 365 |
if (symbolPreview == null) { |
363 | 366 |
symbolPreview = new SymbolPreviewer(); |
364 |
symbolPreview.setPreferredSize(new Dimension(120, 100));
|
|
367 |
symbolPreview.setPreferredSize(new Dimension(150, 100));
|
|
365 | 368 |
|
366 | 369 |
} |
367 | 370 |
return symbolPreview; |
... | ... | |
399 | 402 |
return cmbUnits; |
400 | 403 |
} |
401 | 404 |
|
405 |
public double getUnitScaleFactor() { |
|
406 |
double unitFactor; |
|
407 |
try { |
|
408 |
unitFactor = Attributes.CHANGE[getCmbUnits().getSelectedIndex()]/100; |
|
409 |
} catch (ArrayIndexOutOfBoundsException aioobEx) { //jijiji |
|
410 |
unitFactor = 0; // which represents size in pixel |
|
411 |
} |
|
412 |
return unitFactor; |
|
413 |
} |
|
414 |
|
|
402 | 415 |
private JComboBox getCmbType() { |
403 | 416 |
if (cmbType == null) { |
404 | 417 |
cmbType = new JComboBox(tabs); |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/AbstractTypeSymbolEditorPanel.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.3 2007-04-05 16:08:34 jaume |
|
46 |
* Revision 1.4 2007-04-20 07:54:38 jaume |
|
47 |
* *** empty log message *** |
|
48 |
* |
|
49 |
* Revision 1.3 2007/04/05 16:08:34 jaume |
|
47 | 50 |
* Styled labeling stuff |
48 | 51 |
* |
49 | 52 |
* Revision 1.2 2007/03/09 11:25:00 jaume |
... | ... | |
86 | 89 |
import javax.swing.JPanel; |
87 | 90 |
|
88 | 91 |
import com.iver.cit.gvsig.fmap.core.symbols.ISymbol; |
92 |
import com.iver.cit.gvsig.project.documents.layout.Attributes; |
|
89 | 93 |
/** |
90 | 94 |
* Abstract class that all the Symbol settings interface must extend. |
91 | 95 |
* |
... | ... | |
154 | 158 |
owner.refresh(); |
155 | 159 |
} |
156 | 160 |
|
161 |
protected final double getUnitScaleFactor() { |
|
162 |
return owner.getUnitScaleFactor(); |
|
163 |
} |
|
157 | 164 |
/** |
158 | 165 |
* Returns the symbol class that is handled by this configuration panel. |
159 | 166 |
* @return <b>Class</b> (of the concrete ISymbol that this configuration panel deals with) |
Also available in: Unified diff