Class ChartGraphics
java.lang.Object
eu.bandm.music.applications.tabstaff.ChartGraphics
- Direct Known Subclasses:
ChartGraphics_byStrings
,ChartGraphics_svg
Subroutines and configuration data for the "grid" view of tabstaff,
for static and animated SVG renderings.
This is the superclass of two implementations, with explicit
String construction and one with the
JSVG library, resp.
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static enum
The roles of a key in the grid, when assigned to MIDI note on/off event. -
Field Summary
Modifier and TypeFieldDescription(package private) int
Configuration parameter: Size of the circle which stands for events by arbitrary hands.(package private) Color
Configuration parameter: Color of all diatonic keys.(package private) Color
Configuration parameter: Color of all key-press symbols.(package private) Color
Configuration parameter: Color of all keys between the diatonic keys.(package private) Color
Configuration parameter: Color of numbers on filled keypress symbols.(package private) int
Configuration parameter: offset between two adjacent squares which represent the keys.(package private) int
Configuration parameter: offset between two adjacent squares which represent the keys.(package private) int
Configuration parameter: border of squares representing keys which are root.(package private) int
Configuration parameter: border of squares representing keys which are not root.(package private) final int[]
Distances (in chromatic steps) for each scale position to its upper neighbour in a major scale.final int
Highest index for columns.final int
Highest index for rows.(package private) final int[]
Distances (in chromatic steps) for each scale position to its upper neighbour in a natural minor scale.(package private) final SimpleMessage.Sender<eu.bandm.tools.util.xml.XMLDocumentIdentifier>
(package private) int
Configuration parameter: Offset from the left margin of the graphic area to the very first square which represents a key.(package private) int
Configuration parameter: Offset from the top margin of the graphic area to the very first square which represents a key.(package private) int
Configuration parameter: Size of the rotated square which stands for left-hand events.(package private) int
Configuration parameter: Radius of the rounded corner.(package private) int
Configuration parameter: Radius of the rounded corner.final Tabstaff
static final int
(package private) int
Configuration parameter: width of the squares which represent the keys.(package private) int
Configuration parameter: height of the squares which represent the keys.(package private) int
Configuration parameter: Size of the upright square which stands for right-hand events. -
Constructor Summary
ModifierConstructorDescriptionprotected
ChartGraphics
(int rows, int cols, Tabstaff score, SimpleMessage.Sender<eu.bandm.tools.util.xml.XMLDocumentIdentifier> msg) -
Method Summary
Modifier and TypeMethodDescription(package private) int
col2coord
(int column) Get the x coord of a given column number (from 1 to 8).static int
coord2index
(int r, int c) Translate a coordinate pair of the complete 8*8 area into a linear index.(package private) @Opt ChartGraphics.rank[]
Calculate the form and color of the grid background.(package private) int
row2coord
(int row) Get the y coord of a given row number (from 1 to 8).static ChartGraphics.rank[]
scaleToButtons
(Tabstaff.distance distance, int[] scaleDistances) Calculate the ranks of all squares to display (root, own, or foreign).abstract void
writeSequenceOfSvgs
(String fileStem) Write to a sequence of distinct files whiche contain the graphics for different time points.abstract void
writeToDynamicSVG
(File file) Write to one single file which contains the animated graphics stepping through the time points.
-
Field Details
-
score
-
msg
-
maxRow
public final int maxRowHighest index for rows. -
maxCol
public final int maxColHighest index for columns. -
seconds_per_whole
public static final int seconds_per_whole- See Also:
-
linewidth_slim
int linewidth_slimConfiguration parameter: border of squares representing keys which are not root. -
linewidth_fat
int linewidth_fatConfiguration parameter: border of squares representing keys which are root. -
size_x
int size_xConfiguration parameter: width of the squares which represent the keys. -
dist_x
int dist_xConfiguration parameter: offset between two adjacent squares which represent the keys. -
size_y
int size_yConfiguration parameter: height of the squares which represent the keys. -
dist_y
int dist_yConfiguration parameter: offset between two adjacent squares which represent the keys. -
round_x
int round_xConfiguration parameter: Radius of the rounded corner. -
round_y
int round_yConfiguration parameter: Radius of the rounded corner. -
offset_x
int offset_xConfiguration parameter: Offset from the left margin of the graphic area to the very first square which represents a key. (The offset from the last key to the right margin is fixed to half a button width.) -
offset_y
int offset_yConfiguration parameter: Offset from the top margin of the graphic area to the very first square which represents a key. (The offset from the last key to the bottom margin is fixed to half a button height.) -
squareSize
int squareSizeConfiguration parameter: Size of the upright square which stands for right-hand events. -
rotSquareSize
int rotSquareSizeConfiguration parameter: Size of the rotated square which stands for left-hand events. -
circleRadius
int circleRadiusConfiguration parameter: Size of the circle which stands for events by arbitrary hands. -
color_keypress
Color color_keypressConfiguration parameter: Color of all key-press symbols. -
color_diatonic
Color color_diatonicConfiguration parameter: Color of all diatonic keys. -
color_numberOnFill
Color color_numberOnFillConfiguration parameter: Color of numbers on filled keypress symbols. -
color_notDiatonic
Color color_notDiatonicConfiguration parameter: Color of all keys between the diatonic keys. -
majorMode
final int[] majorModeDistances (in chromatic steps) for each scale position to its upper neighbour in a major scale.ATTENTION scale support currently only provisionary.
-
minorMode
final int[] minorModeDistances (in chromatic steps) for each scale position to its upper neighbour in a natural minor scale.ATTENTION scale support currently only provisionary.
-
-
Constructor Details
-
ChartGraphics
protected ChartGraphics(int rows, int cols, Tabstaff score, SimpleMessage.Sender<eu.bandm.tools.util.xml.XMLDocumentIdentifier> msg)
-
-
Method Details
-
writeSequenceOfSvgs
Write to a sequence of distinct files whiche contain the graphics for different time points. -
writeToDynamicSVG
Write to one single file which contains the animated graphics stepping through the time points.- Throws:
IOException
-
coord2index
public static int coord2index(int r, int c) Translate a coordinate pair of the complete 8*8 area into a linear index. This corresponds to a numbering of the keys from left to right, starting with the lowest row and ascending. -
scaleToButtons
Calculate the ranks of all squares to display (root, own, or foreign).
(ATTENTION button(1,1) is currently fixed to root, since dynamic layout change with "mode=nearest" is not yet implemented.)- Parameters:
distance
- how the leftmost key in each row is related to the leftmost key one row higher/lower.scaleDistances
- gives for every diatonic step the distance to its successor in chromatic steps. CURRENTLY seven positions must cover twelve chromatic steps.
-
col2coord
int col2coord(int column) Get the x coord of a given column number (from 1 to 8). This coordinate is used as the left edge of the painted button. -
row2coord
int row2coord(int row) Get the y coord of a given row number (from 1 to 8). This coordinate is used as the top edge of the painted button (= numerically lower and optically higher). -
initialGridPattern
Calculate the form and color of the grid background. (Currently restricted to the situation defined by the very first event.)- Returns:
- null in case of errors in the voice data.
-