Package org.jjazz.cl_editor.api
Class CopyBuffer
java.lang.Object
org.jjazz.cl_editor.api.CopyBuffer
Singleton class to manage ChordLeadSheetItems and Bars for copy/paste operations. There are 2 modes of copy, ItemMode and
BarMode.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
barModeCopy
(List<ChordLeadSheetItem> items, int fromBarIndex, int toBarIndex) Put a copy of each item in the buffer in BarModevoid
clear()
int
int
static CopyBuffer
getItemsCopy
(ChordLeadSheet targetCls, int targetBarIndex) Return a copy of the items in the buffer adjusted to targetBarIndex and with the specified container.int
getSize()
boolean
boolean
isEmpty()
void
itemModeCopy
(List<? extends ChordLeadSheetItem> items) Put items in the buffer in ItemMode.
-
Method Details
-
getInstance
-
itemModeCopy
Put items in the buffer in ItemMode.- Parameters:
items
-
-
barModeCopy
Put a copy of each item in the buffer in BarMode- Parameters:
items
-fromBarIndex
-toBarIndex
-
-
clear
public void clear() -
getSize
public int getSize()- Returns:
- int The size of ChordLeadSheetItems in the buffer.
-
isBarCopyMode
public boolean isBarCopyMode() -
getBarMinIndex
public int getBarMinIndex() -
getBarMaxIndex
public int getBarMaxIndex() -
isEmpty
public boolean isEmpty() -
getItemsCopy
Return a copy of the items in the buffer adjusted to targetBarIndex and with the specified container.In ItemMode, the items are shitfed so the first item start at targetBarIndex. In BarMode, the items are shifted so that getBarMinIndex() match targetBarIndex.
- Parameters:
targetCls
- The container of the new items. If null container is not changed.targetBarIndex
- The barIndex where items are copied to. If barIndex<0, positions are not changed. @return- Returns:
-