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 @ 40559
History | View | Annotate | Download (3.11 KB)
1 | 40559 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | 40435 | jjdelcerro | *
|
4 | 40559 | jjdelcerro | * Copyright (C) 2007-2013 gvSIG Association.
|
5 | 40435 | jjdelcerro | *
|
6 | * This program is free software; you can redistribute it and/or
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | 40559 | jjdelcerro | * as published by the Free Software Foundation; either version 3
|
9 | 40435 | jjdelcerro | * of the License, or (at your option) any later version.
|
10 | *
|
||
11 | * This program is distributed in the hope that it will be useful,
|
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | 40559 | jjdelcerro | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 | * MA 02110-1301, USA.
|
||
20 | 40435 | jjdelcerro | *
|
21 | 40559 | jjdelcerro | * For any additional information, do not hesitate to contact us
|
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | 40435 | jjdelcerro | */
|
24 | package org.gvsig.fmap.geom.handler; |
||
25 | |||
26 | import java.awt.geom.Point2D; |
||
27 | |||
28 | |||
29 | /**
|
||
30 | * <p>In a <i>FMap</i> graphic layer, each geometry drawn has control points named <i>handlers</i>
|
||
31 | * that allow user to move, modify, set, ... that geometry.</p>
|
||
32 | *
|
||
33 | * <p>Each geometry will have its own handlers, and each one can have different behavior
|
||
34 | * according its nature.</p>
|
||
35 | *
|
||
36 | * <p>The <code>Handler</code> interface defines the least set of common methods for all
|
||
37 | * geometry handlers.</p>
|
||
38 | */
|
||
39 | public interface Handler { |
||
40 | /**
|
||
41 | * <p>Generic method of moving in 2D a handler of a geometry using two numbers that
|
||
42 | * represent the 2D coordinates.</p>
|
||
43 | *
|
||
44 | * <p>Each handler of each geometry adapts this method to its own behavior in that
|
||
45 | * geometry, that implies that could not be implemented.</p>
|
||
46 | *
|
||
47 | * @param x first dimension coordinate
|
||
48 | * @param y second dimension coordinate
|
||
49 | *
|
||
50 | * @see #set(double, double)
|
||
51 | */
|
||
52 | public void move(double x, double y); |
||
53 | /**
|
||
54 | * <p>Generic method of situating in 2D a handler of a geometry using two numbers
|
||
55 | * that represent the 2D coordinates.</p>
|
||
56 | *
|
||
57 | * <p>Each handler of each geometry adapts this method to its own behavior in that
|
||
58 | * geometry, that implies that could not be implemented.</p>
|
||
59 | *
|
||
60 | * @param x first dimension coordinate
|
||
61 | * @param y second dimension coordinate
|
||
62 | *
|
||
63 | * @see #move(double, double)
|
||
64 | * @see #getPoint()
|
||
65 | */
|
||
66 | public void set(double x, double y); |
||
67 | |||
68 | /**
|
||
69 | * <p>Generic method of getting the 2D point that represents a handler of a geometry.</p>
|
||
70 | *
|
||
71 | * <p>Each handler of each geometry adapts this method to its own behavior in that
|
||
72 | * geometry, that implies that could not be implemented.</p>
|
||
73 | *
|
||
74 | * @return point 2D that represents this handler of geometry
|
||
75 | *
|
||
76 | * @see #set(double, double)
|
||
77 | * @see #move(double, double)
|
||
78 | */
|
||
79 | public Point2D getPoint(); |
||
80 | /**
|
||
81 | * <p>Returns <code>true</code> if the object is a <code>Handler</code> and has the
|
||
82 | * same coordinates as this one.</p>
|
||
83 | *
|
||
84 | * @param obj the reference object with which to compare
|
||
85 | * @return <code>true</code> if this object is the same as the <code>obj</code>
|
||
86 | * argument; <code>false</code> otherwise
|
||
87 | *
|
||
88 | * @see #getPoint()
|
||
89 | */
|
||
90 | public boolean equalsPoint(Object obj); |
||
91 | } |