lib
Class TimeUnit

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

public class TimeUnit
extends java.lang.Object
implements IEditableElement

A TimeUnit is a measurement of time with two attributes, the interval and the unit of measurement. For example, 10 seconds, 5 hz, and so forth.

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

Field Summary
private  double dInterval
           
private  java.lang.String strUnitName
           
 
Constructor Summary
TimeUnit(java.lang.String unit, double value)
          Initialize this unit time
 
Method Summary
 JTreeNode buildTree(JTreeNode root, LearnableActionPattern lap, boolean detailed, boolean expanded)
          Build the tree structure of the file
 java.lang.String getUnitName()
          Get the name of the unit involved
 double getUnitValue()
          Get our interval value for this unit time
 void onSelect(JAbode mainGui, JEditorWindow subGui, JDiagram diagram)
          We've been selected on the diagram for editing, so populate the properties grid with editors allowing the user to change our interval and unit.
 void setUnitName(java.lang.String unitName)
          Set the name of our unit
 void setUnitValue(double value)
          Set the value of this unit of time
 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

dInterval

private double dInterval

strUnitName

private java.lang.String strUnitName
Constructor Detail

TimeUnit

public TimeUnit(java.lang.String unit,
                double value)
Initialize this unit time

Method Detail

onSelect

public void onSelect(JAbode mainGui,
                     JEditorWindow subGui,
                     JDiagram diagram)
We've been selected on the diagram for editing, so populate the properties grid with editors allowing the user to change our interval and unit.

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.

getUnitName

public java.lang.String getUnitName()
Get the name of the unit involved


getUnitValue

public double getUnitValue()
Get our interval value for this unit time


setUnitName

public void setUnitName(java.lang.String unitName)
Set the name of our unit


setUnitValue

public void setUnitValue(double value)
Set the value of this unit of time


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)
Description copied from interface: IEditableElement
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