|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
GUI
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.
| 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 |
private VoteProcessor votes
VoteProcessor,
Go to Codeprivate javax.swing.ButtonGroup buttonGroup1
private javax.swing.ButtonGroup buttonGroup2
private javax.swing.ButtonGroup buttonGroup3
private javax.swing.JButton jButton1
private javax.swing.JButton jButton2
private javax.swing.JButton jButton3
private javax.swing.JButton jButton4
private javax.swing.JButton jButton5
private javax.swing.JButton jButton6
private javax.swing.JButton jButton7
private javax.swing.JButton jButton8
private javax.swing.JButton jButton9
private javax.swing.JLabel jLabel1
private javax.swing.JLabel jLabel2
private javax.swing.JLabel jLabel3
private javax.swing.JLabel jLabel4
private javax.swing.JLabel jLabel5
private javax.swing.JLabel jLabel6
private javax.swing.JLabel jLabel7
private javax.swing.JLabel jLabel8
private javax.swing.JMenu jMenu1
private javax.swing.JMenuBar jMenuBar1
private javax.swing.JMenuItem jMenuItem1
private javax.swing.JMenuItem jMenuItem2
private javax.swing.JMenuItem jMenuItem3
private javax.swing.JPanel jPanel1
private javax.swing.JPanel jPanel2
private javax.swing.JPanel jPanel3
private javax.swing.JPanel jPanel4
private javax.swing.JPanel jPanel5
public javax.swing.JProgressBar jProgressBar1
private javax.swing.JRadioButton jRadioButton1
private javax.swing.JRadioButton jRadioButton2
private javax.swing.JRadioButton jRadioButton3
private javax.swing.JRadioButton jRadioButton4
private javax.swing.JRadioButton jRadioButton5
private javax.swing.JRadioButton jRadioButton6
private javax.swing.JTextField jTextField1
private javax.swing.JTextField jTextField2
private javax.swing.JTextField jTextField3
public javax.swing.JTextField jTextField4
public javax.swing.JTextField jTextField5
| Constructor Detail |
public GUI()
VoteProcessor.VoteProcessor(GUI),
initComponents(),
Go to Code| Method Detail |
private void initComponents()
private void choosecsvfile2(java.awt.event.ActionEvent evt)
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.
evt - ActionEvent from jButton9jTextField5,
VoteProcessor.makeSignOutfile(boolean),
filechooser(boolean,String,String),
form code,
Go to Codeprivate void jMenuItem3(java.awt.event.ActionEvent evt)
evt - ActionEvent from MenujMenuItem3,
JOptionPane#showMessageDialog(),
Go to Codeprivate void voteresult(java.awt.event.ActionEvent evt)
evt - ActionEvent from jButtonGroup1VoteProcessor.doCalculation(boolean),
#jButtonGroup1,
form code method,
Go to Codeprivate void chooseCsvFile1(java.awt.event.ActionEvent evt)
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.
evt - ActionEvent from jButton2jTextField4,
VoteProcessor.makeOutfile(boolean),
filechooser(boolean,String,String),
form code method,
Go to Codeprivate void showFileCsv2(java.awt.event.ActionEvent evt)
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.
evt - ActionEvent from ButtonGroup3#ButtonGroup3,
jLabel8,
jButton9,
jTextField5,
VoteProcessor.makeSignOutfile(boolean),
filechooser(boolean,String,String),
Output,
form code method,
Go to Codeprivate void showFileCsv1(java.awt.event.ActionEvent evt)
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
evt - ActionEvent from jButtonGroup2#ButtonGroup2,
jLabel7,
jButton2,
jTextField4,
VoteProcessor.makeOutfile(boolean),
filechooser(boolean,String,String),
Output,
form code method,
Go to Codeprivate void loadBallotFile(java.awt.event.ActionEvent evt)
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.
evt - from jButton8VoteProcessor.setVotes(String),
VoteProcessor.CheckVoteFile(),
jLabel3,
jTextField3,
form code method,
Go to Codeprivate void loadKeyFile(java.awt.event.ActionEvent evt)
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.
evt - from jButton6VoteProcessor.setKeys(String),
VoteProcessor.checkKeyFile(),
jLabel2,
jTextField2,
form code method,
Go to Codeprivate void ballotfilechooser(java.awt.event.ActionEvent evt)
EPC Main_process 7: This method gets path to ballot file from filechooser() and fills matching textfield with this path.
evt - gets path from jButton7filechooser(boolean,String,String),
jTextField3,
form code method,
Go to Codeprivate void keyfilechoose(java.awt.event.ActionEvent evt)
EPC Main_process 6: This method gets path to key file from filechooser() and fills Textfield2 with this path.
evt - gets path from jButton5filechooser(boolean,String,String),
jTextField2,
form code method,
Go to Codeprivate void loadOptionfile(java.awt.event.ActionEvent evt)
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.
evt - ActionEvent from jButton4VoteProcessor.setOptions(String),
VoteProcessor.CheckOptionfile(),
jLabel1,
jTextField1,
form code method,
Go to Codeprivate void Optionfilechoose(java.awt.event.ActionEvent evt)
EPC Main_process 5: This method gets path to option file from filechooser and fills matching textfield with this path.
evt - gets path from jButton3filechooser(boolean,String,String),
jTextField1,
form code method,
Go to Codeprivate void Reset(java.awt.event.ActionEvent evt)
evt - captures ActionEvent from menuVoteProcessor,
jProgressBar1,
jTextField1,
jLabel1,
jTextField2,
jLabel2,
jTextField3,
jLabel3,
jLabel7,
jLabel8,
jButton2,
jTextField4,
jButton9,
jTextField5,
VoteProcessor.makeOutfile(boolean),
VoteProcessor.makeSignOutfile(boolean),
VoteProcessor.doCalculation(boolean),
Go to Codeprivate void Close(java.awt.event.ActionEvent evt)
evt - action event from jMenuItem1private void startProcessing(java.awt.event.ActionEvent evt)
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.
evt - ActionEvent from jButton1Errorhandler.getShowTable(),
VoteProcessor.checkKeyFile(),
VoteProcessor.CheckVoteFile(),
VoteProcessor.doProcessing(),
TabelFrame,
form code method,
Go to Code
public java.lang.String[] filechooser(boolean open,
java.lang.String firstfilter,
java.lang.String secondfilter)
open - if true filechooser is used for opening file, if false for saving a filefirstfilter - String representation of the first extension filter like ".xml"secondfilter - String representation of the second extension filter like ".eml"
JFileChooser,
Go to Code
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||