com.mindfusion.diagramming
Class AnchorPoint

java.lang.Object
  extended by com.mindfusion.diagramming.AnchorPoint
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Cloneable

public final class AnchorPoint
extends java.lang.Object
implements java.lang.Cloneable, java.io.Externalizable

Represent a point where an arrow can connect to a node. A set of anchor points is represented by the AnchorPattern class. Such a set can be assigned to a node by calling the DiagramNode.setAnchorPattern(com.mindfusion.diagramming.AnchorPattern) method.

See Also:
Serialized Form

Constructor Summary
AnchorPoint(float x, float y)
          Initializes a new AnchorPoint instance by setting its relative position in nodes.
AnchorPoint(float x, float y, boolean allowIncoming, boolean allowOutgoing)
          Initializes a new AnchorPoint instance by setting its relative position in nodes and specifying whether it will allow outgoing or incoming arrows.
AnchorPoint(float x, float y, boolean allowIncoming, boolean allowOutgoing, java.awt.Color color, short column)
          Initializes a new AnchorPoint instance by setting its relative position in nodes and specifying whether it will allow outgoing or incoming arrows.
AnchorPoint(float x, float y, boolean allowIncoming, boolean allowOutgoing, java.awt.Color color, short column, java.lang.Object tag)
          Initializes a new AnchorPoint instance by setting its relative position in nodes and specifying whether it will allow outgoing or incoming arrows.
AnchorPoint(float x, float y, boolean allowIncoming, boolean allowOutgoing, int markStyle)
          Initializes a new AnchorPoint instance by setting its relative position in nodes and specifying whether it will allow outgoing or incoming arrows.
AnchorPoint(float x, float y, boolean allowIncoming, boolean allowOutgoing, int markStyle, java.awt.Color color)
          Initializes a new AnchorPoint instance by setting its relative position in nodes and specifying whether it will allow outgoing or incoming arrows.
 
Method Summary
 java.lang.Object clone()
          Creates a clone of the anchor point.
 boolean getAllowIncoming()
          Gets a value indicating whether this anchor point accepts incoming arrows.
 boolean getAllowOutgoing()
          Gets a value indicating whether this anchor point accepts outgoing arrows.
 java.awt.Color getColor()
          Gets the color used to draw this anchor point.
 short getColumn()
          Gets the column to which this anchor point is related.
 int getMarkStyle()
          Gets a value indicating what mark is drawn at the position of this anchor point.
 java.lang.Object getTag()
          Gets a custom data object assigned to this anchor point.
 float getX()
          Gets the X position of the anchor point.
 float getY()
          Gets the Y position of the anchor point.
 void readExternal(java.io.ObjectInput in)
           
 void setAllowIncoming(boolean value)
          Sets a value indicating whether this anchor point accepts incoming arrows.
 void setAllowOutgoing(boolean value)
          Sets a value indicating whether this anchor point accepts outgoing arrows.
 void setColor(java.awt.Color value)
          Sets the color used to draw this anchor point.
 void setColumn(short value)
          Sets the column to which this anchor point is related.
 void setMarkStyle(int value)
          Sets a value indicating what mark is drawn at the position of this anchor point.
 java.lang.Object setTag(java.lang.Object tag)
          Assigns a custom data object to this anchor point.
 void setX(float value)
          Sets the X position of the anchor point.
 void setY(float value)
          Sets the Y position of the anchor point.
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnchorPoint

public AnchorPoint(float x,
                   float y)
Initializes a new AnchorPoint instance by setting its relative position in nodes. The point will allow both outgoing and incoming arrows.

Parameters:
x - The horizontal position of the anchor point specified as percents of the node width.
y - The vertical position of the anchor point specified as percents of the node height.

AnchorPoint

public AnchorPoint(float x,
                   float y,
                   boolean allowIncoming,
                   boolean allowOutgoing)
Initializes a new AnchorPoint instance by setting its relative position in nodes and specifying whether it will allow outgoing or incoming arrows.

Parameters:
x - The horizontal position of the anchor point specified as percents of the node width.
y - The vertical position of the anchor point specified as percents of the node height.
allowIncoming - true if this point should accept incoming arrows, otherwise false.
allowOutgoing - true if this point should accept outgoing arrows, otherwise false.

AnchorPoint

public AnchorPoint(float x,
                   float y,
                   boolean allowIncoming,
                   boolean allowOutgoing,
                   int markStyle)
Initializes a new AnchorPoint instance by setting its relative position in nodes and specifying whether it will allow outgoing or incoming arrows. The shape of the anchor point mark is specified too.

Parameters:
x - The horizontal position of the anchor point specified as percents of the node width.
y - The vertical position of the anchor point specified as percents of the node height.
allowIncoming - true if this point should accept incoming arrows, otherwise false.
allowOutgoing - true if this point should accept outgoing arrows, otherwise false.
markStyle - One of the MarkStyle constants.

AnchorPoint

public AnchorPoint(float x,
                   float y,
                   boolean allowIncoming,
                   boolean allowOutgoing,
                   int markStyle,
                   java.awt.Color color)
