|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.frinika.sequencer.gui.ItemPanel
public abstract class ItemPanel
Basis for PianoRoll and PartView We imagine the pianoRoll/trackView to be drawn on a large "virtualScreen" such that the origins (pitch=0,beat=0) coincide with (0,0) ItemPanel provides a view of this through itemViewRect.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected boolean |
altIsDown
|
protected boolean |
controlIsDown
|
protected boolean |
dragArmed
|
protected Item |
dragItem
|
protected int |
dragMode
|
protected ToolAdapter |
dragViewTool
|
protected ToolAdapter |
eraseTool
|
protected boolean |
isChanging
|
protected java.awt.Rectangle |
lastItemViewRect
|
static int |
OVER_ENVELOPE_GAIN
|
static int |
OVER_ENVELOPE_LEFT
|
static int |
OVER_ENVELOPE_RIGHT
|
static int |
OVER_ITEM_LEFT
|
static int |
OVER_ITEM_MIDDLE
|
static int |
OVER_ITEM_RIGHT
|
protected static int |
OVER_ITEM_TOP
|
static int |
OVER_NOTHING
|
protected ProjectContainer |
project
|
protected ToolAdapter |
rectZoomTool
|
protected ItemScrollPane |
scroller
|
protected ToolAdapter |
selectTool
|
protected FrinikaSequencer |
sequencer
|
protected int |
ticksPerBeat
|
protected boolean |
timeBased
|
protected ToolAdapter |
tool
|
protected javax.swing.JToolBar |
toolBar
|
double |
userToScreen
|
protected ToolAdapter |
writeTool
|
protected int |
xAnchor
|
protected int |
yAnchor
|
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.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 | |
---|---|
protected |
ItemPanel(ProjectContainer project,
ItemScrollPane scroller,
boolean hasTimeLine,
boolean canScrollY,
double ticksToScreen,
boolean sampleBased)
|
Method Summary | |
---|---|
void |
armDrag(java.awt.Point p,
Item item)
|
abstract void |
clientAddToSelection(Item item)
|
abstract void |
clientClearSelection()
Clears all items from the ItemPanels selection |
abstract void |
clientNotifySelectionChange()
|
abstract void |
clientRemoveFromSelection(Item item)
|
void |
componentHidden(java.awt.event.ComponentEvent arg0)
|
void |
componentMoved(java.awt.event.ComponentEvent arg0)
|
void |
componentResized(java.awt.event.ComponentEvent arg0)
|
void |
componentShown(java.awt.event.ComponentEvent arg0)
|
void |
copyImageToScreen(java.awt.Graphics g)
|
abstract void |
dragTo(java.awt.Point p)
|
abstract void |
endDrag()
This will be called when the mouse is released from a dragging operation |
abstract void |
erase(Item item)
|
void |
feedBack(Item item)
|
void |
followSong(boolean b)
|
abstract int |
getHoverStateAt(java.awt.Point p)
|
ProjectContainer |
getProjectContainer()
|
ItemScrollPane |
getScroller()
|
abstract double |
getSnapQuantization()
|
ToolAdapter |
getTool(java.lang.String name)
Get the tool associated with name. |
java.lang.String |
getToolTipText(java.awt.event.MouseEvent event)
|
java.awt.Rectangle |
getVirtualScreenRect()
|
ExtendingRangeModel |
getXRangeModel()
|
javax.swing.DefaultBoundedRangeModel |
getYRangeModel()
|
void |
ignorePartWarp(boolean b)
|
boolean |
isFollowSong()
|
boolean |
isRightButtonPressed()
|
abstract boolean |
isSnapQuantized()
|
abstract Item |
itemAt(java.awt.Point p)
|
void |
map(java.awt.Point point)
|
int |
mapX(int x)
|
void |
notifyTickPosition(long tick)
This method is called each time a new tick is played by the sequencer. |
void |
paintComponent(java.awt.Graphics g)
|
protected abstract void |
paintImageImpl(java.awt.Rectangle clipRect,
java.awt.Graphics2D g)
|
protected abstract void |
paintImageImplLabel(java.awt.Graphics2D graphics)
override this to draw on top of screen |
protected void |
paintImages()
paint the itemImage and timeLineImage. |
void |
paintTimeImpl(int xClip,
int widthClip,
java.awt.Graphics g1)
|
void |
paintTimeImplUser(int xClip,
int widthClip,
java.awt.Graphics g1)
|
boolean |
pointInTimeLine(int y)
|
protected void |
rebuildXScrollBars()
|
void |
rectZoomFinished()
|
void |
repaintItems()
flag reconstruction the image of the notes and request a repaint |
boolean |
requiresNotificationOnEachTick()
Your implementation should return true if your listener requires to be notified for each and every tick. |
abstract void |
rightButtonPressedOnItem(int x,
int y)
|
void |
scaleX(double fact)
This is called when the scale of painoRoll to screen mapping changes the sub class must workpout the new postion of all items. |
long |
screenToTickAbs(int x,
boolean quantizeMe)
Convert virtual screen x to a tick. |
long |
screenToTickAbs(int x,
boolean quantizeMe,
boolean drumMode)
Convert virtual screen x to a tick. |
long |
screenToTickRel(int x,
int dx,
boolean quantizeMe)
Convert delta on the virtual screen to a tick with optional quntization |
protected void |
scrollItemImageX()
|
protected void |
scrollItemImageY()
|
void |
scrollRectToVisible(java.awt.Rectangle r)
|
boolean |
scrollToContain(int x)
|
java.awt.Point |
scrollToContian(java.awt.Point p)
|
abstract void |
selectInRect(java.awt.Rectangle rect,
boolean shift)
Add items in the rectangle to the ItemPanels selection. |
void |
setAltState(boolean b)
|
void |
setControlState(boolean b)
method to let the ItemPanel know the state of the control key Look at controlIsDown field. |
void |
setDirty()
Force a complete redraw on next repaint(); |
void |
setDragMode(int mode)
|
abstract void |
setFocus(Item item)
|
void |
setIgnoreRepaints(boolean yes)
|
void |
setRightButton(boolean buttonState)
|
abstract void |
setSnapQuantization(double quant)
|
abstract void |
setSnapQuantized(boolean b)
|
abstract void |
setTimeAtX(int x)
|
void |
setTool(java.lang.String name)
|
void |
setToolBar(ItemRollToolBar bar)
|
void |
setX(int xNew)
Sets the x cordinate of the viewport on the items space. |
void |
setY(int yNew)
|
double |
userToScreen(double userTIme)
Convert time or tick to virtual screen x |
void |
writeDraggedAt(java.awt.Point p)
Notififiction that mouse has been drag during after a writeTool press. |
protected abstract void |
writePressedAt(java.awt.Point p)
|
protected abstract void |
writeReleasedAt(java.awt.Point p)
|
void |
zoomIn()
|
void |
zoomOut()
|
void |
zoomToRect(java.awt.Rectangle rect)
|
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int OVER_NOTHING
public static final int OVER_ITEM_MIDDLE
public static final int OVER_ITEM_RIGHT
public static final int OVER_ITEM_LEFT
protected static final int OVER_ITEM_TOP
public static final int OVER_ENVELOPE_LEFT
public static final int OVER_ENVELOPE_RIGHT
public static final int OVER_ENVELOPE_GAIN
protected java.awt.Rectangle lastItemViewRect
protected int ticksPerBeat
public double userToScreen
protected boolean timeBased
protected javax.swing.JToolBar toolBar
protected int xAnchor
protected int yAnchor
protected ItemScrollPane scroller
protected FrinikaSequencer sequencer
protected boolean dragArmed
protected int dragMode
protected ProjectContainer project
protected ToolAdapter selectTool
protected ToolAdapter eraseTool
protected ToolAdapter writeTool
protected ToolAdapter dragViewTool
protected ToolAdapter rectZoomTool
protected ToolAdapter tool
protected Item dragItem
protected boolean controlIsDown
protected boolean altIsDown
protected boolean isChanging
Constructor Detail |
---|
protected ItemPanel(ProjectContainer project, ItemScrollPane scroller, boolean hasTimeLine, boolean canScrollY, double ticksToScreen, boolean sampleBased)
Method Detail |
---|
public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
getToolTipText
in class javax.swing.JComponent
public ItemScrollPane getScroller()
public void componentHidden(java.awt.event.ComponentEvent arg0)
componentHidden
in interface java.awt.event.ComponentListener
public void componentMoved(java.awt.event.ComponentEvent arg0)
componentMoved
in interface java.awt.event.ComponentListener
public void componentResized(java.awt.event.ComponentEvent arg0)
componentResized
in interface java.awt.event.ComponentListener
public void componentShown(java.awt.event.ComponentEvent arg0)
componentShown
in interface java.awt.event.ComponentListener
protected abstract void writePressedAt(java.awt.Point p)
protected abstract void writeReleasedAt(java.awt.Point p)
public abstract void dragTo(java.awt.Point p)
public abstract void endDrag()
public java.awt.Rectangle getVirtualScreenRect()
public abstract Item itemAt(java.awt.Point p)
public int mapX(int x)
public void map(java.awt.Point point)
point
- public void notifyTickPosition(long tick)
SongPositionListener
notifyTickPosition
in interface SongPositionListener
public boolean scrollToContain(int x)
public void copyImageToScreen(java.awt.Graphics g)
protected abstract void paintImageImpl(java.awt.Rectangle clipRect, java.awt.Graphics2D g)
protected void paintImages()
protected abstract void paintImageImplLabel(java.awt.Graphics2D graphics)
graphics
- public void paintTimeImpl(int xClip, int widthClip, java.awt.Graphics g1)
public void paintTimeImplUser(int xClip, int widthClip, java.awt.Graphics g1)
public void scaleX(double fact)
public long screenToTickAbs(int x, boolean quantizeMe)
x
-
public long screenToTickAbs(int x, boolean quantizeMe, boolean drumMode)
x
-
public long screenToTickRel(int x, int dx, boolean quantizeMe)
x
- reference point to deduce bar boundariesdx
- screen delta to convert
public abstract double getSnapQuantization()
getSnapQuantization
in interface Snapable
public abstract boolean isSnapQuantized()
protected void scrollItemImageX()
protected void scrollItemImageY()
public void scrollRectToVisible(java.awt.Rectangle r)
scrollRectToVisible
in class javax.swing.JComponent
public java.awt.Point scrollToContian(java.awt.Point p)
public abstract void clientClearSelection()
public abstract void selectInRect(java.awt.Rectangle rect, boolean shift)
public void setIgnoreRepaints(boolean yes)
public void setX(int xNew)
xNew
- public void setY(int yNew)
public double userToScreen(double userTIme)
userTIme
-
public void zoomIn()
public void zoomOut()
public void zoomToRect(java.awt.Rectangle rect)
protected void rebuildXScrollBars()
public void setRightButton(boolean buttonState)
public boolean isRightButtonPressed()
public void followSong(boolean b)
b
- if true panel will auto scroll to follow sequencer
songPosition.public boolean isFollowSong()
public abstract void setTimeAtX(int x)
public boolean requiresNotificationOnEachTick()
SongPositionListener
requiresNotificationOnEachTick
in interface SongPositionListener
public boolean pointInTimeLine(int y)
public void setToolBar(ItemRollToolBar bar)
public void armDrag(java.awt.Point p, Item item)
public abstract void rightButtonPressedOnItem(int x, int y)
public abstract void clientAddToSelection(Item item)
public abstract void clientRemoveFromSelection(Item item)
public abstract void erase(Item item)
public void repaintItems()
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public void rectZoomFinished()
public abstract int getHoverStateAt(java.awt.Point p)
public void setDragMode(int mode)
public ProjectContainer getProjectContainer()
public void setTool(java.lang.String name)
public ToolAdapter getTool(java.lang.String name)
name
-
public void writeDraggedAt(java.awt.Point p)
p
- public abstract void setSnapQuantization(double quant)
setSnapQuantization
in interface Snapable
public void feedBack(Item item)
public abstract void setSnapQuantized(boolean b)
public void setControlState(boolean b)
public void setDirty()
public abstract void setFocus(Item item)
public void ignorePartWarp(boolean b)
public abstract void clientNotifySelectionChange()
public ExtendingRangeModel getXRangeModel()
public javax.swing.DefaultBoundedRangeModel getYRangeModel()
public void setAltState(boolean b)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |