Class LabelStyle
java.lang.Object
uk.ac.starlink.ttools.plot2.layer.LabelStyle
- All Implemented Interfaces:
Style
Style for LabelPlotter.
- Since:
- 15 Feb 2013
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionLabelStyle
(Captioner captioner, Anchor anchor, Color color, int spacing, byte crowdLimit, Point offset) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Draws the label at the origin without colouring it.boolean
Returns the positioning anchor used by this style.getCaptionBounds
(Caption label) Returns a rectangle within which all of the given label will fall.Returns the captioner used by this style.getColor()
Returns the colour used by this style.byte
Returns the number of labels allowed within spacing pixels.Returns an icon suitable for displaying in a legend for this style.int
Returns the minimum pixel spacing permitted between labels.int
hashCode()
-
Constructor Details
-
LabelStyle
public LabelStyle(Captioner captioner, Anchor anchor, Color color, int spacing, byte crowdLimit, Point offset) 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 spacingoffset
- pixel offset for label positioning
-
-
Method Details
-
getLegendIcon
Description copied from interface:Style
Returns an icon suitable for displaying in a legend for this style.- Specified by:
getLegendIcon
in interfaceStyle
-
getCaptioner
Returns the captioner used by this style.- Returns:
- captioner
-
getAnchor
Returns the positioning anchor used by this style.- Returns:
- anchor
-
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
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 content
-
getCaptionBounds
Returns a rectangle within which all of the given label will fall.- Parameters:
label
- text content- Returns:
- bounding box
-
equals
-
hashCode
public int hashCode()
-