svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.editing.app / org.gvsig.editing.app.mainplugin / src / main / java / org / gvsig / editing / gui / cad / panels / matrix / MatrixOperations.java @ 40557
History | View | Annotate | Download (5.75 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.editing.gui.cad.panels.matrix; |
25 |
|
26 |
/**
|
27 |
* Characteristics to create the matrix of geometries.
|
28 |
*
|
29 |
* @author Vicente Caballero Navarro
|
30 |
*/
|
31 |
public class MatrixOperations { |
32 |
private boolean isRectangular = true; |
33 |
private double distRows = 1000; |
34 |
private double distColumns = 1000; |
35 |
private double rotation = 0; |
36 |
private int numRows = 5; |
37 |
private int numColumns = 5; |
38 |
private double positionX = 900000; |
39 |
private double positionY = 4500000; |
40 |
private int num = 5; |
41 |
private boolean accepted = false; |
42 |
private boolean rotateElements = false; |
43 |
|
44 |
/**
|
45 |
* Returns the distance among the columns of the matrix in units of the map
|
46 |
*
|
47 |
* @return Distance X.
|
48 |
*/
|
49 |
public double getDistColumns() { |
50 |
return distColumns;
|
51 |
} |
52 |
|
53 |
/**
|
54 |
* Add the distance among the columns of the matrix in units of the map
|
55 |
*
|
56 |
* @param distColumns Distance X
|
57 |
*/
|
58 |
public void setDistColumns(double distColumns) { |
59 |
this.distColumns = distColumns;
|
60 |
} |
61 |
|
62 |
/**
|
63 |
* Returns the distance among the rows of the matrix in units of the map
|
64 |
*
|
65 |
* @return Distance Y.
|
66 |
*/
|
67 |
public double getDistRows() { |
68 |
return distRows;
|
69 |
} |
70 |
|
71 |
/**
|
72 |
* Add the distance among the rows of the matrix in units of the map
|
73 |
*
|
74 |
* @param distColumns Distance Y
|
75 |
*/
|
76 |
public void setDistRows(double distRows) { |
77 |
this.distRows = distRows;
|
78 |
} |
79 |
|
80 |
/**
|
81 |
* Returns true if the form to calculate the matrix is rectangular and false it if is polar.
|
82 |
*
|
83 |
* @return True if the form is Rectangular.
|
84 |
*/
|
85 |
public boolean isRectangular() { |
86 |
return isRectangular;
|
87 |
} |
88 |
|
89 |
/**
|
90 |
* Add if the form to calulate the matrix is rectangular or polar.
|
91 |
*
|
92 |
* @param isRectangular
|
93 |
*/
|
94 |
public void setRectangular(boolean isRectangular) { |
95 |
this.isRectangular = isRectangular;
|
96 |
} |
97 |
|
98 |
/**
|
99 |
* Returns the number of geometries to show in polar form.
|
100 |
*
|
101 |
* @return Number of geometries.
|
102 |
*/
|
103 |
public int getNum() { |
104 |
return num;
|
105 |
} |
106 |
|
107 |
/**
|
108 |
* Add the number of geometries to show in polar form.
|
109 |
*
|
110 |
* @param num Number of geometries.
|
111 |
*/
|
112 |
public void setNum(int num) { |
113 |
this.num = num;
|
114 |
} |
115 |
|
116 |
/**
|
117 |
* Returns the number of columns in the matrix.
|
118 |
*
|
119 |
* @return Number of columns.
|
120 |
*/
|
121 |
public int getNumColumns() { |
122 |
return numColumns;
|
123 |
} |
124 |
|
125 |
/**
|
126 |
* Add the number of columns in the matrix.
|
127 |
*
|
128 |
* @param numColumns Number of columns.
|
129 |
*/
|
130 |
public void setNumColumns(int numColumns) { |
131 |
this.numColumns = numColumns;
|
132 |
} |
133 |
|
134 |
/**
|
135 |
* Returns the number of rows in the matrix.
|
136 |
*
|
137 |
* @return Number of rows.
|
138 |
*/
|
139 |
public int getNumRows() { |
140 |
return numRows;
|
141 |
} |
142 |
|
143 |
/**
|
144 |
* Add the number of rows in the matrix.
|
145 |
*
|
146 |
* @param numRows Number of rows.
|
147 |
*/
|
148 |
public void setNumRows(int numRows) { |
149 |
this.numRows = numRows;
|
150 |
} |
151 |
|
152 |
/**
|
153 |
* Returns the position x of polar form center.
|
154 |
*
|
155 |
* @return Position x.
|
156 |
*/
|
157 |
public double getPositionX() { |
158 |
return positionX;
|
159 |
} |
160 |
|
161 |
/**
|
162 |
* Add the position x of polar form center.
|
163 |
*
|
164 |
* @param positionX Position x.
|
165 |
*/
|
166 |
public void setPositionX(double positionX) { |
167 |
this.positionX = positionX;
|
168 |
} |
169 |
|
170 |
/**
|
171 |
* Returns the position y of polar form center.
|
172 |
*
|
173 |
* @return Position y.
|
174 |
*/
|
175 |
public double getPositionY() { |
176 |
return positionY;
|
177 |
} |
178 |
|
179 |
/**
|
180 |
* Add the position y of polar form center.
|
181 |
*
|
182 |
* @param positionY Position y.
|
183 |
*/
|
184 |
public void setPositionY(double positionY) { |
185 |
this.positionY = positionY;
|
186 |
} |
187 |
|
188 |
/**
|
189 |
* Returns de rotation of geometries.
|
190 |
*
|
191 |
* @return Rotation.
|
192 |
*/
|
193 |
public double getRotation() { |
194 |
return rotation;
|
195 |
} |
196 |
|
197 |
/**
|
198 |
* Add the rotation of geometries.
|
199 |
*
|
200 |
* @param rotation Rotation.
|
201 |
*/
|
202 |
public void setRotation(double rotation) { |
203 |
this.rotation = rotation;
|
204 |
} |
205 |
|
206 |
/**
|
207 |
* Returns true if all of properties are ready to be applied.
|
208 |
*
|
209 |
* @return True if is ready.
|
210 |
*/
|
211 |
public boolean isAccepted() { |
212 |
return this.accepted; |
213 |
} |
214 |
|
215 |
/**
|
216 |
* Add true if all of properties are ready to be applied.
|
217 |
*
|
218 |
* @param accepted True if is ready.
|
219 |
*/
|
220 |
public void setAccepted(boolean accepted) { |
221 |
this.accepted = accepted;
|
222 |
} |
223 |
|
224 |
/**
|
225 |
* Introduces true if the geometries has to rotate also in the polar form.
|
226 |
*
|
227 |
* @param b True if has to ratate.
|
228 |
*/
|
229 |
public void setRotateElements(boolean b) { |
230 |
this.rotateElements = b;
|
231 |
} |
232 |
|
233 |
/**
|
234 |
* Returns true if the geometries has to rate also in the polar form.
|
235 |
*
|
236 |
* @return True if has to rotate.
|
237 |
*/
|
238 |
public boolean isRotateElements() { |
239 |
return rotateElements;
|
240 |
} |
241 |
} |