Revision 47476 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/StylePreviewer.java
StylePreviewer.java | ||
---|---|---|
21 | 21 |
* For any additional information, do not hesitate to contact us |
22 | 22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
23 | 23 |
*/ |
24 |
/* CVS MESSAGES: |
|
25 |
* |
|
26 |
* $Id: StylePreviewer.java 30892 2009-09-21 12:02:19Z cordinyana $ |
|
27 |
* $Log$ |
|
28 |
* Revision 1.6 2007-08-16 06:54:35 jvidal |
|
29 |
* javadoc updated |
|
30 |
* |
|
31 |
* Revision 1.5 2007/08/13 11:33:03 jvidal |
|
32 |
* javadoc |
|
33 |
* |
|
34 |
* Revision 1.4 2007/07/30 12:56:04 jaume |
|
35 |
* organize imports, java 5 code downgraded to 1.4 and added PictureFillSymbol |
|
36 |
* |
|
37 |
* Revision 1.3 2007/05/08 15:44:07 jaume |
|
38 |
* *** empty log message *** |
|
39 |
* |
|
40 |
* Revision 1.2 2007/04/04 16:01:14 jaume |
|
41 |
* *** empty log message *** |
|
42 |
* |
|
43 |
* Revision 1.2 2007/03/09 11:25:00 jaume |
|
44 |
* Advanced symbology (start committing) |
|
45 |
* |
|
46 |
* Revision 1.1.2.4 2007/02/21 07:35:14 jaume |
|
47 |
* *** empty log message *** |
|
48 |
* |
|
49 |
* Revision 1.1.2.3 2007/02/08 15:43:04 jaume |
|
50 |
* some bug fixes in the editor and removed unnecessary imports |
|
51 |
* |
|
52 |
* Revision 1.1.2.2 2007/01/30 18:10:10 jaume |
|
53 |
* start commiting labeling stuff |
|
54 |
* |
|
55 |
* Revision 1.1.2.1 2007/01/26 13:49:03 jaume |
|
56 |
* *** empty log message *** |
|
57 |
* |
|
58 |
* |
|
59 |
*/ |
|
60 | 24 |
package org.gvsig.app.gui.styling; |
61 | 25 |
|
62 | 26 |
import java.awt.Color; |
... | ... | |
67 | 31 |
import java.awt.Rectangle; |
68 | 32 |
import org.apache.commons.lang3.mutable.MutableObject; |
69 | 33 |
import org.gvsig.fmap.dal.feature.Feature; |
70 |
|
|
71 | 34 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
72 | 35 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
73 | 36 |
import org.gvsig.fmap.mapcontext.rendering.symbols.IWarningSymbol; |
... | ... | |
80 | 43 |
* Defines the properties of the symbols that are showed in the |
81 | 44 |
* SymbolPreviewer panel.Also the user has methods to set this attributes. |
82 | 45 |
* |
83 |
* @author jaume dominguez faus - jaume.dominguez@iver.es
|
|
46 |
* @author gvSIG Team
|
|
84 | 47 |
* |
85 | 48 |
*/ |
86 | 49 |
public class StylePreviewer extends SymbolPreviewer{ |
... | ... | |
88 | 51 |
* |
89 | 52 |
*/ |
90 | 53 |
private static final long serialVersionUID = -1690697926703748637L; |
91 |
private int hGap = 5, vGap = 5;
|
|
54 |
private int hGap, vGap;
|
|
92 | 55 |
private IStyle style; |
93 | 56 |
private boolean showOutline; |
94 | 57 |
|
... | ... | |
99 | 62 |
*/ |
100 | 63 |
public StylePreviewer(MutableObject<Feature> feature) { |
101 | 64 |
super(feature); |
102 |
setBackground(Color.WHITE);
|
|
65 |
initialize();
|
|
103 | 66 |
} |
104 | 67 |
|
105 | 68 |
public StylePreviewer() { |
106 | 69 |
super(); |
107 |
setBackground(Color.WHITE);
|
|
70 |
initialize();
|
|
108 | 71 |
} |
72 |
|
|
73 |
private void initialize() { |
|
74 |
this.hGap = 5; |
|
75 |
this.vGap = 5; |
|
76 |
setBackground(Color.WHITE); |
|
77 |
} |
|
78 |
|
|
109 | 79 |
/** |
110 | 80 |
* Obtains the style of the symbol showed in the SymbolPreviewer panel |
111 | 81 |
* @return style,IStyle |
... | ... | |
118 | 88 |
this.showOutline = so; |
119 | 89 |
} |
120 | 90 |
|
91 |
@Override |
|
121 | 92 |
public ISymbol getSymbol() { |
122 | 93 |
throw new Error(Messages.getText("undefined_for_StylePreviewer_use") |
123 | 94 |
+" getStyle() "+ |
... | ... | |
125 | 96 |
|
126 | 97 |
} |
127 | 98 |
|
99 |
@Override |
|
128 | 100 |
public void setSymbol(ISymbol symbol) { |
129 | 101 |
throw new Error(Messages.getText("undefined_for_StylePreviewer_use") |
130 | 102 |
+" setStyle(IStyle) "+ |
... | ... | |
138 | 110 |
|
139 | 111 |
public void setStyle(IStyle style) { |
140 | 112 |
this.style = style; |
141 |
// repaint(); |
|
142 |
|
|
143 | 113 |
} |
144 | 114 |
|
115 |
@Override |
|
145 | 116 |
public void paint(Graphics g) { |
146 | 117 |
Graphics2D g2 = (Graphics2D) g; |
147 | 118 |
Rectangle r = getBounds(); |
... | ... | |
166 | 137 |
SymbolDrawingException.STR_UNSUPPORTED_SET_OF_SETTINGS, |
167 | 138 |
"", |
168 | 139 |
SymbolDrawingException.UNSUPPORTED_SET_OF_SETTINGS); |
169 |
warning.drawInsideRectangle(g2, null, r,null);
|
|
140 |
warning.drawInsideRectangle(g2, null, r); |
|
170 | 141 |
} catch (SymbolDrawingException e1) { |
171 | 142 |
// IMPOSSIBLE TO REACH THIS |
172 | 143 |
} |
Also available in: Unified diff