Class DashComboBox

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JComboBox<float[]>
uk.ac.starlink.util.gui.RenderingComboBox<float[]>
uk.ac.starlink.ttools.gui.DashComboBox
All Implemented Interfaces:
ActionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, ListDataListener, ListCellRenderer<float[]>

public class DashComboBox extends uk.ac.starlink.util.gui.RenderingComboBox<float[]>
Combo box for selecting dash patterns.
Since:
12 Jan 2006
Author:
Mark Taylor
See Also:
  • Constructor Details

    • DashComboBox

      public DashComboBox()
      Constructs a dash selector with a default range of dash patterns.
    • DashComboBox

      public DashComboBox(float[][] dashes)
      Constructs a dash selector with a given set of dash patterns.
      Parameters:
      dashes - dash patterns for selection; null is OK for a solid line.
  • Method Details

    • getSelectedDash

      public float[] getSelectedDash()
      Returns the currently selected dash pattern.
      Returns:
      selected dash array
    • setSelectedDash

      public void setSelectedDash(float[] dash)
      Sets the selected dash array. You should use this and not set the dash directly using methods on JComboBox or its model.
      Parameters:
      dash - new selected dash. Null is ok for solid
    • getRendererText

      protected String getRendererText(float[] d)
      Overrides:
      getRendererText in class uk.ac.starlink.util.gui.RenderingComboBox<float[]>
    • getRendererIcon

      protected Icon getRendererIcon(float[] d)
      Overrides:
      getRendererIcon in class uk.ac.starlink.util.gui.RenderingComboBox<float[]>