Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.virtuosotechnologies.asaph.modelutils
Class DataTransferUtilsImpl  view DataTransferUtilsImpl download DataTransferUtilsImpl.java

java.lang.Object
  extended bycom.virtuosotechnologies.asaph.modelutils.DataTransferUtilsImpl
All Implemented Interfaces:
DataTransferUtils

class DataTransferUtilsImpl
extends java.lang.Object
implements DataTransferUtils

Implementation of DataTransferUtils API


Field Summary
private  java.awt.datatransfer.Clipboard clipboard_
           
private  java.awt.datatransfer.ClipboardOwner clipboardOwner_
           
private  com.virtuosotechnologies.asaph.model.Song curClipboardContentsSong_
           
private  com.virtuosotechnologies.asaph.notationmanager.NotationManager notationManager_
           
private  SongUtilsImpl songUtils_
           
 
Fields inherited from interface com.virtuosotechnologies.asaph.modelutils.DataTransferUtils
API_NAME, BLOCKLIST_FLAVOR, LINEFRAGMENT_FLAVOR, LINELIST_FLAVOR
 
Constructor Summary
(package private) DataTransferUtilsImpl(com.virtuosotechnologies.asaph.notationmanager.NotationManager notationManager)
           
 
Method Summary
 java.awt.datatransfer.Transferable createBlockListTransferable(com.virtuosotechnologies.asaph.model.Song song, java.util.Collection blocks, com.virtuosotechnologies.asaph.model.ChordSet currentSet, com.virtuosotechnologies.asaph.model.Variation variation, boolean remove, javax.swing.event.UndoableEditListener undoListener)
          Create a Transferable for an ordered collection of blocks in a song
private  com.virtuosotechnologies.asaph.modelutils.impl.LineFragmentData createLineFragment(com.virtuosotechnologies.asaph.model.SongLine line, com.virtuosotechnologies.asaph.model.StringSongLineMember startMember, int startPos, com.virtuosotechnologies.asaph.model.StringSongLineMember endMember, int endPos, com.virtuosotechnologies.asaph.model.ChordSet currentSet, boolean remove, javax.swing.event.UndoableEditListener undoListener)
           
 java.awt.datatransfer.Transferable createLineFragmentTransferable(com.virtuosotechnologies.asaph.model.SongLine line, com.virtuosotechnologies.asaph.model.StringSongLineMember startMember, int startPos, com.virtuosotechnologies.asaph.model.StringSongLineMember endMember, int endPos, com.virtuosotechnologies.asaph.model.ChordSet currentSet, boolean remove, javax.swing.event.UndoableEditListener undoListener)
          Create a Transferable for a fragment of a line
 java.awt.datatransfer.Transferable createLineListTransferable(com.virtuosotechnologies.asaph.model.Song song, java.util.Collection lines, com.virtuosotechnologies.asaph.model.ChordSet currentSet, boolean remove, javax.swing.event.UndoableEditListener undoListener)
          Create a Transferable for an ordered collection of lines in a song
 java.awt.datatransfer.Transferable createTransferableForString(java.lang.String str)
          Create a Transferable given a string.
 java.awt.datatransfer.Transferable getClipboardContents()
          Get the current system clipboard contents.
 java.awt.datatransfer.DataFlavor getFlavorOf(java.awt.datatransfer.Transferable transferable, java.awt.datatransfer.DataFlavor preferred)
          Get the flavor of the given transferable.
 java.awt.datatransfer.DataFlavor getPasteType(java.awt.datatransfer.Transferable transferable, java.awt.datatransfer.DataFlavor pasteContext)
          Get the type of object that would be pasted given a transferable and a context.
private  void insertBlockListAfter(com.virtuosotechnologies.asaph.modelutils.impl.BlockListData data, com.virtuosotechnologies.asaph.model.Song song, com.virtuosotechnologies.asaph.model.SongBlock block, boolean sameSong, com.virtuosotechnologies.asaph.model.ChordSet chordSet, com.virtuosotechnologies.asaph.model.Variation variation, javax.swing.event.UndoableEditListener undoListener)
           
