lib
Class ActionPattern

java.lang.Object
  extended by lib.ActionPattern
All Implemented Interfaces:
IEditableElement, INamedElement

public class ActionPattern
extends java.lang.Object
implements IEditableElement, INamedElement

An Action Pattern is a name, interval and a sequence of action elements

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

Field Summary
private  java.util.ArrayList alElements
           
private  java.lang.String documentation
           
private  java.lang.String strName
           
private  TimeUnit tTimeOut
           
 
Constructor Summary
ActionPattern(java.lang.String name, TimeUnit time)
          Initialize our action pattern with a blank list of elements
ActionPattern(java.lang.String name, TimeUnit time, java.util.ArrayList children)
          Create an Action Pattern with a pre-loaded list of elements
 
Method Summary
 JTreeNode buildTree(JTreeNode root, LearnableActionPattern lap, boolean detailed, boolean expanded)
          Convert this element into a tree branch
 java.lang.String getDocumentation()
          Get the documentation string for this element
 java.util.ArrayList getElements()
          Get the list of elements of this action pattern
 java.lang.String getName()
          Get the name of this action pattern
 ActionPattern getSelf()
           
 TimeUnit getTimeUnit()
          Get the timeout for this action pattern
 void onSelect(JAbode mainGui, JEditorWindow subGui, JDiagram diagram)
          When we click this Action Pattern in the GUI populate the properties panel with the various attributes and setup listeners to catch modifications that are made.
 void setDocumentation(java.lang.String docString)
          Set the documentation string for this element
 void setElements(java.util.ArrayList elements)
          Set the list of elements used in this action pattern
 void setName(java.lang.String name)
          Set the name of this action pattern
 void setTimeUnit(TimeUnit unit)
          Set the timeout/interval for this action pattern
 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

alElements

private java.util.ArrayList alElements

tTimeOut

private TimeUnit tTimeOut

strName

private java.lang.String strName

documentation

private java.lang.String documentation
Constructor Detail

ActionPattern

public ActionPattern(java.lang.String name,
                     TimeUnit time)
Initialize our action pattern with a blank list of elements

Parameters:
name - Name of this action Pattern
time - Time unit for our interval/timeout (Ymir-style)

ActionPattern

public ActionPattern(java.lang.String name,
                     TimeUnit time,
                     java.util.ArrayList children)
Create an Action Pattern with a pre-loaded list of elements

Parameters:
name - Name of this action pattern
time - Time unit for our interval/timeout (Ymir-style)
Method Detail

getElements

public java.util.ArrayList getElements()
Get the list of elements of this action pattern

Returns:
List of elements in this action pattern

getName

public java.lang.String getName()
Get the name of this action pattern

Specified by:
getName in interface INamedElement
Returns:
Name of the action pattern.

getTimeUnit

public TimeUnit getTimeUnit()
Get the timeout for this action pattern

Returns:
Time unit for our ymir like timeout/interval

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

setElements

public void setElements(java.util.ArrayList elements)
Set the list of elements used in this action pattern

Parameters:
elements - New list of elements for this action pattern

setName

public void setName(java.lang.String name)
Set the name of this action pattern

Specified by:
setName in interface INamedElement
Parameters:
name - The new name of this action pattern

setTimeUnit

public void setTimeUnit(TimeUnit unit)
Set the timeout/interval for this action pattern

Parameters:
unit - The new timeout for this action pattern.

onSelect

public void onSelect(JAbode mainGui,
                     JEditorWindow subGui,
                     JDiagram diagram)
When we click this Action Pattern 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 - Reference to the MDI
subGui - Reference to the editor window
diagram - Diagram refernece on our editing window

getSelf

public ActionPattern getSelf()

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)
Convert this element into a tree branch

Specified by:
buildTree in interface IEditableElement
Parameters:
root - The root of this sub-tree
lap - The learnable action pattern file we're part of.
detailed - Is the diagram detailed (i.e. decorative nodes)
expanded - Is this diagram expanded (i.e. show sub-tree chained elements)
Returns:
A constructed sub-tree showing this element and any sub-elements that need to be demonstrated.