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.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringoldValue=old number of liens, newValue=new number of linesstatic final StringoldValue=old boolean, newValue=new booleanstatic final Stringoldvalue=old nbCols, newValue=new nbCols.static final Stringoldvalue=CLI_Section, newValue=new color.static final Stringoldvalue=CLI_Section, newValue=new quantization value.static final Stringoldvalue=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_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 intGet the number of lines of a bar annotation.abstract BarBoxConfiggetBarBoxConfig(int barIndex) Get the BarBoxConfig of the specified bar.abstract RectanglegetBarRectangle(int barBoxIndex) Get the dimensions of the specified BarBox.abstract BarRendererFactoryThe factory used by this editor via BarBoxes.abstract QuantizationgetDisplayQuantizationValue(CLI_Section section) abstract SelectedBargetFocusedBar(boolean includeFocusedItem) Get the focused SelectedBar, if any.abstract ChordLeadSheetgetModel()abstract intabstract intabstract PositiongetPositionFromPoint(Point editorPoint) Return the Position that correspond to a graphical point in the editor.abstract ColorgetSectionColor(CLI_Section section) Get the color associated to a section.abstract CL_EditorSettingsThe settings of the editor.abstract Songabstract org.openide.awt.UndoRedoabstract intGet the zoom vertical factor.abstract booleanCheck if bar annotations are visible.abstract booleanisSectionStartOnNewLine(CLI_Section section) abstract voidmakeBarVisible(int barIndex) Make sure a specific bar is visible.abstract voidrequestAttention(ChordLeadSheetItem<?> item) Cause the renderer(s) of the specified item to do a brief UI change to request user attention.abstract voidselectBars(int barIndexFrom, int barIndexTo, boolean b) Select the bars in the specified barIndex range.abstract voidselectBarsExcept(int barIndexFrom, int barIndexTo, boolean b) Select the bars out of the specified barIndex range.abstract voidselectItem(ChordLeadSheetItem<?> item, boolean b) Select the ItemRenderer(s) whose model is item.abstract voidselectItems(List<? extends ChordLeadSheetItem> items, boolean b) Replace the current selection with the specified items.abstract voidsetBarAnnotationNbLines(int n) Set the number of lines of a bar annotation.abstract voidsetBarAnnotationVisible(boolean b) Set bar annotations visible or not.abstract voidsetBarBoxConfig(BarBoxConfig bbConfig, Integer... barIndexes) Set the BarBoxConfig for specified bars.abstract voidsetDisplayQuantizationValue(CLI_Section section, Quantization q) Set how chords positions are quantized for display.abstract voidabstract voidsetFocusOnBar(int barIndex) Set the focus on one bar in the editor.abstract voidsetFocusOnItem(ChordLeadSheetItem<?> item, IR_Type irClass) Set the focus on an ItemRenderer whose model is item.abstract voidsetNbColumns(int nbCols) abstract voidsetSectionColor(CLI_Section section, Color c) Set the color associated to a section.abstract voidsetSectionStartOnNewLine(CLI_Section section, boolean b) Set if the bar corresponding to specified section should start on a new line.abstract voidsetZoomVFactor(int factor) Set the zoom vertical factor.abstract voidshowInsertionPoint(boolean b, ChordLeadSheetItem<?> item, Position pos, boolean copyMode) Show an insertion point in the editor for copy/move operations.abstract voidshowPlaybackPoint(boolean b, Position pos) Show a playback point in the editor at specified position.voidClear the editor 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_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.
-