Revision 12970

View differences:

trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/PictureFill.java
71 71
import com.iver.cit.gvsig.project.documents.view.legend.gui.JSymbolPreviewButton;
72 72

  
73 73
/**
74
 * @author jaume dominguez faus - jaume.dominguez@iver.es
74
 * <b>PictureFill</b> allows the user to store and modify the properties that fills a
75
 * polygon with a padding and an outline<p>
76
 * <p>
77
 * This functionality is carried out thanks to two tabs (picture fill and MarkerFillProperties)
78
 * which are included in the panel to edit the properities of a symbol (SymbolEditor)
79
 * how is explained in AbstractTypeSymbolEditor.<p>
80
 * <p>
81
 * The first tab (picture fill)permits the user to select the picture for the padding and
82
 * differentes options to modify it such as the angle(<b>incrAngle</b>) and the scale
83
 * (<b>incrScaleX,incrScaleY</b>). Also, there is an option to select a color for the
84
 * fill (<b>jccFillColor</b>).
85
 * <p>
86
 * The second tab is implementes as a MarkerFillProperties class and offers the possibilities
87
 * to change the separtion and the offset.
88
 *
89
 *
90
 *@see MarkerFillProperties
91
 *@see AbstractTypeSymbolEditor
92
 *@author jaume dominguez faus - jaume.dominguez@iver.es
75 93
 */
76 94
public class PictureFill extends AbstractTypeSymbolEditor implements
77
		ActionListener {
95
ActionListener {
78 96
	private static File lastDir;
79 97

  
80 98
	private JLabel lblFileName;
......
87 105
	private ColorChooserPanel jccFillColor;
88 106
	private ILineSymbol outline;
89 107
	private JSymbolPreviewButton btnOutline;
90
	
108

  
91 109
	private ActionListener chooseAction = new ActionListener() {
92 110
		public void actionPerformed(ActionEvent e) {
93 111
			boolean isSelection;
......
130 148
		}
131 149

  
132 150
	};
133

  
151
	/**
152
	 * constructor method
153
	 * @param owner
154
	 */
134 155
	public PictureFill(SymbolEditor owner) {
135 156
		super(owner);
136 157
		initialize();
137 158
	}
138 159

  
160
	/**
161
	 * Initializes the parameters that allows the user to fill the padding of
162
	 * a polygon with a picture style.To do it, two tabs are created (picture fill and
163
	 * MarkerFillProperties)inside the SymbolEditor panel with default values for the
164
     * different attributes.
165
	 */
139 166
	private void initialize() {
140 167
		JPanel myTab = new JPanel(new FlowLayout(FlowLayout.LEADING, 5,5));
141 168
		myTab.setName(PluginServices.getText(this, "picture_fill"));
142
		
169

  
143 170
		JButton btn = new JButton(PluginServices.getText(this, "browse"));
144 171
		btn.addActionListener(chooseAction);
145
		
172

  
146 173
		JPanel aux2 = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 5));
147
		
174

  
148 175
		aux2.add(btn);
149 176
		aux2.add(lblFileName = new JLabel(
150 177
				PluginServices.getText(this, "none_selected")));
151
		
178

  
152 179
		GridBagLayoutPanel aux = new GridBagLayoutPanel();
153 180
		aux.addComponent(new JBlank(20, 20));
154 181
		aux.addComponent(aux2);
155
		
182

  
156 183
		aux2 = new JPanel(new GridLayout(1, 2, 20, 5));
157 184
		GridBagLayoutPanel aux3;
158 185
		aux3 = new GridBagLayoutPanel();
159 186
		aux3.addComponent(PluginServices.getText(this, "angle")+":",
160 187
				incrAngle = new JIncrementalNumberField("0", 5));
161
		aux3.addComponent(PluginServices.getText(this, "scale")+"X:", 
188
		aux3.addComponent(PluginServices.getText(this, "scale")+"X:",
162 189
				incrScaleX = new JIncrementalNumberField(
163 190
						"1",
164 191
						5,
......
180 207
		aux3.addComponent(PluginServices.getText(this, "fill_color")+":",
181 208
				jccFillColor = new ColorChooserPanel());
182 209
		jccFillColor.setAlpha(255);
183
		
210

  
184 211
		aux3.addComponent(new JBlank(5,5));
185 212
		aux3.addComponent(new JBlank(5,5));
186 213
		aux2.add(aux3);
187
		
214

  
188 215
		aux.addComponent(aux2);
189 216
		aux.addComponent(new JBlank(20, 20));
190 217
		aux.addComponent(PluginServices.getText(this, "outline")+":",
191 218
				btnOutline = new JSymbolPreviewButton(FShape.LINE));
192
		
219

  
193 220
		fillProperties = new MarkerFillProperties();
194 221
		myTab.add(aux);
195
		
222

  
196 223
		fillProperties.addActionListener(this);
197 224
		incrAngle.addActionListener(this);
198 225
		incrScaleX.addActionListener(this);
199 226
		incrScaleY.addActionListener(this);
200 227
		jccFillColor.addActionListener(this);
201
		
202
		
228

  
229

  
203 230
		tabs.add(myTab);
204 231
		tabs.add(fillProperties);
205 232
	}
......
216 243
		try {
217 244
			sym.setImage(imageFile);
218 245
			sym.setFillColor(jccFillColor.getColor());
219
			
246

  
220 247
			sym.setOutline(outline);
221 248
			sym.setAngle(incrAngle.getDouble()*FConstant.DEGREE_TO_RADIANS);
222 249
			sym.setXScale(incrScaleX.getDouble());
......
228 255
			NotificationManager.addError(PluginServices.getText(this, "could_not_open_picture_file"), e);
229 256
			return null;
230 257
		}
231
		
258

  
232 259
	}
233 260

  
234 261
	public String getName() {
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/MarkerFill.java
40 40
 */
41 41

  
42 42
/* CVS MESSAGES:
43
*
44
* $Id$
45
* $Log$
46
* Revision 1.15  2007-08-03 11:29:13  jaume
47
* refactored AbstractTypeSymbolEditorPanel class name to AbastractTypeSymbolEditor
48
*
49
* Revision 1.14  2007/08/03 09:20:46  jaume
50
* refactored class names
51
*
52
* Revision 1.13  2007/08/01 13:02:08  jaume
53
* renamed methods
54
*
55
* Revision 1.12  2007/07/30 12:56:04  jaume
56
* organize imports, java 5 code downgraded to 1.4 and added PictureFillSymbol
57
*
58
* Revision 1.11  2007/06/29 13:07:33  jaume
59
* +PictureLineSymbol
60
*
61
* Revision 1.10  2007/05/28 13:34:28  jaume
62
* *** empty log message ***
63
*
64
* Revision 1.9  2007/05/08 15:44:07  jaume
65
* *** empty log message ***
66
*
67
* Revision 1.8  2007/04/27 12:10:17  jaume
68
* *** empty log message ***
69
*
70
* Revision 1.7  2007/04/05 16:08:34  jaume
71
* Styled labeling stuff
72
*
73
* Revision 1.6  2007/04/04 16:01:14  jaume
74
* *** empty log message ***
75
*
76
* Revision 1.5  2007/03/28 16:44:08  jaume
77
* *** empty log message ***
78
*
79
* Revision 1.4  2007/03/13 16:57:35  jaume
80
* Added MultiVariable legend
81
*
82
* Revision 1.3  2007/03/09 11:25:00  jaume
83
* Advanced symbology (start committing)
84
*
85
* Revision 1.1.2.3  2007/02/21 07:35:14  jaume
86
* *** empty log message ***
87
*
88
* Revision 1.1.2.2  2007/02/08 15:43:05  jaume
89
* some bug fixes in the editor and removed unnecessary imports
90
*
91
* Revision 1.1.2.1  2007/01/26 13:49:03  jaume
92
* *** empty log message ***
93
*
94
* Revision 1.1  2007/01/16 11:52:11  jaume
95
* *** empty log message ***
96
*
97
* Revision 1.8  2007/01/10 17:05:05  jaume
98
* moved to FMap and gvSIG
99
*
100
* Revision 1.7  2006/11/13 09:15:23  jaume
101
* javadoc and some clean-up
102
*
103
* Revision 1.6  2006/11/06 16:06:52  jaume
104
* *** empty log message ***
105
*
106
* Revision 1.5  2006/11/02 17:19:28  jaume
107
* *** empty log message ***
108
*
109
* Revision 1.4  2006/10/31 16:16:34  jaume
110
* *** empty log message ***
111
*
112
* Revision 1.3  2006/10/30 19:30:35  jaume
113
* *** empty log message ***
114
*
115
* Revision 1.2  2006/10/29 23:53:49  jaume
116
* *** empty log message ***
117
*
118
* Revision 1.1  2006/10/27 12:41:09  jaume
119
* GUI
120
*
121
*
122
*/
43
 *
44
 * $Id$
45
 * $Log$
46
 * Revision 1.16  2007-08-08 10:18:15  jvidal
47
 * javadoc
48
 *
49
 * Revision 1.15  2007/08/03 11:29:13  jaume
50
 * refactored AbstractTypeSymbolEditorPanel class name to AbastractTypeSymbolEditor
51
 *
52
 * Revision 1.14  2007/08/03 09:20:46  jaume
53
 * refactored class names
54
 *
55
 * Revision 1.13  2007/08/01 13:02:08  jaume
56
 * renamed methods
57
 *
58
 * Revision 1.12  2007/07/30 12:56:04  jaume
59
 * organize imports, java 5 code downgraded to 1.4 and added PictureFillSymbol
60
 *
61
 * Revision 1.11  2007/06/29 13:07:33  jaume
62
 * +PictureLineSymbol
63
 *
64
 * Revision 1.10  2007/05/28 13:34:28  jaume
65
 * *** empty log message ***
66
 *
67
 * Revision 1.9  2007/05/08 15:44:07  jaume
68
 * *** empty log message ***
69
 *
70
 * Revision 1.8  2007/04/27 12:10:17  jaume
71
 * *** empty log message ***
72
 *
73
 * Revision 1.7  2007/04/05 16:08:34  jaume
74
 * Styled labeling stuff
75
 *
76
 * Revision 1.6  2007/04/04 16:01:14  jaume
77
 * *** empty log message ***
78
 *
79
 * Revision 1.5  2007/03/28 16:44:08  jaume
80
 * *** empty log message ***
81
 *
82
 * Revision 1.4  2007/03/13 16:57:35  jaume
83
 * Added MultiVariable legend
84
 *
85
 * Revision 1.3  2007/03/09 11:25:00  jaume
86
 * Advanced symbology (start committing)
87
 *
88
 * Revision 1.1.2.3  2007/02/21 07:35:14  jaume
89
 * *** empty log message ***
90
 *
91
 * Revision 1.1.2.2  2007/02/08 15:43:05  jaume
92
 * some bug fixes in the editor and removed unnecessary imports
93
 *
94
 * Revision 1.1.2.1  2007/01/26 13:49:03  jaume
95
 * *** empty log message ***
96
 *
97
 * Revision 1.1  2007/01/16 11:52:11  jaume
98
 * *** empty log message ***
99
 *
100
 * Revision 1.8  2007/01/10 17:05:05  jaume
101
 * moved to FMap and gvSIG
102
 *
103
 * Revision 1.7  2006/11/13 09:15:23  jaume
104
 * javadoc and some clean-up
105
 *
106
 * Revision 1.6  2006/11/06 16:06:52  jaume
107
 * *** empty log message ***
108
 *
109
 * Revision 1.5  2006/11/02 17:19:28  jaume
110
 * *** empty log message ***
111
 *
112
 * Revision 1.4  2006/10/31 16:16:34  jaume
113
 * *** empty log message ***
114
 *
115
 * Revision 1.3  2006/10/30 19:30:35  jaume
116
 * *** empty log message ***
117
 *
118
 * Revision 1.2  2006/10/29 23:53:49  jaume
119
 * *** empty log message ***
120
 *
121
 * Revision 1.1  2006/10/27 12:41:09  jaume
122
 * GUI
123
 *
124
 *
125
 */
123 126
package com.iver.cit.gvsig.gui.styling;
124 127

  
125 128
import java.awt.Color;
......
145 148
import com.iver.cit.gvsig.fmap.core.symbols.MarkerFillSymbol;
146 149
import com.iver.cit.gvsig.gui.panels.ColorChooserPanel;
147 150
/**
148
*
149
* @author jaume dominguez faus - jaume.dominguez@iver.es
150
*
151
*/
151
 * <b>MarkerFill</b> allows the user to store and modify the properties that fills a
152
 * polygon with a padding made of markers and an outline<p>
153
 * <p>
154
 * This functionality is carried out thanks to two tabs (marker fill and MarkerFillProperties)
155
 * which are included in the panel to edit the properities of a symbol (SymbolEditor)
156
 * how is explained in AbstractTypeSymbolEditor.<p>
157
 * <p>
158
 * The first tab (marker fill)permits the user to select the marker for the padding and
159
 * other options such as the color for the fill (<b>btnChooseMarker</b>),to select the
160
 * ouline (<b>btnOutline</b>)and the distribution (grid or random) of the marker inside
161
 * the padding (<b>rdGrid,rdRandom</b>).
162
 * <p>
163
 * The second tab is implementes as a MarkerFillProperties class and offers the possibilities
164
 * to change the separtion and the offset.
165
 *
166
 *
167
 *@see MarkerFillProperties
168
 *@see AbstractTypeSymbolEditor
169
 *@author jaume dominguez faus - jaume.dominguez@iver.es
170
 */
152 171
public class MarkerFill extends AbstractTypeSymbolEditor implements ActionListener {
153
    private ArrayList tabs = new ArrayList();
154
    private ColorChooserPanel markerCC;
155
    private JButton btnChooseMarker;
156
    private JButton btnOutline;
157
    private MarkerFillSymbol mfs = new MarkerFillSymbol();
158
    private MarkerFillProperties panelStyle = new MarkerFillProperties();
159
    private JRadioButton rdGrid;
172
	private ArrayList tabs = new ArrayList();
173
	private ColorChooserPanel markerCC;
174
	private JButton btnChooseMarker;
175
	private JButton btnOutline;
176
	private MarkerFillSymbol mfs = new MarkerFillSymbol();
177
	private MarkerFillProperties panelStyle = new MarkerFillProperties();
178
	private JRadioButton rdGrid;
160 179
	private JRadioButton rdRandom;
161 180
	private AbstractMarkerSymbol marker;
181
	/**
182
	 * constructor method
183
	 * @param owner
184
	 */
185
	public MarkerFill(SymbolEditor owner) {
186
		super(owner);
187
		initialize();
188
	}
189
	/**
190
	 * Initializes the parameters that allows the user to fill the padding of
191
	 * a polygon with a style made of markers.To do it, two tabs are created (marker
192
	 * fill and MarkerFillProperties)inside the SymbolEditor panel with default values
193
	 * for the different attributes.
194
	 */
195
	private void initialize() {
196
//		GridLayout layout;
197
		JPanel myTab;
198
		// Marker fill tab
162 199

  
163
    public MarkerFill(SymbolEditor owner) {
164
        super(owner);
165
        initialize();
166
    }
200
		{
201
			myTab = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 10));
202
			myTab.setName(PluginServices.getText(this, "marker_fill"));
167 203

  
168
    private void initialize() {
169
//        GridLayout layout;
170
        JPanel myTab;
171
        // Marker fill tab
204
			GridBagLayoutPanel p = new GridBagLayoutPanel();
205
			JPanel aux = new JPanel(new FlowLayout(FlowLayout.LEADING, 5, 5));
206
			markerCC = new ColorChooserPanel();
207
			markerCC.setAlpha(255);
208
			markerCC.addActionListener(this);
209
			aux.add(markerCC);
172 210

  
173
        {
174
        	myTab = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 10));
175
        	myTab.setName(PluginServices.getText(this, "marker_fill"));
211
			p.addComponent(PluginServices.getText(this, "color"), aux);
212
			btnChooseMarker = new JButton(PluginServices.getText(this, "choose_marker"));
213
			btnChooseMarker.addActionListener(this);
214
			aux = new JPanel(new FlowLayout(FlowLayout.LEADING, 5, 5));
215
			aux.add(btnChooseMarker);
216
			p.addComponent("", aux);
176 217

  
177
        	GridBagLayoutPanel p = new GridBagLayoutPanel();
178
        	JPanel aux = new JPanel(new FlowLayout(FlowLayout.LEADING, 5, 5));
179
            markerCC = new ColorChooserPanel();
180
            markerCC.setAlpha(255);
181
            markerCC.addActionListener(this);
182
            aux.add(markerCC);
218
			aux = new JPanel(new FlowLayout(FlowLayout.LEADING, 5, 5));
219
			btnOutline = new JButton(PluginServices.getText(this, "outline"));
220
			aux.add(btnOutline);
221
			btnOutline.setEnabled(false);
222
			p.addComponent("", aux);
183 223

  
184
            p.addComponent(PluginServices.getText(this, "color"), aux);
185
            btnChooseMarker = new JButton(PluginServices.getText(this, "choose_marker"));
186
            btnChooseMarker.addActionListener(this);
187
            aux = new JPanel(new FlowLayout(FlowLayout.LEADING, 5, 5));
188
            aux.add(btnChooseMarker);
189
            p.addComponent("", aux);
224
			ButtonGroup group = new ButtonGroup();
225
			rdGrid = new JRadioButton(PluginServices.getText(this, "grid"));
226
			rdGrid.addActionListener(this);
227
			rdRandom = new JRadioButton(PluginServices.getText(this, "random"));
228
			rdRandom.addActionListener(this);
229
			group.add(rdGrid);
230
			group.add(rdRandom);
190 231

  
191
            aux = new JPanel(new FlowLayout(FlowLayout.LEADING, 5, 5));
192
            btnOutline = new JButton(PluginServices.getText(this, "outline"));
193
            aux.add(btnOutline);
194
            btnOutline.setEnabled(false);
195
            p.addComponent("", aux);
232
			aux = new JPanel(new FlowLayout(FlowLayout.LEADING, 5, 5));
233
			aux.add(rdGrid);
234
			aux.add(rdRandom);
235
			rdGrid.setSelected(true);
236
			p.addComponent("", aux);
196 237

  
197
            ButtonGroup group = new ButtonGroup();
198
            rdGrid = new JRadioButton(PluginServices.getText(this, "grid"));
199
            rdGrid.addActionListener(this);
200
            rdRandom = new JRadioButton(PluginServices.getText(this, "random"));
201
            rdRandom.addActionListener(this);
202
            group.add(rdGrid);
203
            group.add(rdRandom);
238
			myTab.add(p);
204 239

  
205
            aux = new JPanel(new FlowLayout(FlowLayout.LEADING, 5, 5));
206
            aux.add(rdGrid);
207
            aux.add(rdRandom);
208
            rdGrid.setSelected(true);
209
            p.addComponent("", aux);
240
		}
241
		tabs.add(myTab);
210 242

  
211
            myTab.add(p);
243
		// Fill properties tab
244
		tabs.add(panelStyle);
245
		panelStyle.addActionListener(this);
246
	}
212 247

  
213
        }
214
        tabs.add(myTab);
248
	public void refreshControls(ISymbol layer) {
249
		if (layer == null) {
250
			System.err.println(getClass().getName()+":: should be unreachable code");
251
			// set defaults
252
			markerCC.setColor(Color.BLACK);
253
			rdGrid.setSelected(true);
254
			rdRandom.setSelected(false);
255
		} else {
215 256

  
216
        // Fill properties tab
217
       tabs.add(panelStyle);
218
       panelStyle.addActionListener(this);
219
    }
257
			MarkerFillSymbol mfs = (MarkerFillSymbol) layer;
258
			int fillStyle = mfs.getMarkerFillProperties().getFillStyle();
259
			rdGrid.setSelected(fillStyle == SimpleMarkerFillPropertiesStyle.GRID_FILL);
260
			rdRandom.setSelected(fillStyle == SimpleMarkerFillPropertiesStyle.RANDOM_FILL);
261
			panelStyle.setModel(mfs.getMarkerFillProperties());
262
		}
263
	}
220 264

  
221
    public void refreshControls(ISymbol layer) {
222
    	if (layer == null) {
223
    		System.err.println(getClass().getName()+":: should be unreachable code");
224
        	// set defaults
225
           	markerCC.setColor(Color.BLACK);
226
           	rdGrid.setSelected(true);
227
    		rdRandom.setSelected(false);
228
        } else {
265
	public String getName() {
266
		return PluginServices.getText(this, "marker_fill");
267
	}
229 268

  
230
        	MarkerFillSymbol mfs = (MarkerFillSymbol) layer;
231
        	int fillStyle = mfs.getMarkerFillProperties().getFillStyle();
232
        	rdGrid.setSelected(fillStyle == SimpleMarkerFillPropertiesStyle.GRID_FILL);
233
        	rdRandom.setSelected(fillStyle == SimpleMarkerFillPropertiesStyle.RANDOM_FILL);
234
        	panelStyle.setModel(mfs.getMarkerFillProperties());
235
        }
236
    }
269
	public JPanel[] getTabs() {
270
		return (JPanel[]) tabs.toArray(new JPanel[0]);
271
	}
237 272

  
238
    public String getName() {
239
        return PluginServices.getText(this, "marker_fill");
240
    }
273
	public void actionPerformed(ActionEvent e) {
274
		JComponent comp = (JComponent) e.getSource();
275
		if (comp.equals(btnChooseMarker)) {
276
			SymbolSelector symSelect = new SymbolSelector( getLayer(), FShape.POINT);
277
			PluginServices.getMDIManager().addWindow(symSelect);
278
			marker = (AbstractMarkerSymbol) symSelect.getSelectedObject();
241 279

  
242
    public JPanel[] getTabs() {
243
        return (JPanel[]) tabs.toArray(new JPanel[0]);
244
    }
280
			if (marker == null) return;
245 281

  
246
    public void actionPerformed(ActionEvent e) {
247
        JComponent comp = (JComponent) e.getSource();
248
        if (comp.equals(btnChooseMarker)) {
249
            SymbolSelector symSelect = new SymbolSelector( getLayer(), FShape.POINT);
250
            PluginServices.getMDIManager().addWindow(symSelect);
251
            marker = (AbstractMarkerSymbol) symSelect.getSelectedObject();
282
			mfs.setMarker(marker);
283
		} else if (comp.equals(markerCC)) {
284
			marker.setColor(markerCC.getColor());
285
		}
252 286

  
253
            if (marker == null) return;
287
		IMarkerFillPropertiesStyle prop = panelStyle.getMarkerFillProperties();
288
		prop.setFillStyle(rdGrid.isSelected() ?
289
				IMarkerFillPropertiesStyle.GRID_FILL : IMarkerFillPropertiesStyle.RANDOM_FILL);
290
		mfs.setMarkerFillProperties(prop);
291
		fireSymbolChangedEvent();
292
	}
254 293

  
255
            mfs.setMarker(marker);
256
        } else if (comp.equals(markerCC)) {
257
        	marker.setColor(markerCC.getColor());
258
        }
259

  
260
        IMarkerFillPropertiesStyle prop = panelStyle.getMarkerFillProperties();
261
        prop.setFillStyle(rdGrid.isSelected() ?
262
        		IMarkerFillPropertiesStyle.GRID_FILL : IMarkerFillPropertiesStyle.RANDOM_FILL);
263
        mfs.setMarkerFillProperties(prop);
264
        fireSymbolChangedEvent();
265
    }