Initializes a new AnchorPoint instance by setting its relative position in nodes and specifying whether it will allow outgoing or incoming arrows. The shape and color of the anchor point mark are specified too.

Parameters:
x - The horizontal position of the anchor point specified as percents of the node width.
y - The vertical position of the anchor point specified as percents of the node height.
allowIncoming - true if this point should accept incoming arrows, otherwise false.
allowOutgoing - true if this point should accept outgoing arrows, otherwise false.
markStyle - One of the MarkStyle constants.
color - A Color object representing the color of the anchor point mark.

AnchorPoint

public AnchorPoint(float x,
                   float y,
                   boolean allowIncoming,
                   boolean allowOutgoing,
                   java.awt.Color color,
                   short column)
Initializes a new AnchorPoint instance by setting its relative position in nodes and specifying whether it will allow outgoing or incoming arrows. The table column to which the anchor point is related is specified too.

Parameters:
x - The horizontal position of the anchor point specified as percents of the node width.
y - The vertical position of the anchor point specified as percents of the node height.
allowIncoming - true if this point should accept incoming arrows, otherwise false.
allowOutgoing - true if this point should accept outgoing arrows, otherwise false.
color - A Color object representing the color of the anchor point mark.
column - An index of a table column relatively to which the anchor point x position should be calculated.

AnchorPoint

public AnchorPoint(float x,
                   float y,
                   boolean allowIncoming,
                   boolean allowOutgoing,
                   java.awt.Color color,
                   short column,
                   java.lang.Object tag)
Initializes a new AnchorPoint instance by setting its relative position in nodes and specifying whether it will allow outgoing or incoming arrows. The table column to which the anchor point is related is specified too.

Parameters:
x - The horizontal position of the anchor point specified as percents of the node width.
y - The vertical position of the anchor point specified as percents of the node height.
allowIncoming - true if this point should accept incoming arrows, otherwise false.
allowOutgoing - true if this point should accept outgoing arrows, otherwise false.
color - A Color object representing the color of the anchor point mark.
column - An index of a table column relatively to which the anchor point x position should be calculated.
tag - A custom data object associated with the anchor point.
Method Detail

clone

public java.lang.Object clone()
Creates a clone of the anchor point.

Overrides:
clone in class java.lang.Object
Returns:
An AnchorPoint instance.

getX

public float getX()
Gets the X position of the anchor point.

Returns:
A float value specifying the point position as percent of the node width.

setX

public void setX(float value)
Sets the X position of the anchor point.

Parameters:
value - A float value specifying the point position as percents of the node width.

getY

public float getY()
Gets the Y position of the anchor point.

Returns:
A float value specifying the point position as percent of the node height.

setY

public void setY(float value)
Sets the Y position of the anchor point.

Parameters:
value - A float value specifying the point position as percents of the node height.

getColumn

public short getColumn()
Gets the column to which this anchor point is related.

Returns:
An integer value specifying the column index.

setColumn

public void setColumn(short value)
Sets the column to which this anchor point is related.

Parameters:
value - An integer value specifying the column index.

getAllowIncoming

public boolean getAllowIncoming()
Gets a value indicating whether this anchor point accepts incoming arrows.

Returns:
true if incoming arrows can connect to this point, or false otherwise.

setAllowIncoming

public void setAllowIncoming(boolean value)
Sets a value indicating whether this anchor point accepts incoming arrows. param value true if incoming arrows can connect to this point, or otherwise false.


getAllowOutgoing

public boolean getAllowOutgoing()
Gets a value indicating whether this anchor point accepts outgoing arrows.

Returns:
true if outgoing arrows can connect to this point, or false otherwise.

setAllowOutgoing

public void setAllowOutgoing(boolean value)
Sets a value indicating whether this anchor point accepts outgoing arrows. param value true if outgoing arrows can connect to this point, or otherwise false.


getMarkStyle

public int getMarkStyle()
Gets a value indicating what mark is drawn at the position of this anchor point.

Returns:
One of the MarkStyle constants.

setMarkStyle

public void setMarkStyle(int value)
Sets a value indicating what mark is drawn at the position of this anchor point.

Parameters:
value - One of the MarkStyle constants.

getColor

public java.awt.Color getColor()
Gets the color used to draw this anchor point.

Returns:
A Color object representing the anchor point color.

setColor

public void setColor(java.awt.Color value)
Sets the color used to draw this anchor point.

Parameters:
value - A Color object representing the anchor point color.

getTag

public java.lang.Object getTag()
Gets a custom data object assigned to this anchor point.

Returns:
An Object containing custom data.

setTag

public java.lang.Object setTag(java.lang.Object tag)
Assigns a custom data object to this anchor point. If the tag object is serializable, it will be automatically saved when serializing the diagram into binary format. When serializing to XML, you can save the tag by handling the DiagramListener.serializeTag(com.mindfusion.diagramming.SerializeTagEvent) event.

Parameters:
tag - An Object containing custom data.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException