com.yworks.yfiles.server.graphml.folding.markup
Class Port

java.lang.Object
  extended bycom.yworks.yfiles.server.graphml.folding.markup.Port
All Implemented Interfaces:
Port

public class Port
extends java.lang.Object
implements Port

A data object that represents a yFiles FLEX port for EdgeViewState objects.


Constructor Summary
Port()
          Creates a new Port object at the center of its owner.
Port(YPoint offset)
          Creates a new Port object.
Port(YPoint offset, java.lang.Object owner)
          Creates a new Port object.
 
Method Summary
 YPoint getAbsoluteLocation()
          Calculates the absolute location of the port.
 YPoint getAbsoluteLocation(double x, double y, double width, double height)
          Calculates the absolute position by adding the offset to the given bounds of the port owner.
 YPoint getOffset()
          Returns the offset of the port location relative to the port's owner.
 java.lang.Object getOwner()
          Returns the owner of the port.
 IPortStyle getStyle()
          The port style.
 void setOffset(YPoint offset)
          Sets the offset of the port location relative to the owner's center.
 void setOwner(java.lang.Object owner)
          Sets the owner of the port.
 void setStyle(IPortStyle style)
          Sets a new port style for the port.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Port

public Port()
Creates a new Port object at the center of its owner.


Port

public Port(YPoint offset)
Creates a new Port object.

Parameters:
offset - The offset of the port location relative to the port owner's center.

Port

public Port(YPoint offset,
            java.lang.Object owner)
Creates a new Port object.

Parameters:
offset - The offset of the port location relative to the port's owner's center.
owner - The owner of the port.
Method Detail

getStyle

public IPortStyle getStyle()
The port style.

Returns:
The style of the port.

setStyle

public void setStyle(IPortStyle style)
Sets a new port style for the port.

Parameters:
style - The new style.

setOffset

public void setOffset(YPoint offset)
Sets the offset of the port location relative to the owner's center.

Parameters:
offset - The port's offset relative to the owner's center.

getOffset

public YPoint getOffset()
Returns the offset of the port location relative to the port's owner.

Returns:
the offset of the port location relative to the port's owner.

getAbsoluteLocation

public YPoint getAbsoluteLocation(double x,
                                  double y,
                                  double width,
                                  double height)
Calculates the absolute position by adding the offset to the given bounds of the port owner.

Parameters:
x - The x coordinate of the port owner.
y - The y coordinate of the port owner.
width - The width of the port owner.
height - The height of the port owner.
Returns:

getAbsoluteLocation

public YPoint getAbsoluteLocation()
Calculates the absolute location of the port. If the owning node is collapsed, the center of its NodeViewState's layout is used instead of the node layout's center to add the offset to.

Returns:
The absolute location of the port.

getOwner

public java.lang.Object getOwner()
Returns the owner of the port.

Returns:
The owner of the port.

setOwner

public void setOwner(java.lang.Object owner)
Sets the owner of the port.

Parameters:
owner - The new owner of the port.


Copyright © 2000-2007 yWorks GmbH. All rights reserved