|
|||||||||
| Home >> All >> org >> chordcast >> [ ui overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.chordcast.ui
Class Neck

java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel
org.chordcast.ui.Neck
- All Implemented Interfaces:
- javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.swing.SwingConstants
- public class Neck
- extends javax.swing.JLabel
The gui of a guitar neck.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JLabel |
javax.swing.JLabel.AccessibleJLabel |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
private javax.swing.border.TitledBorder |
border
|
private static int |
BOTTOM_MARGIN
|
private org.chordcast.data.Chord |
chord
|
private byte |
currentElement
|
private static double |
editableRatio
|
private static int |
ELEMENT_SIZE
|
private static java.awt.Font |
exportFont
|
private static double |
exportRatio
|
private static int |
FRET_SPACING
|
private static int |
HORIZONTAL_MARGIN
|
private boolean |
isEditable
|
private static java.awt.Font |
printFont
|
static java.awt.Color |
PRINTING_COLOR
|
private static double |
printRatio
|
static java.awt.Color |
SHOWING_COLOR
|
private static int |
STRING_SPACING
|
private static int |
TOP_MARGIN
|
private static java.awt.Font |
viewFont
|
private static double |
viewRatio
|
| Fields inherited from class javax.swing.JLabel |
labelFor |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
Neck(org.chordcast.data.Chord hisChord)
Initialize the Neck with hisChord value. |
|
| Method Summary | |
void |
changeBorder()
Permit to update the border and the startfret |
void |
changeDimension()
|
protected int |
findBlocOrigineX(int stringNB,
double ratio)
methods use to localise positions where to draw the elements |
protected int |
findBlocOrigineY(int fretNB,
double ratio)
methods use to localise positions where to draw the elements |
protected int |
findBlocRelativeX(int stringNB,
double ratio)
methods use to localise positions where to draw the elements |
org.chordcast.data.Chord |
getChord()
Return the Chord that the Neck represent. |
byte |
getCurrentElement()
Get the Current Element |
protected java.awt.Dimension |
getDimension(double ratio)
Get the dimension needed for the graphics with a specified ratio |
int |
getElementSize()
Get the ELEMENT_SIZE Size |
java.awt.Dimension |
getExportDimension()
Get the dimension needed for the graphics on which draw the chord img (to export as image file) |
java.awt.Font |
getExportFont()
|
double |
getExportRatio()
|
int |
getFretSpacing()
Return the distance between two fret |
int |
getHorizontalMargin()
Get the X start position of the Neck |
protected java.awt.Dimension |
getNormalDimension()
Get the dimension needed for the graphics with a ratio of 1d |
java.awt.Dimension |
getPrintDimension()
Get the dimension needed for the graphics on which draw the chord img (to print) |
java.awt.Font |
getPrintFont()
|
double |
getPrintRatio()
|
int |
getStringSpacing()
Return the distance between two string |
int |
getTopMargin()
Get the Y start position of the Neck |
java.awt.Dimension |
getViewDimension()
Get the dimension needed for the graphics on which draw the chord img (to show on the screen (as a component)) |
java.awt.Font |
getViewFont()
|
double |
getViewRatio()
|
protected void |
paintBARRED(java.awt.Graphics g,
int x,
int y,
int startX,
int startY,
double ratio)
Draw a "barred square" on the Neck at the specified position |
void |
paintBlankChord(java.awt.Graphics g,
int startX,
int startY,
double ratio)
Draw the Neck without elements |
void |
paintComponent(java.awt.Graphics g)
Paint the Neck |
protected void |
paintDOT(java.awt.Graphics g,
int x,
int y,
int startX,
int startY,
double ratio)
|
void |
paintImg(java.awt.Graphics g,
int startX,
int startY)
Draw the Chord on a graphic for generate images used in the html |
void |
paintItSelf(java.awt.Graphics g,
int startX,
int startY,
double ratio)
Séquential parsing of the Chord elements |
protected void |
paintIXE(java.awt.Graphics g,
int x,
int y,
int startX,
int startY,
double ratio)
Draw a X on the Neck at the specified position |
protected void |
paintSQUARE(java.awt.Graphics g,
int x,
int y,
int startX,
int startY,
double ratio)
|
protected void |
paintZERO(java.awt.Graphics g,
int x,
int y,
int startX,
int startY,
double ratio)
Draw a 0 on the Neck at the specified position |
void |
printImg(java.awt.Graphics g,
int startX,
int startY)
|
void |
setCurrentElement(byte elem)
Set the Current Element |
void |
setEditable(boolean editable)
|
void |
setExportFont(java.awt.Font newFont)
|
void |
setExportRatio(double newRatio)
|
void |
setPrintFont(java.awt.Font newFont)
|
void |
setPrintRatio(double newRatio)
|
void |
setViewFont(java.awt.Font newFont)
|
void |
setViewRatio(double newRatio)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
STRING_SPACING
private static final int STRING_SPACING
- See Also:
- Constant Field Values
FRET_SPACING
private static final int FRET_SPACING
- See Also:
- Constant Field Values
HORIZONTAL_MARGIN
private static final int HORIZONTAL_MARGIN
- See Also:
- Constant Field Values
TOP_MARGIN
private static final int TOP_MARGIN
- See Also:
- Constant Field Values
BOTTOM_MARGIN
private static final int BOTTOM_MARGIN
- See Also:
- Constant Field Values
ELEMENT_SIZE
private static final int ELEMENT_SIZE
- See Also:
- Constant Field Values
viewFont
private static java.awt.Font viewFont
printFont
private static java.awt.Font printFont
exportFont
private static java.awt.Font exportFont
viewRatio
private static double viewRatio
printRatio
private static double printRatio
exportRatio
private static double exportRatio
editableRatio
private static double editableRatio
isEditable
private boolean isEditable
currentElement
private byte currentElement
border
private javax.swing.border.TitledBorder border
chord
private final org.chordcast.data.Chord chord
SHOWING_COLOR
public static java.awt.Color SHOWING_COLOR
PRINTING_COLOR
public static java.awt.Color PRINTING_COLOR
| Constructor Detail |
Neck
public Neck(org.chordcast.data.Chord hisChord)
- Initialize the Neck with hisChord value.
| Method Detail |
setEditable
public void setEditable(boolean editable)
getNormalDimension
protected java.awt.Dimension getNormalDimension()
- Get the dimension needed for the graphics
with a ratio of 1d
getDimension
protected java.awt.Dimension getDimension(double ratio)
- Get the dimension needed for the graphics
with a specified ratio
getPrintDimension
public java.awt.Dimension getPrintDimension()
- Get the dimension needed for the graphics on which
draw the chord img (to print)
getExportDimension
public java.awt.Dimension getExportDimension()
- Get the dimension needed for the graphics on which
draw the chord img (to export as image file)
getViewDimension
public java.awt.Dimension getViewDimension()
- Get the dimension needed for the graphics on which
draw the chord img (to show on the screen (as a component))
getChord
public org.chordcast.data.Chord getChord()
- Return the Chord that the Neck represent.
getStringSpacing
public int getStringSpacing()
- Return the distance between two string
getFretSpacing
public int getFretSpacing()
- Return the distance between two fret
getHorizontalMargin
public int getHorizontalMargin()
- Get the X start position of the Neck
getTopMargin
public int getTopMargin()
- Get the Y start position of the Neck
getElementSize
public int getElementSize()
- Get the ELEMENT_SIZE Size
getCurrentElement
public byte getCurrentElement()
- Get the Current Element
setCurrentElement
public void setCurrentElement(byte elem)
- Set the Current Element
changeBorder
public void changeBorder()
- Permit to update the border and the startfret
changeDimension
public void changeDimension()
paintComponent
public void paintComponent(java.awt.Graphics g)
- Paint the Neck
printImg
public void printImg(java.awt.Graphics g, int startX, int startY)
paintImg
public void paintImg(java.awt.Graphics g, int startX, int startY)
- Draw the Chord on a graphic for generate images used in the html
paintItSelf
public void paintItSelf(java.awt.Graphics g, int startX, int startY, double ratio)
- Séquential parsing of the Chord elements
getViewRatio
public double getViewRatio()
setViewRatio
public void setViewRatio(double newRatio)
getExportRatio
public double getExportRatio()
setExportRatio
public void setExportRatio(double newRatio)
getPrintRatio
public double getPrintRatio()
setPrintRatio
public void setPrintRatio(double newRatio)
getViewFont
public java.awt.Font getViewFont()
setViewFont
public void setViewFont(java.awt.Font newFont)
getExportFont
public java.awt.Font getExportFont()
setExportFont
public void setExportFont(java.awt.Font newFont)
getPrintFont
public java.awt.Font getPrintFont()
setPrintFont
public void setPrintFont(java.awt.Font newFont)
paintDOT
protected void paintDOT(java.awt.Graphics g, int x, int y, int startX, int startY, double ratio)
paintSQUARE
protected void paintSQUARE(java.awt.Graphics g, int x, int y, int startX, int startY, double ratio)
paintBARRED
protected void paintBARRED(java.awt.Graphics g, int x, int y, int startX, int startY, double ratio)
- Draw a "barred square" on the Neck at the specified position
paintIXE
protected void paintIXE(java.awt.Graphics g, int x, int y, int startX, int startY, double ratio)
- Draw a X on the Neck at the specified position
paintZERO
protected void paintZERO(java.awt.Graphics g, int x, int y, int startX, int startY, double ratio)
- Draw a 0 on the Neck at the specified position
paintBlankChord
public void paintBlankChord(java.awt.Graphics g, int startX, int startY, double ratio)
- Draw the Neck without elements
findBlocOrigineX
protected int findBlocOrigineX(int stringNB,
double ratio)
- methods use to localise positions where to draw the elements
findBlocRelativeX
protected int findBlocRelativeX(int stringNB,
double ratio)
- methods use to localise positions where to draw the elements
findBlocOrigineY
protected int findBlocOrigineY(int fretNB,
double ratio)
- methods use to localise positions where to draw the elements
|
|||||||||
| Home >> All >> org >> chordcast >> [ ui overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC