Package adams.gui.sendto
Class AbstractSendToAction
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.gui.sendto.AbstractSendToAction
-
- All Implemented Interfaces:
LoggingSupporter
,SizeOfHandler
,Serializable
,Comparable<AbstractSendToAction>
- Direct Known Subclasses:
Clipboard
,CopyTableAsImage
,EmailRecipient
,ExportAsImage
,ExportAsSpreadsheet
,ExportTableAsImage
,PDFPrinter
,Printer
,TextFile
public abstract class AbstractSendToAction extends LoggingObject implements Comparable<AbstractSendToAction>
Ancestor for classes that allow data forwarding in some sense, e.g., via email.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected SendToActionSupporter
m_Owner
the owner.-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractSendToAction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Class[]
accepts()
Returns the classes that the action accepts.int
compareTo(AbstractSendToAction o)
Compares this object with the specified object for order.boolean
equals(Object o)
Returns whether the specified object is the same as this one.abstract String
getAction()
Returns the short description of the sendto action.ImageIcon
getIcon()
Returns the icon.String
getIconName()
Returns the file name of the icon.SendToActionSupporter
getOwner()
Returns the current owner of this action.int
hashCode()
Hashcode so can be used as hashtable key.abstract String
send(Object o)
Performs the actual sending/forwarding/processing of the data.void
setOwner(SendToActionSupporter value)
Sets the owner of this action.-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Owner
protected SendToActionSupporter m_Owner
the owner.
-
-
Method Detail
-
setOwner
public void setOwner(SendToActionSupporter value)
Sets the owner of this action.- Parameters:
value
- the owner
-
getOwner
public SendToActionSupporter getOwner()
Returns the current owner of this action.- Returns:
- the owner, null if none set
-
getAction
public abstract String getAction()
Returns the short description of the sendto action. Description gets used for menu items.- Returns:
- the short description
-
getIconName
public String getIconName()
Returns the file name of the icon.- Returns:
- the filename or null if no icon available
-
getIcon
public ImageIcon getIcon()
Returns the icon.- Returns:
- the icon or empty icon if no icon name available
- See Also:
getIconName()
-
accepts
public abstract Class[] accepts()
Returns the classes that the action accepts.- Returns:
- the accepted classes
-
send
public abstract String send(Object o)
Performs the actual sending/forwarding/processing of the data.- Parameters:
o
- the object to send- Returns:
- null if everything OK, otherwise error message
-
compareTo
public int compareTo(AbstractSendToAction o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Simply performs comparison on the action string.- Specified by:
compareTo
in interfaceComparable<AbstractSendToAction>
- Parameters:
o
- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- See Also:
getAction()
-
equals
public boolean equals(Object o)
Returns whether the specified object is the same as this one.
For AbstractSendToAction objects, it merely uses the action string for comparison.- Overrides:
equals
in classObject
- Parameters:
o
- the object to compare with- Returns:
- true if both AbstractSendToAction instances and the same action string
- See Also:
compareTo(AbstractSendToAction)
,getAction()
-
hashCode
public int hashCode()
Hashcode so can be used as hashtable key. Returns the hashcode of thegetAction()
string.
-
-