lib
Class DriveElement

java.lang.Object
  extended by lib.DriveElement
All Implemented Interfaces:
IEditableElement

public class DriveElement
extends java.lang.Object
implements IEditableElement

A Drive Element is a name, a trigger list of action elements and a named action, and an optional timeout for scheduling frequency

Version:
1.0
Author:
CobaltSoftware (abode.devteam@cobaltsoftware.net)

Field Summary
private  java.util.ArrayList alTrigger
           
private  java.lang.String documentation
           
private  int senseCount
           
private  java.lang.String strAction
           
private  java.lang.String strName
           
private  TimeUnit tFrequency
           
 
Constructor Summary
DriveElement(java.lang.String name, java.util.ArrayList trigger, java.lang.String action)
          Create this drive element with a name, trigger (list of actionelements) and a corresponding action name to invoke.
DriveElement(java.lang.String name, java.util.ArrayList trigger, java.lang.String action, TimeUnit freq)
          Create this drive element, with a name, trigger (list of action elements) and a corresponding name of action to invoke, as well as a scheduling frequency.
 
Method Summary
 JTreeNode buildTree(JTreeNode root, LearnableActionPattern lap, boolean detailed, boolean expanded)
          Build the tree structure of the file
 java.lang.String getAction()
          Get the name of the action we invoke
 java.lang.String getDocumentation()
          Get the documentation string for this element
 TimeUnit getFrequency()
          Get the scheduling frequency of this drive element
 java.lang.String getName()
          Get the name of this drive element
 DriveElement getSelf()
          Get a reference back to the drive element itself, since sometimes inner classes have some truly horrible syntax for referring back to the parent class.
 java.util.ArrayList getTrigger()
          Get our trigger list
 void onSelect(JAbode mainGui, JEditorWindow subGui, JDiagram diagram)
          When we click this Action Element in the GUI populate the properties panel with the various attributes and setup listeners to catch modifications that are made.
 void setAction(java.lang.String act)
          Set our action name to invoke
 void setDocumentation(java.lang.String docString)
          Set the documentation string for this element
 void setFrequency(TimeUnit time)
          Set our scheduling frequency
 void setName(java.lang.String name)
          Set the name of this drive element
 void setTrigger(java.util.ArrayList trigger)
          Set our trigger (Should be arraylist of actionelement objects)
 void showContextMenu(JTreeNode showOn, LearnableActionPattern lap, JEditorWindow window, JDiagram diagram)
          Produce and show a context menu for this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

strName

private java.lang.String strName

alTrigger

private java.util.ArrayList alTrigger

strAction

private java.lang.String strAction

tFrequency

private TimeUnit tFrequency

documentation

private java.lang.String documentation

senseCount

private int senseCount
Constructor Detail

DriveElement

public DriveElement(java.lang.String name,
                    java.util.ArrayList trigger,
                    java.lang.String action)
Create this drive element with a name, trigger (list of actionelements) and a corresponding action name to invoke.

Parameters:
name - Name of the drive element
trigger - Arraylist of action elements comprising our trigger
action - POSH Root to trigger

DriveElement

public DriveElement(java.lang.String name,
                    java.util.ArrayList trigger,
                    java.lang.String action,
                    TimeUnit freq)
Create this drive element, with a name, trigger (list of action elements) and a corresponding name of action to invoke, as well as a scheduling frequency.

Parameters:
name - Name of the drive element
trigger - Arraylist of action elements comprising our trigger
action - Posh root to trigger
freq - Frequency specification for this drive element
Method Detail

getAction

public java.lang.String getAction()
Get the name of the action we invoke

Returns:
POSH Root name

getFrequency

public TimeUnit getFrequency()
Get the scheduling frequency of this drive element

Returns:
Frequency time unit

getName

public java.lang.String getName()
Get the name of this drive element

Returns:
Name of the drive element

getTrigger

public java.util.ArrayList getTrigger()
Get our trigger list

Returns:
Trigger in form of arraylist

getDocumentation

public java.lang.String getDocumentation()
Get the documentation string for this element

Returns:
Documentation string for this element

setDocumentation

public void setDocumentation(java.lang.String docString)
Set the documentation string for this element

Parameters:
docString - New documentation string

setAction

public void setAction(java.lang.String act)
Set our action name to invoke

Parameters:
act - Action name.

setFrequency

public void setFrequency(TimeUnit time)
Set our scheduling frequency

Parameters:
time - New frequency

setName

public void setName(java.lang.String name)
Set the name of this drive element


setTrigger

public void setTrigger(java.util.ArrayList trigger)
Set our trigger (Should be arraylist of actionelement objects)

Parameters:
trigger - Arraylist of action elements comprising the trigger

onSelect

public void onSelect(JAbode mainGui,
                     JEditorWindow subGui,
                     JDiagram diagram)
When we click this Action Element in the GUI populate the properties panel with the various attributes and setup listeners to catch modifications that are made.

Specified by:
onSelect in interface IEditableElement
Parameters:
mainGui - The reference to the outer GUI
subGui - The internal frame we're referring to
diagram - The diagram we're being select on.

getSelf

public DriveElement getSelf()
Get a reference back to the drive element itself, since sometimes inner classes have some truly horrible syntax for referring back to the parent class.

Returns:
this

showContextMenu

public void showContextMenu(JTreeNode showOn,
                            LearnableActionPattern lap,
                            JEditorWindow window,
                            JDiagram diagram)
Produce and show a context menu for this object

Specified by:
showContextMenu in interface IEditableElement
Parameters:
showOn - The tree node invoking us
lap - The file we're a part of
window - The window we're being dispalyed in
diagram - The diagram in the window we'return being shown on

buildTree

public JTreeNode buildTree(JTreeNode root,
                           LearnableActionPattern lap,
                           boolean detailed,
                           boolean expanded)
Build the tree structure of the file

Specified by:
buildTree in interface IEditableElement
Returns:
Tree node representing this node and the relevent sub-tree for the specified diagram rendering settings