Revision 1714 trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/FLayoutFunctions.java

View differences:

FLayoutFunctions.java
28 28
import java.awt.geom.Point2D;
29 29
import java.awt.geom.Rectangle2D;
30 30
import java.awt.print.PageFormat;
31

  
32 31
import org.gvsig.app.project.documents.layout.commands.FrameCommandsRecord;
33 32
import org.gvsig.app.project.documents.layout.fframes.FFrameGroup;
34 33
import org.gvsig.app.project.documents.layout.fframes.IFFrame;
......
60 59
        .getLogger(FLayoutFunctions.class);
61 60
    
62 61
    private LayoutPanel layout = null;
63
    private ObservableHelper observers;
62
    private final ObservableHelper observers;
64 63
    /**
65 64
     * Crea un nuevo FLayoutFunctions.
66 65
     * 
......
77 76
     * Gestiona la herramienta de selecci?n sobre el Mapa.
78 77
     */
79 78
    public void setSelect() {
80
        IFFrame fframe = null;
79
        IFFrame fframe;
81 80
        boolean isUpdate = false;
82 81
        layout.getLayoutContext().updateFFrames();
83 82
        IFFrame[] fframes = layout.getLayoutContext().getFFrames();
84 83
        FrameCommandsRecord efs =
85 84
            layout.getLayoutContext().getFrameCommandsRecord();
86 85
        efs.startComplex("move");
87
        for (int i = 0; i < fframes.length; i++) {
88
            fframe = fframes[i];
89

  
86
        for (IFFrame fframe1 : fframes) {
87
            fframe = fframe1;
90 88
            int difx =
91 89
                (layout.getLayoutControl().getLastPoint().x - layout
92 90
                    .getLayoutControl().getFirstPoint().x);
93 91
            int dify =
94 92
                (layout.getLayoutControl().getLastPoint().y - layout
95 93
                    .getLayoutControl().getFirstPoint().y);
96

  
97 94
            if (((Math.abs(difx) > 3) || (Math.abs(dify) > 3))
98 95
                && (fframe.getSelected() != IFFrame.NOSELECT)) {
99 96
                Rectangle2D rectangle = fframe.getLastMoveRect();
......
113 110
                    fframeAux.setBoundBox(FLayoutUtilities.toSheetRect(
114 111
                        rectangle, layout.getLayoutControl().getAT()));
115 112
                    efs.update(fframe, fframeAux);
116
                    fframeAux.getBoundingBox(layout.getLayoutControl().getAT());
113
                    fframeAux.getBoundingBox(layout.getLayoutControl().getAT()); //?????????????????
117 114

  
118 115
                    isUpdate = true;
119 116
                } catch (CloneNotSupportedException e) {
......
121 118
                }
122 119

  
123 120
            }
124
            Rectangle rect = null;
121
            Rectangle rect;
125 122
            if (layout.getLayoutControl().getReSel() == null) {
126 123
                rect = new Rectangle();
127 124
                rect.setFrameFromDiagonal(layout.getLayoutControl()
......
134 131
                    .getLayoutControl().getAT())))) {
135 132
                fframe.setSelected(true);
136 133
            }
137

  
138 134
            if (isUpdate) {
139 135
                observers.notifyObservers(this, 
140 136
                    new DefaultLayoutNotification(LayoutNotification.LAYOUT_INVALIDATED));
......
157 153
     */
158 154
    public void setViewPan(Point p1, Point p2) {
159 155
        IFFrame[] fframes = layout.getLayoutContext().getFFrames();
160
        for (int i = 0; i < fframes.length; i++) {
161
            if (fframes[i] instanceof IFFrameUseFMap) {
162
                IFFrameUseFMap fframe = (IFFrameUseFMap) fframes[i];
163

  
156
        for (IFFrame fframe1 : fframes) {
157
            if (fframe1 instanceof IFFrameUseFMap) {
158
                IFFrameUseFMap fframe = (IFFrameUseFMap) fframe1;
164 159
                if (((IFFrame) fframe).getSelected() != IFFrame.NOSELECT) {
165 160
                    if (fframe.getATMap() != null) {
166
                        Rectangle2D.Double r = new Rectangle2D.Double();
167 161
                        Envelope envel =
168
                            // fframe.getMapContext().getViewPort().getExtent();
169 162
                            fframe.getMapContext().getViewPort().getEnvelope();
170 163
                        
171 164
                        if (envel != null) {
......
249 242
        return pWorld;
250 243
    }
251 244

  
245
    @Override
252 246
    public void addObserver(Observer o) {
253 247
        observers.addObserver(o);        
254 248
    }
255 249

  
250
    @Override
256 251
    public void deleteObserver(Observer o) {
257 252
      observers.deleteObserver(o);        
258 253
    }
259 254

  
255
    @Override
260 256
    public void deleteObservers() {
261 257
       observers.deleteObservers();        
262 258
    }
......
280 276
        
281 277
        double sheet_height_screen_pix = lyt_panel.getLayoutControl().getRect().getHeight();
282 278
        int ori = lyt_panel.getLayoutContext().getAttributes().getPageFormat().getOrientation();
283
        double paper_h_i72 = 0;
279
        double paper_h_i72;
284 280
        
285 281
        /*
286 282
         * Javadoc says getPageFormat().getWidth()(getHeight()

Also available in: Unified diff