dguitar.gui
Class TrackPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JLayeredPane
                  extended bydguitar.gui.TrackPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.io.Serializable

public class TrackPanel
extends javax.swing.JLayeredPane
implements java.awt.event.MouseListener

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

Nested Class Summary
 
Nested classes inherited from class javax.swing.JLayeredPane
javax.swing.JLayeredPane.AccessibleJLayeredPane
 
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  boolean changed
           
private  java.awt.Dimension clefSize
           
private static java.lang.Integer CURSOR_LAYER
           
protected  DisplayOptions displayOptions
           
private  GPTrack gpTrack
           
private  int leftMargin
           
private  boolean musicCursorsProcesingEvents
           
private  int numBars
           
private  int rightMargin
           
private  int spaceBCBP
           
private  MusicCursor tablatureMusicCursor
           
private  BarPanel TablaturePanel
           
private  javax.swing.JLabel TrebleLabel
           
 
Fields inherited from class javax.swing.JLayeredPane
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER
 
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
TrackPanel()
          Creates a new instance of TrackPanel
TrackPanel(DisplayOptions currentDisplayOptions, MusicCursorPosition aMusicCursorPosition)
           
 
Method Summary
 void addBar(int n)
           
 void addTablatureBar(int n)
           
private  void arrange()
           
 int getLeftMargin()
           
 java.awt.Dimension getMinimumSize()
          Gets the mininimum size of this component.
 int getNoteSpacing()
           
 int getNumBars()
           
 java.awt.Dimension getPreferredSize()
          Gets the preferred size of this component.
 BarMTP getTablatureBar(int measure)
           
 boolean hasChanged()
           
private  void initComponents()
           
 boolean isMusicCursorsProcesingEvents()
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void setLeftMargin(int newx)
           
 void setMeasures(java.util.List Measures)
           
 void setMeasureTrackPair(int measure, GPMeasureTrackPair mtp)
           
 void setMusicCursor(int measure, int measurePrev, boolean scroll)
           
 void setMusicCursorSingleColor(boolean singleColor)
           
 void setMusicCursorsProcesingEvents(boolean musicCursorsProcesingEvents)
           
 void setMusicCursorsVisible(boolean value)
           
 void setNoteSpacing(int ns)
           
 void setTrack(GPTrack t)
           
 java.lang.String toString()
           
 void updateMusicCursor(java.awt.event.MouseEvent e)
           
 void validate()
          Validates this container and all of its subcomponents.
 
Methods inherited from class javax.swing.JLayeredPane
addImpl, getAccessibleContext, getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, paramString, putLayer, remove, setLayer, setLayer, setPosition
 
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, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, 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, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, 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, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

leftMargin

private int leftMargin

rightMargin

private int rightMargin

TrebleLabel

private javax.swing.JLabel TrebleLabel

changed

private boolean changed

TablaturePanel

private BarPanel TablaturePanel

numBars

private int numBars

clefSize

private java.awt.Dimension clefSize

spaceBCBP

private int spaceBCBP

displayOptions

protected DisplayOptions displayOptions

tablatureMusicCursor

private MusicCursor tablatureMusicCursor

CURSOR_LAYER

private static java.lang.Integer CURSOR_LAYER

gpTrack

private GPTrack gpTrack

musicCursorsProcesingEvents

private boolean musicCursorsProcesingEvents
Constructor Detail

TrackPanel

public TrackPanel()
Creates a new instance of TrackPanel


TrackPanel

public TrackPanel(DisplayOptions currentDisplayOptions,
                  MusicCursorPosition aMusicCursorPosition)
Method Detail

arrange

private void arrange()

initComponents

private void initComponents()

setMeasures

public void setMeasures(java.util.List Measures)

setMeasureTrackPair

public void setMeasureTrackPair(int measure,
                                GPMeasureTrackPair mtp)

setMusicCursor

public void setMusicCursor(int measure,
                           int measurePrev,
                           boolean scroll)

getTablatureBar

public BarMTP getTablatureBar(int measure)

addTablatureBar

public void addTablatureBar(int n)

addBar

public void addBar(int n)

getNumBars

public int getNumBars()

hasChanged

public boolean hasChanged()

getMinimumSize

public java.awt.Dimension getMinimumSize()
Gets the mininimum size of this component.

Returns:
a dimension object indicating this component's minimum size

getPreferredSize

public java.awt.Dimension getPreferredSize()
Gets the preferred size of this component.

Returns:
a dimension object indicating this component's preferred size

getLeftMargin

public int getLeftMargin()

setLeftMargin

public void setLeftMargin(int newx)

validate

public void validate()
Validates this container and all of its subcomponents.

The validate method is used to cause a container to lay out its subcomponents again. It should be invoked when this container's subcomponents are modified (added to or removed from the container, or layout-related information changed) after the container has been displayed.

See Also:
Container.add(java.awt.Component), JComponent.revalidate()

setNoteSpacing

public void setNoteSpacing(int ns)

getNoteSpacing

public int getNoteSpacing()

setTrack

public void setTrack(GPTrack t)

setMusicCursorSingleColor

public void setMusicCursorSingleColor(boolean singleColor)

updateMusicCursor

public void updateMusicCursor(java.awt.event.MouseEvent e)

setMusicCursorsProcesingEvents

public void setMusicCursorsProcesingEvents(boolean musicCursorsProcesingEvents)
Parameters:
musicCursorsProcesingEvents - The musicCursorsProcesingEvents to set.

setMusicCursorsVisible

public void setMusicCursorsVisible(boolean value)

isMusicCursorsProcesingEvents

public boolean isMusicCursorsProcesingEvents()
Returns:
Returns the musicCursorsProcesingEvents.

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

toString

public java.lang.String toString()