info.bioinfweb.treegraph.document.format
Class LegendFormats
java.lang.Object
info.bioinfweb.treegraph.document.format.ConcreteTextFormats
info.bioinfweb.treegraph.document.format.LegendFormats
- All Implemented Interfaces:
- CornerRadiusFormats, ElementFormats, LineFormats, TextFormats, Cloneable
public class LegendFormats
- extends ConcreteTextFormats
- implements ElementFormats, LineFormats, TextFormats, CornerRadiusFormats, Cloneable
Methods inherited from class info.bioinfweb.treegraph.document.format.ConcreteTextFormats |
addTextStyle, assignTextFormats, getDecimalFormat, getDescent, getFont, getFontName, getLocale, getTextColor, getTextHeight, getTextStyle, hasTextStyle, removeTextStyle, setDecimalFormat, setFontName, setLocale, setTextColor, setTextStyle |
Methods inherited from interface info.bioinfweb.treegraph.document.format.TextFormats |
addTextStyle, assignTextFormats, getDecimalFormat, getDescent, getFont, getFontName, getLocale, getTextColor, getTextHeight, getTextStyle, hasTextStyle, removeTextStyle, setDecimalFormat, setFontName, setLocale, setTextColor, setTextStyle |
STD_ORIENTATION
public static final TextOrientation STD_ORIENTATION
STD_LEGEND_STYLE
public static final LegendStyle STD_LEGEND_STYLE
DEFAULT_SPACING_IN_MM
public static final float DEFAULT_SPACING_IN_MM
- See Also:
- Constant Field Values
STD_POSITION
public static final int STD_POSITION
- See Also:
- Constant Field Values
owner
private Legend owner
orientation
private TextOrientation orientation
legendStyle
private LegendStyle legendStyle
lineColor
private Color lineColor
lineWidth
private DistanceValue lineWidth
cornerRadius
private DistanceValue cornerRadius
margin
private Margin margin
spacing
private DistanceValue spacing
position
private int position
minTreeDistance
private DistanceValue minTreeDistance
anchorNames
private String[] anchorNames
LegendFormats
public LegendFormats(Legend owner)
getOwner
public Legend getOwner()
setOwner
public void setOwner(Legend owner)
getOrientation
public TextOrientation getOrientation()
setOrientation
public void setOrientation(TextOrientation orientation)
getLineColor
public Color getLineColor()
- Specified by:
getLineColor
in interface LineFormats
setLineColor
public void setLineColor(Color lineColor)
- Specified by:
setLineColor
in interface LineFormats
getLineWidth
public DistanceValue getLineWidth()
- Specified by:
getLineWidth
in interface LineFormats
getPosition
public int getPosition()
- The position of a legend defined in which order vertically overlapping legends are
positioned. Legends with higher position numbers are displayed further right.
- Returns:
- the position number (can also be negative)
setPosition
public void setPosition(int position)
- The position of a legend defined in which order vertically overlapping legends are
positioned. Legends with higher position numbers are displayed further right.
The assinged legend (if present) is reinserted into its Legends
-object
to ensure the correct order.
- Parameters:
position
- the new position number (can also be negative)
getMinTreeDistance
public DistanceValue getMinTreeDistance()
getLegendStyle
public LegendStyle getLegendStyle()
setLegendStyle
public void setLegendStyle(LegendStyle style)
getMargin
public Margin getMargin()
getSpacing
public DistanceValue getSpacing()
- The legend spacing is the distance between the bracket and the text of a legend.
getCornerRadius
public DistanceValue getCornerRadius()
- Specified by:
getCornerRadius
in interface CornerRadiusFormats
getAnchorName
public String getAnchorName(int no)
setAnchorName
public void setAnchorName(int no,
String value)
getAnchor
public Node getAnchor(int no)
setAnchor
public void setAnchor(int no,
Node node)
sortAnchors
public void sortAnchors(PositionPaintType type)
- Sorts the anchors by the y-coordinates of their according terminal subnodes. The
upper most one becomes first. If only one anchor is specified it is made shure that
the secound anchor is
null
.
Note that the anchors of a legend can be only positioned by the y-values for one
painter ID at a time. Therefor positioners have to call this method every time they
are executed.
- Parameters:
type
- the painter type for the y-coordinates
hasOneAnchor
public boolean hasOneAnchor()
- Tests whether only one anchor is specified.
assignLineFormats
public void assignLineFormats(LineFormats other)
- Specified by:
assignLineFormats
in interface LineFormats
assignCornerRadiusFormats
public void assignCornerRadiusFormats(CornerRadiusFormats other)
- Specified by:
assignCornerRadiusFormats
in interface CornerRadiusFormats
assignLegendPosition
public void assignLegendPosition(LegendFormats other)
- Adopts the position values and the anchors but not the owning legend object.
- Parameters:
other
- the object that contains the source values
assignLegendFormats
public void assignLegendFormats(LegendFormats other)
assign
public void assign(LegendFormats other)
clone
public LegendFormats clone()
- Returns a deep copy of this class. (Note that the value of
owner
is
copied as well althogh the owning legend is only connected to this and not to the
returned object.)
- Specified by:
clone
in interface CornerRadiusFormats
- Specified by:
clone
in interface ElementFormats
- Specified by:
clone
in interface LineFormats
- Specified by:
clone
in interface TextFormats
- Overrides:
clone
in class ConcreteTextFormats