Class Legend

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class Legend extends JComponent
Draws the legend for identifying points on a plot.
Since:
4 Jan 2006
Author:
Mark Taylor
See Also:
  • Constructor Details

    • Legend

      public Legend()
      Constructor.
  • Method Details

    • setErrorModeSelections

      public void setErrorModeSelections(ErrorModeSelection[] errorSelections)
      Configures this legend to use a given set of error mode selections. These can affect how marker style icons are drawn.
      Parameters:
      errorSelections - new error mode selections
    • setStyles

      public void setStyles(Style[] styles, String[] labels)
      Sets the plot styles and their associated text labels. The two arrays must have the same length. Only styles with labels which are not blank will be shown.
      Parameters:
      styles - style array
      labels - label array
    • resetWidth

      public void resetWidth()
      Resets the width to the minimum necessary for this component. Otherwise, the width is so arranged that it never shrinks, only grows as longer legend text elements are added - that behaviour reduces ugly resizing in TOPCAT.
    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • getMaximumSize

      public Dimension getMaximumSize()
      Overrides:
      getMaximumSize in class JComponent
    • getMinimumSize

      public Dimension getMinimumSize()
      Overrides:
      getMinimumSize in class JComponent