Revision 41974 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.fmap.control/src/main/java/org/gvsig/fmap/mapcontrol/tools/Behavior/Behavior.java

View differences:

Behavior.java
80 80

  
81 81
	protected GeometryManager geomManager = GeometryLocator.getGeometryManager();
82 82
	
83
        protected int mouseButton = BUTTON_LEFT;
83
        private int mouseButton = BUTTON_LEFT;
84
        private boolean isMyButton = false; 
84 85
        
85 86
        public Behavior() {
86 87
            
......
266 267
	 * Create an arc. If there is an
267 268
	 * error return <code>null</code> and add the error
268 269
	 * to the log
269
	 * @param centerX
270
	 * @param centerY
271
	 * @param angleStart
272
	 * @param angleExtent
273
	 * @return
274
	 * The arc
270
        * @param centerX
271
        * @param centerY
272
        * @param radious
273
        * @param angleStart
274
        * @param angleExtent
275
        * @return The arc
275 276
	 */
276 277
	protected Arc createArc(double centerX, double centerY, double radious,
277 278
			double angleStart, double angleExtent){
......
298 299
	 * to the log
299 300
	 * @param centerX
300 301
	 * @param centerY
302
     * @param radious
301 303
	 * @return
302 304
	 * The arc
303 305
	 */
......
339 341
	}
340 342
        
341 343
        
342
        protected boolean isMyButton(MouseEvent e) {
344
        public boolean isMyButton(MouseEvent e) {
345
            if( e == null ) {
346
                return this.isMyButton;
347
            }
343 348
            switch(this.mouseButton) {
344 349
                case BUTTON_LEFT:
345 350
                default:
346
                    return (SwingUtilities.isLeftMouseButton(e));
351
                    this.isMyButton = SwingUtilities.isLeftMouseButton(e);
352
                    return this.isMyButton ;
347 353
                case BUTTON_MIDDLE:
348
                    return (SwingUtilities.isMiddleMouseButton(e));
354
                    this.isMyButton = SwingUtilities.isMiddleMouseButton(e);
355
                    return this.isMyButton ;
349 356
                case BUTTON_RIGHT:
350
                    return (SwingUtilities.isRightMouseButton(e));                   
357
                    this.isMyButton = SwingUtilities.isRightMouseButton(e);
358
                    return this.isMyButton ;
351 359
            }
352 360
        }
361
        
362
        public boolean isMyButton() {
363
            return this.isMyButton;
364
        }
353 365
}

Also available in: Unified diff