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 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

      protected WildcardFileFilter filter
    • io

      protected java.lang.Class<InterfaceIO> io
    • dialog

      protected java.lang.Class<InterfaceIODialogBox> dialog
    • options

      protected java.lang.Class<InterfaceIOOptions> 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: NamedObject
      Gets the name for this object.
      Specified by:
      getName in interface NamedObject
      Returns:
    • setName

      public void setName​(java.lang.String name)
      Description copied from interface: NamedObject
      Sets the name for this object.
      Specified by:
      setName in interface NamedObject
    • getIO

      public java.lang.Class<InterfaceIO> getIO()
    • setIO

      public void setIO​(java.lang.Class<InterfaceIO> io)
    • addExtension

      public void addExtension​(java.lang.String ext)
    • getExtensions

      public java.util.List<java.lang.String> getExtensions()
    • setDialog

      public void setDialog​(java.lang.Class<InterfaceIODialogBox> dialog)
    • getDialog

      public java.lang.Class<InterfaceIODialogBox> getDialog()
    • getFilter

      public WildcardFileFilter getFilter()
    • getLabel

      public java.lang.String getLabel()
    • setLabel

      public void setLabel​(java.lang.String label)
    • setFilter

      public void setFilter​(WildcardFileFilter filter)
    • 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, returns null.
      Parameters:
      frame -
      panel -
      options -
      Returns:
    • getOptionsInstance

      public InterfaceIOOptions getOptionsInstance()
      Returns an instance of InterfaceIOOptions appropriate for this IO type.
      Returns:
    • setOptions

      public void setOptions​(java.lang.Class<InterfaceIOOptions> options)
    • getIOInstance

      public InterfaceIO 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

      public boolean isCompatibleObject​(InterfaceObject object)
      Does this I/O type handle objects of type object?
      Parameters:
      object -
      Returns:
    • isCompatibleType

      public boolean isCompatibleType​(InterfaceIOType type)
      Determines whether this type supports all of the objects supported by type
      Parameters:
      type -
      Returns:
    • isCompatibleOptions

      public boolean isCompatibleOptions​(InterfaceIOOptions options)
      Determines whether options is 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:
      toString in class java.lang.Object
    • getObjectIcon

      public javax.swing.Icon getObjectIcon()
      Description copied from interface: IconObject
      Returns the Icon associated with this object.
      Specified by:
      getObjectIcon in interface IconObject
      Returns:
    • issueTreeNode

      public InterfaceTreeNode issueTreeNode()
      Description copied from interface: TreeObject
      Issues a new InterfaceTreeNode for 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:
      issueTreeNode in interface TreeObject
      Returns:
    • setTreeNode

      public void setTreeNode​(InterfaceTreeNode node)
      Description copied from interface: TreeObject
      Sets the children for this node's InterfaceTreeNode.
      Specified by:
      setTreeNode in interface TreeObject
    • getTreeLabel

      public java.lang.String getTreeLabel()
      Description copied from interface: TreeObject
      Returns the label text to appear in a tree node.
      Specified by:
      getTreeLabel in interface TreeObject
      Returns: