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.
(Experimental state: Currently only the very first measure is rendered, which must be in 4-4 meter, between 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.
    • yLowestLine

      protected int yLowestLine
      The position of the lowest line, either a full "lineola", or a ledger line. Configuration parameter, can be overwritten by a subclass.
    • yDistLines

      protected int yDistLines
      The distance between adjacent lineolas. Configuration parameter, can be overwritten by a subclass.
    • yStaffsGap

      protected int yStaffsGap
      The gap between the two halfs of the staff. Configuration parameter, can be overwritten by a subclass.
    • additionalStemDistance

      protected int additionalStemDistance
      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. Configuration parameter, can be overwritten by a subclass.
    • widthLedgerHalf

      protected int widthLedgerHalf
      The width of a ledger line. Configuration parameter, can be overwritten by a subclass.
    • xDistHalfStemHalf

      protected int xDistHalfStemHalf
      The distance between the two double-stesm for half notes. Configuration parameter, can be overwritten by a subclass.
    • genericFontFamily

      protected String genericFontFamily
      The parameter for the constructor call "new Font(..)" to get a system default font. Configuration parameter, can be overwritten by a subclass.
    • nominalFontSize

      protected int nominalFontSize
      The parameter for the constructor call "new Font(..)" to get a system default font. Configuration parameter, can be overwritten by a subclass.
    • nominalClefSize

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

      protected final Lazy<Font> boldFont
      Font for numbers for fresh key presses.
    • oldFont

      protected final Lazy<Font> oldFont
      Font for numbers for tied notes.
    • widthNumber

      protected int widthNumber
      The estimated width for all number fields. Configuration parameter, can be overwritten by a subclass.
    • widestDigit

      protected String widestDigit
      The optically widest digit in the selected font. Configuration parameter, can be overwritten by a subclass.
    • widthDigit

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

      protected int halfGlyphHeight
      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 ≙ yLowestLine. 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 verticalExtend.
    • 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, boolean is_first, 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