public final class ObjectPosition extends Object
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>
Modifier and Type | Field and Description |
---|---|
static ObjectPosition |
DEFAULT_POSITION |
Constructor and Description |
---|
ObjectPosition()
Creates a new ObjectPosition object.
|
ObjectPosition(ObjectPosition p)
Copy constructor
|
ObjectPosition(Position targ,
Position lab,
Justification just,
double x,
double y)
Creates a new ObjectPosition object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object lp)
Compare two ObjectPositions
|
Position |
getAnchor()
Return the anchor of the label (or other object).
|
Justification |
getJustify()
Return the justification of the label (or other object).
|
double |
getOffsetX()
Return the X offset of the object
|
double |
getOffsetY()
Return the Y offset of the object
|
Position |
getTargetAnchor()
Return the anchor of the target (e.g.
|
static ObjectPosition |
parse(String serializableString)
Parse a String that has been written by
toSerializableString and
create a new ObjectPosition that matches the text description |
void |
setAnchor(Position p)
Set the anchor of the label (or other object).
|
void |
setJustify(Justification j)
Set the justification of the label (or other object).
|
void |
setOffsetX(double d)
Set the X offset of the object
|
void |
setOffsetY(double d)
Set the Y offset of the object
|
void |
setTargetAnchor(Position p)
Set the anchor of the target object (e.g.
|
String |
toSerializableString()
Return a String that represents this ObjectPosition, suitable
for recreating the ObjectPosition with
parse |
String |
toString()
Return a string representation of this ObjectPosition
|
public static ObjectPosition DEFAULT_POSITION
public ObjectPosition()
public ObjectPosition(ObjectPosition p)
p
- original position.public ObjectPosition(Position targ, Position lab, Justification just, double x, double y)
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 offsetpublic Position getAnchor()
public Position getTargetAnchor()
public Justification getJustify()
public double getOffsetX()
public double getOffsetY()
public void setAnchor(Position p)
p
- anchor of the objectpublic void setTargetAnchor(Position p)
public void setJustify(Justification j)
j
- text justificationpublic void setOffsetX(double d)
d
- x offsetpublic void setOffsetY(double d)
d
- y offsetpublic boolean equals(Object lp)
public String toString()
public String toSerializableString()
parse
public static ObjectPosition parse(String serializableString)
toSerializableString
and
create a new ObjectPosition that matches the text descriptionserializableString
- Copyright 2011-2015 Cytoscape Consortium. All rights reserved.