|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.googlecode.whatswrong.AbstractEdgeLayout
com.googlecode.whatswrong.SpanLayout
public class SpanLayout
A SpanLayouy lays out edges as rectangular blocks under or above the tokens that the edge covers. The label is written into these blocks. If there are multiple edge types then all spans of the same type appear in the same contiguous vertical area.
Field Summary |
---|
Fields inherited from class com.googlecode.whatswrong.AbstractEdgeLayout |
---|
baseline, curve, from, heightPerLevel, maxHeight, maxWidth, shapes, to, vertexExtraSpace, visible |
Constructor Summary | |
---|---|
SpanLayout()
Creates a new SpanLayout. |
Method Summary | |
---|---|
java.util.Map<Token,java.lang.Integer> |
estimateRequiredTokenWidths(java.util.Collection<Edge> edges,
java.awt.Graphics2D g2d)
For each token that has a self-loop we need the token to be wide enough. |
int |
getOrder(java.lang.String type)
Returns the order/vertical layer in which the area of a certain type should be drawn. |
boolean |
isSeparationLines()
Should we draw separation lines between the areas for different span types. |
java.awt.Dimension |
layoutEdges(java.util.Collection<Edge> edges,
java.util.Map<Token,Bounds1D> bounds,
java.awt.Graphics2D g2d)
Lays out the edges as spans (blocks) under or above the tokens they contain. |
void |
setSeparationLines(boolean separationLines)
Should we draw separation lines between the areas for different span types. |
void |
setTypeOrder(java.lang.String type,
int order)
Sets the order/vertical layer in which the area of a certain type should be drawn. |
Methods inherited from class com.googlecode.whatswrong.AbstractEdgeLayout |
---|
addToSelection, calculateDepth, clearSelection, getBaseline, getColor, getEdgeAt, getFrom, getHeight, getHeightPerLevel, getSelected, getStroke, getStroke, getTo, getVertexExtraSpace, getWidth, isCurve, onlyShow, removeFromSelection, select, setBaseline, setColor, setCurve, setHeightPerLevel, setStroke, setVertexExtraSpace, showAll, toggleSelection |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpanLayout()
Method Detail |
---|
public void setTypeOrder(java.lang.String type, int order)
type
- the type we want to change the order for.order
- the order/vertical layer in which the area of the given type should be drawn.public int getOrder(java.lang.String type)
type
- the type we want to get the order for.
public boolean isSeparationLines()
public void setSeparationLines(boolean separationLines)
separationLines
- true iff separation lines should be drawn.public java.util.Map<Token,java.lang.Integer> estimateRequiredTokenWidths(java.util.Collection<Edge> edges, java.awt.Graphics2D g2d)
edges
- the set of edges that can contain self-loops.g2d
- the graphics object needed to find out the actual width of text.
public java.awt.Dimension layoutEdges(java.util.Collection<Edge> edges, java.util.Map<Token,Bounds1D> bounds, java.awt.Graphics2D g2d)
edges
- the edges to layout.bounds
- the bounds of the tokens the spans connect.g2d
- the graphics object to draw on.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |