org.oddjob.designer.model
Class DesignerModel

java.lang.Object
  extended byjava.util.Observable
      extended byorg.oddjob.designer.model.DesignerModel

public class DesignerModel
extends java.util.Observable

Model for a designer session.


Constructor Summary
DesignerModel(DesignComponent start)
          Constructor.
 
Method Summary
 void delete(DesignTreeNode child)
           
 DesignComponent getCurrentComponent()
           
 DesignTreeNode getCurrentSelection()
          Get the currently selected node.
 java.lang.String getCurrentXML()
           
static int getIndex(DesignTreeNode child)
           
static DesignComponent getParentComponent(DesignTreeNode child)
           
 DesignComponent getRootComponent()
          Get the root component.
 DesignTreeModel getTreeModel()
          Get the tree model.
 void replaceSelected(DesignComponent dc)
           
 void replaceSelected(java.lang.String xml)
           
 void setCurrentSelection(DesignTreeNode node)
          Set the currently selected node.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DesignerModel

public DesignerModel(DesignComponent start)
Constructor.

Parameters:
start - The root component.
Method Detail

getRootComponent

public DesignComponent getRootComponent()
Get the root component.

Returns:
The DesignComponent which is the root.

getTreeModel

public DesignTreeModel getTreeModel()
Get the tree model.

Returns:
A TreeModel.

setCurrentSelection

public void setCurrentSelection(DesignTreeNode node)
Set the currently selected node.

Parameters:
node - The node. May be null.

getCurrentSelection

public DesignTreeNode getCurrentSelection()
Get the currently selected node.

Returns:
The currently selected node. Null if none.

getCurrentComponent

public DesignComponent getCurrentComponent()

getCurrentXML

public java.lang.String getCurrentXML()

replaceSelected

public void replaceSelected(java.lang.String xml)

replaceSelected

public void replaceSelected(DesignComponent dc)

delete

public void delete(DesignTreeNode child)

getParentComponent

public static DesignComponent getParentComponent(DesignTreeNode child)

getIndex

public static int getIndex(DesignTreeNode child)