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
Direct Known Subclasses:
PortViewState

public class Port
extends java.lang.Object
implements Port

A data object that represents a yFiles FLEX port.


Constructor Summary
Port()
          Creates a new Port object using NodeScaledPortLocationModel.NODE_CENTER_ANCHORED as location model parameter.
Port(IPortLocationModelParameter locationModelParameter, java.lang.Object owner)
          Creates a new Port object using the given location model parameter and owner.
Port(YPoint offset, java.lang.Object owner)
          Creates a new Port object.
 
Method Summary
 YPoint getAbsoluteLocation()
          Calculates the absolute location of the port in world coordinates described by the port's location model parameter.
 IPortLocationModelParameter getLocationModelParameter()
          Gets the port model's parameter that determines the location of this port.
 YPoint getOffset()
          Returns the offset of the port location relative to the port owner's center.
 java.lang.Object getOwner()
          Returns the owner of the port.
 YRectangle getOwnerLayout()
           
static YRectangle getOwnerLayout(java.lang.Object portOwner)
           
 IPortStyle getStyle()
          The port style.
 java.lang.Object getTag()
          The user tag assigned to this port
 int getZOrder()
          Returns the z-order of the port used on client side.
 void setAbsoluteLocation(YPoint absoluteLocation)
          If a valid owner and port location model parameter is set, the absolute location is converted into an port location model parameter using the IPortLocationModel#createParameter method of the old parameter's model.
 void setLocationModelParameter(IPortLocationModelParameter locationModelParameter)
          Sets the port model's parameter that determines the location of this port.
 void setOffset(YPoint offset)
          Sets the the port's location relative to the center of its owner.
 void setOwner(java.lang.Object owner)
          Sets the owner of the port.
 void setStyle(IPortStyle style)
          Sets a new port style for the port.
 void setTag(java.lang.Object tag)
          The user tag assigned to this port
 void setZOrder(int zOrder)
          Sets the z-order of the port used on client side.
 
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 using NodeScaledPortLocationModel.NODE_CENTER_ANCHORED as location model parameter. Note that an owner has to be set before a correct location of the port can be calculated.


Port

public Port(YPoint offset,
            java.lang.Object owner)
Creates a new Port object. The given offset is converted into an IPortLocationModelParameter using the createOffsetParameter method of NodeScaledPortLocationModel

Parameters:
offset - The offset of the port location relative to the port owner's center.
owner - The owner of the port.
See Also:
NodeScaledPortLocationModel.createOffsetParameter(Object, y.geom.YPoint)

Port

public Port(IPortLocationModelParameter locationModelParameter,
            java.lang.Object owner)
Creates a new Port object using the given location model parameter and owner.

Parameters:
locationModelParameter - The model parameter describing the port location.
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 the port's location relative to the center of its owner.

The offset is converted to absolute world coordinates by adding them to the port owner's layout. After that setting the port location is delegated to setAbsoluteLocation.

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

getOffset

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

The offset is calculated by subtracting the port owner's center coordinates from the absolute port location returned by getAbsoluteLocation.

Returns:
The offset of the port location relative to the ports owner center.

getLocationModelParameter

public IPortLocationModelParameter getLocationModelParameter()
Gets the port model's parameter that determines the location of this port.


setLocationModelParameter

public void setLocationModelParameter(IPortLocationModelParameter locationModelParameter)
Sets the port model's parameter that determines the location of this port.


getAbsoluteLocation

public YPoint getAbsoluteLocation()
Calculates the absolute location of the port in world coordinates described by the port's location model parameter.

If no port owner and/or no valid port location model but an absolute location has been set before, this absolute location is returned.

Returns:
The absolute location of the port in world coordinates.
See Also:
setAbsoluteLocation(y.geom.YPoint)

setAbsoluteLocation

public void setAbsoluteLocation(YPoint absoluteLocation)
If a valid owner and port location model parameter is set, the absolute location is converted into an port location model parameter using the IPortLocationModel#createParameter method of the old parameter's model.

Otherwise the absolute location is stored as is.

Parameters:
absoluteLocation - The absolute location of the port.

getOwnerLayout

public YRectangle getOwnerLayout()

getOwnerLayout

public static YRectangle getOwnerLayout(java.lang.Object portOwner)

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.

getZOrder

public int getZOrder()
Returns the z-order of the port used on client side.


setZOrder

public void setZOrder(int zOrder)
Sets the z-order of the port used on client side.

Parameters:
zOrder - The new z-order of the port.

getTag

public java.lang.Object getTag()
The user tag assigned to this port


setTag

public void setTag(java.lang.Object tag)
The user tag assigned to this port



Copyright © 2000-2013 yWorks GmbH. All rights reserved