Revision 12970 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/styling/LineFill.java

View differences:

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);

Also available in: Unified diff