Package org.jjazz.ss_editor.api
Class SS_Editor
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.jjazz.ss_editor.api.SS_Editor
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible,org.openide.util.Lookup.Provider
A SongStructure editor.
Its Lookup must contain :
- editor's ActionMap
- edited SongStructure
- edited Song (container of the SongStructure if there is one)
- the selected SongParts or RhythmParameters.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringoldValue=rhythm, newValue=list of visible RPs in compact view modestatic final StringoldValue=old mode, newValue=new mode.static final StringoldValue=rhythm, newValue=list of currently visible RPsFields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidcleanup()Clean up everything so component can be garbaged.abstract List<RhythmParameter<?>>Get visible RPs in compact view mode for the specified rhythm.abstract SongPartgetFocusedSongPart(boolean includeFocusedRhythmParameter) Get the focused SongPart, if any.abstract SongStructuregetModel()abstract RectanglegetRpViewerRectangle(SongPart spt, RhythmParameter<?> rp) Get the bounds of the component representing the specified RhythmParameter.abstract SS_EditorSettingsabstract Songabstract SongPartParametergetSongPartParameterFromPoint(Point editorPoint, AtomicBoolean sptLeft) Return the SongPart/RhythmParameter corresponding to a graphical point.abstract RectangleGet the bounds of the component representing the specified SongPart.abstract SptViewerFactoryabstract org.openide.awt.UndoRedoabstract SS_Editor.ViewModeGet the view mode.abstract List<RhythmParameter<?>>The rhythm parameters effectively displayed in the editor for a specific rhythm.abstract intabstract intabstract voidTry to scroll so that the specified song part becomes visible.abstract voidselectRhythmParameter(SongPart spt, RhythmParameter<?> rp, boolean b) Select a specific RhythmParameter.abstract voidselectSongPart(SongPart spt, boolean b) Select a songpart.abstract voidsetCompactViewRPs(Rhythm r, List<RhythmParameter<?>> rps) Set visible RPs in compact view mode for the specified rhythm.abstract voidsetController(SS_EditorMouseListener controller) abstract voidsetFocusOnRhythmParameter(SongPart spt, RhythmParameter<?> rp) Set the focus on a specific RhythmParameter.abstract voidSet the focus on a specific SongPart.abstract voidSet view mode.abstract voidsetZoomHFactor(int hfactor) Set the horizontal zoom factor.abstract voidsetZoomHFactorToFitWidth(int width) Adjust the horizontal zoom factor to try to fit all the SongParts in the specified width.abstract voidsetZoomVFactor(int vfactor) Set the vertical zoom factor.abstract voidshowPlaybackPoint(boolean b, Position pos) Show a playback point in the editor at specified position.abstract voidshowSptInsertionMark(boolean b, int sptIndex, boolean copyMode) Show an insertion mark in the editor for SongPart copy/move operations.voidClear selection.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openide.util.Lookup.Provider
getLookup
-
Field Details
-
PROP_EDITOR_VIEW_MODE
oldValue=old mode, newValue=new mode.- See Also:
-
PROP_COMPACT_VIEW_MODE_VISIBLE_RPS
oldValue=rhythm, newValue=list of visible RPs in compact view mode- See Also:
-
PROP_RHYHM_VISIBLE_RPS
oldValue=rhythm, newValue=list of currently visible RPs- See Also:
-
-
Constructor Details
-
SS_Editor
public SS_Editor()
-
-
Method Details
-
getModel
-
getSongModel
- Returns:
- The Song which contains the SongStructure model. Can be null.
-
getUndoManager
public abstract org.openide.awt.UndoRedo getUndoManager()- Returns:
- The UndoManager used but this editor.
-
getSettings
-
getSptViewerRendererFactory
-
setController
-
cleanup
public abstract void cleanup()Clean up everything so component can be garbaged. -
setZoomHFactor
public abstract void setZoomHFactor(int hfactor) Set the horizontal zoom factor.- Parameters:
hfactor- An int value between 0 and 100.
-
getZoomHFactor
public abstract int getZoomHFactor() -
setZoomHFactorToFitWidth
public abstract void setZoomHFactorToFitWidth(int width) Adjust the horizontal zoom factor to try to fit all the SongParts in the specified width.- Parameters:
width-
-
setZoomVFactor
public abstract void setZoomVFactor(int vfactor) Set the vertical zoom factor.- Parameters:
vfactor- An int value between 0 and 100.
-
getZoomVFactor
public abstract int getZoomVFactor() -
selectSongPart
Select a songpart.- Parameters:
spt-b-
-
selectRhythmParameter
Select a specific RhythmParameter.- Parameters:
spt-rp-b- True to select, False to unselect.
-
setFocusOnSongPart
Set the focus on a specific SongPart.- Parameters:
spt- The SongPart to be focused.
-
setFocusOnRhythmParameter
Set the focus on a specific RhythmParameter.- Parameters:
spt-rp-
-
showSptInsertionMark
public abstract void showSptInsertionMark(boolean b, int sptIndex, boolean copyMode) Show an insertion mark in the editor for SongPart copy/move operations.- Parameters:
b- Show/hide the insertion point.sptIndex- The SongPart index where insertion will be made.copyMode- If true insertion point is shown for a copy operation, otherwise it's a move operation.
-
showPlaybackPoint
Show a playback point in the editor at specified position.- Parameters:
b- Show/hide the playback point.pos- The position in the SongStructure model.
-
getSongPartParameterFromPoint
public abstract SongPartParameter getSongPartParameterFromPoint(Point editorPoint, AtomicBoolean sptLeft) Return the SongPart/RhythmParameter corresponding to a graphical point.If we're not on a RhythmParameter, only the x coordinate is evaluated to find the right SongPart. If we're on the right of the last SongPart we return the last SongPart (with sptLeft false). If there is no SongPart, return null values for both spt and rp.
- Parameters:
editorPoint-sptLeft- Used to return an indicator if point was on the left or right side of the songpart- Returns:
-
getSptViewerRectangle
Get the bounds of the component representing the specified SongPart.- Parameters:
spt-- Returns:
- The bounds in the screen coordinates space.
-
getRpViewerRectangle
Get the bounds of the component representing the specified RhythmParameter.- Parameters:
spt-rp-- Returns:
- The bounds in the screen coordinates space.
-
makeSptViewerVisible
Try to scroll so that the specified song part becomes visible.- Parameters:
spt-
-
getViewMode
Get the view mode.- Returns:
- Can't be null
-
setViewMode
Set view mode.Fire a PROP_EDITOR_VIEW_MODE change event.
- Parameters:
mode-
-
getCompactViewRPs
Get visible RPs in compact view mode for the specified rhythm.Fire a PROP_VISIBLE_RPS change event.
- Parameters:
r-- Returns:
-
setCompactViewRPs
Set visible RPs in compact view mode for the specified rhythm.Fire a PROP_COMPACT_VISIBLE_RPS change event.
- Parameters:
r-rps-
-
getVisibleRps
The rhythm parameters effectively displayed in the editor for a specific rhythm.- Parameters:
r-- Returns:
- A non-empty list.
-
getFocusedSongPart
Get the focused SongPart, if any.- Parameters:
includeFocusedRhythmParameter- If true and focus is on a RhythmParameter editor, return the SongPart for this RhythmParameter editor.- Returns:
- Can be null. The SongPart corresponding to the SongPart editor.
-
unselectAll
public void unselectAll()Clear selection.
-