266

  
267 294
	public Class getSymbolClass() {
268 295
		return MarkerFillSymbol.class;
269 296
	}
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/Mask.java
84 84
		};
85 85
	};
86 86
	/**
87
	 * Constructor method
87
	 * Constructor method that initializes the parameters to create a tab to modify
88
	 * attributes of a mask for points such as style,size and symbol (to represent a point
89
	 * in the map).
88 90
	 * @param owner
89
    */
91
	 */
90 92
	public Mask(AbstractTypeSymbolEditor owner) {
91 93
		super();
92 94
		setName(PluginServices.getText(this, "mask"));
......
115 117
		add(aux);
116 118
		add(aux2);
117 119
	}
118
/**
119
 * To obtain the size for the text halo.This size is taken from a
120
 * JIncrementalNumberField. If this component does not exist,
121
 * a new JIncrementalNumberField is created to specify it.
122
 * @return
123
 */
120
	/**
121
	 * To obtain the size for the text halo.This size is taken from a
122
	 * JIncrementalNumberField. If this component does not exist,
123
	 * a new JIncrementalNumberField is created to specify it.
124
	 * @return
125
	 */
124 126
	private JIncrementalNumberField getTxtHaloSize() {
125 127
		if (txtHaloSize == null) {
126 128
			txtHaloSize = new JIncrementalNumberField(String.valueOf(0), 5, 0, Double.MAX_VALUE, 1);
......
129 131
		return txtHaloSize;
130 132
	}
131 133

  
132
/**
133
 * Creates the button that allows the user to select the symbol that will substitute
134
 * a point in the map.
135
 * @return
136
 */
134
	/**
135
	 * Creates the button that allows the user to select the symbol that will substitute
136
	 * a point in the map.
137
	 * @return
138
	 */
137 139
	private JButton getBtnHaloSymbol() {
138 140
		if (btnHaloSymbol == null) {
139 141
			btnHaloSymbol = new JButton(PluginServices.getText(this, "symbol"));
......
149 151
		return btnHaloSymbol;
150 152
	}
151 153

  
152
/**
153
 * To determine if the halo style is selected.If the Radio button
154
 * that determines this information does not exist, a new radio button
155
 * is created for this purpose.
156
 * @return
157
 */
154
	/**
155
	 * To determine if the halo style is selected.If the Radio button
156
	 * that determines this information does not exist, a new radio button
157
	 * is created for this purpose.
158
	 * @return
159
	 */
158 160
	private JRadioButton getRdHalo() {
159 161
		if (rdBtnHalo == null) {
160 162
			rdBtnHalo = new JRadioButton(PluginServices.getText(this, "halo"));
......
163 165
		return rdBtnHalo;
164 166
	}
165 167

  
166
 /**
167
 * To determine if there will be no defined style for a point (without halo).
168
 * If the Radio button that determines this information does not exist,
169
 * a new radio button is created for this purpose.
170
 * @return
171
 */
168
	/**
169
	 * To determine if there will be no defined style for a point (without halo).
170
	 * If the Radio button that determines this information does not exist,
171
	 * a new radio button is created for this purpose.
172
	 * @return
173
	 */
172 174
	private JRadioButton getRdNone() {
173 175
		if (rdBtnNone == null) {
174 176
			rdBtnNone = new JRadioButton(PluginServices.getText(this, "none"));
......
177 179

  
178 180
		return rdBtnNone;
179 181
	}
180
/**
181
 * To determine if a mask will be added or not in the map
182
 * @param mask
183
 */
182
	/**
183
	 * Sets the graphical component that shows the properties of the model.
184
	 * @param mask
185
	 */
184 186
	public void setModel(IMask mask) {
185 187
		if (mask != null) {
186 188
			getTxtHaloSize().setDouble(mask.getSize());
......
188 190
		}
189 191
		getRdHalo().setSelected(mask != null);
190 192
	}
191
/**
192
 * This method returns an IMask or null depending on the option
193
 * that the user had decided (if he wants a mask or not)in the tab "mask" inside
194
 * the panel to edit the properities of a symbol (SymbolEditor).
195
 * If the user
196
 * wants it, a new IMask is created.
197
 * @return
198
 */
193
	/**
194
	 * This method returns an IMask or null depending on the option
195
	 * that the user had decided (if he wants a mask or not)in the tab "mask" inside
196
	 * the panel to edit the properities of a symbol (SymbolEditor).
197
	 * If the user
198
	 * wants it, a new IMask is created.
199
	 * @return
200
	 */
199 201
	public IMask getMask() {
200 202
		if (!getRdHalo().isSelected()) return null;
201 203

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/LineFill.java
62 62
import com.iver.cit.gvsig.project.documents.view.legend.gui.JSymbolPreviewButton;
63 63

  
64 64
/**
65
 * @autor jaume dominguez faus - jaume.dominguez@iver.es
66
 */
65
* <b>LineFill</b> allows the user to store and modify the properties that fills a
66
* polygon with a padding composed of lines<p>
67
* <p>
68
* This functionality is carried out thanks to a tab (line fill)which is included
69
* in the panel to edit the properities of a symbol (SymbolEditor)how is explained
70
* in AbstractTypeSymbolEditor.<p>
71
* <p>
72
* This tab permits the user to change the line that composes the padding
73
* (<b>btnLineSymbol</b>),the outline of the polygon (<b>btnOutlineSymbol</b>),
74
* the color between the lines (<b>jcc</b>),the angle of the line(<b>incrAngle</b>),
75
* the offset between paralel lines(<b>incrOffset</b>) and the separation
76
* (<b>incrSeparation</b>).
77
*
78
*
79
*@see AbstractTypeSymbolEditor
80
*@author jaume dominguez faus - jaume.dominguez@iver.es
81
*/
67 82
public class LineFill extends AbstractTypeSymbolEditor implements ActionListener {
68 83
	private ArrayList tabs = new ArrayList();
69 84
	private ColorChooserPanel jcc;
......
79 94
		initialize();
80 95
	}
81 96

  
97
	/**
98
	 * Initializes the parameters that allows the user to fill the padding of
99
	 * a polygon with a simpleline style.To do it, a tab (line fill) is created inside the
100
	 * SymbolEditor panel with default values for the different attributes.
101
	 */
102

  
82 103
	private void initialize() {
83
		
104

  
84 105
		GridBagLayoutPanel content = new GridBagLayoutPanel();
85 106
		content.setName(PluginServices.getText(this, "line_fill"));
86 107
		JPanel aux;
......
89 110
		jcc.setAlpha(255);
90 111
		content.addComponent(PluginServices.getText(this, "color")+":",
91 112
				aux);
92
		
113

  
93 114
		aux = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0));
94 115
		aux.add(incrAngle = new JIncrementalNumberField("0", 5));
95 116
		content.addComponent(PluginServices.getText(this, "angle")+":",
96 117
				aux);
97
		
118

  
98 119
		aux = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0));
99 120
		aux.add(incrOffset = new JIncrementalNumberField("0", 5));
100 121
		content.addComponent(PluginServices.getText(this, "offset")+":",
101 122
				aux);
102
		
123

  
103 124
		aux = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0));
