Revision 10437 branches/simbologia/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/SimpleFill.java
SimpleFill.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.1.2.2 2007-02-08 15:43:05 jaume |
|
46 |
* Revision 1.1.2.3 2007-02-21 07:35:14 jaume |
|
47 |
* *** empty log message *** |
|
48 |
* |
|
49 |
* Revision 1.1.2.2 2007/02/08 15:43:05 jaume |
|
47 | 50 |
* some bug fixes in the editor and removed unnecessary imports |
48 | 51 |
* |
49 | 52 |
* Revision 1.1.2.1 2007/01/26 13:49:03 jaume |
... | ... | |
78 | 81 |
|
79 | 82 |
import org.gvsig.gui.beans.swing.GridBagLayoutPanel; |
80 | 83 |
|
84 |
import sun.security.action.GetBooleanAction; |
|
85 |
|
|
81 | 86 |
import com.iver.andami.PluginServices; |
82 | 87 |
import com.iver.andami.messages.NotificationManager; |
83 |
import com.iver.cit.gvsig.fmap.core.ISymbol; |
|
88 |
import com.iver.cit.gvsig.fmap.core.FShape; |
|
89 |
import com.iver.cit.gvsig.fmap.core.symbols.ILineSymbol; |
|
90 |
import com.iver.cit.gvsig.fmap.core.symbols.ISymbol; |
|
84 | 91 |
import com.iver.cit.gvsig.fmap.core.symbols.SimpleFillSymbol; |
85 | 92 |
import com.iver.cit.gvsig.gui.panels.ColorChooserPanel; |
93 |
import com.iver.cit.gvsig.project.documents.view.legend.gui.JSymbolPreviewButton; |
|
86 | 94 |
|
87 | 95 |
import de.ios.framework.swing.JDecimalField; |
88 | 96 |
|
... | ... | |
90 | 98 |
private static final String NAME = PluginServices. |
91 | 99 |
getText(SimpleFill.class, "simple_fill"); |
92 | 100 |
private ColorChooserPanel jccFillColor; |
93 |
private ColorChooserPanel jccOutlineColor; |
|
94 | 101 |
private JDecimalField txtOutlineWidth; |
95 | 102 |
private ArrayList tabs = new ArrayList(); |
96 |
|
|
103 |
private JSymbolPreviewButton btnOutline; |
|
104 |
|
|
97 | 105 |
public SimpleFill(SymbolEditor owner) { |
98 | 106 |
super(owner); |
99 | 107 |
initialize(); |
... | ... | |
114 | 122 |
jccFillColor = new ColorChooserPanel(); |
115 | 123 |
jccFillColor.setAlpha(255); |
116 | 124 |
|
117 |
// TODO restore previous color |
|
118 |
aux.addComponent(PluginServices.getText(this, "fill_color")+":", |
|
119 |
jccFillColor ); |
|
120 |
jccOutlineColor = new ColorChooserPanel(); |
|
121 |
jccOutlineColor.setAlpha(255); |
|
122 |
// TODO restore previous outline color |
|
123 |
aux.addComponent(PluginServices.getText(this, "outline_color")+":", |
|
124 |
jccOutlineColor ); |
|
125 |
btnOutline = new JSymbolPreviewButton(FShape.LINE); |
|
126 |
btnOutline.setPreferredSize(new Dimension(100, 35)); |
|
127 |
|
|
128 |
aux.addComponent(PluginServices.getText(this, "outline")+":", |
|
129 |
btnOutline ); |
|
125 | 130 |
txtOutlineWidth = new JDecimalField(25); |
126 | 131 |
// TODO restore previous outline width |
127 | 132 |
aux.addComponent(PluginServices.getText(this, "outline_width")+":", |
... | ... | |
130 | 135 |
myTab.add(aux); |
131 | 136 |
|
132 | 137 |
jccFillColor.addActionListener(this); |
133 |
jccOutlineColor.addActionListener(this);
|
|
138 |
btnOutline.addActionListener(this);
|
|
134 | 139 |
txtOutlineWidth.addActionListener(this); |
135 | 140 |
tabs.add(myTab); |
136 | 141 |
} |
137 | 142 |
|
138 | 143 |
public ISymbol getLayer() { |
139 | 144 |
SimpleFillSymbol sfs = new SimpleFillSymbol(); |
140 |
sfs.setOutlineColor(jccOutlineColor.getColor());
|
|
145 |
sfs.setOutline((ILineSymbol) btnOutline.getSymbol());
|
|
141 | 146 |
sfs.setFillColor(jccFillColor.getColor()); |
142 | 147 |
return sfs; |
143 | 148 |
} |
... | ... | |
150 | 155 |
} else { |
151 | 156 |
sym = (SimpleFillSymbol) layer; |
152 | 157 |
jccFillColor.setColor(sym.getFillColor()); |
153 |
jccOutlineColor.setColor(sym.getOutlineColor()); |
|
154 |
|
|
158 |
btnOutline.setSymbol(sym.getOutline()); |
|
155 | 159 |
} |
156 | 160 |
} catch (IndexOutOfBoundsException ioEx) { |
157 | 161 |
NotificationManager.addWarning("Symbol layer index out of bounds", ioEx); |
Also available in: Unified diff