Package adams.gui.clipboard
Class AbstractClipboardData<T>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.clipboard.AbstractClipboardData<T>
-
- Type Parameters:
T
- the type of data this class manages
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Serializable
- Direct Known Subclasses:
BufferedImage
,String
public abstract class AbstractClipboardData<T> extends AbstractOptionHandler
Ancestor for classes that copy to and paste from the system's clipboard.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractClipboardData()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
canPaste()
Checks whether the required data type is available from the clipboard.abstract void
copy(T data)
Copies the data to the clipboard.boolean
copyFromToken(Token data)
Copies the data stored in the token to the clipboard.abstract Class
getFlowClass()
Returns the class used in the flow.abstract T
paste()
Pastes the data from the clipboard.Token
pasteAsToken()
Pastes the data from the clipboard as flow token.protected abstract T
unwrap(Token data)
Unwraps the actual data from the token.protected abstract Token
wrap(T data)
Wraps the data from the clipboard in a flow token.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
getFlowClass
public abstract Class getFlowClass()
Returns the class used in the flow.- Returns:
- the class
-
copy
public abstract void copy(T data)
Copies the data to the clipboard.- Parameters:
data
- the data to copy
-
unwrap
protected abstract T unwrap(Token data)
Unwraps the actual data from the token.- Parameters:
data
- the token to unwrap- Returns:
- the actual data, null if can't handle
-
copyFromToken
public boolean copyFromToken(Token data)
Copies the data stored in the token to the clipboard.- Parameters:
data
- the data to copy
-
canPaste
public abstract boolean canPaste()
Checks whether the required data type is available from the clipboard.- Returns:
- true if data is available
-
paste
public abstract T paste()
Pastes the data from the clipboard.- Returns:
- the pasted data, null if failed to paste
-
wrap
protected abstract Token wrap(T data)
Wraps the data from the clipboard in a flow token.- Returns:
- the pasted data, null if failed to paste
-
pasteAsToken
public Token pasteAsToken()
Pastes the data from the clipboard as flow token.- Returns:
- the pasted data, null if failed to paste
-
-