cl::utfsm::samplingSystemUI::BeanGrouper Class Reference

Inheritance diagram for cl::utfsm::samplingSystemUI::BeanGrouper:
Inheritance graph
[legend]
Collaboration diagram for cl::utfsm::samplingSystemUI::BeanGrouper:
Collaboration graph
[legend]

List of all members.

Classes

class  ScriptRunner
class  Watchdog

Public Member Functions

 BeanGrouper (SamplingSystemGUI ssg, String group, int status)
void addSamp (String component, String property)
void updateLabel ()
void runScript ()
void setStatus (int status)
boolean Ready2Samp ()
void setGroupName (String name)
String getGroupName ()
boolean checkIfExists (String component, String property)
ArrayList< SerializablePropertygetSerializableProperty ()
void loadConfiguration (long frequency, int timeWindow, int samplingTime)
ScriptExecutor getScript ()
void setScript (ScriptExecutor script)
void windowActivated (WindowEvent e)
void windowClosed (WindowEvent e)
void windowDeactivated (WindowEvent e)
void windowDeiconified (WindowEvent e)
void windowIconified (WindowEvent e)
void windowOpened (WindowEvent e)
void windowClosing (WindowEvent e)

Package Attributes

SamplingDataCorrelator _sdc

Private Member Functions

void initialize ()
void askClose ()
JButton getCleanButton ()
StatusIcon getStatusIcon ()
JToggleButton getPauseButton ()
JButton getStartButton ()
JButton getStopButton ()
JLabel getTimeSampLabel ()
JSpinner getTimeSampSpinner ()
JLabel getTimeWindowLabel ()
JSpinner getTimeWindowSpinner ()
JLabel getFrequencyLabel ()
JSpinner getFreqSpinner ()
JButton getResetFrequencyButton ()
JToggleButton getSaveButton ()
JLabel getFileNameLabel ()
JComboBox getStatusComboBox ()
void addToStatusComboBox (String status)
void updateStatusComboBox ()
JMenuBar getBeanGrouperMenuBar ()
JMenu getScriptMenu ()
JMenuItem getDelScriptMenuItem ()
JMenuItem getAddScriptMenuItem ()
void addSamp (DataPrinter w)
void startSample ()
void setStatusIcon (int status)
void stopSample ()
void setTimeWindow ()

Private Attributes

SamplingSystemGUI ssg = null
JButton startButton = null
JToggleButton pauseButton = null
JButton stopButton = null
JButton resetFrequencyButton = null
JButton cleanButton = null
JLabel frecuencyLabel = null
JSpinner freqSpinner = null
JLabel timeSampLabel = null
JSpinner timeSampSpinner = null
JLabel timeWindowLabel = null
JSpinner timeWindowSpinner = null
JToggleButton saveButton = null
JLabel fileNameLabel = null
JComboBox statusComboBox = null
StatusIcon statusIcon
JMenuItem addScriptMenuItem
JMenuItem delScriptMenuItem
JMenu scriptMenu
JMenuBar beanGrouperMenuBar
ArrayList< DataPrintersamplers = null
boolean ready2samp = false
boolean isStopped = true
String group
boolean faultErrorAddedToStatusBox = false
boolean pausedGraph = false
ScriptExecutor script = null

Static Private Attributes

static final long serialVersionUID = 6190720245608994272L

Detailed Description

Displays the GUI for a Sampling Group, allowing plotting and control of its functions.

Class that works as a displayable container of sampling items. It has an internal state to check if it's selected to be sampled (a check-box) and N samples, which will start parallel to one another once the "Start Sample(s)" button from the GUI is pressed.

Author:
Alejandro Baltra <abaltra@alumnos.inf.utfsm.cl>
Rodrigo Tobar <rtobar@inf.utfsm.cl>
Jorge Avarias <javarias@inf.utfsm.cl>
Arturo Hoffstadt <ahoffsta@inf.utfsm.cl>

Constructor & Destructor Documentation

cl::utfsm::samplingSystemUI::BeanGrouper::BeanGrouper ( SamplingSystemGUI  ssg,
String  group,
int  status 
) [inline]

This is the overloaded constructor that allows to save the Sampling Group name

