Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

antMountGUI::PatternDlg Class Reference

List of all members.

Public Member Functions

 PatternDlg (java.awt.Frame parent, boolean modal)
void actionPerformed (ActionEvent event)
void itemStateChanged (ItemEvent event)
void mousePressed (MouseEvent e)
void mouseReleased (MouseEvent e)
void mouseClicked (MouseEvent e)
void mouseEntered (MouseEvent e)
void mouseExited (MouseEvent e)
void checkTableEditing ()

Static Public Member Functions

void main (String args[])

Private Member Functions

void displayStroke ()
void enableWidget (boolean b)
void buildStrokePanel (String strokeType)
void ratioBrowseButtons ()
void saveCurrentStroke ()
void initComponents ()
void onStrokesTF ()
void onStrokesTFFocus ()
void closeDialog (java.awt.event.WindowEvent evt)
void onBeginButton ()
void onLessButton ()
void onAddButton ()
void onRemoveButton ()
void onMoreButton ()
void onEndButton ()
void onDone ()
void onAddTableRow ()
void onAddBeforeTableRow ()
void onAddAfterTableRow ()
void onMoveUpTableRow ()
void onMoveDownTableRow ()
void checkPopup (MouseEvent e)

Private Attributes

Vector Strokes = new Vector()
int currentStroke = 0
JButton addB = new JButton()
JButton beginB = new JButton()
JPanel browsePanel = new JPanel()
JPanel jPanel1 = new JPanel()
JSeparator jSeparator1 = new JSeparator()
JButton lessB = new JButton()
JButton endB = new JButton()
JButton moreB = new JButton()
JButton removeB = new JButton()
JTextField strokesTF = new JTextField()
JPanel jPanel3 = new JPanel()
JSeparator jSeparator2 = new JSeparator()
JPanel buttonPanel = new JPanel()
JButton applyButton = new JButton()
JButton doneButton = new JButton()
JPanel strokePanel = new JPanel()
JComboBox modeCB = new JComboBox()
JLabel modeL = new JLabel()
JLabel timeL = new JLabel()
JTextField timeTF = new JTextField()
JLabel orientationL = new JLabel()
JTextField orientationTF = new JTextField()
JLabel X0L = new JLabel()
JTextField X0TF = new JTextField()
JLabel X1L = new JLabel()
JTextField X1TF = new JTextField()
JLabel Y0L = new JLabel()
JTextField Y0TF = new JTextField()
JLabel Y1L = new JLabel()
JTextField Y1TF = new JTextField()
JLabel longCenterL = new JLabel()
JLabel latCenterL = new JLabel()
JLabel polarOrientL = new JLabel()
JTextField longCenterTF = new JTextField()
JTextField latCenterTF = new JTextField()
JTextField polarOrientTF = new JTextField()
DefaultTableModel tableModel
JTable arrayT = new JTable(tableModel)
JScrollPane scrollPane = new JScrollPane(arrayT)
JPopupMenu arrayPM = new JPopupMenu()
int rowPressed = -1
int colPressed = -1
JMenuItem addBeforeMI = new JMenuItem("Add row before")
JMenuItem addAfterMI = new JMenuItem("Add row after")
JMenuItem addMI = new JMenuItem("Add row")
JMenuItem moveUpMI = new JMenuItem("Move Up")
JMenuItem moveDownMI = new JMenuItem("Move Down")
JMenuItem editMI = new JMenuItem("Edit cell")

Detailed Description

Author:
acaproni
The dialog allows the user to create a list of strokes The way each stroke is shown depends on the type of the stroke itself

The window is divided in three areas: 1. The button to navigate, add and remove the strokes 2. The fields of the current stoke 3. The buttons to terminate (Done, Apply)

While the first and the last area are fixed, the second one depends on the type of the stroke

Invariant:
Strokes!=null

Strokes.size()>=0

currentStroke>=0 && currentStroke<=Strokes.size()

Version:
1.0


Constructor & Destructor Documentation

antMountGUI::PatternDlg::PatternDlg java.awt.Frame  parent,
boolean  modal
[inline]
 

Creates new (dialog) PatternDlg

Parameters:
parent The parent frame
modal If true the dialog is modal


Member Function Documentation

void antMountGUI::PatternDlg::actionPerformed ActionEvent  event  )  [inline]
 

Receive and dispatches the ActionEvents generated by the user

Parameters:
event The event

event!=null

event.getActionCommand()!=null

event.getSource()!=null

@ assert arrayT!=null

void antMountGUI::PatternDlg::buildStrokePanel String  strokeType  )  [inline, private]
 

Build the panel with the right fields for each kind of stroke (it selects the items but doesn't fill their fields)

Parameters:
strokeType The string that describes the type of the stroke
Precondition:
strokeType!=null

strokeType.compareToIgnoreCase("Linear")==0 || strokeType.compareToIgnoreCase("Arc")==0 || strokeType.compareToIgnoreCase("Curve")==0

void antMountGUI::PatternDlg::checkPopup MouseEvent  e  )  [inline, private]
 

If the pop menu has to be shown, this method visualizes and hides the items depending on the position where the mouse button was pressed and then it alsoi shows the menu

Parameters:
e The event received

e!=null

rowPressed>=-1

colPressed>=-1

arrayT!=null

void antMountGUI::PatternDlg::checkTableEditing  )  [inline]
 

Check if the user was editing a cell of the table and eventually terminate the editing (acquiring the data)

arrayT!=null

editor!=null

void antMountGUI::PatternDlg::closeDialog java.awt.event.WindowEvent  evt  )  [inline, private]
 

Closes the dialog

Parameters:
evt The event

void antMountGUI::PatternDlg::displayStroke  )  [inline, private]
 

Display the current stroke

stroke!=null

arrayT!=null

model!=null

void antMountGUI::PatternDlg::enableWidget boolean  b  )  [inline, private]
 

Enable or disable the widgets of the window It manages the fields but not the browse buttons

Parameters:
b The widgets are enabled if the parameter is true

void antMountGUI::PatternDlg::initComponents  )  [inline, private]
 

This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.

void antMountGUI::PatternDlg::itemStateChanged ItemEvent  event  )  [inline]
 

Manages the event generated when the user changes the type of the stroke It build the panel for the right stroke panel

This method is executed when the item changed (the change may be generated either by the user or the process)

event!=null

void antMountGUI::PatternDlg::main String  args[]  )  [inline, static]
 

Parameters:
args the command line arguments

void antMountGUI::PatternDlg::mouseClicked MouseEvent  e  )  [inline]
 

The user clicked a mouse button

Parameters:
The event

void antMountGUI::PatternDlg::mouseEntered MouseEvent  e  )  [inline]
 

The mouse enters a component

Parameters:
The event

void antMountGUI::PatternDlg::mouseExited MouseEvent  e  )  [inline]
 

The mouse exited a component

Parameters:
The event

void antMountGUI::PatternDlg::mousePressed MouseEvent  e  )  [inline]
 

The user pressed the mouse button

Parameters:
e The event

void antMountGUI::PatternDlg::mouseReleased MouseEvent  e  )  [inline]
 

The user released the mouse button

Parameters:
The event

void antMountGUI::PatternDlg::onAddAfterTableRow  )  [inline, private]
 

The user wants to add a new row after the row over the mouse pointer

Postcondition:
((DefaultTableModel)arrayT.getModel()).getRowCount()==($pre(int,((DefaultTableModel)arrayT.getModel()).getRowCount())+1)

arrayT!=null

model!=null

void antMountGUI::PatternDlg::onAddBeforeTableRow  )  [inline, private]
 

The user wants to add a new row before the row over the mouse pointer

Postcondition:
((DefaultTableModel)arrayT.getModel()).getRowCount()==($pre(int,((DefaultTableModel)arrayT.getModel()).getRowCount())+1)

arrayT!=null

model!=null

void antMountGUI::PatternDlg::onAddButton  )  [inline, private]
 

Executed when the user create a new stroke It instatiates a new (empty) stroke that insert into the vector at the requested position then the new stroke is shown

Postcondition:
Strokes.size()==($pre(int,Strokes.size()))+1

arrayT!=null

model!=null

void antMountGUI::PatternDlg::onAddTableRow  )  [inline, private]
 

The user wants to add a new row

Postcondition:
((DefaultTableModel)arrayT.getModel()).getRowCount() ==($pre(int,((DefaultTableModel)arrayT.getModel()).getRowCount())+1)

arrayT!=null

model!=null

void antMountGUI::PatternDlg::onBeginButton  )  [inline, private]
 

Save the current item and go to the beginning of the list

Postcondition:
currentStroke==1

