dguitar.gui
Class BarTablature

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bydguitar.gui.Bar
                      extended bydguitar.gui.BarMTP
                          extended bydguitar.gui.BarTablature
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, OptionsDisplay, java.io.Serializable

public class BarTablature
extends BarMTP

This class extends BarMTP and display the notes using Guitar Tablature representation

Author:
Mauricio Gracia Gutiérrez
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class dguitar.gui.BarMTP
BarMTP.PaintedBeatInfo
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
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  java.util.List EONlabels
          a collection of Effects On Note Labels
private static int EONX
           
private  java.util.List SLabels
          a collection of SilenceLabelS
 
Fields inherited from class dguitar.gui.BarMTP
addEONs, addSilence, colorNext, colorPrev, fontAscent, lastNumHLines, MIN_WIDTH, mtp
 
Fields inherited from class dguitar.gui.Bar
BP, displayTimeSignature, isFirst, isLast, measure, minx, TS
 
Fields inherited from class javax.swing.JPanel
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
BarTablature(DisplayOptions dco, BarPanel BP)
          Creates a new instance of BarTablature, related the BarPanel BP
 
Method Summary
private  void addSilence(int currentX, GPDuration d)
          add a Silence simbol using the currentX position, and duration
protected  int calculateHeightOfString(int s)
          Calculate how High is a Instrument String located
private  void commonConstructor()
           
private  javax.swing.JLabel createLabelForIndex(int pos, int x, int y, GPEffectsOnNote EON, GPBeat beat)
           
private  void eonAdd(int currentX, int currentY, GPEffectsOnNote EON, GPBeat beat)
          add a Effect On Note using the currentX position, and duration
private  void eonLocate(javax.swing.JLabel EONLabel, int currentX, int currentY, GPEffectsOnNote EON, GPBeat beat)
          This method sets the position of a Effects on Note label
private  java.awt.Point eonPosition(GPEffectsOnNote EON, java.awt.Point current, java.awt.Dimension dim)
          Calculates the effects position.
 boolean equals(java.lang.Object o)
           
private  int index(GPBendType bendType)
           
private  int index(GPEffectsOnNote EON)
          Returns an index for a array given a Effects On Note
private  void locateSilence(javax.swing.JLabel SilenceLabel, int currentX)
          This method sets the position of the silence
protected  void paintEffects(java.awt.Graphics g, int currentX, int y, GPEffectsOnNote EON, int contEON, GPBeat beat)
           
protected  void paintNote(java.awt.Graphics g, int currentX, int y, GPNote note)
          This method paint the notes using g, currentX, y and a GPNote
protected  void paintRhythmHL(java.awt.Graphics g, int x, int lowest, int n, GPBeat prev)
          Paints the Rhytm Horizonal Lines
protected  void paintSilence(java.awt.Graphics g, int currentX, GPBeat beat, int contSilences)
          This method paints a Silence
private  int paintSpaceAroundFret(java.awt.Graphics g, java.lang.String aux, int x, int y)
          Fill a rectangle with the background color of the size of the text to be displayed
 
Methods inherited from class dguitar.gui.BarMTP
calculateWidth, calculateWidth, calculateWidthOfBeat, getBeats, getMeasureTrackPair, getMusicCursorPosition, getMusicCursorPosition, hasBeats, minDurationOfBeats, nextBeat, paintBeat, paintComponent, paintMeasureTrackPair, paintRhythm, setMeasureTrackPair, setMinDuration, setMinWidth, snapX
 
Methods inherited from class dguitar.gui.Bar
equalTimeSignature, getBottomOffset, getDisplayOptions, getExtendBottom, getExtendTop, getHeight, getMaximumSize, getMeasure, getMinimumSize, getPreferredSize, getTopOffset, getWidth, paintMeasure, setBottomOffset, setDisplayOptions, setExtendBottom, setExtendTop, setMeasure, setTopOffset
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EONX

private static final int EONX
See Also:
Constant Field Values

EONlabels

private java.util.List EONlabels
a collection of Effects On Note Labels


SLabels

private java.util.List SLabels
a collection of SilenceLabelS

Constructor Detail

BarTablature

public BarTablature(DisplayOptions dco,
                    BarPanel BP)
Creates a new instance of BarTablature, related the BarPanel BP

Method Detail

addSilence

private void addSilence(int currentX,
                        GPDuration d)
add a Silence simbol using the currentX position, and duration


calculateHeightOfString

protected int calculateHeightOfString(int s)
Calculate how High is a Instrument String located

Specified by:
calculateHeightOfString in class BarMTP

commonConstructor

private void commonConstructor()

createLabelForIndex

private javax.swing.JLabel createLabelForIndex(int pos,
                                               int x,
                                               int y,
                                               GPEffectsOnNote EON,
                                               GPBeat beat)

eonAdd

private void eonAdd(int currentX,
                    int currentY,
                    GPEffectsOnNote EON,
                    GPBeat beat)
add a Effect On Note using the currentX position, and duration


eonLocate

private void eonLocate(javax.swing.JLabel EONLabel,
                       int currentX,
                       int currentY,
                       GPEffectsOnNote EON,
                       GPBeat beat)
This method sets the position of a Effects on Note label


eonPosition

private java.awt.Point eonPosition(GPEffectsOnNote EON,
                                   java.awt.Point current,
                                   java.awt.Dimension dim)
Calculates the effects position.

Parameters:
EON - - The effects on note to be located
current - - the current position
dim - - the size of the Label that holds the EONicon
Returns:
a Point with the position.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class Bar

index

private int index(GPBendType bendType)

index

private int index(GPEffectsOnNote EON)
Returns an index for a array given a Effects On Note

Parameters:
EON -
Returns:
an index for a array given a Effects On Note

locateSilence

private void locateSilence(javax.swing.JLabel SilenceLabel,
                           int currentX)
This method sets the position of the silence


paintEffects

protected void paintEffects(java.awt.Graphics g,
                            int currentX,
                            int y,
                            GPEffectsOnNote EON,
                            int contEON,
                            GPBeat beat)
Specified by:
paintEffects in class BarMTP

paintNote

protected void paintNote(java.awt.Graphics g,
                         int currentX,
                         int y,
                         GPNote note)
This method paint the notes using g, currentX, y and a GPNote

Specified by:
paintNote in class BarMTP

paintRhythmHL

protected void paintRhythmHL(java.awt.Graphics g,
                             int x,
                             int lowest,
                             int n,
                             GPBeat prev)
Paints the Rhytm Horizonal Lines

Specified by:
paintRhythmHL in class BarMTP

paintSilence

protected void paintSilence(java.awt.Graphics g,
                            int currentX,
                            GPBeat beat,
                            int contSilences)
This method paints a Silence

Specified by:
paintSilence in class BarMTP

paintSpaceAroundFret

private int paintSpaceAroundFret(java.awt.Graphics g,
                                 java.lang.String aux,
                                 int x,
                                 int y)
Fill a rectangle with the background color of the size of the text to be displayed