Parameters:
ssg The Sampling Group this BeanGrouper is attached to.
group The name of the Sampling Group this BeanGrouper is grouping.

References getStatusIcon(), initialize(), and cl::utfsm::samplingSystemUI::StatusIcon::setStatus().


Member Function Documentation

void cl::utfsm::samplingSystemUI::BeanGrouper::addSamp ( String  component,
String  property 
) [inline]

This method ads to the Sampling Group, a new sample. This method is used by
SamplingSystemGUI to add Sampling to the Sampling Group, represented by BeanGrouper.

  • Creates a PlotPrinter, which extends from DataPrinter.
  • Set the Components and Properties to the PlotPrinter
  • Adds this new Sample to the Sampling Group using the other addSamp method.
    Parameters:
    component Name of the Component containing the property to be sampled.
    property Name of the Property to be sampled.

References addSamp(), cl::utfsm::samplingSystemUI::SamplingSystemGUI::addToSampled(), getSaveButton(), group, isStopped, samplers, cl::utfsm::samplingSystemUI::PlotPrinter::setComponent(), cl::utfsm::samplingSystemUI::PlotPrinter::setDumpToFile(), cl::utfsm::samplingSystemUI::PlotPrinter::setProperty(), and ssg.

void cl::utfsm::samplingSystemUI::BeanGrouper::addSamp ( DataPrinter  w  )  [inline, private]

This method adds a new sample (represented as a DataPrinter) into this class.
This class should be able to hold N samples inside itself.

  • First, the BeanLister widget contained by the DataPrinter is added to the jPanel
  • Second, the DataPrinter is added to the list of samplers.
    Parameters:
    w The Printer Object that is used to represent a sampling by its own.

References cl::utfsm::samplingSystemUI::DataPrinter::getWidget(), samplers, and updateLabel().

Referenced by addSamp(), and cl::utfsm::samplingSystemUI::SamplingSystemGUI::addToSampling().

void cl::utfsm::samplingSystemUI::BeanGrouper::addToStatusComboBox ( String  status  )  [inline, private]

References statusComboBox.

Referenced by startSample(), and stopSample().

void cl::utfsm::samplingSystemUI::BeanGrouper::askClose (  )  [inline, private]
boolean cl::utfsm::samplingSystemUI::BeanGrouper::checkIfExists ( String  component,
String  property 
) [inline]
JMenuItem cl::utfsm::samplingSystemUI::BeanGrouper::getAddScriptMenuItem (  )  [inline, private]
JMenuBar cl::utfsm::samplingSystemUI::BeanGrouper::getBeanGrouperMenuBar (  )  [inline, private]

References beanGrouperMenuBar, and getScriptMenu().

Referenced by initialize().

JButton cl::utfsm::samplingSystemUI::BeanGrouper::getCleanButton (  )  [inline, private]

This method clean the graphic
This JButton when you click it remove all points in the trace

Returns:
javax.swing.JButton Reference to the Clean Button.

References cleanButton, and samplers.

Referenced by initialize().

JMenuItem cl::utfsm::samplingSystemUI::BeanGrouper::getDelScriptMenuItem (  )  [inline, private]
JLabel cl::utfsm::samplingSystemUI::BeanGrouper::getFileNameLabel (  )  [inline, private]

Initializes the Label that says "Sampling To:"

Returns:
javax.swing.JLabel Reference to the Label.

References fileNameLabel.

Referenced by initialize(), and startSample().

JSpinner cl::utfsm::samplingSystemUI::BeanGrouper::getFreqSpinner (  )  [inline, private]

Initializes the TextField that will allow to input the desired Frequency for the Sampling Group.
By default the value is 10 Hz.
Also checks for its correctness when the value changes.

Returns:
javax.swing.JTextField Reference to the Text Field containing the number.

References freqSpinner, and samplers.

Referenced by initialize(), loadConfiguration(), and setTimeWindow().

JLabel cl::utfsm::samplingSystemUI::BeanGrouper::getFrequencyLabel (  )  [inline, private]

Initializes the Frequency Label

Returns:
javax.swing.JLabel Reference to the Label says "Frequency".

References frecuencyLabel.

Referenced by initialize().

String cl::utfsm::samplingSystemUI::BeanGrouper::getGroupName (  )  [inline]