104 125
		aux.add(incrSeparation = new JIncrementalNumberField(
105 126
				"5",
......
110 131
		incrSeparation.setDouble(5);
111 132
		content.addComponent(PluginServices.getText(this, "separation")+":",
112 133
				aux);
113
		
134

  
114 135
		aux = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0));
115 136
		aux.add(btnLineSymbol = new JSymbolPreviewButton(FShape.LINE));
116 137
		btnLineSymbol.setPreferredSize(new Dimension(100, 35));
......
120 141
		aux.add(btnOutlineSymbol = new JSymbolPreviewButton(FShape.LINE));
121 142
		btnOutlineSymbol.setPreferredSize(new Dimension(100, 35));
122 143
		content.addComponent(PluginServices.getText(this, "outline"), aux);
123
		
144

  
124 145
		jcc.addActionListener(this);
125 146
		incrAngle.addActionListener(this);
126 147
		incrOffset.addActionListener(this);
127 148
		incrSeparation.addActionListener(this);
128 149
		btnOutlineSymbol.addActionListener(this);
129 150
		btnLineSymbol.addActionListener(this);
130
		
151

  
131 152
		tabs.add(content);
132
		
153

  
133 154
	}
134 155

  
135 156
	public EditorTool getEditorTool() {
......
143 164
		sym.setSeparation(incrSeparation.getDouble());
144 165
		sym.setFillColor(jcc.getColor());
145 166
		sym.setOutline(outline);
146
		sym.setLineSymbol(line);	
167
		sym.setLineSymbol(line);
147 168
		return sym;
148 169
	}
