Class NoteView

All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, Comparable<NoteEvent>, EventListener, Accessible

public class NoteView extends JPanel implements PropertyChangeListener, Comparable<NoteEvent>
A JComponent which represents a NoteEvent.

See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • setModel

      public void setModel(NoteEvent ne)
    • getModel

      public NoteEvent getModel()
    • getNoteColor

      public Color getNoteColor()
    • getNoteBorderColor

      public Color getNoteBorderColor()
    • setSelected

      public void setSelected(boolean b, boolean repaint)
      Select this NoteView.

      Fire a PROP_SELECTED change event.

      Parameters:
      b -
      repaint - If true call repaint() after. Use false to greatly improve performance when updating many NoteViews at once (call repaint() on the container at the end)
    • isSelected

      public boolean isSelected()
    • isMuted

      public boolean isMuted()
    • setMuted

      public void setMuted(boolean muted)
    • isShowNoteString

      public boolean isShowNoteString()
    • setShowNoteString

      public void setShowNoteString(boolean b)
      Decide if we show the note string in the viewer (eg "Eb").
      Parameters:
      b -
    • getExtraTooltip

      public String getExtraTooltip()
    • setExtraTooltip

      public void setExtraTooltip(String text)
      The extra help tooltip text added to note name and velocity.
      Parameters:
      text -
    • paint

      public void paint(Graphics g)
      Overrides:
      paint in class JComponent
    • cleanup

      public void cleanup()
    • toString

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

      public static List<NoteEvent> getNotes(Collection<NoteView> noteViews)
      Get a list of notes from a collection of NoteViews.
      Parameters:
      noteViews -
      Returns:
      A mutable list
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Specified by:
      propertyChange in interface PropertyChangeListener
    • compareTo

      public int compareTo(NoteEvent ne)
      Rely on NoteEvent.compareTo() but returns 0 only if noteEvent==ne.
      Specified by:
      compareTo in interface Comparable<NoteEvent>
      Parameters:
      ne -
      Returns: