edu.williams.cs.ljil.helpers
Class DiagramHelper

java.lang.Object
  extended by edu.williams.cs.ljil.helpers.DiagramHelper

public class DiagramHelper
extends java.lang.Object

Author:
lerner To change the template for this generated type comment go to Window - Preferences - Java - Code Generation - Code and Comments

Constructor Summary
DiagramHelper()
           
 
Method Summary
static void addDiagramChangeListener(DiagramChangeListener l)
          Adds a listener for changes to a diagram
static void addSubtreeToDiagram(laser.littlejil.AbstractStep astep, laser.littlejil.Diagram d, laser.littlejil.AbstractBinding parentBinding)
          Utility method for adding a subtree to a diagram.
protected static void fireStepAdded(laser.littlejil.AbstractStep step, laser.littlejil.AbstractBinding parentBinding, laser.littlejil.Diagram diagram)
          Notifies listeners that a step has been added to a diagram.
protected static void fireStepRemoved(laser.littlejil.AbstractStep step, laser.littlejil.AbstractBinding parentBinding, laser.littlejil.Diagram olddiagram)
          Notifies listeners that a step has been removed from a diagram.
static void removeDiagramChangeListener(ActionableStateListener l)
          Removes a listener for changes to a diagram
protected static void removeNullHandler(laser.littlejil.NullStep astep, laser.littlejil.HandlerBinding parentBinding)
          Removes a null handler from a diagram.
static void removeSubtree(laser.littlejil.AbstractStep astep, laser.littlejil.AbstractBinding parentBinding)
          Removes a subtree from a diagram
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiagramHelper

public DiagramHelper()
Method Detail

addSubtreeToDiagram

public static void addSubtreeToDiagram(laser.littlejil.AbstractStep astep,
                                       laser.littlejil.Diagram d,
                                       laser.littlejil.AbstractBinding parentBinding)
Utility method for adding a subtree to a diagram.

Parameters:
astep - The root step of the subtree to add to a diagram. This may not be null.
d - The diagram to add the step to. This may not be null.
parentBinding - the binding from the root step to its parent

removeSubtree

public static void removeSubtree(laser.littlejil.AbstractStep astep,
                                 laser.littlejil.AbstractBinding parentBinding)
Removes a subtree from a diagram

Parameters:
astep - The root of the subtree to remove
parentBinding - The binding from the root to its parent.

removeNullHandler

protected static void removeNullHandler(laser.littlejil.NullStep astep,
                                        laser.littlejil.HandlerBinding parentBinding)
Removes a null handler from a diagram.

Parameters:
astep - The null handler to remove
parentBinding - The binding from the null handler to the step it is a handler for

addDiagramChangeListener

public static void addDiagramChangeListener(DiagramChangeListener l)
Adds a listener for changes to a diagram

Parameters:
l - The listener to add.

removeDiagramChangeListener

public static void removeDiagramChangeListener(ActionableStateListener l)
Removes a listener for changes to a diagram

Parameters:
l - The listener to remove

fireStepAdded

protected static void fireStepAdded(laser.littlejil.AbstractStep step,
                                    laser.littlejil.AbstractBinding parentBinding,
                                    laser.littlejil.Diagram diagram)
Notifies listeners that a step has been added to a diagram.

Parameters:
step - The step that was added
parentBinding - The binding to the parent that was added

fireStepRemoved

protected static void fireStepRemoved(laser.littlejil.AbstractStep step,
                                      laser.littlejil.AbstractBinding parentBinding,
                                      laser.littlejil.Diagram olddiagram)
Notifies listeners that a step has been removed from a diagram.

Parameters:
step - The step that was removed.
parentBinding - The binding to the parent that was removed.
olddiagram - The diagram that was modified.