149 170

  
......
158 179
	public JPanel[] getTabs() {
159 180
		return (JPanel[]) tabs.toArray(new JPanel[tabs.size()]);
160 181
	}
161
	
182

  
162 183
	public void refreshControls(ISymbol layer) {
163 184
		LineFillSymbol lfs = (LineFillSymbol) layer;
164 185
		incrAngle.setDouble(lfs.getAngle()/FConstant.DEGREE_TO_RADIANS);
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/SimpleFill.java
43 43
*
44 44
* $Id$
45 45
* $Log$
46
* Revision 1.12  2007-08-03 11:29:13  jaume
46
* Revision 1.13  2007-08-08 10:16:53  jvidal
47
* javadoc
48
*
49
* Revision 1.12  2007/08/03 11:29:13  jaume
47 50
* refactored AbstractTypeSymbolEditorPanel class name to AbastractTypeSymbolEditor
48 51
*
49 52
* Revision 1.11  2007/07/23 07:01:13  jaume
......
131 134
import com.iver.cit.gvsig.gui.panels.ColorChooserPanel;
132 135
import com.iver.cit.gvsig.project.documents.view.legend.gui.JSymbolPreviewButton;
133 136
/**
137
* <b>SimpleFill</b> allows the user to store and modify the properties that fills a
138
* polygon with a padding and an outline<p>
139
* <p>
140
* This functionality is carried out thanks to a tab (simple fill)which is included
141
* in the panel to edit the properities of a symbol (SymbolEditor)how is explained
142
* in AbstractTypeSymbolEditor.<p>
143
* <p>
144
* This tab permits the user to change the color of the padding
145
* (<b>jccFillColor</b>)and its outline (<b>btnOutline</b>).Also the user has the
146
* options to modify the opacity (<b>sldFillTransparency,sldOutlineTransparency</b>)
147
* for both attributes and the width <b>txtOutlineWidth</b> (only for the outline).
134 148
*
135
* @author jaume dominguez faus - jaume.dominguez@iver.es
136 149
*
150
*@see AbstractTypeSymbolEditor
151
*@author jaume dominguez faus - jaume.dominguez@iver.es
137 152
*/
138 153
public class SimpleFill extends AbstractTypeSymbolEditor implements ActionListener, ChangeListener {
139 154
	private static final String NAME = PluginServices.
......
159 174
		return (JPanel[]) tabs.toArray(new JPanel[0]);
160 175
	}
161 176

  
177
	/**
178
	 * Initializes the parameters that allows the user to fill the padding of
179
	 * a polygon with a simplefill style.To do it, a tab (simple fill) is created inside the
180
	 * SymbolEditor panel with default values for the different attributes.
181
	 */
162 182
	private void initialize() {
163 183
		JPanel myTab = new JPanel(new FlowLayout(FlowLayout.LEADING, 5,5));
164 184
		myTab.setName(PluginServices.getText(this, "simple_fill"));
......
232 252
				} else {
233 253
					sldOutlineTransparency.setValue(100);
234 254
				}
235
				
236
				
237 255

  
256

  
257

  
238 258
			}
239 259
		} catch (IndexOutOfBoundsException ioEx) {
240 260
			NotificationManager.addWarning("Symbol layer index out of bounds", ioEx);
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/AbstractTypeSymbolEditor.java
43 43
*
44 44
* $Id$
45 45
* $Log$
46
* Revision 1.1  2007-08-03 11:29:13  jaume
46
* Revision 1.2  2007-08-08 10:19:40  jvidal
47
* javadoc
48
*
49
* Revision 1.1  2007/08/03 11:29:13  jaume
47 50
* refactored AbstractTypeSymbolEditorPanel class name to AbastractTypeSymbolEditor
48 51
*
49 52
* Revision 1.12  2007/08/03 09:20:47  jaume
......
124 127
 * interface to be operable from the SymbolEditor</b>. The panels provide
125 128
 * by this are the tabs of the JTabbedPane of the options area in the
126 129
 * SymbolEditor.
127
 * </p> 
128
 * <p> 
129
 * The components contained by this panelset are automatically placed in 
130
 * the <b>SymbolEditor</b>'s symbol options area. In case other panel 
130
 * </p>
131
 * <p>
132
 * The components contained by this panelset are automatically placed in
133
 * the <b>SymbolEditor</b>'s symbol options area. In case other panel
131 134
 * of this was already placed, then the old one is replaced by this.
132 135
 * </p>
133 136
 * <p>
......
218 221
				cs.setReferenceSystem(owner.getUnitsReferenceSystem());
219 222
				cs.setUnit(owner.getUnit());
220 223
			}
