Class CL_Editor
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
,org.openide.util.Lookup.Provider
Editor's lookup contains :
- editor's ActionMap
- edited ChordLeadSheet
- edited Song (container of the ChordLeadSheet if there is one)
- editor's Zoomable instances
- selected items or bars
The editor creates BarBoxes using a BarBoxConfig based on the editor's default config, and on the BarRenderer types obtained from the BarRendererProvider instances found in the global lookup.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
oldValue=old number of liens, newValue=new number of linesstatic final String
oldValue=old boolean, newValue=new booleanstatic final String
oldvalue=old nbCols, newValue=new nbCols.static final String
oldvalue=CLI_Section, newValue=new color.static final String
oldvalue=CLI_Section, newValue=new quantization value.static final String
oldvalue=CLI_Section, newValue=new boolean.Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
cleanup()
Clean up everything so component can be garbaged.abstract int
Get the number of lines of a bar annotation.abstract BarBoxConfig
getBarBoxConfig
(int barIndex) Get the BarBoxConfig of the specified bar.abstract Rectangle
getBarRectangle
(int barBoxIndex) Get the dimensions of the specified BarBox.abstract BarRendererFactory
The factory used by this editor via BarBoxes.abstract Quantization
getDisplayQuantizationValue
(CLI_Section section) abstract SelectedBar
getFocusedBar
(boolean includeFocusedItem) Get the focused SelectedBar, if any.abstract ChordLeadSheet
getModel()
abstract int
abstract int
abstract Position
getPositionFromPoint
(Point editorPoint) Return the Position that correspond to a graphical point in the editor.abstract Color
getSectionColor
(CLI_Section section) Get the color associated to a section.abstract CL_EditorSettings
The settings of the editor.abstract Song
abstract org.openide.awt.UndoRedo
abstract int
Get the zoom vertical factor.abstract boolean
Check if bar annotations are visible.abstract boolean
isSectionStartOnNewLine
(CLI_Section section) abstract void
makeBarVisible
(int barIndex) Make sure a specific bar is visible.abstract void
requestAttention
(ChordLeadSheetItem<?> item) Cause the renderer(s) of the specified item to do a brief UI change to request user attention.abstract void
selectBars
(int barIndexFrom, int barIndexTo, boolean b) Select the bars in the specified barIndex range.abstract void
selectBarsExcept
(int barIndexFrom, int barIndexTo, boolean b) Select the bars out of the specified barIndex range.abstract void
selectItem
(ChordLeadSheetItem<?> item, boolean b) Select the ItemRenderer(s) whose model is item.abstract void
selectItems
(List<? extends ChordLeadSheetItem> items, boolean b) Replace the current selection with the specified items.abstract void
setBarAnnotationNbLines
(int n) Set the number of lines of a bar annotation.abstract void
setBarAnnotationVisible
(boolean b) Set bar annotations visible or not.abstract void
setBarBoxConfig
(BarBoxConfig bbConfig, Integer... barIndexes) Set the BarBoxConfig for specified bars.abstract void
setDisplayQuantizationValue
(CLI_Section section, Quantization q) Set how chords positions are quantized for display.abstract void
abstract void
setFocusOnBar
(int barIndex) Set the focus on one bar in the editor.abstract void
setFocusOnItem
(ChordLeadSheetItem<?> item, IR_Type irClass) Set the focus on an ItemRenderer whose model is item.abstract void
setNbColumns
(int nbCols) abstract void
setSectionColor
(CLI_Section section, Color c) Set the color associated to a section.abstract void
setSectionStartOnNewLine
(CLI_Section section, boolean b) Set if the bar corresponding to specified section should start on a new line.abstract void
setZoomVFactor
(int factor) Set the zoom vertical factor.abstract void
showInsertionPoint
(boolean b, ChordLeadSheetItem<?> item, Position pos, boolean copyMode) Show an insertion point in the editor for copy/move operations.abstract void
showPlaybackPoint
(boolean b, Position pos) Show a playback point in the editor at specified position.void
Clear the editor selection.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
Methods 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, update
Methods 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, validate
Methods 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, transferFocusUpCycle
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.openide.util.Lookup.Provider
getLookup
-
Field Details
-
PROP_NB_COLUMNS
oldvalue=old nbCols, newValue=new nbCols.Note that the NbColumns setting is serialized via the ZoomHFactor.
- See Also:
-
PROP_SECTION_QUANTIZATION
oldvalue=CLI_Section, newValue=new quantization value.Don't change the String value, it's also used as client property name during CLI_Section serialization since JJazzLab 4.
- See Also:
-
PROP_SECTION_COLOR
oldvalue=CLI_Section, newValue=new color.Don't change the String value, it's also used as client property name during CLI_Section serialization since JJazzLab 4.
- See Also:
-
PROP_SECTION_START_ON_NEW_LINE
oldvalue=CLI_Section, newValue=new boolean.Don't change the String value, it's also used as client property name during CLI_Section serialization since JJazzLab 4.
- See Also:
-
PROP_BAR_ANNOTATION_VISIBLE
oldValue=old boolean, newValue=new booleanDon't change the String value, it's also used as a client property name during Song serialization since JJazzLab 4.
- See Also:
-
PROP_BAR_ANNOTATION_NB_LINES
oldValue=old number of liens, newValue=new number of linesDon't change the String value, it's also used as a client property name during Song serialization since JJazzLab 4.
- See Also:
-
-
Constructor Details
-
CL_Editor
public CL_Editor()
-
-
Method Details
-
setEditorMouseListener
-
getModel
- Returns:
- The ChordLeadSheet model for this CL_Editor.
-
getSongModel
- Returns:
- The Song which contains the ChordLeadSheet. Can be null.
-
getUndoManager
public abstract org.openide.awt.UndoRedo getUndoManager()- Returns:
- The UndoManager used but this editor.
-
getSettings
The settings of the editor.- Returns:
-
getBarRendererFactory
The factory used by this editor via BarBoxes.- Returns:
-
setDisplayQuantizationValue
Set how chords positions are quantized for display.Fires a property change event.
- Parameters:
q
-section
- If null, set the quantization display for all sections.- See Also:
-
#getSectionQuantizationPropertyName(org.jjazz.chordleadsheet.api.Section)
-
getDisplayQuantizationValue
- Parameters:
section
-- Returns:
- The quantization used to display the specified section.
-
getFocusedBar
Get the focused SelectedBar, if any.- Parameters:
includeFocusedItem
- If true and focus is on a ChordLeadSheetItem, return the SelectedBar for this item.- Returns:
- Can be null.
-
setSectionStartOnNewLine
Set if the bar corresponding to specified section should start on a new line.Fires a property change event.
- Parameters:
section
-b
-- See Also:
-
#getSectionOnNewLinePropertyName(org.jjazz.chordleadsheet.api.Section)
-
isSectionStartOnNewLine
- Parameters:
section
-- Returns:
- True if section bar should start on new line.
-
setSectionColor
Set the color associated to a section.Fires a property change event.
- Parameters:
section
- Must be one of the ColorSetManager reference colors.c
-- See Also:
-
#getSectionColorPropertyName(org.jjazz.chordleadsheet.api.Section)
-
getSectionColor
Get the color associated to a section.- Parameters:
section
-- Returns:
-
setBarBoxConfig
Set the BarBoxConfig for specified bars.- Parameters:
bbConfig
-barIndexes
- If no arg specified, apply bbConfig to all bars
-
getBarBoxConfig
Get the BarBoxConfig of the specified bar.- Parameters:
barIndex
-- Returns:
-
isBarAnnotationVisible
public abstract boolean isBarAnnotationVisible()Check if bar annotations are visible.- Returns:
-
setBarAnnotationVisible
public abstract void setBarAnnotationVisible(boolean b) Set bar annotations visible or not.Fire a PROP_BAR_ANNOTATIONS_VISIBLE change event.
- Parameters:
b
-
-
getBarAnnotationNbLines
public abstract int getBarAnnotationNbLines()Get the number of lines of a bar annotation.- Returns:
-
setBarAnnotationNbLines
public abstract void setBarAnnotationNbLines(int n) Set the number of lines of a bar annotation.Fire a PROP_BAR_ANNOTATIONS_NB_LINES change event.
- Parameters:
n
- A value between 1 and 10
-
setNbColumns
public abstract void setNbColumns(int nbCols) -
getNbColumns
public abstract int getNbColumns() -
getNbBarBoxes
public abstract int getNbBarBoxes() -
cleanup
public abstract void cleanup()Clean up everything so component can be garbaged. -
getPositionFromPoint
Return the Position that correspond to a graphical point in the editor.If point is on a model bar try to retrieve the beat value. If point is on a non-model bar (eg past end), return only the bar, beat is set to 0. If point is somewhere else return null.
- Parameters:
editorPoint
- A point in the editor's coordinates.- Returns:
- Null if point does not correspond to a barbox
-
makeBarVisible
public abstract void makeBarVisible(int barIndex) Make sure a specific bar is visible.- Parameters:
barIndex
- int The index of the bar to be made visible
-
setZoomVFactor
public abstract void setZoomVFactor(int factor) Set the zoom vertical factor.- Parameters:
factor
- A value between 0 and 100 included.
-
getZoomVFactor
public abstract int getZoomVFactor()Get the zoom vertical factor.- Returns:
- A value between 0 and 100 included.
-
selectBars
public abstract void selectBars(int barIndexFrom, int barIndexTo, boolean b) Select the bars in the specified barIndex range.- Parameters:
barIndexFrom
- intbarIndexTo
- intb
- True to select, False to unselect.
-
selectBarsExcept
public abstract void selectBarsExcept(int barIndexFrom, int barIndexTo, boolean b) Select the bars out of the specified barIndex range.- Parameters:
barIndexFrom
- intbarIndexTo
- intb
- True to select, False to unselect.
-
selectItem
Select the ItemRenderer(s) whose model is item.- Parameters:
item
-b
- True to select, False to unselect.
-
selectItems
Replace the current selection with the specified items.- Parameters:
items
-b
- True to select, False to unselect.
-
setFocusOnBar
public abstract void setFocusOnBar(int barIndex) Set the focus on one bar in the editor.- Parameters:
barIndex
- int The index of the bar.
-
setFocusOnItem
Set the focus on an ItemRenderer whose model is item.- Parameters:
item
-irClass
- the type of ItemRenderer to focus if there is multiple ItemRenderers for one item. If null, focus on the first ItemRenderer found.
-
requestAttention
Cause the renderer(s) of the specified item to do a brief UI change to request user attention.- Parameters:
item
-- Throws:
IllegalArgumentException
- If ChordLeadSheet model does not contain item.
-
showInsertionPoint
public abstract void showInsertionPoint(boolean b, ChordLeadSheetItem<?> item, Position pos, boolean copyMode) Show an insertion point in the editor for copy/move operations.- Parameters:
b
- Show/hide the insertion point. If false other arguments are not used.item
- The item for which we show the insertion point for.pos
- The position of the insertion point.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
-
-
getBarRectangle
Get the dimensions of the specified BarBox.- Parameters:
barBoxIndex
-- Returns:
- A Rectangle in the screen coordinates of this editor.
-
unselectAll
public void unselectAll()Clear the editor selection.
-