Package mgui.interfaces.io
Class InterfaceIOType
java.lang.Object
mgui.interfaces.io.InterfaceIOType
- All Implemented Interfaces:
NamedObject,TreeObject,IconObject
public class InterfaceIOType extends java.lang.Object implements IconObject, NamedObject, TreeObject
Specifies an Input/Output interface object; e.g., file loaders or writers.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Class<InterfaceIODialogBox>dialogprotected java.util.List<java.lang.String>extensionsprotected WildcardFileFilterfilterprotected java.lang.Class<InterfaceIO>ioprotected java.lang.Stringlabelprotected java.lang.Stringnameprotected java.lang.Class<InterfaceIOOptions>optionsprotected inttypestatic intTYPE_INPUTstatic intTYPE_OUTPUTstatic intTYPE_RANDOM -
Constructor Summary
Constructors Constructor Description InterfaceIOType() -
Method Summary
Modifier and Type Method Description voidaddExtension(java.lang.String ext)java.lang.Class<InterfaceIODialogBox>getDialog()InterfaceIODialogBoxgetDialogInstance(javax.swing.JFrame frame, InterfaceIOPanel panel, InterfaceIOOptions options)Returns an instance of the dialog box associated with this I/O type.java.util.List<java.lang.String>getExtensions()WildcardFileFiltergetFilter()java.lang.Class<InterfaceIO>getIO()InterfaceIOgetIOInstance()Returns a new instance of this type.java.lang.StringgetLabel()java.lang.StringgetName()Gets the name for this object.javax.swing.IcongetObjectIcon()Returns theIconassociated with this object.InterfaceIOOptionsgetOptionsInstance()Returns an instance ofInterfaceIOOptionsappropriate for this IO type.java.util.ArrayList<java.lang.Class<?>>getSupportedObjects()Returns a list of classes for objects which are supported by this I/O interfacejava.lang.StringgetTreeLabel()Returns the label text to appear in a tree node.intgetType()booleanisCompatibleObject(InterfaceObject object)Does this I/O type handle objects of typeobject?booleanisCompatibleOptions(InterfaceIOOptions options)Determines whetheroptionsis compatible with this typebooleanisCompatibleType(InterfaceIOType type)Determines whether this type supports all of the objects supported bytypebooleanisInput()Is this input?booleanisOutput()Is this output?InterfaceTreeNodeissueTreeNode()Issues a newInterfaceTreeNodefor this object.voidsetDialog(java.lang.Class<InterfaceIODialogBox> dialog)voidsetFilter(WildcardFileFilter filter)voidsetIO(java.lang.Class<InterfaceIO> io)voidsetLabel(java.lang.String label)voidsetName(java.lang.String name)Sets the name for this object.voidsetOptions(java.lang.Class<InterfaceIOOptions> options)voidsetTreeNode(InterfaceTreeNode node)Sets the children for this node'sInterfaceTreeNode.voidsetType(java.lang.String t)java.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
TYPE_INPUT
public static int TYPE_INPUT -
TYPE_OUTPUT
public static int TYPE_OUTPUT -
TYPE_RANDOM
public static int TYPE_RANDOM -
name
protected java.lang.String name -
label
protected java.lang.String label -
filter
-
io
-
dialog
-
options
-
type
protected int type -
extensions
protected java.util.List<java.lang.String> extensions
-
-
Constructor Details
-
InterfaceIOType
public InterfaceIOType()
-
-
Method Details
-
setType
public void setType(java.lang.String t) -
getType
public int getType() -
getName
public java.lang.String getName()Description copied from interface:NamedObjectGets the name for this object.- Specified by:
getNamein interfaceNamedObject- Returns:
-
setName
public void setName(java.lang.String name)Description copied from interface:NamedObjectSets the name for this object.- Specified by:
setNamein interfaceNamedObject
-
getIO
-
setIO
-
addExtension
public void addExtension(java.lang.String ext) -
getExtensions
public java.util.List<java.lang.String> getExtensions() -
setDialog
-
getDialog
-
getFilter
-
getLabel
public java.lang.String getLabel() -
setLabel
public void setLabel(java.lang.String label) -
setFilter
-
getDialogInstance
public InterfaceIODialogBox getDialogInstance(javax.swing.JFrame frame, InterfaceIOPanel panel, InterfaceIOOptions options)Returns an instance of the dialog box associated with this I/O type. If there is no associated dialog box, returnsnull.- Parameters:
frame-panel-options-- Returns:
-
getOptionsInstance
Returns an instance ofInterfaceIOOptionsappropriate for this IO type.- Returns:
-
setOptions
-
getIOInstance
Returns a new instance of this type.- Returns:
-
isInput
public boolean isInput()Is this input?- Returns:
-
isOutput
public boolean isOutput()Is this output?- Returns:
-
isCompatibleObject
Does this I/O type handle objects of typeobject?- Parameters:
object-- Returns:
-
isCompatibleType
Determines whether this type supports all of the objects supported bytype- Parameters:
type-- Returns:
-
isCompatibleOptions
Determines whetheroptionsis compatible with this type- Parameters:
options-- Returns:
-
getSupportedObjects
public java.util.ArrayList<java.lang.Class<?>> getSupportedObjects()Returns a list of classes for objects which are supported by this I/O interface- Returns:
- See Also:
InterfaceIO
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
getObjectIcon
public javax.swing.Icon getObjectIcon()Description copied from interface:IconObjectReturns theIconassociated with this object.- Specified by:
getObjectIconin interfaceIconObject- Returns:
-
issueTreeNode
Description copied from interface:TreeObjectIssues a newInterfaceTreeNodefor this object. The object is responsible for maintaining, updating, and destroying the tree nodes it issues, or notifying containers -- i.e., parent trees -- of changes which require the tree nodes to be modified or destroyed.- Specified by:
issueTreeNodein interfaceTreeObject- Returns:
-
setTreeNode
Description copied from interface:TreeObjectSets the children for this node'sInterfaceTreeNode.- Specified by:
setTreeNodein interfaceTreeObject
-
getTreeLabel
public java.lang.String getTreeLabel()Description copied from interface:TreeObjectReturns the label text to appear in a tree node.- Specified by:
getTreeLabelin interfaceTreeObject- Returns:
-