Generic getter for the group name

Returns:
The name of group.

References group.

Referenced by cl::utfsm::samplingSystemUI::SamplingSystemGUI::addToSampling(), getSerializableProperty(), and windowClosing().

JToggleButton cl::utfsm::samplingSystemUI::BeanGrouper::getPauseButton (  )  [inline, private]

This method pause the graphic in movement
This JButton when click do a pause of the graphic, but the sampling still running

Returns:
javax.swing.JButton Reference to the Pause Button.

References pauseButton, pausedGraph, and samplers.

Referenced by initialize().

JButton cl::utfsm::samplingSystemUI::BeanGrouper::getResetFrequencyButton (  )  [inline, private]

This method initializes resetFrequencyButton
This JButton when click do a kind of "Reset" in the frequency of the Samp

Returns:
javax.swing.JButton Reference to the Reset Frequency Button.

References freqSpinner, getSaveButton(), getTimeSampSpinner(), pauseButton, resetFrequencyButton, startButton, startSample(), stopButton, stopSample(), and timeSampSpinner.

Referenced by initialize().

JToggleButton cl::utfsm::samplingSystemUI::BeanGrouper::getSaveButton (  )  [inline, private]
ScriptExecutor cl::utfsm::samplingSystemUI::BeanGrouper::getScript (  )  [inline]

References script.

JMenu cl::utfsm::samplingSystemUI::BeanGrouper::getScriptMenu (  )  [inline, private]
ArrayList<SerializableProperty> cl::utfsm::samplingSystemUI::BeanGrouper::getSerializableProperty (  )  [inline]
JButton cl::utfsm::samplingSystemUI::BeanGrouper::getStartButton (  )  [inline, private]

This method initializes startButton
This JButton when click do a lot of effects, among them:

  • Enabling and Disabling the corresponding widgets in the GUI.
  • Starts the Sample
    Returns:
    javax.swing.JButton Reference to the Start Button.

References getSaveButton(), getTimeSampSpinner(), pauseButton, setTimeWindow(), startButton, startSample(), and stopButton.

Referenced by getAddScriptMenuItem(), getDelScriptMenuItem(), and initialize().

JComboBox cl::utfsm::samplingSystemUI::BeanGrouper::getStatusComboBox (  )  [inline, private]

References statusComboBox.

Referenced by initialize(), startSample(), and stopSample().

StatusIcon cl::utfsm::samplingSystemUI::BeanGrouper::getStatusIcon (  )  [inline, private]
JButton cl::utfsm::samplingSystemUI::BeanGrouper::getStopButton (  )  [inline, private]

Initializes the Stop Button, and also performs on click, the stop of the Sampling.

Returns:
javax.swing.JButton Reference to the Stop Button

References freqSpinner, pauseButton, pausedGraph, samplers, stopButton, stopSample(), and timeSampSpinner.

Referenced by initialize().

JLabel cl::utfsm::samplingSystemUI::BeanGrouper::getTimeSampLabel (  )  [inline, private]

Initializes the Label that says "Sampling time:"

Returns:
javax.swing.JLabel Reference to the Label.

References timeSampLabel.

Referenced by initialize().

JSpinner cl::utfsm::samplingSystemUI::BeanGrouper::getTimeSampSpinner (  )  [inline, private]

Initializes the TextField that will allow to input the desired Sampling Time for the Sampling Group.
By default the value is 0, which means infinite time (or until stop button is pressed).
Also checks for its correctness when the value changes.

Returns:
javax.swing.JTextField Reference to the Text Field containing the number.

References timeSampSpinner.

Referenced by getAddScriptMenuItem(), getDelScriptMenuItem(), getResetFrequencyButton(), getSerializableProperty(), getStartButton(), initialize(), loadConfiguration(), and startSample().

JLabel cl::utfsm::samplingSystemUI::BeanGrouper::getTimeWindowLabel (  )  [inline, private]

Initializes the Label that says "Time Window:"

Returns:
javax.swing.JLabel Reference to the Label.

References timeWindowLabel.

Referenced by initialize().

JSpinner cl::utfsm::samplingSystemUI::BeanGrouper::getTimeWindowSpinner (  )  [inline, private]

