|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.view.Port
Defines a logical end point of an edge relative to the center location of a node. Port locations are specified relative to the center location of the corresponding node.
A port can be thought of as the first or last control point of an edge realizer.
Field Summary | |
protected EdgeRealizer |
realizer
|
protected double |
xoff
|
protected double |
yoff
|
Constructor Summary | |
Port()
Constructs a new Port with default offset 0.0 . |
|
Port(double xoff,
double yoff)
Constructs a new Port with offset location (xoff,yoff) . |
|
Port(Port port)
Constructs a new Port as a copy of a given port. |
Method Summary | |
void |
calcUnionRect(Rectangle2D rect,
NodeRealizer r)
Enlarges the given rectangle such that it will contain the complete visual representation of this port. |
boolean |
contains(double x,
double y)
Returns true if the given coordinates lie within the visual shape of this port. |
Port |
createCopy()
Creates an unbound copy of this port. |
Port |
createRotatedPort()
Creates an unbound copy of this port that is rotated by 90 degrees. |
boolean |
findIntersection(NodeRealizer r,
double ix,
double iy,
double ox,
double oy,
Point2D result)
Returns true iff the coord (ix,iy)
lies within the visual shape of this port and the
coord (ox,oy> lies outside of that shape.
|
double |
getOffsetX()
Returns the center x-coord of this port relative to the center of the node it is connected to. |
double |
getOffsetY()
Returns the center y-coord of this port relative to the center of the node it is connected to. |
EdgeRealizer |
getOwner()
Returns the edge realizer this port belongs to. |
double |
getX(NodeRealizer nr)
Returns the absolute center x-coord of this port. |
double |
getY(NodeRealizer nr)
Returns the absolute center y-coord of this port. |
void |
paint(Graphics2D gfx,
NodeRealizer r)
Paints a little black rectangle if the edge realizer this port belongs to is selected. |
void |
read(ObjectInputStream in)
Reads in a serialized form of a port that was previously written out by the method Port.write(ObjectOutputStream out) . |
protected void |
setDirty()
Marks this port and it's associated edge realizer as dirty. |
void |
setOffsets(double xoff,
double yoff)
Sets the center coords of this port relative to the center of the node is connected to. |
void |
setOffsetX(double xoff)
Sets the center x-coord of this port relative to the center of the node is connected to. |
void |
setOffsetY(double yoff)
Sets the center x-coord of this port relative to the center of the node is connected to. |
String |
toString()
Returns a string representation of this port. |
void |
write(ObjectOutputStream out)
Writes out this port in a serialized form. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected double xoff
protected double yoff
protected EdgeRealizer realizer
Constructor Detail |
public Port()
0.0
.
public Port(double xoff, double yoff)
(xoff,yoff)
.
public Port(Port port)
Method Detail |
public Port createCopy()
public Port createRotatedPort()
public EdgeRealizer getOwner()
public boolean findIntersection(NodeRealizer r, double ix, double iy, double ox, double oy, Point2D result)
true
iff the coord (ix,iy)
lies within the visual shape of this port and the
coord (ox,oy>
lies outside of that shape.
In that case the intersection point of the
line (ix,iy) - (ox,oy)
with that shape
will be stored in the given point.
public void paint(Graphics2D gfx, NodeRealizer r)
protected void setDirty()
public boolean contains(double x, double y)
public void calcUnionRect(Rectangle2D rect, NodeRealizer r)
r
- The node realizer this port is connected to.public double getOffsetX()
public double getOffsetY()
public double getX(NodeRealizer nr)
public double getY(NodeRealizer nr)
public void setOffsetX(double xoff)
public void setOffsetY(double yoff)
public void setOffsets(double xoff, double yoff)
public void write(ObjectOutputStream out) throws IOException
IOException
public void read(ObjectInputStream in) throws IOException, ClassNotFoundException
Port.write(ObjectOutputStream out)
.
IOException
ClassNotFoundException
public String toString()
toString
in class Object
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |