Revision 27278 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/StyleSelector.java

View differences:

StyleSelector.java
137 137
	private static final long serialVersionUID = -7476555713446755512L;
138 138
	private ImageSizePanel isp;
139 139
	private IStyle styleType;
140
	private boolean showPanelOptions = true;
140 141

  
141 142
	public StyleSelector(IStyle style, int shapeType) {
142 143
		this(style, shapeType, new StyleSelectorFilter() {
......
158 159
	 * @param filter
159 160
	 */
160 161
	public StyleSelector(IStyle style, int shapeType, StyleSelectorFilter filter) {
162
		this(style, shapeType, filter, true);
163
	}
164

  
165

  
166
	public StyleSelector(IStyle style, int shapeType, StyleSelectorFilter filter, boolean showPanelOptions) {
161 167
		super(null, shapeType, filter, false);
162 168

  
169
		this.showPanelOptions = showPanelOptions;
170

  
163 171
		styleType = ((StyleSelectorFilter)filter).getAllowedObject();
164 172
		Preferences prefs = Preferences.userRoot().node( "gvsig.foldering" );
165 173
		rootDir = new File(prefs.get("SymbolStylesFolder", System.getProperty("user.home")+"/gvSIG/Styles"));
......
176 184

  
177 185
	}
178 186

  
187

  
188

  
179 189
	@Override
180 190
	protected void initialize(Object currentElement) throws ClassNotFoundException {
181 191
		library = new StyleLibrary(rootDir);
......
248 258
	protected JPanel getJPanelOptions() {
249 259
		if (jPanelOptions == null) {
250 260
			jPanelOptions = new GridBagLayoutPanel();
251
			jPanelOptions.setBorder(BorderFactory.createTitledBorder(null, PluginServices.getText(this, "options")));
252
			jPanelOptions.addComponent(getImageSizePanel());
253
			jPanelOptions.addComponent(PluginServices.getText(this, "units"),
254
					cmbUnits = new JComboBoxUnits(true));
255
			jPanelOptions.addComponent("",
256
					cmbReferenceSystem = new JComboBoxUnitsReferenceSystem());
261
			if(showPanelOptions){
262
				jPanelOptions.setBorder(BorderFactory.createTitledBorder(null, PluginServices.getText(this, "options")));
263
				jPanelOptions.addComponent(getImageSizePanel());
264
				jPanelOptions.addComponent(PluginServices.getText(this, "units"),
265
						cmbUnits = new JComboBoxUnits(true));
266
				jPanelOptions.addComponent("",
267
						cmbReferenceSystem = new JComboBoxUnitsReferenceSystem());
268
			}
257 269
		}
258 270
		return jPanelOptions;
259 271
	}
......
282 294
	}
283 295

  
284 296
	protected void updateOptionsPanel() {
285
		IStyle s = ((StylePreviewer) jPanelPreview).getStyle();
286
		if (s instanceof ILabelStyle) {
287
			ILabelStyle lab = (ILabelStyle) s;
288
			Dimension sz = lab.getSize();
289
			getImageSizePanel().setImageSize(sz);
297
		if(showPanelOptions){
298
			IStyle s = ((StylePreviewer) jPanelPreview).getStyle();
299
			if (s instanceof ILabelStyle) {
300
				ILabelStyle lab = (ILabelStyle) s;
301
				Dimension sz = lab.getSize();
302
				getImageSizePanel().setImageSize(sz);
303
			}
290 304
		}
291 305
	}
292 306

  

Also available in: Unified diff