Package com.algo.structure
Class Edge
- java.lang.Object
-
- com.algo.plugins.XmlMarshallable
-
- com.algo.structure.Edge
-
- All Implemented Interfaces:
java.io.Serializable
public class Edge extends XmlMarshallable implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Edge.EdgeType
-
Field Summary
Fields Modifier and Type Field Description double
arrowHeadAngle
double
arrowHeadLength
Arrow
arrowType
GralogColor
color
java.util.ArrayList<ControlPoint>
controlPoints
static double
edgeSelectionOffset
Edge.EdgeType
edgeType
java.lang.Double
endPointDistance
java.util.ArrayList<EdgeIntermediatePoint>
intermediatePoints
java.lang.Boolean
isDirected
java.lang.String
label
static double
multiEdgeOffset
java.util.ArrayList<Edge>
siblings
java.lang.Double
startPointDistance
GralogTikStyles
style
java.lang.Double
thickness
GralogGraphicsContext.LineType
type
java.lang.Double
weight
-
Constructor Summary
Constructors Constructor Description Edge()
Edge(Configuration config)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ControlPoint
addControlPoint(Vector2D position, Vector2D clickPosition)
The clickPosition determines where the edge was initially clicked to add the control point.void
collapse(Structure structure)
boolean
containsVertex(Vertex v)
void
fromXml(org.w3c.dom.Element enode, java.util.HashMap<java.lang.String,Vertex> ids)
int
getControlPointCount()
Edge.EdgeType
getEdgeType()
int
getId()
double
getOffset()
Vertex
getSource()
Vector2D
getStartingPointSource()
Vector2D
getStartingPointTarget()
Vertex
getTarget()
java.lang.String
gralogPipify()
boolean
isDirected()
static boolean
isEdgeType(java.lang.String type)
boolean
isLoop()
boolean
isSiblingTo(Edge other)
double
length()
double
maximumCoordinate(int dimension)
ControlPoint
removeControlPoint(ControlPoint c)
boolean
sameOrientationAs(Edge other)
void
setDirectedness(boolean directedness)
void
setEdgeType(Edge.EdgeType e)
void
setEdgeType(java.lang.String e)
void
setId(int id)
void
setLabel(java.lang.String label)
void
setSource(Vertex source)
void
setTarget(Vertex target)
void
snapToGrid(double gridSize)
org.w3c.dom.Element
toSimpleXml(org.w3c.dom.Document doc, java.util.HashMap<Vertex,java.lang.String> ids)
org.w3c.dom.Element
toSimpleXml(org.w3c.dom.Document doc, java.util.HashMap<Vertex,java.lang.String> ids, java.lang.String style)
java.lang.String
toString()
org.w3c.dom.Element
toXml(org.w3c.dom.Document doc, java.util.HashMap<Vertex,java.lang.String> ids)
-
Methods inherited from class com.algo.plugins.XmlMarshallable
toXml, xmlName
-
-
-
-
Field Detail
-
edgeSelectionOffset
public static double edgeSelectionOffset
-
multiEdgeOffset
public static double multiEdgeOffset
-
label
public java.lang.String label
-
weight
public java.lang.Double weight
-
isDirected
public java.lang.Boolean isDirected
-
arrowType
public Arrow arrowType
-
endPointDistance
public java.lang.Double endPointDistance
-
startPointDistance
public java.lang.Double startPointDistance
-
arrowHeadLength
public double arrowHeadLength
-
arrowHeadAngle
public double arrowHeadAngle
-
thickness
public java.lang.Double thickness
-
color
public GralogColor color
-
style
public GralogTikStyles style
-
type
public GralogGraphicsContext.LineType type
-
edgeType
public Edge.EdgeType edgeType
-
siblings
public java.util.ArrayList<Edge> siblings
-
intermediatePoints
public java.util.ArrayList<EdgeIntermediatePoint> intermediatePoints
-
controlPoints
public java.util.ArrayList<ControlPoint> controlPoints
-
-
Constructor Detail
-
Edge
public Edge()
-
Edge
public Edge(Configuration config)
-
-
Method Detail
-
isEdgeType
public static boolean isEdgeType(java.lang.String type)
-
getEdgeType
public Edge.EdgeType getEdgeType()
-
setEdgeType
public void setEdgeType(Edge.EdgeType e)
-
setEdgeType
public void setEdgeType(java.lang.String e)
-
getControlPointCount
public int getControlPointCount()
-
addControlPoint
public ControlPoint addControlPoint(Vector2D position, Vector2D clickPosition)
The clickPosition determines where the edge was initially clicked to add the control point. Depending on clickPosition, the correct edge segment for adding the control point can be determined
-
getId
public int getId()
-
setId
public void setId(int id)
-
removeControlPoint
public ControlPoint removeControlPoint(ControlPoint c)
-
getSource
public Vertex getSource()
-
setSource
public void setSource(Vertex source)
-
isDirected
public boolean isDirected()
-
setDirectedness
public void setDirectedness(boolean directedness)
-
getTarget
public Vertex getTarget()
-
setTarget
public void setTarget(Vertex target)
-
isLoop
public boolean isLoop()
-
isSiblingTo
public boolean isSiblingTo(Edge other)
-
maximumCoordinate
public double maximumCoordinate(int dimension)
-
collapse
public void collapse(Structure structure)
-
snapToGrid
public void snapToGrid(double gridSize)
-
getOffset
public double getOffset()
-
sameOrientationAs
public boolean sameOrientationAs(Edge other)
-
getStartingPointSource
public Vector2D getStartingPointSource()
-
getStartingPointTarget
public Vector2D getStartingPointTarget()
-
containsVertex
public boolean containsVertex(Vertex v)
-
length
public double length()
-
toXml
public org.w3c.dom.Element toXml(org.w3c.dom.Document doc, java.util.HashMap<Vertex,java.lang.String> ids) throws java.lang.Exception
- Throws:
java.lang.Exception
-
toSimpleXml
public org.w3c.dom.Element toSimpleXml(org.w3c.dom.Document doc, java.util.HashMap<Vertex,java.lang.String> ids, java.lang.String style) throws java.lang.Exception
- Throws:
java.lang.Exception
-
toSimpleXml
public org.w3c.dom.Element toSimpleXml(org.w3c.dom.Document doc, java.util.HashMap<Vertex,java.lang.String> ids) throws java.lang.Exception
- Throws:
java.lang.Exception
-
setLabel
public void setLabel(java.lang.String label)
-
fromXml
public void fromXml(org.w3c.dom.Element enode, java.util.HashMap<java.lang.String,Vertex> ids) throws java.lang.Exception
- Throws:
java.lang.Exception
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
gralogPipify
public java.lang.String gralogPipify()
-
-