Class PhraseBirdsEyeViewComponent

All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible

public class PhraseBirdsEyeViewComponent extends JPanel implements PropertyChangeListener
A component to show a "bird's eye view" of whole or part of a Phrase.

See Also:
  • Field Details

  • Constructor Details

    • PhraseBirdsEyeViewComponent

      public PhraseBirdsEyeViewComponent()
  • Method Details

    • getLabel

      public String getLabel()
    • setLabel

      public void setLabel(String label)
      Add a label in the top left corner.
      Parameters:
      label - if null no label is shown
    • setMarkerPosition

      public void setMarkerPosition(float pos)
      Set the position of the marker.
      Parameters:
      pos - If -1, marker is not shown.
    • getMarkerPosition

      public float getMarkerPosition()
    • paintComponent

      public void paintComponent(Graphics g)
    • setTransferHandler

      public void setTransferHandler(TransferHandler th)
      Overridden to also automatically enable mouse drag listener to initiate the drag (if th is not null) .
      Overrides:
      setTransferHandler in class JComponent
      Parameters:
      th -
    • getModel

      public Phrase getModel()
    • getShowVelocityMode

      public int getShowVelocityMode()
      Get the show velocity mode.
      Returns:
      See Also:
    • setShowVelocityMode

      public void setShowVelocityMode(int showVelocityMode)
      Set the show velocity mode.
      Parameters:
      showVelocityMode - 0=don't show velocity. 1=use variation of the foreground color. 2=use different color shades.
    • setModel

      public void setModel(Phrase model, TimeSignature ts, FloatRange beatRange)
      Set the Phrase model.
      Parameters:
      model -
      ts - If null bar lines will not be drawn
      beatRange - Can't be an empty range
    • getBeatRange

      public FloatRange getBeatRange()
      The beat range shown in this component.
      Returns:
    • setBeatRange

      public void setBeatRange(FloatRange beatRange)
      Set the beat range shown in this component.
      Parameters:
      beatRange - Must be consistent with the model Phrase/TimeSignature
    • getTimeSignature

      public TimeSignature getTimeSignature()
      Can be null.
      Returns:
    • propertyChange

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