Class ItemRenderer

All Implemented Interfaces:
FocusListener, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible
Direct Known Subclasses:
IR_AnnotationText, IR_Section

public abstract class ItemRenderer extends JPanel implements PropertyChangeListener, FocusListener
The base class for ItemRenderers.

Subclasses should typically implement the paintComponent() function to render the item. The class listens to the item model's changes and call the modelChanged() and/or modelMoved() functions that should be implemented by subclasses.

See Also:
  • Constructor Details

  • Method Details

    • getIR_Type

      public IR_Type getIR_Type()
    • setModel

      public void setModel(ChordLeadSheetItem<?> item)
    • setZoomFactor

      public abstract void setZoomFactor(int factor)
      Zoom factor.
      Parameters:
      factor - 0=min zoom (bird's view), 100=max zoom
    • getZoomFactor

      public abstract int getZoomFactor()
    • requestAttention

      public void requestAttention(Color flashColor)
      Briefly flash this renderer background to request user attention.
      Parameters:
      flashColor -
    • cleanup

      public void cleanup()
      Clean up everything so this object can be garbaged.
    • getModel

      public ChordLeadSheetItem<?> getModel()
    • toString

      public String toString()
      Overrides:
      toString in class Component
    • isSelected

      public boolean isSelected()
    • setSelected

      public final void setSelected(boolean b)
      Set the Component selected or not.
      Parameters:
      b - Select the Component if b is true.
    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      Specified by:
      propertyChange in interface PropertyChangeListener
    • focusGained

      public void focusGained(FocusEvent e)
      Specified by:
      focusGained in interface FocusListener
    • focusLost

      public final void focusLost(FocusEvent e)
      Specified by:
      focusLost in interface FocusListener