|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
API that includes data transfer tools for songs and parts of songs.
This API is thread-safe and may be called from any thread.
Field Summary | |
static DataFlavor |
BLOCKLIST_FLAVOR
DataFlavor for a list of blocks |
static DataFlavor |
LINEFRAGMENT_FLAVOR
DataFlavor for a part of a line |
static DataFlavor |
LINELIST_FLAVOR
DataFlavor for a list of lines |
Method Summary | |
Transferable |
createBlockListTransferable(Song song,
Collection blocks,
ChordSet currentSet,
Variation variation,
boolean remove,
UndoableEditListener undoListener)
Create a Transferable for an ordered collection of blocks in a song |
Transferable |
createLineFragmentTransferable(SongLine line,
TextString startMember,
int startPos,
TextString endMember,
int endPos,
ChordSet currentSet,
boolean remove,
UndoableEditListener undoListener)
Create a Transferable for a fragment of a line |
Transferable |
createLineListTransferable(Song song,
Collection lines,
ChordSet currentSet,
boolean remove,
UndoableEditListener undoListener)
Create a Transferable for an ordered collection of lines in a song |
Transferable |
createTransferableForString(String str)
Create a Transferable given a string. |
Transferable |
getClipboardContents()
Get the current system clipboard contents. |
DataFlavor |
getFlavorOf(Transferable transferable,
DataFlavor preferred)
Get the flavor of the given transferable. |
DataFlavor |
getPasteType(Transferable transferable,
DataFlavor pasteContext)
Get the type of object that would be pasted given a transferable and a context. |
void |
pasteTransferable(Transferable transferable,
SongLine line,
TextString member,
int pos,
ChordSet chordSet,
Variation variation,
UndoableEditListener undoListener)
Paste the given transferable in the given position. |
void |
pasteTransferable(Transferable transferable,
SongLine line,
TextString startMember,
int startPos,
TextString endMember,
int endPos,
ChordSet chordSet,
Variation variation,
UndoableEditListener undoListener)
Paste the given transferable, replacing the given range. |
void |
pasteTransferableAfter(Transferable transferable,
SongBlock block,
SongLine line,
ChordSet chordSet,
Variation variation,
UndoableEditListener undoListener)
Paste the given transferable after the given line. |
void |
pasteTransferableAfter(Transferable transferable,
Song song,
SongBlock block,
ChordSet chordSet,
Variation variation,
UndoableEditListener undoListener)
Paste the given transferable after the given block. |
void |
setClipboardContents(Transferable transfer)
Set the current system clipboard contents. |
Field Detail |
public static final DataFlavor BLOCKLIST_FLAVOR
public static final DataFlavor LINELIST_FLAVOR
public static final DataFlavor LINEFRAGMENT_FLAVOR
Method Detail |
public void setClipboardContents(Transferable transfer)
transfer
- Transferable to setpublic Transferable getClipboardContents()
public Transferable createLineFragmentTransferable(SongLine line, TextString startMember, int startPos, TextString endMember, int endPos, ChordSet currentSet, boolean remove, UndoableEditListener undoListener)
line
- the containing SongLinestartMember
- the starting line member, or null to specify
the start of the linestartPos
- position within the starting line memberendMember
- the ending line member, or null to specify
the end of the lineendPos
- position within the ending line membercurrentSet
- current ChordSetremove
- true to remove the data from the lineundoListener
- listener for undo records. Ignored if remove is false.
IllegalArgumentException
public Transferable createLineListTransferable(Song song, Collection lines, ChordSet currentSet, boolean remove, UndoableEditListener undoListener)
song
- the song containing the blocks.lines
- ordered Collection of Line objects.currentSet
- current ChordSetremove
- true to remove the lines from the songundoListener
- listener for undo records. Ignored if remove is false.
IllegalArgumentException
- some lines are defunct or are not from the
given song.public Transferable createBlockListTransferable(Song song, Collection blocks, ChordSet currentSet, Variation variation, boolean remove, UndoableEditListener undoListener)
song
- the song containing the blocks.blocks
- ordered Collection of Block objects.currentSet
- current ChordSetvariation
- Variation to remove blocks fromremove
- true to remove the blocks from the songundoListener
- listener for undo records. Ignored if remove is false.
IllegalArgumentException
- some blocks are defunct or are not from the
given song.public Transferable createTransferableForString(String str)
str
- string to examine
public DataFlavor getFlavorOf(Transferable transferable, DataFlavor preferred)
transferable
- transferable to examinepreferred
- the preferred flavor, or null for no preference.
public DataFlavor getPasteType(Transferable transferable, DataFlavor pasteContext) throws CannotPasteException
transferable
- transferable to examinepasteContext
- the DataFlavor indicating where the user is pasting. Must be
LINFRAGMENT_FLAVOR, LINELIST_FLAVOR or BLOCKLIST_FLAVOR.
CannotPasteException
- the transferable doesn't provide a suitable flavorpublic void pasteTransferable(Transferable transferable, SongLine line, TextString member, int pos, ChordSet chordSet, Variation variation, UndoableEditListener undoListener) throws CannotPasteException
transferable
- transferable to pasteline
- line to paste intomember
- member containing the paste position. Null to paste at the beginningpos
- position within the memberchordSet
- ChordSet to use for the transferable's primary chords
if the destination song is not the same as the source song.variation
- variation to add blocks to, or null for the default variation.undoListener
- listener for undo records, or null to not generate edits
CannotPasteException
- the transferable doesn't provide a suitable flavorpublic void pasteTransferable(Transferable transferable, SongLine line, TextString startMember, int startPos, TextString endMember, int endPos, ChordSet chordSet, Variation variation, UndoableEditListener undoListener) throws CannotPasteException
transferable
- transferable to pasteline
- line to paste intostartMember
- Start of the range to replace. Null for the beginning of the linestartPos
- position within startMemberendMember
- End of the range to replace. Null for the end of the lineendPos
- position within endMemberchordSet
- ChordSet to use for the transferable's primary chords
if the destination song is not the same as the source song.variation
- variation to add blocks to, or null for the default variation.undoListener
- listener for undo records, or null to not generate edits
CannotPasteException
- the transferable doesn't provide a suitable flavorpublic void pasteTransferableAfter(Transferable transferable, SongBlock block, SongLine line, ChordSet chordSet, Variation variation, UndoableEditListener undoListener) throws CannotPasteException
transferable
- transferable to pasteblock
- block to paste intoline
- line to paste after, or null to paste at beginningchordSet
- ChordSet to use for the transferable's primary chords
if the destination song is not the same as the source song.variation
- variation to add blocks to, or null for the default variation.undoListener
- listener for undo records, or null to not generate edits
CannotPasteException
- the transferable doesn't provide a suitable flavorpublic void pasteTransferableAfter(Transferable transferable, Song song, SongBlock block, ChordSet chordSet, Variation variation, UndoableEditListener undoListener) throws CannotPasteException
transferable
- transferable to pastesong
- song to paste intoblock
- block to paste after, or null to paste at beginningchordSet
- ChordSet to use for the transferable's primary chords
if the destination song is not the same as the source song.variation
- variation to add blocks to, or null for the default variation.undoListener
- listener for undo records, or null to not generate edits
CannotPasteException
- the transferable doesn't provide a suitable flavor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |