Class DisplayTablature
java.lang.Object
eu.bandm.music.entities.DisplayRhythm
eu.bandm.music.applications.tabstaff.DisplayTablature
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.)
(Experimental state: Currently only the very first measure is rendered, which must be in 4-4 meter, between timepoints 0/1 to 1/1.)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
How to distribute the necessary shift among upper and lower stem.static enum
Which of the two four-line systems shall be painted as lines and not realized by ledger lines.static enum
When to apply shifts. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
Additional distance to shift, so that the background clear of an overapping digit does not harm the overlapping stem of the other voice.Font for numbers for fresh key presses.protected DisplayTablature.shiftAgainstCollision
How to distribute necessary shifts.Unification of all events of the left hand, per time point.Unification of all events of the right hand, per time point.(package private) FontMetrics
protected String
The parameter for the constructor call "new Font(..)
" to get a system default font.protected int
Half the height of one digit.protected int
The parameter for the constructor call "new Font(..)
" to get a system default font.protected int
The parameter for the constructor call "new Font(..)
" to get a system default font.Font for numbers for tied notes.protected final Tabstaff
The score data, needed for event parmeters.(package private) static final Map
<Integer, DisplayTablature.shiftAgainstCollision> (package private) final TablatureGraphics
The data prepared for tablature rendering.Which of the two four-line systems shall be painted as lines and not realized by ledger lines.protected DisplayTablature.VocesTangentes
When to apply shifts.protected String
The optically widest digit in the selected font.protected int
The width for one digit.protected int
The width of a ledger line.protected int
The estimated width for all number fields.protected int
The distance between the two double-stesm for half notes.protected int
The distance between adjacent lineolas.protected int
The position of the lowest line, either a full "lineola", or a ledger line.protected int
The gap between the two halfs of the staff.Fields inherited from class eu.bandm.music.entities.DisplayRhythm
BRACKET_HEIGHT, bracket_spans_whole_duration, BRACKET_X_OFFSET_LAST_STEM, BRACKET_X_OFFSET_NEXT_STEM, co_rhythm, contra_rhythm, DIA_PROLONGATION_DOT, HALF_BRACKET_LABEL_WIDTH, HEIGHT_BEAM, HEIGHT_BRACKET_LEVEL, hide_all_brackets, hide_all_numerators, NOTEHEADSIZE, OFFSET_LEFT, OFFSET_RIGHT, paint_ties_as_arcs, pauses_have_stemlets, WIDTH_SHORT_BEAM, X_DIST_DOTS, Y_BASE, Y_BEAM_DISTANCE, Y_CONTRA_STEMEND, Y_CONTRA_STEMLET_START, Y_CONTRA_STEMSTART, Y_STEMEND, Y_STEMLET_START, Y_STEMSTART
-
Constructor Summary
ConstructorsConstructorDescriptionDisplayTablature
(Tabstaff score, TablatureGraphics tabGraphics, DisplayTablature.VerticalExtend verticalExtend) Constructor with sensible default parameters for layout.DisplayTablature
(Tabstaff score, TablatureGraphics tabGraphics, DisplayTablature.VerticalExtend verticalExtend, DisplayTablature.VocesTangentes vocesTangentes, DisplayTablature.shiftAgainstCollision collisionMode) Constructor with explicit parameters for layout. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
correctionShift
(boolean is_co, int index) Calculate horizontal shift for avoiding collicions.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.void
paintOneMeasure
(Graphics2D gr, int width, MSplitter.Result splitResultRight, Map<Tp, Set<Event>> eventsRight, MSplitter.Result splitResultLeft, Map<Tp, Set<Event>> eventsLeft) Print both hand rhythms and (numeric) note heads, with collision avoidance.void
paintStaff
(Graphics2D gr, int width, Tabstaff.SubArea subarea) Paint the two times four lines of the two staves, according to the setting ofverticalExtend
.protected void
paintStem
(Graphics2D g, boolean isHalf, int from, int to, int x) Paints a double stem for half notesprotected int
row2y
(int row) The rows on the TUI count from 1 to 8 upward.Methods inherited from class eu.bandm.music.entities.DisplayRhythm
draw_pauses, drawNoteHead_1, drawNoteHead_2, drawNoteHead_4, drawPause_1, drawPause_eighth, drawPause_half, drawPause_quarter, paintFeatherBeam, paintOneMeasure, paintOneMeasureOneVoice
-
Field Details
-
score
The score data, needed for event parmeters. -
tabGraphics
The data prepared for tablature rendering. -
verticalExtend
Which of the two four-line systems shall be painted as lines and not realized by ledger lines. -
vocesTangentes
When to apply shifts. -
collisionMode
How to distribute necessary shifts. -
yLowestLine
protected int yLowestLineThe position of the lowest line, either a full "lineola", or a ledger line. Configuration parameter, can be overwritten by a subclass. -
yDistLines
protected int yDistLinesThe distance between adjacent lineolas. Configuration parameter, can be overwritten by a subclass. -
yStaffsGap
protected int yStaffsGapThe gap between the two halfs of the staff. Configuration parameter, can be overwritten by a subclass. -
additionalStemDistance
protected int additionalStemDistanceAdditional 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 widthLedgerHalfThe width of a ledger line. Configuration parameter, can be overwritten by a subclass. -
xDistHalfStemHalf
protected int xDistHalfStemHalfThe distance between the two double-stesm for half notes. Configuration parameter, can be overwritten by a subclass. -
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 nominalFontSizeThe parameter for the constructor call "new Font(..)
" to get a system default font. Configuration parameter, can be overwritten by a subclass. -
nominalClefSize
protected int nominalClefSizeThe parameter for the constructor call "new Font(..)
" to get a system default font. Configuration parameter, can be overwritten by a subclass. -
boldFont
Font for numbers for fresh key presses. -
oldFont
Font for numbers for tied notes. -
widthNumber
protected int widthNumberThe estimated width for all number fields. Configuration parameter, can be overwritten by a subclass. -
widestDigit
The optically widest digit in the selected font. Configuration parameter, can be overwritten by a subclass. -
widthDigit
protected int widthDigitThe width for one digit. Cannot be set earlier than the "Graphics" object is known. -
halfGlyphHeight
protected int halfGlyphHeightHalf the height of one digit. Cannot be set earlier than the "Graphics" object is known. -
eventsLeft
Unification of all events of the left hand, per time point. Communicates todraw_headAndStem(java.awt.Graphics2D, boolean, boolean, int, int, eu.bandm.music.entities.RationalDuration.DottedBaseDuration, boolean, int)
-
eventsRight
Unification of all events of the right hand, per time point. Communicates todraw_headAndStem(java.awt.Graphics2D, boolean, boolean, int, int, eu.bandm.music.entities.RationalDuration.DottedBaseDuration, boolean, int)
-
shiftMap
-
shifts
-
fontMetrics
FontMetrics fontMetrics
-
-
Constructor Details
-
DisplayTablature
public DisplayTablature(Tabstaff score, TablatureGraphics tabGraphics, DisplayTablature.VerticalExtend verticalExtend) Constructor with sensible default parameters for layout.- Parameters:
score
- the score data, needed for event parmeters.
-
DisplayTablature
public DisplayTablature(Tabstaff score, TablatureGraphics tabGraphics, DisplayTablature.VerticalExtend verticalExtend, DisplayTablature.VocesTangentes vocesTangentes, DisplayTablature.shiftAgainstCollision collisionMode) Constructor with explicit parameters for layout.- Parameters:
score
- the score data, needed for event parmeters.
-
-
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
Paints a double stem for half notes -
paintStaff
Paint the two times four lines of the two staves, according to the setting ofverticalExtend
. -
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 classDisplayRhythm
-
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 fromDisplayRhythm
.- Overrides:
draw_headAndStem
in classDisplayRhythm
-