Class GUI

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Frame
                  extended byjavax.swing.JFrame
                      extended byGUI
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class GUI
extends javax.swing.JFrame

GUI - Graphical User Interface This class is responsible for the graphical presentation. The code is created by Netbeans Form Designer IDE 5.0. All components are taken from java swing class.

Author:
Alexander Scheidl
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  javax.swing.ButtonGroup buttonGroup1
          ButtonGroup for 'yes' or 'no' computing results
private  javax.swing.ButtonGroup buttonGroup2
          Buttongroup for 'yes' or 'no' of vote export to csv
private  javax.swing.ButtonGroup buttonGroup3
          Buttongroup for 'yes' or 'no' of vote export to csv with signature strings
private  javax.swing.JButton jButton1
          start button for process start
private  javax.swing.JButton jButton2
          'choose' button for filepath to vote export
private  javax.swing.JButton jButton3
          'choose' button for filepath to option file
private  javax.swing.JButton jButton4
          'load' button for option file
private  javax.swing.JButton jButton5
          'choose' button for filepath to key file
private  javax.swing.JButton jButton6
          'load' button for key file
private  javax.swing.JButton jButton7
          'choose' button for filepath to ballot file
private  javax.swing.JButton jButton8
          'load' button for ballot file
private  javax.swing.JButton jButton9
          'choose' button for filepath to vote export with signature
private  javax.swing.JLabel jLabel1
          shows load status of option file
private  javax.swing.JLabel jLabel2
          shows load status of key file
private  javax.swing.JLabel jLabel3
          shows load status of ballot file
private  javax.swing.JLabel jLabel4
          label 'compute and display results'
private  javax.swing.JLabel jLabel5
          label 'vote export to csv'
private  javax.swing.JLabel jLabel6
          label 'vote export to csv with signature'
private  javax.swing.JLabel jLabel7
          label 'file' for path to csv file
private  javax.swing.JLabel jLabel8
          label 'file' for path to csv file with signature
private  javax.swing.JMenu jMenu1
          Menu
private  javax.swing.JMenuBar jMenuBar1
          Menu Bar
private  javax.swing.JMenuItem jMenuItem1
          item 'Close'
private  javax.swing.JMenuItem jMenuItem2
          item 'Reset'
private  javax.swing.JMenuItem jMenuItem3
          item 'About'
private  javax.swing.JPanel jPanel1
          Option file panel
private  javax.swing.JPanel jPanel2
          Key file panel
private  javax.swing.JPanel jPanel3
          ballot file panel
private  javax.swing.JPanel jPanel4
          panel for progress bar and start button
private  javax.swing.JPanel jPanel5
          options panel
 javax.swing.JProgressBar jProgressBar1
          Progress bar to show current status of vote processing
private  javax.swing.JRadioButton jRadioButton1
          'yes' button for compute and show results
private  javax.swing.JRadioButton jRadioButton2
          'no' button for compute and show results
private  javax.swing.JRadioButton jRadioButton3
          'yes' button for vote export to csv
private  javax.swing.JRadioButton jRadioButton4
          'no' button for vote export to csv
private  javax.swing.JRadioButton jRadioButton5
          'yes' button for vote export to csv with signature string
private  javax.swing.JRadioButton jRadioButton6
          'no' button for vote export to csv with signature string
private  javax.swing.JTextField jTextField1
          Textfield for showing path to option file
private  javax.swing.JTextField jTextField2
          Textfield for showing path to key file
private  javax.swing.JTextField jTextField3
          Textfield for showing path to ballot file
 javax.swing.JTextField jTextField4
          Textfield for showing path to output file without signature strings
 javax.swing.JTextField jTextField5
          Textfield for showing path to output file with signature strings
private  VoteProcessor votes
          The VoteProcessor variable for interaction with GUI and program variable will be initialised by constructor of GUI class
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Window
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
GUI()
          Creates new form GUI.
 
Method Summary
private  void ballotfilechooser(java.awt.event.ActionEvent evt)
          sets path to option file.
