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 voidattributeUpdated(AttributeEvent e)Called when an Attribute's value has been updated.java.lang.Objectclone()FileLoadergetFileLoader()java.lang.StringgetFilenameForInstance(java.lang.String instance)Constructs a filename from the given parameters and the file name form.java.lang.StringgetFilenameForInstance(java.lang.String instance, java.lang.Integer series)Constructs a filename from the given parameters and the file name form.java.lang.StringgetFilenameForm()FileWritergetFileWriter()InterfaceIOTypegetLoaderIOType()java.lang.StringgetName()Gets the name for this object.javax.swing.IcongetObjectIcon()Returns theIconassociated with this object.protected java.lang.StringgetSeriesReplaced(java.lang.String filename, int series)java.lang.StringgetTreeLabel()Returns the label text to appear in a tree node.InterfaceIOTypegetWriterIOType()protected voidinit()voidsetFileLoader(FileLoader loader)voidsetFilenameForm(java.lang.String form)voidsetFileWriter(FileWriter writer)voidsetName(java.lang.String name)Sets the name for this object.voidsetTreeNode(InterfaceTreeNode node)Sets the children for this node'sInterfaceTreeNode.Methods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, destroy, isDestroyed, issueTreeNode, updateTreeNodesMethods 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:IconObjectReturns theIconassociated with this object.- Specified by:
getObjectIconin 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, ornullseries- Series number, ornullif 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:NamedObjectSets the name for this object.- Specified by:
setNamein interfaceNamedObject- Overrides:
setNamein classAbstractInterfaceObject
-
getName
public java.lang.String getName()Description copied from interface:NamedObjectGets the name for this object.- Specified by:
getNamein interfaceNamedObject- Overrides:
getNamein 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:AttributeListenerCalled when an Attribute's value has been updated.- Specified by:
attributeUpdatedin interfaceAttributeListener
-
getTreeLabel
public java.lang.String getTreeLabel()Description copied from interface:TreeObjectReturns the label text to appear in a tree node.- Specified by:
getTreeLabelin interfaceTreeObject- Overrides:
getTreeLabelin classAbstractInterfaceObject- Returns:
-
setTreeNode
Description copied from interface:TreeObjectSets the children for this node'sInterfaceTreeNode.- Specified by:
setTreeNodein interfaceTreeObject- Overrides:
setTreeNodein classAbstractInterfaceObject
-
clone
public java.lang.Object clone()- Overrides:
clonein classjava.lang.Object
-