private  void insertLineFragmentAt(com.virtuosotechnologies.asaph.modelutils.impl.LineFragmentData data, com.virtuosotechnologies.asaph.model.SongLine line, com.virtuosotechnologies.asaph.model.StringSongLineMember member, int pos, boolean sameSong, com.virtuosotechnologies.asaph.model.ChordSet chordSet, javax.swing.event.UndoableEditListener undoListener)
           
private  void insertLineListAfter(com.virtuosotechnologies.asaph.modelutils.impl.LineListData data, com.virtuosotechnologies.asaph.model.SongBlock block, com.virtuosotechnologies.asaph.model.SongLine line, boolean sameSong, com.virtuosotechnologies.asaph.model.ChordSet chordSet, javax.swing.event.UndoableEditListener undoListener)
           
 void pasteTransferable(java.awt.datatransfer.Transferable transferable, com.virtuosotechnologies.asaph.model.SongLine line, com.virtuosotechnologies.asaph.model.StringSongLineMember member, int pos, com.virtuosotechnologies.asaph.model.ChordSet chordSet, com.virtuosotechnologies.asaph.model.Variation variation, javax.swing.event.UndoableEditListener undoListener)
          Paste the given transferable in the given position.
 void pasteTransferable(java.awt.datatransfer.Transferable transferable, com.virtuosotechnologies.asaph.model.SongLine line, com.virtuosotechnologies.asaph.model.StringSongLineMember startMember, int startPos, com.virtuosotechnologies.asaph.model.StringSongLineMember endMember, int endPos, com.virtuosotechnologies.asaph.model.ChordSet chordSet, com.virtuosotechnologies.asaph.model.Variation variation, javax.swing.event.UndoableEditListener undoListener)
          Paste the given transferable, replacing the given range.
 void pasteTransferableAfter(java.awt.datatransfer.Transferable transferable, com.virtuosotechnologies.asaph.model.SongBlock block, com.virtuosotechnologies.asaph.model.SongLine line, com.virtuosotechnologies.asaph.model.ChordSet chordSet, com.virtuosotechnologies.asaph.model.Variation variation, javax.swing.event.UndoableEditListener undoListener)
          Paste the given transferable after the given line.
 void pasteTransferableAfter(java.awt.datatransfer.Transferable transferable, com.virtuosotechnologies.asaph.model.Song song, com.virtuosotechnologies.asaph.model.SongBlock block, com.virtuosotechnologies.asaph.model.ChordSet chordSet, com.virtuosotechnologies.asaph.model.Variation variation, javax.swing.event.UndoableEditListener undoListener)
          Paste the given transferable after the given block.
private  void pasteTransferableImpl(java.awt.datatransfer.Transferable transferable, com.virtuosotechnologies.asaph.model.SongLine line, com.virtuosotechnologies.asaph.model.StringSongLineMember member, int pos, boolean delete, com.virtuosotechnologies.asaph.model.StringSongLineMember startMember, int startPos, com.virtuosotechnologies.asaph.model.StringSongLineMember endMember, int endPos, com.virtuosotechnologies.asaph.model.ChordSet chordSet, com.virtuosotechnologies.asaph.model.Variation variation, javax.swing.event.UndoableEditListener undoListener)
           
 void setClipboardContents(java.awt.datatransfer.Transferable transfer)
          Set the current system clipboard contents.
(package private)  void setSongUtils(SongUtilsImpl songUtils)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

songUtils_

private SongUtilsImpl songUtils_

notationManager_

private com.virtuosotechnologies.asaph.notationmanager.NotationManager notationManager_

clipboardOwner_

private java.awt.datatransfer.ClipboardOwner clipboardOwner_

clipboard_

private java.awt.datatransfer.Clipboard clipboard_

curClipboardContentsSong_

private com.virtuosotechnologies.asaph.model.Song curClipboardContentsSong_
Constructor Detail

DataTransferUtilsImpl

DataTransferUtilsImpl(com.virtuosotechnologies.asaph.notationmanager.NotationManager notationManager)
Method Detail

setSongUtils

void setSongUtils(SongUtilsImpl songUtils)

setClipboardContents

public void setClipboardContents(java.awt.datatransfer.Transferable transfer)
Set the current system clipboard contents.

Specified by:
setClipboardContents in interface DataTransferUtils

getClipboardContents