private  void chooseCsvFile1(java.awt.event.ActionEvent evt)
          Filechooser for output file without signature strings.
private  void choosecsvfile2(java.awt.event.ActionEvent evt)
          Filechooser for outputfile with signature status.
private  void Close(java.awt.event.ActionEvent evt)
          call of this method closes program.
 java.lang.String[] filechooser(boolean open, java.lang.String firstfilter, java.lang.String secondfilter)
          this method creates and file chooser so that files can be easily chosen.
private  void initComponents()
          This method is called from within the constructor to initialize the form.
private  void jMenuItem3(java.awt.event.ActionEvent evt)
          method captures action event from menu and shows "about" information
private  void keyfilechoose(java.awt.event.ActionEvent evt)
          sets path to option file.
private  void loadBallotFile(java.awt.event.ActionEvent evt)
          load the ballot file.
private  void loadKeyFile(java.awt.event.ActionEvent evt)
          this method loads the keys.
private  void loadOptionfile(java.awt.event.ActionEvent evt)
          load the Option file.
private  void Optionfilechoose(java.awt.event.ActionEvent evt)
          sets path to option file.
private  void Reset(java.awt.event.ActionEvent evt)
          method called from menu, used to reset program to inital state.
private  void showFileCsv1(java.awt.event.ActionEvent evt)
          action handling for export csv file.
private  void showFileCsv2(java.awt.event.ActionEvent evt)
          action handling for export csv file with signature strings.
private  void startProcessing(java.awt.event.ActionEvent evt)
          this method starts the evaluation process.
private  void voteresult(java.awt.event.ActionEvent evt)
          This method captures action event from jButtonGroup and tell the program with the doCalculation(boolean) method if the evalution process should be started or not.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

votes

private VoteProcessor votes
The VoteProcessor variable for interaction with GUI and program variable will be initialised by constructor of GUI class

See Also:
VoteProcessor, Go to Code

buttonGroup1

private javax.swing.ButtonGroup buttonGroup1
ButtonGroup for 'yes' or 'no' computing results

See Also:
Go to Code

buttonGroup2

private javax.swing.ButtonGroup buttonGroup2
Buttongroup for 'yes' or 'no' of vote export to csv

See Also:
Go to Code

buttonGroup3

private javax.swing.ButtonGroup buttonGroup3
Buttongroup for 'yes' or 'no' of vote export to csv with signature strings

See Also:
Go to Code

jButton1

private javax.swing.JButton jButton1
start button for process start

See Also:
Go to Code

jButton2

private javax.swing.JButton jButton2
'choose' button for filepath to vote export

See Also:
Go to Code

jButton3

private javax.swing.JButton jButton3
'choose' button for filepath to option file

See Also:
Go to Code

jButton4

private javax.swing.JButton jButton4
'load' button for option file

See Also:
Go to Code

jButton5

private javax.swing.JButton jButton5
'choose' button for filepath to key file

See Also:
Go to Code

jButton6

private javax.swing.JButton jButton6
'load' button for key file

See Also:
Go to Code

jButton7

private javax.swing.JButton jButton7
'choose' button for filepath to ballot file

See Also:
Go to Code

jButton8

private javax.swing.JButton jButton8
'load' button for ballot file

See Also:
Go to Code

jButton9

private javax.swing.JButton jButton9
'choose' button for filepath to vote export with signature

See Also:
Go to Code

jLabel1

private javax.swing.JLabel jLabel1
shows load status of option file

See Also:
Go to Code

jLabel2

private javax.swing.JLabel jLabel2
shows load status of key file

See Also:
Go to Code

jLabel3

private javax.swing.JLabel jLabel3
shows load status of ballot file

See Also:
Go to Code

jLabel4

private javax.swing.JLabel jLabel4
label 'compute and display results'

See Also:
Go to Code

jLabel5

private javax.swing.JLabel jLabel5
label 'vote export to csv'

See Also:
Go to Code

jLabel6

private javax.swing.JLabel jLabel6
label 'vote export to csv with signature'

See Also:
Go to Code

jLabel7

private javax.swing.JLabel jLabel7
label 'file' for path to csv file

