Interface ChordLeadSheetItem<T>
- Type Parameters:
T
-
- All Superinterfaces:
Comparable<ChordLeadSheetItem<?>>
,Transferable
- All Known Subinterfaces:
CLI_BarAnnotation
,CLI_ChordSymbol
,CLI_Section
- All Known Implementing Classes:
ChordLeadSheetItem.DefaultComparableItem
,CLI_ChordSymbol.ComparableCsItem
Items which belong to a ChordLeadSheet.
PropertyChangeEvents are fired when an attribute is modified.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
An interface for items used only for position comparison purposes, when using the NavigableSet/SortedSet-based methods of ChordLeadSheet or ChordSequence.static class
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
default int
compareTo
(ChordLeadSheetItem<?> other) First compare using position, then use isBarSingleItem(), then use System.identifyHashCode().createItemFrom
(int bar) Create an item at the beginning of the specified bar for comparison purposes.createItemFrom
(Position pos, boolean inclusive) Create an item right before the specified position for comparison purposes.createItemTo
(int bar) Create an item at the end of the specified bar for comparison purposes.createItemTo
(Position pos, boolean inclusive) Create an item right after the specified position for comparison purposes.Get the client properties.Get the ChordLeadSheet this object belongs to.getCopy
(ChordLeadSheet newCls, Position newPos) Get a copy of this item at a specified position.getData()
Get the data part of this item.Get a copy of the position of this item.boolean
Return true if there can be only one single item perbar, like a time signature.void
Methods inherited from interface java.awt.datatransfer.Transferable
getTransferData, getTransferDataFlavors, isDataFlavorSupported
-
Field Details
-
PROP_CONTAINER
oldValue=old container, newValue=new container.- See Also:
-
PROP_ITEM_DATA
oldValue=old data, newValue=new data.- See Also:
-
PROP_ITEM_POSITION
oldValue=old position, newValue=new position.- See Also:
-
-
Method Details
-
getContainer
ChordLeadSheet getContainer()Get the ChordLeadSheet this object belongs to.- Returns:
- Can be null.
-
getData
T getData()Get the data part of this item.- Returns:
-
getPosition
Position getPosition()Get a copy of the position of this item.- Returns:
-
getCopy
Get a copy of this item at a specified position.Client properties are also copied.
- Parameters:
newCls
- If null, the copy will have the same container that this object.newPos
- If null, the copy will have the same position that this object.- Returns:
-
isBarSingleItem
boolean isBarSingleItem()Return true if there can be only one single item perbar, like a time signature.- Returns:
-
getClientProperties
StringProperties getClientProperties()Get the client properties.- Returns:
-
compareTo
First compare using position, then use isBarSingleItem(), then use System.identifyHashCode().Performs a special handling for ComparableItems.
- Specified by:
compareTo
in interfaceComparable<T>
- Parameters:
other
-- Returns:
- 0 only if this == other, so that comparison is consistent with equals().
-
addPropertyChangeListener
-
removePropertyChangeListener
-
createItemTo
Create an item right after the specified position for comparison purposes.For the Comparable interface, any item whose position is before (or equal if inclusive is true) to pos will be considered BEFORE the returned item.
- Parameters:
pos
-inclusive
-- Returns:
-
createItemTo
Create an item at the end of the specified bar for comparison purposes.For the Comparable interface, any normal item in the bar will be considered BEFORE the returned item.
- Parameters:
bar
-- Returns:
-
createItemFrom
Create an item right before the specified position for comparison purposes.For the Comparable interface, any item whose position is after (or equal if inclusive is true) to pos will be considered AFTER the returned item.
- Parameters:
pos
-inclusive
-- Returns:
-
createItemFrom
Create an item at the beginning of the specified bar for comparison purposes.For the Comparable interface, any normal item in the bar will be considered AFTER the returned item.
- Parameters:
bar
-- Returns:
-