Class Graphics

java.lang.Object
eu.bandm.music.applications.tabstaff.Graphics

public class Graphics extends Object
Generates a dynmic svg which executes the key presses and finger changes visually.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) static enum 
    Type of a key in the grid
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (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
    main(String[] args)
     
    number(int column, int row, int finger, String color)
    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).
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • linewidth_slim

      int linewidth_slim
      Border of squares representing keys which are not root.
    • linewidth_fat

      int linewidth_fat
      Border of squares representing keys which are root.
    • size_x

      int size_x
      Width of the squares which represent the keys.
    • dist_x

      int dist_x
      Offset between two adjacent squares which represent the keys.
    • size_y

      int size_y
      Height of the squares which represent the keys.
    • dist_y

      int dist_y
      Offset between two adjacent squares which represent the keys.
    • round_x

      int round_x
      Radius of the ronded corner.
    • round_y

      int round_y
      Radius of the ronded corner.
    • offset_x

      int offset_x
      Offset from the start of graphic area to very first square which represents a key.
    • offset_y

      int offset_y
      Offset from the start of graphic area to very first square which represents a key.
    • squareSize

      int squareSize
      Size of the rotated square which stands for left-hand events.
    • circleRadius

      int circleRadius
      Size of the circle which stands for right-hand events.
    • color_keypress

      String color_keypress
      Color of all key-press symbols.
    • xmlDeclaration

      public static String 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

      public static Graphics.rank[] scaleToButtons(Tabstaff.distance distance, int[] scaleDistances)
      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

      public static String svgStartTag(float width, float height)
      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

      public String svg_fullGrid(Graphics.rank[] ranks)
      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

      public String rightHand(int column, int row)
      Generate the svg code for pressing a particular key without finger indication.
    • rightHand

      public String rightHand(int column, int row, int finger)
      Generate the svg code for pressing a particular key with a given finger.
    • right_fingerChange

      public String right_fingerChange(int column, int row, int finger)
      Generate the svg code for silently changing the finger on a particular key.
    • leftHand

      public String leftHand(int column, int row)
      Generate the svg code for pressing a particular key without finger indication.
    • leftHand

      public String leftHand(int column, int row, int finger)
      Generate the svg code for pressing a particular key with a given finger.
    • left_fingerChange

      public String left_fingerChange(int column, int row, int finger)
      Generate the svg code for silently changing the finger on a particular key.
    • tie

      String tie(int column, int row)
      Generate an "arriving" tie symbol. This decorates silent fingerchange events.
    • number

      public String number(int column, int row, int finger, String color)
      Generate the svg source for printing the finger number.
    • main

      public static void main(String[] args) throws IOException
      Throws:
      IOException