|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel dguitar.gui.Bar dguitar.gui.BarMTP
This class extends Bar, and it holds a MeasureTrackPair. Music is represented usually as an array of Tracks and Measures Tracks are usually represented as rows. Measure are usually represtend as columns. A music track pair is the intersection of a row with a column.
Nested Class Summary | |
(package private) class |
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 | |
protected boolean |
addEONs
Are Effects On Note going to be added for the first time ? |
protected boolean |
addSilence
Are silences going to be added for the first time ? |
protected java.awt.Color |
colorNext
This is the color of the horizontal rhytm lina that goes forward to the Next beat |
protected java.awt.Color |
colorPrev
This is the color of the horizontal rhythm line that goes back to the Previous beat |
protected int |
fontAscent
The fontAscent of the Fret font |
protected int |
lastNumHLines
The last Number of Horinzontal rhythm lines that were draw. |
private int |
min_width
|
static int |
MIN_WIDTH
|
private GPDuration |
minDuration
|
protected GPMeasureTrackPair |
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 | |
BarMTP(DisplayOptions currentDisplayOptions,
BarPanel BP)
Creates a new instance of BarTablature, related the BarPanel BP |
Method Summary | |
protected abstract int |
calculateHeightOfString(int s)
|
private int |
calculateMinX()
|
protected int |
calculateWidth(int inc)
|
protected int |
calculateWidth(java.util.List beats)
|
protected int |
calculateWidthOfBeat(GPBeat beat)
|
private void |
commonConstructor()
|
java.util.List |
getBeats()
|
GPMeasureTrackPair |
getMeasureTrackPair()
|
MusicCursorPosition |
getMusicCursorPosition(int beat)
|
MusicCursorPosition |
getMusicCursorPosition(MusicCursor musicCursor)
Creates a musicCursorPosition for this Bar |
boolean |
hasBeats()
|
GPDuration |
minDurationOfBeats()
Gets the minDuration of a measure-track pair This method is used for proporcional spacing |
protected GPBeat |
nextBeat(java.util.List Beats,
int b,
int max)
|
protected void |
paintBeat(java.awt.Graphics g,
int currentX,
GPBeat beat,
GPBeat prev,
GPBeat next,
BarMTP.PaintedBeatInfo I)
paint a singleBeat, given the currentX position, beat, Nots and the noteIndex. is also uses the prev and next GPBeat |
protected void |
paintComponent(java.awt.Graphics gg)
Calls the UI delegate's paint method, if the UI delegate is non- null . |
protected abstract void |
paintEffects(java.awt.Graphics g,
int currentX,
int y,
GPEffectsOnNote EON,
int contEON,
GPBeat beat)
|
protected void |
paintMeasureTrackPair(java.awt.Graphics g)
This methods overrides the method of Bar and actually paints the frets Graphics g object that is passed has already a copy of the |
protected abstract 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 |
paintRhythm(java.awt.Graphics g,
int x,
int y,
GPBeat beat,
GPBeat prev,
GPBeat next)
paints the vertical and horizontal rhythm lines. |
protected abstract void |
paintRhythmHL(java.awt.Graphics g,
int x,
int lowest,
int n,
GPBeat prev)
|
protected abstract void |
paintSilence(java.awt.Graphics g,
int currentX,
GPBeat beat,
int contSilences)
|
void |
setMeasureTrackPair(GPMeasureTrackPair m)
|
void |
setMinDuration(GPDuration d)
|
void |
setMinWidth(int value)
|
MusicCursorPosition |
snapX(int xx,
MusicCursor musicCursor)
|
Methods inherited from class dguitar.gui.Bar |
equals, 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 |
protected boolean addSilence
protected boolean addEONs
protected int fontAscent
protected int lastNumHLines
protected java.awt.Color colorPrev
protected java.awt.Color colorNext
protected GPMeasureTrackPair mtp
private GPDuration minDuration
public static final int MIN_WIDTH
private int min_width
Constructor Detail |
public BarMTP(DisplayOptions currentDisplayOptions, BarPanel BP)
Method Detail |
private void commonConstructor()
public MusicCursorPosition getMusicCursorPosition(MusicCursor musicCursor)
getMusicCursorPosition
in class Bar
musicCursor
-
public MusicCursorPosition snapX(int xx, MusicCursor musicCursor)
snapX
in class Bar
public MusicCursorPosition getMusicCursorPosition(int beat)
getMusicCursorPosition
in class Bar
public GPMeasureTrackPair getMeasureTrackPair()
public void setMeasureTrackPair(GPMeasureTrackPair m)
public boolean hasBeats()
public java.util.List getBeats()
protected int calculateWidthOfBeat(GPBeat beat)
protected int calculateWidth(java.util.List beats)
protected int calculateWidth(int inc)
calculateWidth
in class Bar
public final GPDuration minDurationOfBeats()
protected abstract int calculateHeightOfString(int s)
protected abstract void paintRhythmHL(java.awt.Graphics g, int x, int lowest, int n, GPBeat prev)
protected abstract void paintNote(java.awt.Graphics g, int currentX, int y, GPNote note)
protected abstract void paintSilence(java.awt.Graphics g, int currentX, GPBeat beat, int contSilences)
protected abstract void paintEffects(java.awt.Graphics g, int currentX, int y, GPEffectsOnNote EON, int contEON, GPBeat beat)
protected final void paintRhythm(java.awt.Graphics g, int x, int y, GPBeat beat, GPBeat prev, GPBeat next)
protected final void paintBeat(java.awt.Graphics g, int currentX, GPBeat beat, GPBeat prev, GPBeat next, BarMTP.PaintedBeatInfo I)
protected final GPBeat nextBeat(java.util.List Beats, int b, int max)
private final int calculateMinX()
protected final void paintMeasureTrackPair(java.awt.Graphics g)
protected void paintComponent(java.awt.Graphics gg)
Bar
null
. We pass the delegate a copy of the
Graphics
object to protect the rest of the
paint code from irrevocable changes
(for example, Graphics.translate
).
if you override this in a subclass you should not make permanent
changes to the passed in Graphics
. for example, you
should not alter the clip Rectangle
or modify the
transform. if you need to do these operations you may find it
easier to create a new Graphics
from the passed in
Graphics
and manipulate it. Further, if you do not
invoker super's implementation you must honor the opaque property,
that is
if this component is opaque, you must completely fill in the background
in a non-opaque color. if you do not honor the opaque property you
will likely see visual artifacts.
paintComponent
in class Bar
gg
- the Graphics
object to protectComponent.paint(java.awt.Graphics)
public void setMinDuration(GPDuration d)
public void setMinWidth(int value)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |