Class LabelStyle
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.layer.LabelStyle
-
-
Constructor Summary
Constructors Constructor Description LabelStyle(Captioner captioner, Anchor anchor, java.awt.Color color, int spacing, byte crowdLimit)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
drawLabel(java.awt.Graphics g, java.lang.String label)
Draws the label at the origin without colouring it.boolean
equals(java.lang.Object o)
Anchor
getAnchor()
Returns the positioning anchor used by this style.Captioner
getCaptioner()
Returns the captioner used by this style.java.awt.Color
getColor()
Returns the colour used by this style.byte
getCrowdLimit()
Returns the number of labels allowed within spacing pixels.javax.swing.Icon
getLegendIcon()
Returns an icon suitable for displaying in a legend for this style.int
getSpacing()
Returns the minimum pixel spacing permitted between labels.int
hashCode()
-
-
-
Constructor Detail
-
LabelStyle
public LabelStyle(Captioner captioner, Anchor anchor, java.awt.Color color, int spacing, byte crowdLimit)
Constructor.- Parameters:
captioner
- renders text to graphicsanchor
- positions text relative to plot pointcolor
- text colourspacing
- minimum pixel distance between labelscrowdLimit
- number of labels allowed within spacing
-
-
Method Detail
-
getLegendIcon
public javax.swing.Icon getLegendIcon()
Description copied from interface:Style
Returns an icon suitable for displaying in a legend for this style.- Specified by:
getLegendIcon
in interfaceStyle
-
getCaptioner
public Captioner getCaptioner()
Returns the captioner used by this style.- Returns:
- captioner
-
getAnchor
public Anchor getAnchor()
Returns the positioning anchor used by this style.- Returns:
- anchor
-
getColor
public java.awt.Color getColor()
Returns the colour used by this style.- Returns:
- colour
-
getSpacing
public int getSpacing()
Returns the minimum pixel spacing permitted between labels.- Returns:
- label spacing in pixels
-
getCrowdLimit
public byte getCrowdLimit()
Returns the number of labels allowed within spacing pixels.- Returns:
- crowd limit
-
drawLabel
public void drawLabel(java.awt.Graphics g, java.lang.String label)
Draws the label at the origin without colouring it. The drawing is therefore in the default colour of the graphics context.- Parameters:
g
- graphics contextlabel
- text string
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-