Class SelectedBar

java.lang.Object
org.jjazz.cl_editor.api.SelectedBar
All Implemented Interfaces:
Comparable<SelectedBar>

public final class SelectedBar extends Object implements Comparable<SelectedBar>
A class to represent a selected bar in the chordleadsheet editor.

This is an immutable class.

  • Field Details

    • POST_END_BAR_MODEL_BAR_INDEX

      public static final int POST_END_BAR_MODEL_BAR_INDEX
      The modelBarIndex to use for a selectedBar after the end of the leadsheet.
      See Also:
  • Constructor Details

    • SelectedBar

      public SelectedBar(int barBoxIndex, ChordLeadSheet cls)
  • Method Details

    • getBarBoxIndex

      public int getBarBoxIndex()
      Returns:
    • getModelBarIndex

      public int getModelBarIndex()
      Return getBarBoxIndex() if it is less than container's size, otherwise return POST_END_BAR_MODEL_BAR_INDEX.
      Returns:
    • getContainer

      public ChordLeadSheet getContainer()
    • equals

      public boolean equals(Object o)
      Relies on container and barBoxIndex.
      Overrides:
      equals in class Object
      Parameters:
      o -
      Returns:
    • hashCode

      public int hashCode()
      Relies on container and barBoxIndex.
      Overrides:
      hashCode in class Object
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(SelectedBar t)
      Comparison based on barBoxIndex, ignore container.
      Specified by:
      compareTo in interface Comparable<SelectedBar>
      Parameters:
      t -
      Returns: