Revision 3039 trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/gui/Panels/ZoomControlPanel.java

View differences:

ZoomControlPanel.java
45 45
	private JButton bZoomMas = null;
46 46
	private JButton bZoomMenos = null;
47 47

  
48
	private int sX = 150, sY = 150; 
48
	private int sX = 140, sY = 140; 
49 49
	private CanvasZone canvas = null;
50 50
	private ViewPort viewPort = null;
51 51
	
52
	private JButton bMove = null;
53
    private boolean move = false;
54 52
    private int numberPoint = -1;
55 53
    
56 54
    public FLyrPoints lyrPoints = null;
......
87 85
        	gridBagConstraints.gridx = 1;
88 86
        gridBagConstraints.gridy = 0;
89 87
        this.setLayout(new GridBagLayout());
90
        this.setPreferredSize(new java.awt.Dimension(200,175));
91
        this.setSize(new java.awt.Dimension(200,175));
88
        this.setPreferredSize(new java.awt.Dimension(175,142));
89
        this.setSize(new java.awt.Dimension(175,142));
92 90
        this.setLocation(new java.awt.Point(0,0));
93 91
        this.add(getPImage(), gridBagConstraints);
94 92
        this.add(getPControls(), gridBagConstraints1);        
......
123 121
			pImage = new JPanel();
124 122
			BorderLayout borderLayout = new BorderLayout();
125 123
			pImage.setLayout(borderLayout);
126
			pImage.setPreferredSize(new java.awt.Dimension(sX, sY));
124
			pImage.setPreferredSize(new java.awt.Dimension(140,140));
127 125
			pImage.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
128 126
			if(canvas == null){
129 127
				canvas = new CanvasZone(sX, sY, this);
......
144 142
	 */
145 143
	private JPanel getPControls() {
146 144
		if (pControls == null) {
147
			GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
148 145
			GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
149 146
			gridBagConstraints3.gridx = 0;
150 147
			gridBagConstraints3.insets = new java.awt.Insets(5,0,0,0);
......
154 151
			gridBagConstraints2.gridy = 0;
155 152
			pControls = new JPanel();
156 153
			pControls.setLayout(new GridBagLayout());
157
			pControls.setPreferredSize(new java.awt.Dimension(33,150));
158
			gridBagConstraints9.gridx = 0;
159
			gridBagConstraints9.gridy = 2;
160
			gridBagConstraints9.insets = new java.awt.Insets(5,0,0,0);
154
			pControls.setPreferredSize(new java.awt.Dimension(33,140));
161 155
			pControls.add(getBZoomMas(), gridBagConstraints2);
162 156
			pControls.add(getBZoomMenos(), gridBagConstraints3);
163
			pControls.add(getBMove(), gridBagConstraints9);
164 157
		}
165 158
		return pControls;
166 159
	}
......
196 189
	}
197 190

  
198 191
	/**
199
	 * This method initializes jButton	
200
	 * 	
201
	 * @return javax.swing.JButton	
202
	 */    
203
	private JButton getBMove() {
204
		if (bMove == null) {
205
			bMove = new JButton();
206
			bMove.setPreferredSize(new java.awt.Dimension(25,25));
207
			bMove.setIcon(new ImageIcon(getClass().getResource("/com/iver/cit/gvsig/gui/Panels/images/Hand.gif")));
208
			bMove.addActionListener(this);
209
		}
210
		return bMove;
211
	}
212
	
213
	/**
214 192
	 * @param viewPort The viewPort to set.
215 193
	 */
216 194
	public void setViewPort(ViewPort viewPort) {
......
250 228
	}
251 229
	
252 230
	/**
253
	 * @return Returns the move.
254
	 */
255
	public boolean isMove() {
256
		return move;
257
	}
258
	
259
	/**
260
	 * @param move The move to set.
261
	 */
262
	public void setMove(boolean move) {
263
		this.move = move;
264
	}
265
	
266
	/**
267 231
	 * Asigna el n?mero de punto que se est? tratando
268 232
	 * @param n
269 233
	 */
......
284 248
	 */
285 249
	public void actionPerformed(ActionEvent e) {
286 250
		if(e.getSource() == bZoomMas){
287
			this.setMove(false);
288 251
			canvas.calcZoom(0.6);
289 252
			canvas.repaint();//.update();
290 253
		}
291 254
		
292 255
		if(e.getSource() == bZoomMenos){
293
			this.setMove(false);
294 256
			canvas.calcZoom(1.8);
295 257
			canvas.repaint();//.update();
296 258
		}
297 259
		
298
		if(e.getSource() == bMove){
299
			this.setMove(true);
300
		}
301 260
	}
302 261
	
303 262

  

Also available in: Unified diff