Class DisplayTablature

java.lang.Object
eu.bandm.music.entities.DisplayRhythm
eu.bandm.music.applications.tabstaff.DisplayTablature

public class DisplayTablature extends DisplayRhythm
Generates a tabulature-like rendering. PROVIS prototype: supports currently only one measure, from timepoints 0/1 to 1/1.
  • Field Details

    • score

      protected final Tabstaff score
      The score data, needed for event parmeters.
    • tabGraphics

      final TablatureGraphics tabGraphics
      The data prepared for tablature rendering.
    • verticalExtend

      public final DisplayTablature.VerticalExtend verticalExtend
      Which of the two four-line systems shall be painted as lines and not realized by ledger lines.
    • vocesTangentes

      protected DisplayTablature.VocesTangentes vocesTangentes
      When to apply shifts.
    • collisionMode

      protected DisplayTablature.shiftAgainstCollision collisionMode
      How to distribute necessary shifts.
    • Y_LOWESTLINE

      protected int Y_LOWESTLINE
      The position of the lowest line, either a full "lineola", or a ledger line. Can be overwritten by a subclass.
    • Y_DIST_LINES

      protected int Y_DIST_LINES
      The distance between adjacent lineolas. Can be overwritten by a subclass.
    • Y_STAFFS_GAP

      protected int Y_STAFFS_GAP
      The gap between the two halfs of the staff. Can be overwritten by a subclass.
    • ADDITIONAL_STEM_DISTANCE

      protected int ADDITIONAL_STEM_DISTANCE
      Additional distance to shift, so that the background clear of an overapping digit does not harm the overlapping stem of the other voice. In device Coordinates. Can be overwritten by a subclass.
    • WIDTH_LEDGER_HALF

      protected int WIDTH_LEDGER_HALF
      The width of a ledger line. Can be overwritten by a subclass.
    • X_DIST_HALF_STEM_HALF

      protected int X_DIST_HALF_STEM_HALF
      The distance between the two double-stesm for half notes. Can be overwritten by a subclass.
    • GENERIC_FONT_FAMILIY

      protected String GENERIC_FONT_FAMILIY
      The parameter for the constructor call "new Font(..)" to get a system default font. Can be overwritten by a subclass.
    • NOMINAL_FONT_SIZE

      protected int NOMINAL_FONT_SIZE
      The parameter for the constructor call "new Font(..)" to get a system default font. Can be overwritten by a subclass.
    • NOMINAL_CLEF_SIZE

      protected int NOMINAL_CLEF_SIZE
      The parameter for the constructor call "new Font(..)" to get a system default font. Can be overwritten by a subclass.
    • boldFont

      protected final eu.bandm.tools.util.java.Lazy<Font> boldFont
      Font for numbers for fresh key presses.
    • oldFont

      protected final eu.bandm.tools.util.java.Lazy<Font> oldFont
      Font for numbers for tied notes.
    • WIDTH_NUMBER

      protected int WIDTH_NUMBER
      The estimated width for all number fields. Can be overwritten by a subclass.
    • WIDEST_DIGIT

      protected String WIDEST_DIGIT
      The optically widest digit in the selected font. Can be overwritten by a subclass.
    • width_digit

      protected int width_digit
      The width for one digit. Cannot be set earlier than the "Graphics" object is known.
    • half_glyph_height

      protected int half_glyph_height
      Half the height of one digit. Cannot be set earlier than the "Graphics" object is known.
    • eventsLeft

      Map<Tp,Set<Event>> eventsLeft
    • eventsRight

      Map<Tp,Set<Event>> eventsRight
    • shiftMap

    • shifts

      final Map<Tp,Integer> shifts
    • fontMetrics

      FontMetrics fontMetrics
  • Constructor Details

  • Method Details

    • row2y

      protected int row2y(int row)
      The rows on the TUI count from 1 to 8 upward. The ypos in swing go downward, so that row 1 ≙ Y_LOWESTLINE. In case of vExtend != both, one of the halfs is printed with ledger lines. In case of vExtend == both, both halfs are printed as full lines, but there is an additional gap between them.
    • paintStem

      protected void paintStem(Graphics2D g, boolean isHalf, int from, int to, int x)
      Paints a double stem for half notes
    • paintStaff

      public void paintStaff(Graphics2D gr, int width, @Opt Tabstaff.SubArea subarea)
      Paint the two times four lines of the two staves, according to the setting of #vExtend.
    • paintOneMeasure

      public void paintOneMeasure(Graphics2D gr, int width, @Opt MSplitter.Result splitResultRight, Map<Tp,Set<Event>> eventsRight, @Opt MSplitter.Result splitResultLeft, Map<Tp,Set<Event>> eventsLeft)
      Print both hand rhythms and (numeric) note heads, with collision avoidance.
      Parameters:
      splitResultRight - is null iff eventsRight is empty
    • correctionShift

      protected int correctionShift(boolean is_co, int index)
      Description copied from class: DisplayRhythm
      Calculate horizontal shift for avoiding collicions.
      Specified by:
      correctionShift in class DisplayRhythm
    • draw_headAndStem

      protected void draw_headAndStem(Graphics2D g, boolean is_co, int nominal_xpos, int index, RationalDuration.DottedBaseDuration duration, boolean isSound, int stemend_T)
      Draw the note-heads, which are sequences of numbers in this case. This definition overrides the call-back definition from DisplayRhythm.
      Overrides:
      draw_headAndStem in class DisplayRhythm