Initializes the TextField that will allow to input the desired Time Window for the Sampling Group.
By default the value is 10, which means 10 minutes.
Also checks for its correctness when the value changes.

Returns:
javax.swing.JTextField Reference to the Text Field containing the number.

References setTimeWindow(), and timeWindowSpinner.

Referenced by getSerializableProperty(), initialize(), loadConfiguration(), and setTimeWindow().

void cl::utfsm::samplingSystemUI::BeanGrouper::initialize (  )  [inline, private]
void cl::utfsm::samplingSystemUI::BeanGrouper::loadConfiguration ( long  frequency,
int  timeWindow,
int  samplingTime 
) [inline]
boolean cl::utfsm::samplingSystemUI::BeanGrouper::Ready2Samp (  )  [inline]

Getter for a boolean status check.

Returns:
True if the Group is selected for sampling, false in the other case

References ready2samp.

void cl::utfsm::samplingSystemUI::BeanGrouper::runScript (  )  [inline]
void cl::utfsm::samplingSystemUI::BeanGrouper::setGroupName ( String  name  )  [inline]

Generic setter for the Group name

Parameters:
name Name of the group

References group.

Referenced by cl::utfsm::samplingSystemUI::SamplingSystemGUI::addToSampling().

void cl::utfsm::samplingSystemUI::BeanGrouper::setScript ( ScriptExecutor  script  )  [inline]
void cl::utfsm::samplingSystemUI::BeanGrouper::setStatus ( int  status  )  [inline]

Method used by the SamplingSystemGUI to set the status icon when a new sampling manager is selected

Parameters:
status 

References isStopped, and setStatusIcon().

void cl::utfsm::samplingSystemUI::BeanGrouper::setStatusIcon ( int  status  )  [inline, private]
void cl::utfsm::samplingSystemUI::BeanGrouper::setTimeWindow (  )  [inline, private]
void cl::utfsm::samplingSystemUI::BeanGrouper::startSample (  )  [inline, private]
void cl::utfsm::samplingSystemUI::BeanGrouper::stopSample (  )  [inline, private]
void cl::utfsm::samplingSystemUI::BeanGrouper::updateLabel (  )  [inline]

Referenced by addSamp().

void cl::utfsm::samplingSystemUI::BeanGrouper::updateStatusComboBox (  )  [inline, private]

References statusComboBox.

Referenced by startSample(), and stopSample().

void cl::utfsm::samplingSystemUI::BeanGrouper::windowActivated ( WindowEvent  e  )  [inline]
void cl::utfsm::samplingSystemUI::BeanGrouper::windowClosed ( WindowEvent  e  )  [inline]
void cl::utfsm::samplingSystemUI::BeanGrouper::windowClosing ( WindowEvent  e  )  [inline]
void cl::utfsm::samplingSystemUI::BeanGrouper::windowDeactivated ( WindowEvent  e  )  [inline]
void cl::utfsm::samplingSystemUI::BeanGrouper::windowDeiconified ( WindowEvent  e  )  [inline]
void cl::utfsm::samplingSystemUI::BeanGrouper::windowIconified ( WindowEvent  e  )  [inline]
void cl::utfsm::samplingSystemUI::BeanGrouper::windowOpened ( WindowEvent  e  )  [inline]

Member Data Documentation

Referenced by startSample(), and stopSample().

Referenced by getAddScriptMenuItem().

Referenced by getBeanGrouperMenuBar().

Referenced by getCleanButton().

Referenced by getDelScriptMenuItem().

Referenced by startSample().

Referenced by getFileNameLabel().

Referenced by getFrequencyLabel().

Referenced by getPauseButton(), and getStopButton().

Referenced by Ready2Samp().

Referenced by getResetFrequencyButton().

Referenced by getSaveButton().

Referenced by getScriptMenu().

final long cl::utfsm::samplingSystemUI::BeanGrouper::serialVersionUID = 6190720245608994272L [static, private]

Generated serialVersionUID by Eclipse

Referenced by addSamp(), askClose(), and windowClosing().

Referenced by getStatusIcon().

Referenced by getTimeSampLabel().

Referenced by getTimeWindowLabel().

Referenced by getTimeWindowSpinner().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2