public abstract class AbstractHandler extends Object implements Handler
Handler
interface adding support for selection, and
identifying a handler of a geometry.Handler
Modifier and Type | Field and Description |
---|---|
protected int |
index
Identifies each handler of a geometry.
|
protected Point2D |
point
Position of this handler.
|
Constructor and Description |
---|
AbstractHandler() |
Modifier and Type | Method and Description |
---|---|
boolean |
equalsPoint(Object obj)
Returns
true if the object is a Handler and has the
same coordinates as this one. |
Point2D |
getPoint()
Generic method of getting the 2D point that represents a handler of a geometry.
|
boolean |
isSelected()
Returns the state of the handler.
|
void |
select(boolean b)
Sets the state of the handler.
|
protected int index
protected Point2D point
public Point2D getPoint()
Handler
Generic method of getting the 2D point that represents a handler of a geometry.
Each handler of each geometry adapts this method to its own behavior in that geometry, that implies that could not be implemented.
getPoint
in interface Handler
Handler.set(double, double)
,
Handler.move(double, double)
public void select(boolean b)
True
if is selected, false
if it's not.b
- true
if the handler is selected, false
otherwiseisSelected()
public boolean isSelected()
True
if is selected, false
if it's not.true
if the handler is selected,false
otherwiseselect(boolean)
public boolean equalsPoint(Object obj)
Handler
Returns true
if the object is a Handler
and has the
same coordinates as this one.
equalsPoint
in interface Handler
obj
- the reference object with which to comparetrue
if this object is the same as the obj
argument; false
otherwiseHandler.getPoint()