|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.canvas.AbstractSite
diva.canvas.connector.AutonomousSite
public class AutonomousSite
A site that is not attached to a figure. Autonomous sites are useful in building editors in which connectors can be reshaped or reconnected, as the connector can be attached to an autonomous site and then the autonomous site moved. Because sites must be located in a transform context, the constructor of autonomous sites requires that a transform context be supplied. For convenience, there are other constructors that accept a figures or pane, and use the transform context of that object.
Field Summary | |
---|---|
private TransformContext |
_context
The enclosing transform context |
private double |
_x
The location of this site. |
private double |
_y
|
Fields inherited from class diva.canvas.AbstractSite |
---|
_hasNormal, _normal |
Constructor Summary | |
---|---|
AutonomousSite(CanvasLayer l,
double x,
double y)
Create a new autonomous site in the transform context of the given pane and at the given location within that layer. |
|
AutonomousSite(CanvasPane p,
double x,
double y)
Create a new autonomous site in the transform context of the given pane and at the given location within that pane. |
|
AutonomousSite(Figure f,
double x,
double y)
Create a new autonomous site in the transform context of the given figure and at the given location within that figure. |
|
AutonomousSite(TransformContext c,
double x,
double y)
Create a new autonomous site in the given transform context and at the given location within that context. |
Method Summary | |
---|---|
Figure |
getFigure()
Return null. |
int |
getID()
Return zero. |
TransformContext |
getTransformContext()
Get the enclosing transform context of this site. |
double |
getX()
Get the x-coordinate of the site, in the enclosing transform context. |
double |
getY()
Get the y-coordinate of the site, in the enclosing transform context. |
void |
setLocation(TransformContext c,
double x,
double y)
Set the transform context and the location within the new transform context. |
void |
translate(double x,
double y)
Translate the site by the indicated distance. |
Methods inherited from class diva.canvas.AbstractSite |
---|
getNormal, getPoint, getPoint, getPoint, getPoint, hasNormal, isNormal, setNormal |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private TransformContext _context
private double _x
private double _y
Constructor Detail |
---|
public AutonomousSite(TransformContext c, double x, double y)
public AutonomousSite(CanvasPane p, double x, double y)
public AutonomousSite(CanvasLayer l, double x, double y)
public AutonomousSite(Figure f, double x, double y)
Method Detail |
---|
public Figure getFigure()
getFigure
in interface Site
getFigure
in class AbstractSite
public int getID()
getID
in interface Site
getID
in class AbstractSite
public TransformContext getTransformContext()
getTransformContext
in interface Site
getTransformContext
in class AbstractSite
public double getX()
getX
in interface Site
getX
in class AbstractSite
public double getY()
getY
in interface Site
getY
in class AbstractSite
public void setLocation(TransformContext c, double x, double y)
public void translate(double x, double y)
translate
in interface Site
translate
in class AbstractSite
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |