Revision 38451 branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/gui/preferencespage/AppSymbolPreferences.java
AppSymbolPreferences.java | ||
---|---|---|
28 | 28 |
|
29 | 29 |
import java.awt.Color; |
30 | 30 |
import java.awt.Font; |
31 |
import java.io.File; |
|
31 | 32 |
|
32 | 33 |
import org.gvsig.andami.PluginServices; |
33 | 34 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
... | ... | |
49 | 50 |
|
50 | 51 |
private DynObject values = null; |
51 | 52 |
|
52 |
private String symbolFileExtension = ".gvssym"; |
|
53 |
private String symbolFileExtension = ".gvssym"; |
|
54 |
private Color defaultSymbolColor; |
|
55 |
private Color defaultSymbolFillColor; |
|
56 |
private boolean defaultSymbolFillColorAleatory; |
|
57 |
private Font defaultSymbolFont; |
|
58 |
private String symbolLibraryPath; |
|
53 | 59 |
|
54 | 60 |
/** |
55 | 61 |
* The unit that will be used when creating new symbols with Cartographic |
... | ... | |
69 | 75 |
} |
70 | 76 |
|
71 | 77 |
private void initDefaults() { |
72 |
SymbolPreferences preferences = MapContextLocator.getSymbolManager().getSymbolPreferences(); |
|
78 |
resetDefaultSymbolColor(); |
|
79 |
resetDefaultSymbolFillColor(); |
|
80 |
resetDefaultSymbolFillColorAleatory(); |
|
81 |
resetSymbolLibraryPath(); |
|
82 |
resetDefaultSymbolFont(); |
|
83 |
|
|
73 | 84 |
if(getDefaultSymbolFont() == null) |
74 |
setDefaultSymbolFont(preferences.getDefaultSymbolFont());
|
|
85 |
setDefaultSymbolFont(defaultSymbolFont);
|
|
75 | 86 |
if(getDefaultSymbolColor() == null) |
76 |
setDefaultSymbolColor(preferences.getDefaultSymbolColor());
|
|
87 |
setDefaultSymbolColor(defaultSymbolColor);
|
|
77 | 88 |
if(getDefaultSymbolFillColor() == null) |
78 |
setDefaultSymbolFillColor(preferences.getDefaultSymbolFillColor());
|
|
89 |
setDefaultSymbolFillColor(defaultSymbolFillColor);
|
|
79 | 90 |
if(getSymbolLibraryPath() == null) |
80 |
setSymbolLibraryPath(preferences.getSymbolLibraryPath());
|
|
81 |
setSymbolFileExtension(preferences.getSymbolFileExtension());
|
|
82 |
setDefaultCartographicSupportMeasureUnit(preferences.getDefaultCartographicSupportMeasureUnit());
|
|
83 |
setDefaultCartographicSupportReferenceSystem(preferences.getDefaultCartographicSupportReferenceSystem());
|
|
91 |
setSymbolLibraryPath(symbolLibraryPath);
|
|
92 |
setSymbolFileExtension(symbolFileExtension);
|
|
93 |
setDefaultCartographicSupportMeasureUnit(defaultCartographicSupportMeasureUnit);
|
|
94 |
setDefaultCartographicSupportReferenceSystem(defaultCartographicSupportReferenceSystem);
|
|
84 | 95 |
} |
85 | 96 |
|
86 | 97 |
public String getSymbolFileExtension() { |
... | ... | |
120 | 131 |
|
121 | 132 |
public boolean isDefaultSymbolFillColorAleatory() { |
122 | 133 |
if(values.getDynValue(SYMBOL_FILL_COLOR_ALEATORY) == null) { |
123 |
SymbolPreferences preferences = MapContextLocator.getSymbolManager().getSymbolPreferences(); |
|
124 |
setDefaultSymbolFillColorAleatory(preferences.isDefaultSymbolFillColorAleatory()); |
|
134 |
setDefaultSymbolFillColorAleatory(defaultSymbolFillColorAleatory); |
|
125 | 135 |
} |
126 | 136 |
return (Boolean)values.getDynValue(SYMBOL_FILL_COLOR_ALEATORY); |
127 | 137 |
} |
... | ... | |
162 | 172 |
} |
163 | 173 |
|
164 | 174 |
public void resetDefaultSymbolColor() { |
165 |
// TODO Auto-generated method stub |
|
166 |
|
|
175 |
defaultSymbolColor = Color.GRAY; |
|
167 | 176 |
} |
168 | 177 |
|
169 | 178 |
public void resetDefaultSymbolFillColor() { |
170 |
// TODO Auto-generated method stub |
|
171 |
|
|
179 |
defaultSymbolFillColor = new Color(60, 235, 235); |
|
172 | 180 |
} |
173 | 181 |
|
174 | 182 |
public void resetDefaultSymbolFillColorAleatory() { |
175 |
// TODO Auto-generated method stub |
|
176 |
|
|
183 |
defaultSymbolFillColorAleatory = false; |
|
177 | 184 |
} |
178 | 185 |
|
179 | 186 |
public void resetDefaultSymbolFont() { |
180 |
// TODO Auto-generated method stub |
|
181 |
|
|
187 |
defaultSymbolFont = new Font("Serif", Font.PLAIN, 8); |
|
182 | 188 |
} |
183 | 189 |
|
184 | 190 |
public void resetSymbolLibraryPath() { |
185 |
// TODO Auto-generated method stub |
|
186 |
|
|
191 |
symbolLibraryPath = |
|
192 |
System.getProperty("user.home") + File.separator + "gvSIG" |
|
193 |
+ File.separator + "Symbols"; |
|
187 | 194 |
} |
188 | 195 |
} |
Also available in: Unified diff