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()
    • setSelected

      public void setSelected(boolean b)
      Select this NoteView.

      Fire a PROP_SELECTED change event.

      Parameters:
      b -
    • isSelected

      public boolean isSelected()
    • isMuted

      public boolean isMuted()
    • setMuted

      public void setMuted(boolean muted)
    • paintComponent

      public void paintComponent(Graphics g)
    • getLineBorder

      public LineBorder getLineBorder()
      Convenience method to get the LineBorder used by this NoteView.
      Returns:
    • 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: