com::cosylab::cdb::browser::Browser Class Reference

Inheritance diagram for com::cosylab::cdb::browser::Browser:
Inheritance graph
[legend]
Collaboration diagram for com::cosylab::cdb::browser::Browser:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void createGUI ()
void createTabbedPane (LinkedHashMap attributes, String XML)
void setRightComp (JComponent component, boolean showButtons)
void setLeftComp ()
void display (String message, boolean newLine)
void setPath (String newLoc)
String getPath ()
void enableButtons (boolean enable)
boolean buttonsEnabled ()
void actionPerformed (ActionEvent e)

Static Public Member Functions

static Browser getInstance ()
static void main (String[]args)

Package Functions

 Browser ()

Private Attributes

JTextArea messageTextArea
JSplitPane splitPane
final int dividerLocation = 240
JTextField currentLocation
final JButton saveChanges = new JButton(" Save Changes to XML record ")
final JButton resetData = new JButton(" Reset Data ")
JButton refreshTree = new JButton(" Refrest CDB Tree ")
final String titleCol1 = "ATTRIBUTE NAME"
final String titleCol2 = "ATTRIBUTE VALUE"

Static Private Attributes

static Browser instance = null
static String strIOR = null

Detailed Description

This class is responsible for initialising and placing all Components inside the GUI.

Author:
Hernan Raffi
Version:
2.0

Constructor & Destructor Documentation

com::cosylab::cdb::browser::Browser::Browser (  )  [inline, package]

Constructor of the Browser class.

References buttonsEnabled().

Referenced by getInstance().


Member Function Documentation

void com::cosylab::cdb::browser::Browser::actionPerformed ( ActionEvent  e  )  [inline]

Invoked when an action occurs (User presses the button).

Parameters:
e A semantic event which indicates that a component-defined action occured.

References buttonsEnabled(), display(), getPath(), messageTextArea, refreshTree, resetData, saveChanges, setLeftComp(), setPath(), and setRightComp().

boolean com::cosylab::cdb::browser::Browser::buttonsEnabled (  )  [inline]

Checks if the buttons (on top pf the tabbed pane) are enabled. true if buttons are enabled; false otherwise.

References resetData, and saveChanges.

Referenced by actionPerformed(), and Browser().

void com::cosylab::cdb::browser::Browser::createGUI (  )  [inline]

Sets up the Graphical User Interface (GUI) of the Browser. The GUI is divided into three sections: left side, where the CDB Tree will be visible; right side for the output (tabbed pane) and the bottom for the message text area. CDB tree (left) and the tabbed panes (right) are separeted by a JSplitPane object. On top of the GUI there is a location bar (shows the current selected path in th tree).

References currentLocation, messageTextArea, refreshTree, resetData, saveChanges, setLeftComp(), setRightComp(), and splitPane.

Referenced by main().

void com::cosylab::cdb::browser::Browser::createTabbedPane ( LinkedHashMap  attributes,
String  XML 
) [inline]

Create the tabbed pane with two tabs (Table View and XML View).

Parameters:
nodeHashMap data of the entry (null is possible).
xml XML record of the node (null is possible).

References setRightComp(), titleCol1, and titleCol2.

void com::cosylab::cdb::browser::Browser::display ( String  message,
boolean  newLine 
) [inline]

Adds some text to the message area at the buttom of the GUI.

Parameters:
message the text to be added.
newLine dispalay message in the next (new) line.

References messageTextArea.

Referenced by actionPerformed().

void com::cosylab::cdb::browser::Browser::enableButtons ( boolean  enable  )  [inline]

Enables/Disables both buttons: saveChanges & resetData

Parameters:
enable enable or disable both buttons.

References resetData, and saveChanges.

static Browser com::cosylab::cdb::browser::Browser::getInstance (  )  [inline, static]

Only one instance of the Browser class can be created at any time during program execution.

Returns:
always the same instance of the Browser class.

References Browser(), and instance.

Referenced by main().

String com::cosylab::cdb::browser::Browser::getPath (  )  [inline]

Returns the path of the current selected tree node.

Returns:
String current selected tree path.

References currentLocation.

Referenced by actionPerformed().

static void com::cosylab::cdb::browser::Browser::main ( String[]  args  )  [inline, static]

The main method.

Parameters:
args the IOR (Input Output reference) which represents the DAL access parameters.

References createGUI(), getInstance(), instance, and strIOR.

void com::cosylab::cdb::browser::Browser::setLeftComp (  )  [inline]

Sets the cdb Tree in the left side of the GUI.

References dividerLocation, splitPane, and strIOR.

Referenced by actionPerformed(), and createGUI().

void com::cosylab::cdb::browser::Browser::setPath ( String  newLoc  )  [inline]

Updates the location text field.

Parameters:
newLoc the new selected location.

References currentLocation.

Referenced by actionPerformed().

void com::cosylab::cdb::browser::Browser::setRightComp ( JComponent  component,
boolean  showButtons 
) [inline]

Sets the right component either a tabbed Pane or an empty text area.

Parameters:
component the component that is added to the right side of the GUI.
showButtons true only if component is instance of JTabbedPane.

References dividerLocation, resetData, saveChanges, and splitPane.

Referenced by actionPerformed(), createGUI(), and createTabbedPane().


Member Data Documentation

Text Field that shows the selected tree path. Located on top of the Browsers GUI.

Referenced by createGUI(), getPath(), and setPath().

The location where the separation occurs.

Referenced by setLeftComp(), and setRightComp().

The instance of the Browser class used during execution.

Referenced by getInstance(), and main().

The message text area (Bottom of the GUI)

Referenced by actionPerformed(), createGUI(), and display().

JButton com::cosylab::cdb::browser::Browser::refreshTree = new JButton(" Refrest CDB Tree ") [private]

Button used to refresh the CDB tree (located on top of the CDB tree).

Referenced by actionPerformed(), and createGUI().

final JButton com::cosylab::cdb::browser::Browser::resetData = new JButton(" Reset Data ") [private]

Button used to reset an XML record (located on top of the tabbed pane).

Referenced by actionPerformed(), buttonsEnabled(), createGUI(), enableButtons(), and setRightComp().

final JButton com::cosylab::cdb::browser::Browser::saveChanges = new JButton(" Save Changes to XML record ") [private]

Button used to Save Changes to an XML record (located on top of the tabbed pane).

Referenced by actionPerformed(), buttonsEnabled(), createGUI(), enableButtons(), and setRightComp().

JSlit Pane used to separete the CDB tree and the tabbed Pane window.

Referenced by createGUI(), setLeftComp(), and setRightComp().

String com::cosylab::cdb::browser::Browser::strIOR = null [static, private]

The IOR (Input Output reference) string which represents the DAL access parameters.

Referenced by main(), and setLeftComp().

final String com::cosylab::cdb::browser::Browser::titleCol1 = "ATTRIBUTE NAME" [private]

Referenced by createTabbedPane().

final String com::cosylab::cdb::browser::Browser::titleCol2 = "ATTRIBUTE VALUE" [private]

Referenced by createTabbedPane().


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

Generated by  doxygen 1.6.2