Synergy Home Page

au.edu.swin.synergy.plugin.workspace
Class BProject

java.lang.Object
  |
  +--au.edu.swin.synergy.plugin.workspace.BProject

public class BProject
extends Object
implements BTreeNode, BSaveable

Represents a project of models. Can be saved, and is used by the BWorkspace to create BWorkspaceTreeBranch objects

Author:
Matthew Evans

Field Summary
protected static String kDefaultName
           
protected static String kKeyModel
           
protected static String kKeyName
           
 
Constructor Summary
BProject()
          Default constructor for BSaveable
BProject(BWorkspaceTreeModel parent, String name, String path)
          Construct a new project with name set to 'name', and the models Vector created
 
Method Summary
 BModel addModel(File modelFile, String packageFileName)
          Add a model to the project, so that it is accessible via this project from the cohesion workspace
 Object getChildAt(int index)
           
 int getChildCount()
           
 int getIndexOf(Object node)
           
 Vector getModels()
           
 String getName()
           
 Object getParent()
           
 String getPath()
           
 boolean isLeaf()
           
 boolean load(BDataFile file)
           
 void nodeWasInserted(BTreeNode model, int index, BTreeNode elementAdded)
           
 void nodeWasRemoved(BTreeNode model, int index, BTreeNode elementRemoved)
           
 void removeAllChildren()
           
 BModel removeModel(BModel model)
          Remove a specified model form the project
 boolean save(BDataFile file)
           
 void saveModifiedModels(BWorkspace workspacePlugin)
           
 void setName(String name)
           
 void setParent(BWorkspaceTreeModel parent)
           
 void setParent(Object parent)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kKeyName

protected static final String kKeyName

kDefaultName

protected static final String kDefaultName

kKeyModel

protected static final String kKeyModel
Constructor Detail

BProject

public BProject(BWorkspaceTreeModel parent,
                String name,
                String path)
Construct a new project with name set to 'name', and the models Vector created
Parameters:
name - the name of the model

BProject

public BProject()
Default constructor for BSaveable
Method Detail

setParent

public void setParent(BWorkspaceTreeModel parent)

setName

public void setName(String name)
Specified by:
setName in interface BTreeNode

addModel

public BModel addModel(File modelFile,
                       String packageFileName)
Add a model to the project, so that it is accessible via this project from the cohesion workspace
Parameters:
model - the model to be included in this project

nodeWasInserted

public void nodeWasInserted(BTreeNode model,
                            int index,
                            BTreeNode elementAdded)

nodeWasRemoved

public void nodeWasRemoved(BTreeNode model,
                           int index,
                           BTreeNode elementRemoved)

removeModel

public BModel removeModel(BModel model)
Remove a specified model form the project
Parameters:
model - the model to remove

getModels

public Vector getModels()

getPath

public String getPath()

getName

public String getName()
Specified by:
getName in interface BTreeNode

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface BTreeNode

getChildAt

public Object getChildAt(int index)
Specified by:
getChildAt in interface BTreeNode

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface BTreeNode

getParent

public Object getParent()
Specified by:
getParent in interface BTreeNode

getIndexOf

public int getIndexOf(Object node)
Specified by:
getIndexOf in interface BTreeNode

setParent

public void setParent(Object parent)
Specified by:
setParent in interface BTreeNode

removeAllChildren

public void removeAllChildren()
Specified by:
removeAllChildren in interface BTreeNode

load

public boolean load(BDataFile file)
Specified by:
load in interface BSaveable

save

public boolean save(BDataFile file)
Specified by:
save in interface BSaveable

saveModifiedModels

public void saveModifiedModels(BWorkspace workspacePlugin)

toString

public String toString()
Overrides:
toString in class Object

Synergy Home Page