Package mgui.interfaces.projects
Class ProjectDataItem
java.lang.Object
mgui.interfaces.AbstractInterfaceObject
mgui.interfaces.projects.ProjectDataItem
- All Implemented Interfaces:
java.lang.Cloneable
,AttributeListener
,InterfaceObject
,NamedObject
,TreeObject
,CleanableObject
,IconObject
public class ProjectDataItem extends AbstractInterfaceObject implements AttributeListener, IconObject, java.lang.Cloneable
Specifies a data item in a modelGUI project, including its name, its I/O classes, and its filename
form (a pattern identifying the location or URL of the item).
TODO: Also specify options for the item
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields inherited from class mgui.interfaces.AbstractInterfaceObject
isDestroyed, tree_nodes
-
Constructor Summary
Constructors Constructor Description ProjectDataItem(java.lang.String name, java.lang.String filename_form)
-
Method Summary
Modifier and Type Method Description void
attributeUpdated(AttributeEvent e)
Called when an Attribute's value has been updated.java.lang.Object
clone()
FileLoader
getFileLoader()
java.lang.String
getFilenameForInstance(java.lang.String instance)
Constructs a filename from the given parameters and the file name form.java.lang.String
getFilenameForInstance(java.lang.String instance, java.lang.Integer series)
Constructs a filename from the given parameters and the file name form.java.lang.String
getFilenameForm()
FileWriter
getFileWriter()
InterfaceIOType
getLoaderIOType()
java.lang.String
getName()
Gets the name for this object.javax.swing.Icon
getObjectIcon()
Returns theIcon
associated with this object.protected java.lang.String
getSeriesReplaced(java.lang.String filename, int series)
java.lang.String
getTreeLabel()
Returns the label text to appear in a tree node.InterfaceIOType
getWriterIOType()
protected void
init()
void
setFileLoader(FileLoader loader)
void
setFilenameForm(java.lang.String form)
void
setFileWriter(FileWriter writer)
void
setName(java.lang.String name)
Sets the name for this object.void
setTreeNode(InterfaceTreeNode node)
Sets the children for this node'sInterfaceTreeNode
.Methods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, destroy, isDestroyed, issueTreeNode, updateTreeNodes
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ProjectDataItem
public ProjectDataItem(java.lang.String name, java.lang.String filename_form)
-
-
Method Details
-
init
protected void init() -
getObjectIcon
public javax.swing.Icon getObjectIcon()Description copied from interface:IconObject
Returns theIcon
associated with this object.- Specified by:
getObjectIcon
in interfaceIconObject
- Returns:
-
getFilenameForInstance
public java.lang.String getFilenameForInstance(java.lang.String instance)Constructs a filename from the given parameters and the file name form.- Parameters:
instance
- Instance ID, ornull
- Returns:
-
getFilenameForInstance
public java.lang.String getFilenameForInstance(java.lang.String instance, java.lang.Integer series)Constructs a filename from the given parameters and the file name form.- Parameters:
instance
- Instance ID, ornull
series
- Series number, ornull
if none- Returns:
-
getSeriesReplaced
protected java.lang.String getSeriesReplaced(java.lang.String filename, int series) -
setName
public void setName(java.lang.String name)Description copied from interface:NamedObject
Sets the name for this object.- Specified by:
setName
in interfaceNamedObject
- Overrides:
setName
in classAbstractInterfaceObject
-
getName
public java.lang.String getName()Description copied from interface:NamedObject
Gets the name for this object.- Specified by:
getName
in interfaceNamedObject
- Overrides:
getName
in classAbstractInterfaceObject
- Returns:
-
setFileLoader
-
getLoaderIOType
-
getFileLoader
-
getWriterIOType
-
setFileWriter
-
getFileWriter
-
setFilenameForm
public void setFilenameForm(java.lang.String form) -
getFilenameForm
public java.lang.String getFilenameForm() -
attributeUpdated
Description copied from interface:AttributeListener
Called when an Attribute's value has been updated.- Specified by:
attributeUpdated
in interfaceAttributeListener
-
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 interfaceTreeObject
- Overrides:
getTreeLabel
in classAbstractInterfaceObject
- Returns:
-
setTreeNode
Description copied from interface:TreeObject
Sets the children for this node'sInterfaceTreeNode
.- Specified by:
setTreeNode
in interfaceTreeObject
- Overrides:
setTreeNode
in classAbstractInterfaceObject
-
clone
public java.lang.Object clone()- Overrides:
clone
in classjava.lang.Object
-