public java.awt.datatransfer.Transferable getClipboardContents()
Get the current system clipboard contents. If the last call to setClipboardContents was given a Transferable obtained by one of the methods of this API (i.e. it is a TransferableImpl), and the clipboard contents haven't changed, then this will return a TransferableImpl.

Specified by:
getClipboardContents in interface DataTransferUtils

createLineFragment

private com.virtuosotechnologies.asaph.modelutils.impl.LineFragmentData createLineFragment(com.virtuosotechnologies.asaph.model.SongLine line,
                                                                                           com.virtuosotechnologies.asaph.model.StringSongLineMember startMember,
                                                                                           int startPos,
                                                                                           com.virtuosotechnologies.asaph.model.StringSongLineMember endMember,
                                                                                           int endPos,
                                                                                           com.virtuosotechnologies.asaph.model.ChordSet currentSet,
                                                                                           boolean remove,
                                                                                           javax.swing.event.UndoableEditListener undoListener)

createLineFragmentTransferable

public java.awt.datatransfer.Transferable createLineFragmentTransferable(com.virtuosotechnologies.asaph.model.SongLine line,
                                                                         com.virtuosotechnologies.asaph.model.StringSongLineMember startMember,
                                                                         int startPos,
                                                                         com.virtuosotechnologies.asaph.model.StringSongLineMember endMember,
                                                                         int endPos,
                                                                         com.virtuosotechnologies.asaph.model.ChordSet currentSet,
                                                                         boolean remove,
                                                                         javax.swing.event.UndoableEditListener undoListener)
Create a Transferable for a fragment of a line

Specified by:
createLineFragmentTransferable in interface DataTransferUtils

createLineListTransferable

public java.awt.datatransfer.Transferable createLineListTransferable(com.virtuosotechnologies.asaph.model.Song song,
                                                                     java.util.Collection lines,
                                                                     com.virtuosotechnologies.asaph.model.ChordSet currentSet,
                                                                     boolean remove,
                                                                     javax.swing.event.UndoableEditListener undoListener)
Create a Transferable for an ordered collection of lines in a song

Specified by:
createLineListTransferable in interface DataTransferUtils

createBlockListTransferable

public java.awt.datatransfer.Transferable createBlockListTransferable(com.virtuosotechnologies.asaph.model.Song song,
                                                                      java.util.Collection blocks,
                                                                      com.virtuosotechnologies.asaph.model.ChordSet currentSet,
                                                                      com.virtuosotechnologies.asaph.model.Variation variation,
                                                                      boolean remove,
                                                                      javax.swing.event.UndoableEditListener undoListener)
Create a Transferable for an ordered collection of blocks in a song

Specified by:
createBlockListTransferable in interface DataTransferUtils

getFlavorOf

public java.awt.datatransfer.DataFlavor getFlavorOf(java.awt.datatransfer.Transferable transferable,
                                                    java.awt.datatransfer.DataFlavor preferred)
Get the flavor of the given transferable. If the given preferred flavor is available in the transferable, returns that flavor, otherwise, returns the "best" flavor out of LINFRAGMENT_FLAVOR, LINELIST_FLAVOR, BLOCKLIST_FLAVOR and stringFlavor. Returns null if none of those flavors is available.

Specified by:
getFlavorOf in interface DataTransferUtils

createTransferableForString

public java.awt.datatransfer.Transferable createTransferableForString(java.lang.String str)
Create a Transferable given a string. Interprets the string into lines, and generates either LINFRAGMENT_FLAVOR or LINELIST_FLAVOR.

Specified by:
createTransferableForString in interface DataTransferUtils

getPasteType

public java.awt.datatransfer.DataFlavor getPasteType(java.awt.datatransfer.Transferable transferable,
                                                     java.awt.datatransfer.DataFlavor pasteContext)
                                              throws CannotPasteException
Get the type of object that would be pasted given a transferable and a context.

Specified by:
getPasteType in interface DataTransferUtils

insertLineFragmentAt

private void insertLineFragmentAt(com.virtuosotechnologies.asaph.modelutils.impl.LineFragmentData data,
                                  com.virtuosotechnologies.asaph.model.SongLine line,
                                  com.virtuosotechnologies.asaph.model.StringSongLineMember member,
                                  int pos,
                                  boolean sameSong,
                                  com.virtuosotechnologies.asaph.model.ChordSet chordSet,
                                  javax.swing.event.UndoableEditListener undoListener)