221
			
224

  
222 225
			owner.setLayerToSymbol(getLayer());
223 226
			owner.refresh();
224 227
			applying = false;
......
230 233
	 * @return <b>Class</b> (of the concrete ISymbol that this configuration panel deals with)
231 234
	 */
232 235
	public abstract Class getSymbolClass();
233

  
236
	/**
237
	 * Returns the editor tool that is handled by this configuration panel.
238
	 * @return <b>EditorTool</b>
239
	 */
234 240
	public abstract EditorTool getEditorTool();
235 241

  
236 242

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/MarkerFillProperties.java
57 57
import com.iver.cit.gvsig.fmap.core.styles.SimpleMarkerFillPropertiesStyle;
58 58

  
59 59
/**
60
 * This class implements a tab to modify attributes to fill the padding of a polygon
61
 * such offset and separation (between pictures or markers).<p>
62
 * <p>
63
 * This tab is used several times in different places in our applicattion becuase the
64
 * behaviour is the same if the user is filling the padding of a polygon using pictures
65
 * or makers .For this reason, in order to avoid the repetition of code, this class has been
66
 * created (instead of treat it like a simple tab). With this solution, the user
67
 * only has to refer it to use it (and do not need to create a tab and fill it again
68
 * and so on).
69
 *
60 70
 * @author jaume dominguez faus - jaume.dominguez@iver.es
61 71
 */
62 72
public class MarkerFillProperties extends JPanel {
......
74 84
			}
75 85
		}
76 86
	};
77

  
87
	/**
88
	 * Constructor method
89
	 *
90
	 */
78 91
	public MarkerFillProperties() {
79 92
		super();
80 93
		initialize();
81 94
	}
82 95

  
96
	/**
97
	 * Initializes the parameters to create a tab to modify attributes to fill the
98
	 * padding of a polygon such offset and separation (between pictures or markers)
99
	 *
100
	 */
83 101
	private void initialize() {
84 102
		GridLayout layout = new GridLayout();
85 103
		layout.setColumns(1);
......
149 167

  
150 168
		setLayout(layout);
151 169
	}
152

  
170
	/**
171
	 * Sets the graphical component that shows the properties of the model.
172
	 * @param fillProps,IMarkerFillPropertiesStyle
173
	 */
153 174
	public void setModel(IMarkerFillPropertiesStyle fillProps) {
154 175
		if (fillProps != null) {
155 176
			txtOffsetX.setDouble(fillProps.getXOffset());
......
159 180
		}
160 181
	}
161 182

  
183
	/**
184
	 * Obtains the MarkerFillProperties
185
	 *
186
	 * @return mfProps,IMarkerFillPropertiesStyle
187
	 */
162 188
	public IMarkerFillPropertiesStyle getMarkerFillProperties() {
163 189
		SimpleMarkerFillPropertiesStyle mfProps = new SimpleMarkerFillPropertiesStyle();
164 190
		mfProps.setXOffset(txtOffsetX.getDouble());
......
167 193
		mfProps.setYSeparation(txtSeparationY.getDouble());
168 194
		return mfProps;
169 195
	}
196
	/**
197
	 * Permits the good operation of the JIncrementalNumberFields that are included
198
	 * in the panel
199
	 * @param l,ActionListener
200
	 */
170 201

  
171 202
	public void addActionListener(ActionListener l) {
172 203
		listeners.add(l);

Also available in: Unified diff