gov.sandia.ccaffeine.dc.user_iface.gui
Class GlobalData

java.lang.Object
  extended by gov.sandia.ccaffeine.dc.user_iface.gui.GlobalData
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class GlobalData
extends java.lang.Object
implements java.awt.event.ActionListener


Field Summary
 java.awt.Color bgcolor
           
static java.io.PrintStream err
           
protected  int heartbeatPeriod
           
static java.io.PrintStream out
           
 boolean tutorialMode
           
 
Constructor Summary
GlobalData(java.awt.Container appFrame, Builder builder)
           
GlobalData(java.awt.Container appFrame, Builder builder, int heartbeatPeriod)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          This method is called whenever our heartbeat timer times out.
 void addConfigureDialog(ConfigureDialog dialog, java.lang.String hashKey)
           
 void addToHistory(java.lang.String s)
           
 void addToHistoryAndToDebugger(java.lang.String s)
          Add a string to the history.
 void clearHistory()
           
 java.lang.String createInstanceName(java.lang.String className)
           
 void detachFarEnd()
          Tell the far end that we are detaching.
 ActionsPanel getActionsPanel()
           
 java.awt.Container getAppFrame()
           
 Arena getArena()
           
 Builder getBuilder()
           
 int getCommandCount()
           
 ConfigureDialog getConfigureDialog(java.lang.String hashKey)
           
 java.awt.Point getDialogLocation()
           
 boolean getDocChanged()
           
 java.lang.String getDocName()
           
 boolean getDocUnsaved()
           
 boolean getDragOccurring()
           
 java.awt.Point getDropLocation()
           
 int getHeartbeatPeriod()
          Get the period (1/frequency) of the heartbeat.
 java.lang.String getHistory()
           
 Palette getPalette()
           
 java.lang.String getTitle()
           
 boolean getWaitingForPorts()
           
 void informOfChange()
           
 void initialize()
           
 boolean instancePresent(java.lang.String clazz, java.lang.String instanceName)
          query if a given instance of given type exists.
 java.lang.String newName()
           
 void p(java.lang.String s)
          Write a string to the Muxer
 void pn(java.lang.String s)
           
 void printHeirarchy(java.lang.Object o)
           
 void setActionsPanel(ActionsPanel actions)
           
 void setArena(Arena arena)
           
 void setDocChanged(boolean b)
           
 void setDocName(java.lang.String name)
           
 void setDocUnsaved(boolean b)
           
 void setDragOccurring(boolean b)
           
 void setDropLocation(java.awt.Point p)
           
 void setDropLocation(java.lang.String s)
           
 void setHeartbeatPeriod(int heartbeatPeriod)
          Set the period (1/frequency) of the heartbeat.
 void setIgnoreChanges(boolean b)
           
 void setPalette(Palette palette)
           
 void setWaitingForPorts(boolean b)
           
 void shutdownFarEnd()
          Tell the far end to shut down.
 void writeStateDataToFarEnd()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

public static java.io.PrintStream out

err

public static java.io.PrintStream err

heartbeatPeriod

protected int heartbeatPeriod

bgcolor

public java.awt.Color bgcolor

tutorialMode

public boolean tutorialMode
Constructor Detail

GlobalData

public GlobalData(java.awt.Container appFrame,
                  Builder builder,
                  int heartbeatPeriod)

GlobalData

public GlobalData(java.awt.Container appFrame,
                  Builder builder)
Method Detail

initialize

public void initialize()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
This method is called whenever our heartbeat timer times out. We will respond to this message by sending out a heartbeat to the Muxer.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
event - The event that is generated by the heartbeat timer.

addToHistoryAndToDebugger

public void addToHistoryAndToDebugger(java.lang.String s)
Add a string to the history. if the debug flag is true then write the string to stderr.

Parameters:
s - The string we are sending to history.

p

public void p(java.lang.String s)
Write a string to the Muxer

Parameters:
s - The string that we are sending to the Muxer

pn

public void pn(java.lang.String s)

newName

public java.lang.String newName()

createInstanceName

public java.lang.String createInstanceName(java.lang.String className)

informOfChange

public void informOfChange()

printHeirarchy

public void printHeirarchy(java.lang.Object o)

instancePresent

public boolean instancePresent(java.lang.String clazz,
                               java.lang.String instanceName)
query if a given instance of given type exists. This could be done differently, of course.

Parameters:
clazz - the type required in the palette.
instanceName - the name required in the arena.

shutdownFarEnd

public void shutdownFarEnd()
Tell the far end to shut down.


writeStateDataToFarEnd

public void writeStateDataToFarEnd()

detachFarEnd

public void detachFarEnd()
Tell the far end that we are detaching.


setWaitingForPorts

public void setWaitingForPorts(boolean b)

getWaitingForPorts

public boolean getWaitingForPorts()

addToHistory

public void addToHistory(java.lang.String s)

getHistory

public java.lang.String getHistory()

clearHistory

public void clearHistory()

getCommandCount

public int getCommandCount()

getDialogLocation

public java.awt.Point getDialogLocation()

setDropLocation

public void setDropLocation(java.awt.Point p)

setDropLocation

public void setDropLocation(java.lang.String s)

getDropLocation

public java.awt.Point getDropLocation()

setDragOccurring

public void setDragOccurring(boolean b)

getDragOccurring

public boolean getDragOccurring()

setDocChanged

public void setDocChanged(boolean b)

getDocChanged

public boolean getDocChanged()

setIgnoreChanges

public void setIgnoreChanges(boolean b)

setDocUnsaved

public void setDocUnsaved(boolean b)

getDocUnsaved

public boolean getDocUnsaved()

setDocName

public void setDocName(java.lang.String name)

getDocName

public java.lang.String getDocName()

getTitle

public java.lang.String getTitle()

addConfigureDialog

public void addConfigureDialog(ConfigureDialog dialog,
                               java.lang.String hashKey)

getConfigureDialog

public ConfigureDialog getConfigureDialog(java.lang.String hashKey)

getAppFrame

public java.awt.Container getAppFrame()

getBuilder

public Builder getBuilder()

setArena

public void setArena(Arena arena)

getArena

public Arena getArena()

setActionsPanel

public void setActionsPanel(ActionsPanel actions)

getActionsPanel

public ActionsPanel getActionsPanel()

setPalette

public void setPalette(Palette palette)

getPalette

public Palette getPalette()

getHeartbeatPeriod

public int getHeartbeatPeriod()
Get the period (1/frequency) of the heartbeat. This is the number of milliseconds between heartbeats.

Returns:
The period of the heartbeat

setHeartbeatPeriod

public void setHeartbeatPeriod(int heartbeatPeriod)
Set the period (1/frequency) of the heartbeat. This is the number of seconds between heartbeats.

Parameters:
heartbeatPeriod - The period of the hearbeat.