LayoutAlgorithm
public abstract class SimpleLayoutAlgorithm extends java.lang.Object implements LayoutAlgorithm
SimpleLayoutAlgorithm
is a partial implementation of the
LayoutAlgorithm
interface which collects functions which are
independent of the output format of the LayoutDirector
.Modifier and Type | Class | Description |
---|---|---|
static class |
SimpleLayoutAlgorithm.RelativePosition |
Enumeration types (enums) for relative positions.
|
Constructor | Description |
---|---|
SimpleLayoutAlgorithm() |
Modifier and Type | Method | Description |
---|---|---|
static Point |
calculateCenter(GraphicalObject graphicalObject,
int level,
int version) |
|
double |
calculateReactionGlyphRotationAngle(ReactionGlyph reactionGlyph) |
method to calculate the rotation angle of the lines from the reaction box,
in degrees
|
static double |
calculateRotationAngle(Point startPoint,
Point endPoint) |
Calculate the rotation angle for a line determined by two
Point s. |
void |
correctDimensions(GraphicalObject glyph) |
Correct the dimensions of a
GraphicalObject by changing its
BoundingBox . |
Dimensions |
createReactionGlyphDimension(ReactionGlyph reactionGlyph) |
method to create a
Dimensions for a ReactionGlyph if it
was missing in the layout model |
Layout |
findLayout(GraphicalObject graphicalObject) |
Find the
Layout to which the given GraphicalObject
belongs. |
Layout |
getLayout() |
|
boolean |
isSetLayout() |
|
void |
setLayout(Layout layout) |
addLayoutedEdge, addLayoutedGlyph, addUnlayoutedEdge, addUnlayoutedGlyph, completeGlyphs, createCompartmentGlyphDimension, createCompartmentGlyphPosition, createCurve, createGlyphBoundingBox, createLayoutDimension, createSpeciesGlyphDimension, createSpeciesReferenceGlyphDimension, createTextGlyphDimension
public Layout getLayout()
getLayout
in interface LayoutAlgorithm
Layout
set for this LayoutAlgorithm;public boolean isSetLayout()
isSetLayout
in interface LayoutAlgorithm
Layout
is set for this LayoutAlgorithm, else falsepublic void setLayout(Layout layout)
setLayout
in interface LayoutAlgorithm
layout
- the Layout
to be set for this LayoutAlgorithmpublic static Point calculateCenter(GraphicalObject graphicalObject, int level, int version)
graphicalObject
- level
- version
- public Dimensions createReactionGlyphDimension(ReactionGlyph reactionGlyph)
LayoutAlgorithm
Dimensions
for a ReactionGlyph
if it
was missing in the layout modelcreateReactionGlyphDimension
in interface LayoutAlgorithm
reactionGlyph
- for which the Dimensions
is missingDimensions
public double calculateReactionGlyphRotationAngle(ReactionGlyph reactionGlyph)
LayoutAlgorithm
calculateReactionGlyphRotationAngle
in interface LayoutAlgorithm
reactionGlyph
- for which the rotation angle shall be calculatedpublic static double calculateRotationAngle(Point startPoint, Point endPoint)
Point
s.public Layout findLayout(GraphicalObject graphicalObject)
Layout
to which the given GraphicalObject
belongs.graphicalObject
- GraphicalObject
for which to find the layoutGraphicalObject
public void correctDimensions(GraphicalObject glyph)
GraphicalObject
by changing its
BoundingBox
. According to the SBGN specification, some objects
have to be represented as a circle or square and not as an ellipse or
rectangle. fit to the glyph. If not this method corrects the layout
informations.glyph
- the GraphicalObject
for which to correct the
dimensions