uk.ac.starlink.ttools.plot2.layer
Class LabelStyle

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.layer.LabelStyle
All Implemented Interfaces:
Style

@Equality
public class LabelStyle
extends Object
implements Style

Style for LabelPlotter.

Since:
15 Feb 2013
Author:
Mark Taylor

Constructor Summary
LabelStyle(Captioner captioner, Anchor anchor, Color color, int spacing, byte crowdLimit)
          Constructor.
 
Method Summary
 void drawLabel(Graphics g, String label)
          Draws the label at the origin without colouring it.
 boolean equals(Object o)
           
 Anchor getAnchor()
          Returns the positioning anchor used by this style.
 Captioner getCaptioner()
          Returns the captioner used by this style.
 Color getColor()
          Returns the colour used by this style.
 byte getCrowdLimit()
          Returns the number of labels allowed within spacing pixels.
 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()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelStyle

public LabelStyle(Captioner captioner,
                  Anchor anchor,
                  Color color,
                  int spacing,
                  byte crowdLimit)
Constructor.

Parameters:
captioner - renders text to graphics
anchor - positions text relative to plot point
color - text colour
spacing - minimum pixel distance between labels
crowdLimit - number of labels allowed within spacing
Method Detail

getLegendIcon

public Icon getLegendIcon()
Description copied from interface: Style
Returns an icon suitable for displaying in a legend for this style.

Specified by:
getLegendIcon in interface Style

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 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(Graphics g,
                      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 context
label - text string

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.