insertLineListAfter

private void insertLineListAfter(com.virtuosotechnologies.asaph.modelutils.impl.LineListData data,
                                 com.virtuosotechnologies.asaph.model.SongBlock block,
                                 com.virtuosotechnologies.asaph.model.SongLine line,
                                 boolean sameSong,
                                 com.virtuosotechnologies.asaph.model.ChordSet chordSet,
                                 javax.swing.event.UndoableEditListener undoListener)

insertBlockListAfter

private void insertBlockListAfter(com.virtuosotechnologies.asaph.modelutils.impl.BlockListData data,
                                  com.virtuosotechnologies.asaph.model.Song song,
                                  com.virtuosotechnologies.asaph.model.SongBlock block,
                                  boolean sameSong,
                                  com.virtuosotechnologies.asaph.model.ChordSet chordSet,
                                  com.virtuosotechnologies.asaph.model.Variation variation,
                                  javax.swing.event.UndoableEditListener undoListener)

pasteTransferable

public void pasteTransferable(java.awt.datatransfer.Transferable transferable,
                              com.virtuosotechnologies.asaph.model.SongLine line,
                              com.virtuosotechnologies.asaph.model.StringSongLineMember member,
                              int pos,
                              com.virtuosotechnologies.asaph.model.ChordSet chordSet,
                              com.virtuosotechnologies.asaph.model.Variation variation,
                              javax.swing.event.UndoableEditListener undoListener)
                       throws CannotPasteException
Paste the given transferable in the given position.

Specified by:
pasteTransferable in interface DataTransferUtils

pasteTransferable

public void pasteTransferable(java.awt.datatransfer.Transferable transferable,
                              com.virtuosotechnologies.asaph.model.SongLine line,
                              com.virtuosotechnologies.asaph.model.StringSongLineMember startMember,
                              int startPos,
                              com.virtuosotechnologies.asaph.model.StringSongLineMember endMember,
                              int endPos,
                              com.virtuosotechnologies.asaph.model.ChordSet chordSet,
                              com.virtuosotechnologies.asaph.model.Variation variation,
                              javax.swing.event.UndoableEditListener undoListener)
                       throws CannotPasteException
Paste the given transferable, replacing the given range.

Specified by:
pasteTransferable in interface DataTransferUtils

pasteTransferableImpl

private void pasteTransferableImpl(java.awt.datatransfer.Transferable transferable,
                                   com.virtuosotechnologies.asaph.model.SongLine line,
                                   com.virtuosotechnologies.asaph.model.StringSongLineMember member,
                                   int pos,
                                   boolean delete,
                                   com.virtuosotechnologies.asaph.model.StringSongLineMember startMember,
                                   int startPos,
                                   com.virtuosotechnologies.asaph.model.StringSongLineMember endMember,
                                   int endPos,
                                   com.virtuosotechnologies.asaph.model.ChordSet chordSet,
                                   com.virtuosotechnologies.asaph.model.Variation variation,
                                   javax.swing.event.UndoableEditListener undoListener)
                            throws CannotPasteException

pasteTransferableAfter

public void pasteTransferableAfter(java.awt.datatransfer.Transferable transferable,
                                   com.virtuosotechnologies.asaph.model.SongBlock block,
                                   com.virtuosotechnologies.asaph.model.SongLine line,
                                   com.virtuosotechnologies.asaph.model.ChordSet chordSet,
                                   com.virtuosotechnologies.asaph.model.Variation variation,
                                   javax.swing.event.UndoableEditListener undoListener)
                            throws CannotPasteException
Paste the given transferable after the given line.

Specified by:
pasteTransferableAfter in interface DataTransferUtils

pasteTransferableAfter

public void pasteTransferableAfter(java.awt.datatransfer.Transferable transferable,
                                   com.virtuosotechnologies.asaph.model.Song song,
                                   com.virtuosotechnologies.asaph.model.SongBlock block,
                                   com.virtuosotechnologies.asaph.model.ChordSet chordSet,
                                   com.virtuosotechnologies.asaph.model.Variation variation,
                                   javax.swing.event.UndoableEditListener undoListener)
                            throws CannotPasteException
Paste the given transferable after the given block.

Specified by:
pasteTransferableAfter in interface DataTransferUtils