See Also:
Go to Code

jLabel8

private javax.swing.JLabel jLabel8
label 'file' for path to csv file with signature

See Also:
Go to Code

jMenu1

private javax.swing.JMenu jMenu1
Menu

See Also:
Go to Code

jMenuBar1

private javax.swing.JMenuBar jMenuBar1
Menu Bar

See Also:
Go to Code

jMenuItem1

private javax.swing.JMenuItem jMenuItem1
item 'Close'

See Also:
Go to Code

jMenuItem2

private javax.swing.JMenuItem jMenuItem2
item 'Reset'

See Also:
Go to Code

jMenuItem3

private javax.swing.JMenuItem jMenuItem3
item 'About'

See Also:
Go to Code

jPanel1

private javax.swing.JPanel jPanel1
Option file panel

See Also:
Go to Code

jPanel2

private javax.swing.JPanel jPanel2
Key file panel

See Also:
Go to Code

jPanel3

private javax.swing.JPanel jPanel3
ballot file panel

See Also:
Go to Code

jPanel4

private javax.swing.JPanel jPanel4
panel for progress bar and start button

See Also:
Go to Code

jPanel5

private javax.swing.JPanel jPanel5
options panel

See Also:
Go to Code

jProgressBar1

public javax.swing.JProgressBar jProgressBar1
Progress bar to show current status of vote processing

See Also:
Go to Code

jRadioButton1

private javax.swing.JRadioButton jRadioButton1
'yes' button for compute and show results

See Also:
Go to Code

jRadioButton2

private javax.swing.JRadioButton jRadioButton2
'no' button for compute and show results

See Also:
Go to Code

jRadioButton3

private javax.swing.JRadioButton jRadioButton3
'yes' button for vote export to csv

See Also:
Go to Code

jRadioButton4

private javax.swing.JRadioButton jRadioButton4
'no' button for vote export to csv

See Also:
Go to Code

jRadioButton5

private javax.swing.JRadioButton jRadioButton5
'yes' button for vote export to csv with signature string

See Also:
Go to Code

jRadioButton6

private javax.swing.JRadioButton jRadioButton6
'no' button for vote export to csv with signature string

See Also:
Go to Code

jTextField1

private javax.swing.JTextField jTextField1
Textfield for showing path to option file

See Also:
Go to Code

jTextField2

private javax.swing.JTextField jTextField2
Textfield for showing path to key file

See Also:
Go to Code

jTextField3

private javax.swing.JTextField jTextField3
Textfield for showing path to ballot file

See Also:
Go to Code

jTextField4

public javax.swing.JTextField jTextField4
Textfield for showing path to output file without signature strings

See Also:
Go to Code

jTextField5

public javax.swing.JTextField jTextField5
Textfield for showing path to output file with signature strings

See Also:
Go to Code
Constructor Detail

GUI

public GUI()
Creates new form GUI.
First Constructor gets the default screensize from awt.Toolkit.class and then build the current GUI frame size with call of the setsize(x,y) method and centers it with call of setLocation().

After that the VoteProcessor is initialised and also the initComponents() method. Finally the GUI is setVisible().

See Also:
VoteProcessor.VoteProcessor(GUI), initComponents(), Go to Code
Method Detail

initComponents

private void initComponents()
This method is called from within the constructor to initialize the form. It is also responsible for position and putting ActionListener to form elements.

WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.

See Also:
Field details, Go to Code

choosecsvfile2

private void choosecsvfile2(java.awt.event.ActionEvent evt)
Filechooser for outputfile with signature status.

EPC Main_process 4.2: This method sets jTextField5 with a path from filechooser so that an outfile with signature status can be written.
After setting path the method tells Voteprocessor to make an outfile.

Parameters:
evt - ActionEvent from jButton9
See Also:
jTextField5, VoteProcessor.makeSignOutfile(boolean), filechooser(boolean,String,String), form code, Go to Code

jMenuItem3

private void jMenuItem3(java.awt.event.ActionEvent evt)
method captures action event from menu and shows "about" information

Parameters:
evt - ActionEvent from Menu
See Also:
jMenuItem3, JOptionPane#showMessageDialog(), Go to Code

voteresult

private void voteresult(java.awt.event.ActionEvent evt)
This method captures action event from jButtonGroup and tell the program with the doCalculation(boolean) method if the evalution process should be started or not.

Parameters:
evt - ActionEvent from jButtonGroup1
See Also:
VoteProcessor.doCalculation(boolean), #jButtonGroup1, form code method, Go to Code

chooseCsvFile1

private void chooseCsvFile1(java.awt.event.ActionEvent evt)
Filechooser for output file without signature strings.

EPC Main_process 4.1: This method sets jTextField4 with a path from filechooser so that an outfile without signature status can be written.
After setting path the method tells Voteprocessor to make an export with the makeOutfile() method.

Parameters:
evt - ActionEvent from jButton2
See Also:
jTextField4, VoteProcessor.makeOutfile(boolean), filechooser(boolean,String,String), form code method, Go to Code

showFileCsv2

private void showFileCsv2(java.awt.event.ActionEvent evt)
action handling for export csv file with signature strings.

EPC Main_process 2.2: This is the action handling method for jButtonGroup3 which is responsible for setting an output file without signature or not.

if event command is true ('yes') a file for exporting has to be chosen and necessary Textfield and Button are set visible or invisible. Also an popup menu for choosing a file will be opened with the filechooser() method.

EPC Main_process 3.2: This method tells the VoteProcessor class with help of the makeSignOutfile() if an outfile with signature has to be made or not

For more details of the output file check the Output class.

Parameters:
evt - ActionEvent from ButtonGroup3
See Also:
#ButtonGroup3, jLabel8, jButton9, jTextField5, VoteProcessor.makeSignOutfile(boolean), filechooser(boolean,String,String), Output, form code method, Go to Code

showFileCsv1

private void showFileCsv1(java.awt.event.ActionEvent evt)
action handling for export csv file.

EPC Main_process 2.1: This is the action handling method for jButtonGroup2 which is responsible for setting an output file without signature or not.

if event command is true ('yes'), a file for exporting has to be chosen and necessary Textfield and Button are set visible or invisible. Also an popup menu for choosing a file will be opened with the filechooser() method.

EPC Main_process 3.1: This method tells the VoteProcessor class with help of the makeOutfile() if an outfile has to be made or not.

Please check the Output class for more details of the output file

Parameters:
evt - ActionEvent from jButtonGroup2
See Also:
#ButtonGroup2, jLabel7, jButton2, jTextField4, VoteProcessor.makeOutfile(boolean), filechooser(boolean,String,String), Output, form code method, Go to Code

loadBallotFile

private void loadBallotFile(java.awt.event.ActionEvent evt)
load the ballot file.

EPC Main_process 10: First this method loads the ballot file via the setVotes(String) method, the path to file captures the method from jTextField3. After that the vote file will be checked and loaded with the CheckVoteFile() method. If true the jLabel3 is set to "file loaded" else mentioned method will do error handling.

Parameters:
evt - from jButton8
See Also:
VoteProcessor.setVotes(String), VoteProcessor.CheckVoteFile(), jLabel3, jTextField3, form code method, Go to Code

loadKeyFile

private void loadKeyFile(java.awt.event.ActionEvent evt)
this method loads the keys.

EPC Main_process 9: First the whole file is loaded with the setKeys(String) - path to file from jTextField2 - method.

After loading the option file string will be checked and loaded via the checkKeyFile() method. This method returns an boolean status if load is ok or if an error has occured. If true the jLabel2 is set to "file loaded" else mentioned method will do error handling.

Parameters:
evt - from jButton6
See Also:
VoteProcessor.setKeys(String), VoteProcessor.checkKeyFile(), jLabel2, jTextField2, form code method, Go to Code

ballotfilechooser

private void ballotfilechooser(java.awt.event.ActionEvent evt)
sets path to option file.

EPC Main_process 7: This method gets path to ballot file from filechooser() and fills matching textfield with this path.

