Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.geometry / org.gvsig.fmap.geometry.api / src / main / java / org / gvsig / fmap / geom / handler / Handler.java @ 40435

History | View | Annotate | Download (3.4 KB)

1
/*
2
 * Created on 10-feb-2005
3
 *
4
 * gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
5
 *
6
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
7
 *
8
 * This program is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU General Public License
10
 * as published by the Free Software Foundation; either version 2
11
 * of the License, or (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
21
     USA.
22
 *
23
 * For more information, contact:
24
 *
25
 *  Generalitat Valenciana
26
 *   Conselleria d'Infraestructures i Transport
27
 *   Av. Blasco Ib??ez, 50
28
 *   46010 VALENCIA
29
 *   SPAIN
30
 *
31
 *      +34 963862235
32
 *   gvsig@gva.es
33
 *      www.gvsig.gva.es
34
 *
35
 *    or
36
 *
37
 *   IVER T.I. S.A
38
 *   Salamanca 50
39
 *   46005 Valencia
40
 *   Spain
41
 *
42
 *   +34 963163400
43
 *   dac@iver.es
44
 */
45
package org.gvsig.fmap.geom.handler;
46

    
47
import java.awt.geom.Point2D;
48

    
49

    
50
/**
51
* <p>In a <i>FMap</i> graphic layer, each geometry drawn has control points named <i>handlers</i>
52
* that allow user to move, modify, set, ... that geometry.</p>
53
*  
54
* <p>Each geometry will have its own handlers, and each one can have different behavior 
55
* according its nature.</p>
56
* 
57
* <p>The <code>Handler</code> interface defines the least set of common methods for all
58
* geometry handlers.</p>
59
*/
60
public interface Handler {
61
        /**
62
         * <p>Generic method of moving in 2D a handler of a geometry using two numbers that
63
         * represent the 2D coordinates.</p>
64
         * 
65
         * <p>Each handler of each geometry adapts this method to its own behavior in that 
66
         * geometry, that implies that could not be implemented.</p>
67
         *
68
         * @param x first dimension coordinate
69
         * @param y second dimension coordinate
70
         * 
71
         * @see #set(double, double)
72
         */
73
        public void move(double x, double y);
74
        /**
75
          * <p>Generic method of situating in 2D a handler of a geometry using two numbers
76
          * that represent the 2D coordinates.</p>
77
         * 
78
         * <p>Each handler of each geometry adapts this method to its own behavior in that 
79
         * geometry, that implies that could not be implemented.</p>
80
         *
81
         * @param x first dimension coordinate
82
         * @param y second dimension coordinate
83
         * 
84
         * @see #move(double, double)
85
         * @see #getPoint()
86
         */
87
        public void set(double x, double y);
88

    
89
        /**
90
          * <p>Generic method of getting the 2D point that represents a handler of a geometry.</p>
91
         * 
92
         * <p>Each handler of each geometry adapts this method to its own behavior in that
93
         * geometry, that implies that could not be implemented.</p>
94
         *
95
         * @return point 2D that represents this handler of geometry
96
         * 
97
         * @see #set(double, double)
98
         * @see #move(double, double)
99
         */
100
        public Point2D getPoint();
101
        /**
102
         * <p>Returns <code>true</code> if the object is a <code>Handler</code> and has the
103
         *  same coordinates as this one.</p>
104
         * 
105
         * @param obj the reference object with which to compare 
106
         * @return <code>true</code> if this object is the same as the <code>obj</code> 
107
         * argument; <code>false</code> otherwise
108
         * 
109
         * @see #getPoint()
110
         */
111
        public boolean equalsPoint(Object obj);
112
}