100 |
100 |
efs.endComplex();
|
101 |
101 |
return;
|
102 |
102 |
}
|
103 |
|
// if (layout.isAdjustingToGrid()) {
|
104 |
|
// //cuadrar con la cuadr?cula dibujada y despu?s en el
|
105 |
|
// mouseReleased guardar ese rect?ngulo de la misma forma.
|
106 |
|
// FLayoutUtilities.setRectGrid(rectangle,
|
107 |
|
// layout.getAtributes().getUnitInPixelsX(),
|
108 |
|
// layout.getAtributes().getUnitInPixelsY(), layout.getAT());
|
109 |
|
// }
|
110 |
|
|
|
103 |
|
111 |
104 |
if (fframe instanceof FFrameGroup) {
|
112 |
105 |
((FFrameGroup) fframe).setAt(layout.getLayoutControl()
|
113 |
106 |
.getAT());
|
... | ... | |
118 |
111 |
fframeAux = (IFFrame) fframe.clone();
|
119 |
112 |
fframeAux.setBoundBox(FLayoutUtilities.toSheetRect(
|
120 |
113 |
rectangle, layout.getLayoutControl().getAT()));
|
121 |
|
// if (fframeAux instanceof IFFrameUseFMap)
|
122 |
|
// ((IFFrameUseFMap)fframeAux).refresh();
|
123 |
114 |
efs.update(fframe, fframeAux);
|
124 |
115 |
fframeAux.getBoundingBox(layout.getLayoutControl().getAT());
|
125 |
116 |
|
... | ... | |
156 |
147 |
}
|
157 |
148 |
|
158 |
149 |
/**
|
159 |
|
* A?ade un fframe al Layout del tipo preseleccionado y abre el di?logo
|
160 |
|
* para configurar las caracter?sticas.
|
161 |
|
*
|
162 |
|
* @return TODO
|
163 |
|
*/
|
164 |
|
// public IFFrame addFFrame() {
|
165 |
|
// IFFrame fframe = null;
|
166 |
|
// boolean isadd = false;
|
167 |
|
//
|
168 |
|
// if (layout.getTool() == Layout.RECTANGLEVIEW) {
|
169 |
|
// fframe = new FFrameView();
|
170 |
|
// isadd = true;
|
171 |
|
// } else if (layout.getTool() == Layout.RECTANGLEOVERVIEW) {
|
172 |
|
// fframe = new FFrameOverView();
|
173 |
|
// isadd = true;
|
174 |
|
// } else if (layout.getTool() == Layout.RECTANGLEPICTURE) {
|
175 |
|
// fframe = new FFramePicture();
|
176 |
|
// isadd = true;
|
177 |
|
// } else if (layout.getTool() == Layout.RECTANGLESCALEBAR) {
|
178 |
|
// fframe = new FFrameScaleBar();
|
179 |
|
// isadd = true;
|
180 |
|
// } else if (layout.getTool() == Layout.RECTANGLELEGEND) {
|
181 |
|
// fframe = new FFrameLegend();
|
182 |
|
// isadd = true;
|
183 |
|
// } else if (layout.getTool() == Layout.RECTANGLETEXT) {
|
184 |
|
// fframe = new FFrameText();
|
185 |
|
// isadd = true;
|
186 |
|
// } else if (layout.getTool() == Layout.RECTANGLENORTH) {
|
187 |
|
// fframe = new FFrameNorth();
|
188 |
|
// isadd = true;
|
189 |
|
// } else if (layout.getTool() == Layout.RECTANGLEBOX) {
|
190 |
|
// fframe = new FFrameTable();
|
191 |
|
// isadd = true;
|
192 |
|
// } else if ((layout.getTool() == Layout.LINE) ||
|
193 |
|
// (layout.getTool() == Layout.POLYLINE) ||
|
194 |
|
// (layout.getTool() == Layout.POLYGON) ||
|
195 |
|
// (layout.getTool() == Layout.CIRCLE) ||
|
196 |
|
// (layout.getTool() == Layout.RECTANGLESIMPLE) ||
|
197 |
|
// (layout.getTool() == Layout.POINT)) {
|
198 |
|
// fframe = new FFrameGraphics();
|
199 |
|
// ((FFrameGraphics)fframe).setGeometryAdapter(layout.getGeometryAdapter());
|
200 |
|
// isadd = false;
|
201 |
|
// ((FFrameGraphics) fframe).update(layout.getTool(), layout.getAT());
|
202 |
|
// } /*else if ((layout.getTool() == Layout.POINT)){
|
203 |
|
// fframe = new FFrameGraphics();
|
204 |
|
// isadd = true;
|
205 |
|
// ((FFrameGraphics) fframe).update(layout.getTool(), layout.getAT());
|
206 |
|
// }*/
|
207 |
|
// if (isadd) {
|
208 |
|
// Rectangle2D r = new Rectangle2D.Double();
|
209 |
|
// //rectOrigin.x+m_PointAnt.x,rectOrigin.y+m_PointAnt.y,m_LastPoint.x-m_PointAnt.x,m_LastPoint.y-m_PointAnt.y);
|
210 |
|
// int tolerance=20;
|
211 |
|
// r=getRectangle(tolerance);
|
212 |
|
//
|
213 |
|
// // if (layout.isAdjustingToGrid()) {
|
214 |
|
// // //cuadrar con la cuadr?cula dibujada y despu?s en el mouseReleased
|
215 |
|
// guardar ese rect?ngulo de la misma forma.
|
216 |
|
// // FLayoutUtilities.setRectGrid(r,
|
217 |
|
// // layout.getAtributes().getUnitInPixelsX(),
|
218 |
|
// // layout.getAtributes().getUnitInPixelsY(), layout.getAT());
|
219 |
|
// // }
|
220 |
|
//
|
221 |
|
// fframe.setBoundBox(FLayoutUtilities.toSheetRect(r, layout.getAT()));
|
222 |
|
// IFFrame newFrame=layout.openFFrameDialog(fframe);
|
223 |
|
// if (newFrame!=null) {
|
224 |
|
// if (!layout.isEditGroup()){
|
225 |
|
// layout.addFFrame(newFrame, true,true);
|
226 |
|
// }
|
227 |
|
// }
|
228 |
|
// }else{
|
229 |
|
// if (layout.getTool() == Layout.POINT){
|
230 |
|
// Rectangle2D r=layout.getGeometryAdapter().getBounds2D();
|
231 |
|
// double d=0.5;//FLayoutUtilities.toSheetDistance(50,layout.getAT());
|
232 |
|
// r=new Rectangle2D.Double(r.getX()-(d/2),r.getY()-d,d*2,d*2);
|
233 |
|
// fframe.setBoundBox(r);
|
234 |
|
// }else{
|
235 |
|
// fframe.setBoundBox(layout.getGeometryAdapter().getBounds2D());
|
236 |
|
// }
|
237 |
|
// layout.addFFrame(fframe, true,true);
|
238 |
|
// ///fframe.setBoundBox(FLayoutUtilities.toSheetRect(r, layout.getAT()));
|
239 |
|
// }
|
240 |
|
// fframe.setLayout(layout);
|
241 |
|
// return fframe;
|
242 |
|
// }
|
243 |
|
|
244 |
|
// private Rectangle2D getRectangle(int tolerance) {
|
245 |
|
// Rectangle2D r=new Rectangle2D.Double();
|
246 |
|
// if
|
247 |
|
// (isCorrectSize(tolerance,layout.getFirstPoint(),layout.getLastPoint())){
|
248 |
|
// Point2D fp=layout.getFirstPoint();
|
249 |
|
// Point2D lp=layout.getLastPoint();
|
250 |
|
// if (fp.getX()<lp.getX()){
|
251 |
|
// if (fp.getY()<lp.getY()){
|
252 |
|
// r.setRect(fp.getX(),fp.getY(),lp.getX()-fp.getX(),lp.getY()-fp.getY());
|
253 |
|
// }else{
|
254 |
|
// r.setRect(fp.getX(),lp.getY(),lp.getX()-fp.getX(),fp.getY()-lp.getY());
|
255 |
|
// }
|
256 |
|
// }else{
|
257 |
|
// if (fp.getY()>lp.getY()){
|
258 |
|
// r.setRect(lp.getX(),lp.getY(),fp.getX()-lp.getX(),fp.getY()-lp.getY());
|
259 |
|
// }else{
|
260 |
|
// r.setRect(lp.getX(),fp.getY(),lp.getX()-fp.getX(),lp.getY()-fp.getY());
|
261 |
|
// }
|
262 |
|
// }
|
263 |
|
// }else{
|
264 |
|
// Point2D p1=layout.getFirstPoint();
|
265 |
|
// p1=new Point2D.Double(p1.getX()+tolerance,p1.getY()+tolerance);
|
266 |
|
// r.setFrameFromDiagonal(layout.getFirstPoint(),p1);
|
267 |
|
// }
|
268 |
|
// return r;
|
269 |
|
// }
|
270 |
|
|
271 |
|
/**
|
272 |
150 |
* Pan sobre la vista del FFrameView.
|
273 |
151 |
*
|
274 |
152 |
* @param p1
|