Class Graphics
java.lang.Object
eu.bandm.music.applications.tabstaff.Graphics
Generates a dynmic svg which executes the key presses and finger changes
visually.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enum
Type of a key in the grid -
Field Summary
FieldsModifier and TypeFieldDescription(package private) int
Size of the circle which stands for right-hand events.(package private) String
Color of all key-press symbols.(package private) int
Offset between two adjacent squares which represent the keys.(package private) int
Offset between two adjacent squares which represent the keys.(package private) int
Border of squares representing keys which are root.(package private) int
Border of squares representing keys which are not root.(package private) int
Offset from the start of graphic area to very first square which represents a key.(package private) int
Offset from the start of graphic area to very first square which represents a key.(package private) int
Radius of the ronded corner.(package private) int
Radius of the ronded corner.(package private) int
Width of the squares which represent the keys.(package private) int
Height of the squares which represent the keys.(package private) int
Size of the rotated square which stands for left-hand events.static String
Evident -
Constructor Summary
Constructors -
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 into a linear index.left_fingerChange
(int column, int row, int finger) Generate the svg code for silently changing the finger on a particular key.leftHand
(int column, int row) Generate the svg code for pressing a particular key without finger indication.leftHand
(int column, int row, int finger) Generate the svg code for pressing a particular key with a given finger.static void
Generate the svg source for printing the finger number.right_fingerChange
(int column, int row, int finger) Generate the svg code for silently changing the finger on a particular key.rightHand
(int column, int row) Generate the svg code for pressing a particular key without finger indication.rightHand
(int column, int row, int finger) Generate the svg code for pressing a particular key with a given finger.(package private) int
row2coord
(int row) Get the y coord of a given row number (from 1 to 8).static Graphics.rank[]
scaleToButtons
(Tabstaff.distance distance, int[] scaleDistances) Calculate the ranks of all squares to display (root, own, or foreign).svg_fullGrid
(Graphics.rank[] ranks) Construct the code for a complete key display.static String
svgStartTag
(float width, float height) Start tag which also gives the phyical size of the graphic.(package private) String
tie
(int column, int row) Generate an "arriving" tie symbol.
-
Field Details
-
linewidth_slim
int linewidth_slimBorder of squares representing keys which are not root. -
linewidth_fat
int linewidth_fatBorder of squares representing keys which are root. -
size_x
int size_xWidth of the squares which represent the keys. -
dist_x
int dist_xOffset between two adjacent squares which represent the keys. -
size_y
int size_yHeight of the squares which represent the keys. -
dist_y
int dist_yOffset between two adjacent squares which represent the keys. -
round_x
int round_xRadius of the ronded corner. -
round_y
int round_yRadius of the ronded corner. -
offset_x
int offset_xOffset from the start of graphic area to very first square which represents a key. -
offset_y
int offset_yOffset from the start of graphic area to very first square which represents a key. -
squareSize
int squareSizeSize of the rotated square which stands for left-hand events. -
circleRadius
int circleRadiusSize of the circle which stands for right-hand events. -
color_keypress
String color_keypressColor of all key-press symbols. -
xmlDeclaration
Evident
-
-
Constructor Details
-
Graphics
public Graphics()
-
-
Method Details
-
coord2index
public static int coord2index(int r, int c) Translate a coordinate pair 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!- Parameters:
distance
- how the leftmost key in each row is related to the leftmost key one row higher/lower.
-
svgStartTag
Start tag which also gives the phyical size of the graphic.- Parameters:
width
- ATTENTION in cm !?!?!?height
- ATTENTION in cm !?!?!?
-
col2coord
int col2coord(int column) Get the x coord of a given column number (from 1 to 8). -
row2coord
int row2coord(int row) Get the y coord of a given row number (from 1 to 8). -
svg_fullGrid
Construct the code for a complete key display. ATTENTION currently all sizes are given in "Pixel", mostly by INLINE constants. FIXME- Parameters:
ranks
- give how to paint the squares representing the keys at the coordinates from (1,1) (1,2) .. (1,8) (2,1) to (8,8)
-
rightHand
Generate the svg code for pressing a particular key without finger indication. -
rightHand
Generate the svg code for pressing a particular key with a given finger. -
right_fingerChange
Generate the svg code for silently changing the finger on a particular key. -
leftHand
Generate the svg code for pressing a particular key without finger indication. -
leftHand
Generate the svg code for pressing a particular key with a given finger. -
left_fingerChange
Generate the svg code for silently changing the finger on a particular key. -
tie
Generate an "arriving" tie symbol. This decorates silent fingerchange events. -
number
Generate the svg source for printing the finger number. -
main
- Throws:
IOException
-