Class ObjectPosition
java.lang.Object
org.cytoscape.view.presentation.property.values.ObjectPosition
ObjectPosition is the value that is used by Position VisualProperties.
It includes information about the anchor point of the object itself, the
anchor point of the target, the justification, and an x,y offset.
Cytoscape Backwards Compatibility (Final Class): This class is final and therefore can't be extended by users. This means that we may add methods for minor version updates. Methods will only be removed for major version updates.
Module: presentation-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>presentation-api</artifactId> </dependency>
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates a new ObjectPosition object.Copy constructorObjectPosition
(Position targ, Position lab, Justification just, double x, double y) Creates a new ObjectPosition object. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compare two ObjectPositionsReturn the anchor of the label (or other object).Return the justification of the label (or other object).double
Return the X offset of the objectdouble
Return the Y offset of the objectReturn the anchor of the target (e.g.static ObjectPosition
Parse a String that has been written bytoSerializableString()
and create a new ObjectPosition that matches the text descriptionvoid
Set the anchor of the label (or other object).void
Set the justification of the label (or other object).void
setOffsetX
(double d) Set the X offset of the objectvoid
setOffsetY
(double d) Set the Y offset of the objectvoid
Set the anchor of the target object (e.g.Return a String that represents this ObjectPosition, suitable for recreating the ObjectPosition withparse(java.lang.String)
toString()
Return a string representation of this ObjectPosition
-
Field Details
-
DEFAULT_POSITION
-
-
Constructor Details
-
ObjectPosition
public ObjectPosition()Creates a new ObjectPosition object. -
ObjectPosition
Copy constructor- Parameters:
p
- original position.
-
ObjectPosition
Creates a new ObjectPosition object.- Parameters:
targ
- the anchor Position of the target (e.g. Node)lab
- the anchor Position of the labeljust
- the Justification of the textx
- an x offsety
- a y offset
-
-
Method Details
-
getAnchor
Return the anchor of the label (or other object).- Returns:
- object anchor
-
getTargetAnchor
Return the anchor of the target (e.g. Node)- Returns:
- target anchor
-
getJustify
Return the justification of the label (or other object).- Returns:
- text justification
-
getOffsetX
public double getOffsetX()Return the X offset of the object- Returns:
- x offset
-
getOffsetY
public double getOffsetY()Return the Y offset of the object- Returns:
- Y offset
-
setAnchor
Set the anchor of the label (or other object).- Parameters:
p
- anchor of the object
-
setTargetAnchor
Set the anchor of the target object (e.g. Node) -
setJustify
Set the justification of the label (or other object).- Parameters:
j
- text justification
-
setOffsetX
public void setOffsetX(double d) Set the X offset of the object- Parameters:
d
- x offset
-
setOffsetY
public void setOffsetY(double d) Set the Y offset of the object- Parameters:
d
- y offset
-
equals
Compare two ObjectPositions -
toString
Return a string representation of this ObjectPosition -
toSerializableString
Return a String that represents this ObjectPosition, suitable for recreating the ObjectPosition withparse(java.lang.String)
- Returns:
- serialized string
-
parse
Parse a String that has been written bytoSerializableString()
and create a new ObjectPosition that matches the text description- Parameters:
serializableString
-- Returns:
- Never returns null. If invalid, simply returns default.
-