void antMountGUI::PatternDlg::onDone  )  [inline, private]
 

The user has just terminated

void antMountGUI::PatternDlg::onEndButton  )  [inline, private]
 

Save the current item and go to the end

Postcondition:
currentStroke==Strokes.size()

void antMountGUI::PatternDlg::onLessButton  )  [inline, private]
 

Save the current item and go to the previous item

Postcondition:
currentStroke==($pre(int,currentStroke))-1

void antMountGUI::PatternDlg::onMoreButton  )  [inline, private]
 

Save the current item and go to the next item

Postcondition:
currentStroke==($pre(int,currentStroke))+1

void antMountGUI::PatternDlg::onMoveDownTableRow  )  [inline, private]
 

The user wants to move down a row of the table

Postcondition:
((DefaultTableModel)arrayT.getModel()).getRowCount() ==($pre(int,((DefaultTableModel)arrayT.getModel()).getRowCount()))

void antMountGUI::PatternDlg::onMoveUpTableRow  )  [inline, private]
 

The user wants to move up a row of the table

Postcondition:
((DefaultTableModel)arrayT.getModel()).getRowCount()==($pre(int,((DefaultTableModel)arrayT.getModel()).getRowCount()))

void antMountGUI::PatternDlg::onRemoveButton  )  [inline, private]
 

The user wants to remove the stroke

Postcondition:
Strokes.size()==($pre(int,Strokes.size())-1)

currentStroke==($pre(int,currentStroke)-1)

void antMountGUI::PatternDlg::onStrokesTF  )  [inline, private]
 

Read the value inserted by the user and display the requested item

void antMountGUI::PatternDlg::onStrokesTFFocus  )  [inline, private]
 

Select the text into the field

void antMountGUI::PatternDlg::ratioBrowseButtons  )  [inline, private]
 

Enable or disable the navigation buttons depending on the available strokes and the displayed stroke

void antMountGUI::PatternDlg::saveCurrentStroke  )  [inline, private]
 

Save the currently displayed stroke in the Stroke vector The type of the stroke created and stored into the vector depends from the tipe chosen by the user in the combobox

Postcondition:
Strokes.size() == ($pre(int,Strokes.size()))+1

model!=null

v!=null

row!=null


Member Data Documentation

JMenuItem antMountGUI::PatternDlg::addAfterMI = new JMenuItem("Add row after") [private]
 

The popup menu item to add a row after that above the mouse pointer

JButton antMountGUI::PatternDlg::addB = new JButton() [private]
 

The add button

JMenuItem antMountGUI::PatternDlg::addBeforeMI = new JMenuItem("Add row before") [private]
 

The popup menu item to add a row before that above the mouse pointer

JMenuItem antMountGUI::PatternDlg::addMI = new JMenuItem("Add row") [private]
 

The popup menu item to append a new row

JButton antMountGUI::PatternDlg::applyButton = new JButton() [private]
 

The apply button

JPopupMenu antMountGUI::PatternDlg::arrayPM = new JPopupMenu() [private]
 

The popup menu that apperas when the user press the right mouse button over tha table

JTable antMountGUI::PatternDlg::arrayT = new JTable(tableModel) [private]
 

The table that displays the arrays

JButton antMountGUI::PatternDlg::beginB = new JButton() [private]
 

The begin button

JPanel antMountGUI::PatternDlg::browsePanel = new JPanel() [private]
 

The panel that contains all the buttons to navigate through the strokes

JPanel antMountGUI::PatternDlg::buttonPanel = new JPanel() [private]
 

A panel for the buttons

int antMountGUI::PatternDlg::colPressed = -1 [private]
 

Remember the table col over which the user pressed a mouse button

int antMountGUI::PatternDlg::currentStroke = 0 [private]
 