Parameters:
evt - gets path from jButton7
See Also:
filechooser(boolean,String,String), jTextField3, form code method, Go to Code

keyfilechoose

private void keyfilechoose(java.awt.event.ActionEvent evt)
sets path to option file.

EPC Main_process 6: This method gets path to key file from filechooser() and fills Textfield2 with this path.

Parameters:
evt - gets path from jButton5
See Also:
filechooser(boolean,String,String), jTextField2, form code method, Go to Code

loadOptionfile

private void loadOptionfile(java.awt.event.ActionEvent evt)
load the Option file.

EPC Main_process 8: First the whole option file is loaded with the setOptions(String) method into a string. This path-string will be captured from the jTextField1.

EPC Main_process 11, 12: After loading the option file string will be checked and loaded via the CheckOptionfile() method. This method sets main/sub option counter and the program parameter. It returns an boolean status which is true if load is ok or false if an error has occured. If true the jLabel1 is set to "file loaded" else mentioned method will do error handling.

Parameters:
evt - ActionEvent from jButton4
See Also:
VoteProcessor.setOptions(String), VoteProcessor.CheckOptionfile(), jLabel1, jTextField1, form code method, Go to Code

Optionfilechoose

private void Optionfilechoose(java.awt.event.ActionEvent evt)
sets path to option file.

EPC Main_process 5: This method gets path to option file from filechooser and fills matching textfield with this path.

Parameters:
evt - gets path from jButton3
See Also:
filechooser(boolean,String,String), jTextField1, form code method, Go to Code

Reset

private void Reset(java.awt.event.ActionEvent evt)
method called from menu, used to reset program to inital state. all methods from 'see also' will be reset

Parameters:
evt - captures ActionEvent from menu
See Also:
VoteProcessor, jProgressBar1, jTextField1, jLabel1, jTextField2, jLabel2, jTextField3, jLabel3, jLabel7, jLabel8, jButton2, jTextField4, jButton9, jTextField5, VoteProcessor.makeOutfile(boolean), VoteProcessor.makeSignOutfile(boolean), VoteProcessor.doCalculation(boolean), Go to Code

Close

private void Close(java.awt.event.ActionEvent evt)
call of this method closes program. Takes use of System.exit(0)

Parameters:
evt - action event from jMenuItem1
See Also:
Go to Code

startProcessing

private void startProcessing(java.awt.event.ActionEvent evt)
this method starts the evaluation process.

EPC Main_process 14: This method starts the evaluation process with click of jButton1. First it will be checked if key- and ballot file are set and have no errors. This will be done with help of the checkKeyFile() and CheckVoteFile() method.

If both are true the process will be started via the doProcessing() method. Key and ballot file are absolutely necessary because even if no calculation has to be done, keys are needed for decryption.

EPC Main_process 36: After processing - if no process stoping errors are occured (checked with the getShowTable() method)- the result will be shown in a Table. Please check the TableFrame class for more details.

Parameters:
evt - ActionEvent from jButton1
See Also:
Errorhandler.getShowTable(), VoteProcessor.checkKeyFile(), VoteProcessor.CheckVoteFile(), VoteProcessor.doProcessing(), TabelFrame, form code method, Go to Code

filechooser

public java.lang.String[] filechooser(boolean open,
                                      java.lang.String firstfilter,
                                      java.lang.String secondfilter)
this method creates and file chooser so that files can be easily chosen.

It also adds filtes via the addChoosableFileFilter() method so that the file choosing is more convenient (.xml; .eml and .csv for saving).

If this method is called by an true parameter so it is used for opening, else it is used for saving a file.

hint: modified example from: http://www.dpunkt.de/java/Programmieren_mit_Java/Oberflaechenprogrammierung/35.html

Parameters:
open - if true filechooser is used for opening file, if false for saving a file
firstfilter - String representation of the first extension filter like ".xml"
secondfilter - String representation of the second extension filter like ".eml"
Returns:
array String[] 0 with the complete path of the file, [1] only with the name of the file
See Also:
JFileChooser, Go to Code