Package uk.ac.starlink.ttools.plot2
Class LegendIcon
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.LegendIcon
-
- All Implemented Interfaces:
javax.swing.Icon
@Equality public class LegendIcon extends java.lang.Object implements javax.swing.Icon
Icon containing legend information for a plot.- Since:
- 13 Feb 2013
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description LegendIcon(LegendEntry[] entries, Captioner captioner, boolean border, java.awt.Color bgColor)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.awt.Color
getBackground()
Returns the background colour of this legend.Captioner
getCaptioner()
Returns this legend's captioner.int
getIconHeight()
int
getIconWidth()
boolean
hasBorder()
Indicates whether this legend has a border.int
hashCode()
void
paintIcon(java.awt.Component c, java.awt.Graphics g, int x0, int y0)
-
-
-
Constructor Detail
-
LegendIcon
public LegendIcon(LegendEntry[] entries, Captioner captioner, boolean border, java.awt.Color bgColor)
Constructor.- Parameters:
entries
- items to display in legendcaptioner
- text rendererborder
- true to draw a line border around the legendbgColor
- opaque background colour, null for transparent
-
-
Method Detail
-
getCaptioner
public Captioner getCaptioner()
Returns this legend's captioner.- Returns:
- captioner
-
hasBorder
public boolean hasBorder()
Indicates whether this legend has a border.- Returns:
- true for border, false for not
-
getBackground
public java.awt.Color getBackground()
Returns the background colour of this legend.- Returns:
- background colour
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidth
in interfacejavax.swing.Icon
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeight
in interfacejavax.swing.Icon
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x0, int y0)
- Specified by:
paintIcon
in interfacejavax.swing.Icon
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-