Revision 10315
branches/simbologia/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/symbols/CharacterMarkerSymbol.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.5.2.4 2007-02-12 15:15:20 jaume |
|
46 |
* Revision 1.5.2.5 2007-02-14 09:58:37 jaume |
|
47 |
* *** empty log message *** |
|
48 |
* |
|
49 |
* Revision 1.5.2.4 2007/02/12 15:15:20 jaume |
|
47 | 50 |
* refactored interval legend and added graduated symbol legend |
48 | 51 |
* |
49 | 52 |
* Revision 1.5.2.3 2007/02/09 07:47:04 jaume |
... | ... | |
195 | 198 |
} |
196 | 199 |
|
197 | 200 |
public void draw(Graphics2D g, AffineTransform affineTransform, FShape shp) { |
198 |
g.setFont(getFont()); |
|
201 |
g.setFont(getFont()/*.deriveFont((float) getSize())*/);
|
|
199 | 202 |
g.setColor(color); |
200 | 203 |
g.rotate(getRotation()); |
201 | 204 |
Point2D p = null; |
branches/simbologia/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/legend/gui/GraduatedSymbols.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.1.2.2 2007-02-13 16:19:19 jaume |
|
46 |
* Revision 1.1.2.3 2007-02-14 09:59:17 jaume |
|
47 |
* *** empty log message *** |
|
48 |
* |
|
49 |
* Revision 1.1.2.2 2007/02/13 16:19:19 jaume |
|
47 | 50 |
* graduated symbol legends (start commiting) |
48 | 51 |
* |
49 | 52 |
* Revision 1.1.2.1 2007/02/12 15:14:41 jaume |
... | ... | |
148 | 151 |
|
149 | 152 |
public void setData(FLayer lyr, Legend legend) { |
150 | 153 |
this.layer = (FLyrVect) lyr; |
151 |
int layerShapeType = 0; |
|
154 |
|
|
152 | 155 |
try { |
153 | 156 |
setShapeType(this.layer.getShapeType()); |
154 | 157 |
} catch (DriverException e) { |
... | ... | |
178 | 181 |
} else { |
179 | 182 |
// Si la capa viene con otro tipo de leyenda, creamos |
180 | 183 |
// una nueva del tipo que maneja este panel |
181 |
renderer = new GraduatedSymbolLegend(layerShapeType);
|
|
184 |
renderer = new GraduatedSymbolLegend(); |
|
182 | 185 |
} |
183 | 186 |
|
184 | 187 |
cmbFieldType.setSelectedIndex(renderer.getIntervalType()); |
... | ... | |
257 | 260 |
default: |
258 | 261 |
throw new Error("Unknown symbol type"); |
259 | 262 |
} |
260 |
// clone symbol |
|
261 |
return SymbologyFactory.createSymbolFromXML(templateSymbol.getXMLEntity(), null); |
|
263 |
return newSymbol(shapeType, size); |
|
262 | 264 |
} else { |
263 | 265 |
// clone symbol |
264 | 266 |
ISymbol mySymbol = SymbologyFactory.createSymbolFromXML(templateSymbol.getXMLEntity(), null); |
branches/simbologia/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/legend/gui/JSymbolPreviewButton.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.1.2.1 2007-02-13 16:19:19 jaume |
|
46 |
* Revision 1.1.2.2 2007-02-14 09:59:17 jaume |
|
47 |
* *** empty log message *** |
|
48 |
* |
|
49 |
* Revision 1.1.2.1 2007/02/13 16:19:19 jaume |
|
47 | 50 |
* graduated symbol legends (start commiting) |
48 | 51 |
* |
49 | 52 |
* |
50 | 53 |
*/ |
51 | 54 |
package com.iver.cit.gvsig.project.documents.view.legend.gui; |
52 | 55 |
|
56 |
import java.awt.BasicStroke; |
|
57 |
import java.awt.Color; |
|
53 | 58 |
import java.awt.Graphics; |
54 | 59 |
import java.awt.Graphics2D; |
60 |
import java.awt.LayoutManager; |
|
61 |
import java.awt.Rectangle; |
|
62 |
import java.awt.event.ActionListener; |
|
63 |
import java.awt.event.MouseEvent; |
|
64 |
import java.awt.event.MouseListener; |
|
65 |
import java.awt.geom.Rectangle2D; |
|
66 |
import java.util.ArrayList; |
|
55 | 67 |
|
56 |
import org.gvsig.gui.beans.swing.JButton; |
|
68 |
import javax.swing.BorderFactory; |
|
69 |
import javax.swing.JComponent; |
|
57 | 70 |
|
58 | 71 |
import com.iver.cit.gvsig.fmap.core.ISymbol; |
59 | 72 |
|
60 |
public class JSymbolPreviewButton extends JButton {
|
|
73 |
public class JSymbolPreviewButton extends JComponent implements MouseListener {
|
|
61 | 74 |
private ISymbol prev; |
75 |
private ArrayList listeners = new ArrayList(); |
|
76 |
private boolean pressed; |
|
62 | 77 |
|
78 |
|
|
79 |
public JSymbolPreviewButton() { |
|
80 |
super(); |
|
81 |
addMouseListener(this); |
|
82 |
mouseExited(null); |
|
83 |
|
|
84 |
} |
|
85 |
|
|
86 |
public JSymbolPreviewButton(LayoutManager layout) { |
|
87 |
this(); |
|
88 |
} |
|
89 |
|
|
63 | 90 |
public void paint(Graphics g) { |
64 |
super.paint(g); |
|
65 |
if (prev!=null) { |
|
66 |
Graphics2D g2 = (Graphics2D) g; |
|
67 |
prev.drawInsideRectangle(g2, g2.getTransform(), getBounds()); |
|
91 |
Rectangle bounds = getBounds(); |
|
92 |
Graphics2D g2 = (Graphics2D) g; |
|
93 |
if (g2 != null) { |
|
94 |
g2.setStroke(new BasicStroke(2)); |
|
95 |
g2.setColor(pressed ? Color.GRAY : Color.WHITE); |
|
96 |
g2.drawLine(0, 0, (int) bounds.getWidth(), 0); |
|
97 |
g2.drawLine(0, 0, 0, (int) bounds.getHeight()); |
|
98 |
g2.setColor(pressed ? Color.WHITE : Color.GRAY); |
|
99 |
g2.drawLine(2, (int) bounds.getHeight(), (int) bounds.getWidth(), (int) bounds.getHeight()); |
|
100 |
g2.drawLine((int) bounds.getWidth(), 0, (int) bounds.getWidth(), (int) bounds.getHeight()); |
|
101 |
|
|
102 |
Rectangle2D r = new Rectangle2D.Double(3, 3, bounds.getWidth()-3, bounds.getHeight()-6); |
|
103 |
|
|
104 |
if (prev!=null) { |
|
105 |
prev.drawInsideRectangle(g2, g2.getTransform(), r.getBounds()); |
|
106 |
} |
|
68 | 107 |
} |
69 | 108 |
} |
70 | 109 |
|
71 | 110 |
public void setSymbol(ISymbol symbol) { |
72 | 111 |
this.prev = symbol; |
73 |
repaint();
|
|
112 |
mouseExited(null);
|
|
74 | 113 |
} |
114 |
|
|
115 |
public void mouseClicked(MouseEvent e) { |
|
116 |
for (int i = 0; i < listeners.size(); i++) { |
|
117 |
((ActionListener) listeners .get(i)).actionPerformed(null); |
|
118 |
} |
|
119 |
} |
|
120 |
|
|
121 |
public void mouseEntered(MouseEvent e) {} |
|
122 |
|
|
123 |
public void mouseExited(MouseEvent e) { |
|
124 |
setBorder(BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); |
|
125 |
pressed = false; |
|
126 |
paint(getGraphics()); |
|
127 |
} |
|
128 |
|
|
129 |
public void mousePressed(MouseEvent e) { |
|
130 |
|
|
131 |
setBorder(BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); |
|
132 |
pressed = true; |
|
133 |
paint(getGraphics()); |
|
134 |
} |
|
135 |
|
|
136 |
public void mouseReleased(MouseEvent e) { |
|
137 |
if (pressed) |
|
138 |
mouseClicked(e); |
|
139 |
mouseExited(e); |
|
140 |
} |
|
141 |
|
|
142 |
public void addActionListener(ActionListener l) { |
|
143 |
listeners.add(l); |
|
144 |
} |
|
145 |
|
|
146 |
|
|
75 | 147 |
} |
branches/simbologia/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/legend/gui/ThemeManagerWindow.java | ||
---|---|---|
128 | 128 |
}; |
129 | 129 |
}); |
130 | 130 |
add(getPanelButtons(), java.awt.BorderLayout.SOUTH); |
131 |
setSize(new java.awt.Dimension(640,450));
|
|
131 |
setSize(new java.awt.Dimension(723,468));
|
|
132 | 132 |
|
133 | 133 |
|
134 | 134 |
} |
... | ... | |
208 | 208 |
public static void addPage(Class abstractThemeManagerPageClass) { |
209 | 209 |
pages.add(abstractThemeManagerPageClass); |
210 | 210 |
} |
211 |
} |
|
211 |
} // @jve:decl-index=0:visual-constraint="10,10" |
Also available in: Unified diff