Class DisplayTablature
java.lang.Object
eu.bandm.music.entities.DisplayRhythm
eu.bandm.music.applications.tabstaff.DisplayTablature
Generates a tabulature-like rendering.
PROVIS prototype: supports currently only one measure, from
timepoints 0/1 to 1/1.
-
Nested Class Summary
Modifier 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
Modifier 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.protected final eu.bandm.tools.util.java.Lazy<Font>
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.protected final eu.bandm.tools.util.java.Lazy<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, 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
ConstructorDescriptionDisplayTablature
(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, 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 of#vExtend
.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. -
Y_LOWESTLINE
protected int Y_LOWESTLINEThe 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_LINESThe distance between adjacent lineolas. Can be overwritten by a subclass. -
Y_STAFFS_GAP
protected int Y_STAFFS_GAPThe gap between the two halfs of the staff. Can be overwritten by a subclass. -
ADDITIONAL_STEM_DISTANCE
protected int ADDITIONAL_STEM_DISTANCEAdditional 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_HALFThe width of a ledger line. Can be overwritten by a subclass. -
X_DIST_HALF_STEM_HALF
protected int X_DIST_HALF_STEM_HALFThe distance between the two double-stesm for half notes. Can be overwritten by a subclass. -
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_SIZEThe 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_SIZEThe parameter for the constructor call "new Font(..)
" to get a system default font. Can be overwritten by a subclass. -
boldFont
Font for numbers for fresh key presses. -
oldFont
Font for numbers for tied notes. -
WIDTH_NUMBER
protected int WIDTH_NUMBERThe estimated width for all number fields. Can be overwritten by a subclass. -
WIDEST_DIGIT
The optically widest digit in the selected font. Can be overwritten by a subclass. -
width_digit
protected int width_digitThe width for one digit. Cannot be set earlier than the "Graphics" object is known. -
half_glyph_height
protected int half_glyph_heightHalf 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, 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, 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 ≙ 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
Paints a double stem for half notes -
paintStaff
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 classDisplayRhythm
-
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 fromDisplayRhythm
.- Overrides:
draw_headAndStem
in classDisplayRhythm
-