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 voiddrawLabel(java.awt.Graphics g, Caption label)Draws the label at the origin without colouring it.booleanequals(java.lang.Object o)AnchorgetAnchor()Returns the positioning anchor used by this style.CaptionergetCaptioner()Returns the captioner used by this style.java.awt.ColorgetColor()Returns the colour used by this style.bytegetCrowdLimit()Returns the number of labels allowed within spacing pixels.javax.swing.IcongetLegendIcon()Returns an icon suitable for displaying in a legend for this style.intgetSpacing()Returns the minimum pixel spacing permitted between labels.inthashCode()
-
-
-
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:StyleReturns an icon suitable for displaying in a legend for this style.- Specified by:
getLegendIconin 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, Caption 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 content
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-