The index of the currently displayed stroke (0 doesn't exist) It is always between 1 and Strokes.size()

JButton antMountGUI::PatternDlg::doneButton = new JButton() [private]
 

The Done button

JMenuItem antMountGUI::PatternDlg::editMI = new JMenuItem("Edit cell") [private]
 

The popup menu item to edit the cell under the mouse pointer

JButton antMountGUI::PatternDlg::endB = new JButton() [private]
 

The button to move to the last stroke

JPanel antMountGUI::PatternDlg::jPanel1 = new JPanel() [private]
 

Support panel for the buttons to browse the strokes

JPanel antMountGUI::PatternDlg::jPanel3 = new JPanel() [private]
 

Another (support) panel for the apply and done buttons

JSeparator antMountGUI::PatternDlg::jSeparator1 = new JSeparator() [private]
 

The separator (just a line) between the buttons to navigate the strokes and the rest of the panel

JSeparator antMountGUI::PatternDlg::jSeparator2 = new JSeparator() [private]
 

A separator (just a line) upon the Apply and Done buttons

JLabel antMountGUI::PatternDlg::latCenterL = new JLabel() [private]
 

The label for the latitude center

JTextField antMountGUI::PatternDlg::latCenterTF = new JTextField() [private]
 

The text field for the latitude center

JButton antMountGUI::PatternDlg::lessB = new JButton() [private]
 

The less button (move to the previous stroke)

JLabel antMountGUI::PatternDlg::longCenterL = new JLabel() [private]
 

The label for the longitude center

JTextField antMountGUI::PatternDlg::longCenterTF = new JTextField() [private]
 

The text field for the longitude center

JComboBox antMountGUI::PatternDlg::modeCB = new JComboBox() [private]
 

The mode (combo box)

JLabel antMountGUI::PatternDlg::modeL = new JLabel() [private]
 

The mode (label)

JButton antMountGUI::PatternDlg::moreB = new JButton() [private]
 

The button to move to the next stroke

JMenuItem antMountGUI::PatternDlg::moveDownMI = new JMenuItem("Move Down") [private]
 

The popup menu item to move down the current line

JMenuItem antMountGUI::PatternDlg::moveUpMI = new JMenuItem("Move Up") [private]
 

The popup menu item to move up the current line

JLabel antMountGUI::PatternDlg::orientationL = new JLabel() [private]
 

The label for orientation

JTextField antMountGUI::PatternDlg::orientationTF = new JTextField() [private]
 

The text field for orientation

JLabel antMountGUI::PatternDlg::polarOrientL = new JLabel() [private]
 

The label for the polar orientation

JTextField antMountGUI::PatternDlg::polarOrientTF = new JTextField() [private]
 

The text field for the polar orientation

JButton antMountGUI::PatternDlg::removeB = new JButton() [private]
 

The button to delete the current stroke

int antMountGUI::PatternDlg::rowPressed = -1 [private]
 

Remember the table row over which the user pressed a mouse button

JScrollPane antMountGUI::PatternDlg::scrollPane = new JScrollPane(arrayT) [private]
 

The scroll bar of the table of arrays

JPanel antMountGUI::PatternDlg::strokePanel = new JPanel() [private]
 

Vector antMountGUI::PatternDlg::Strokes = new Vector() [private]
 

The vector of patterns (empty at startup)

JTextField antMountGUI::PatternDlg::strokesTF = new JTextField() [private]
 

The text field to insert the number of the stroke to move to

DefaultTableModel antMountGUI::PatternDlg::tableModel [private]
 

Initial value:

new DefaultTableModel( new String[][] {{"0.0", "0.0", "0.0"}, {"0.0", "0.0" , "0.0"}}, new String[] {"X (ddmmss.d)", "Y (ddmmss.d/s)", "time rel. (s)"} )
The table model for the table of arrays (it stores the values inserted by the user)

JLabel antMountGUI::PatternDlg::timeL = new JLabel() [private]
 

The label for the time

JTextField antMountGUI::PatternDlg::timeTF = new JTextField() [private]
 

The text field for the time

JLabel antMountGUI::PatternDlg::X0L = new JLabel() [private]
 

Tha label for xArray[0]

JTextField antMountGUI::PatternDlg::X0TF = new JTextField() [private]
 

The text field for xArray[0]

JLabel antMountGUI::PatternDlg::X1L = new JLabel() [private]
 

The label for xArray[1]

JTextField antMountGUI::PatternDlg::X1TF = new JTextField() [private]
 

The text field for xArray[1]

JLabel antMountGUI::PatternDlg::Y0L = new JLabel() [private]
 

The label for yArray[0]

JTextField antMountGUI::PatternDlg::Y0TF = new JTextField() [private]
 

The text field for yArra[0]

JLabel antMountGUI::PatternDlg::Y1L = new JLabel() [private]
 

The label for yArray[1]

JTextField antMountGUI::PatternDlg::Y1TF = new JTextField() [private]
 

The text field for yArray[1]


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 03:07:56 2009 for ACS Java API by doxygen 1.3.8