|
SOA © 2004 SoS Group All Rights Reserved |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel sos.koa.MenuPanel
This class is the top-most class of the system and tracks and controls the overall tally process.
Class Specifications |
invariant state == INIT_STATE||state == CLEARED_STATE||state == CANDIDATES_IMPORTED_STATE||state == VOTES_IMPORTED_STATE||state == PRIVATE_KEY_IMPORTED_STATE||state == PUBLIC_KEY_IMPORTED_STATE||state == VOTES_DECRYPTED_STATE||state == VOTES_COUNTED_STATE||state == REPORT_GENERATED_STATE; invariant (state >= VOTES_IMPORTED_STATE ==> rawVotes != null); invariant (state >= VOTES_COUNTED_STATE ==> voteSet != null); invariant (state >= CANDIDATES_IMPORTED_STATE ==> candidates != null); invariant (state >= PRIVATE_KEY_IMPORTED_STATE ==> privateKey != null); invariant (state >= PUBLIC_KEY_IMPORTED_STATE ==> publicKey != null); constraint \old(theInstance) == theInstance; constraint state == INIT_STATE||state == \old(state)||state == \old(state)+1; |
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
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 | |
[spec_public] (package private) CandidateList |
candidates
The candidates. |
(package private) javax.swing.JButton |
clearButton
GUI stuff. |
(package private) javax.swing.JButton |
countButton
GUI stuff. |
[spec_public] (package private) java.io.File |
currentDir
The current directory used in file browser pop-ups. |
(package private) javax.swing.JButton |
decryptButton
GUI stuff. |
(package private) javax.swing.JButton |
exitButton
GUI stuff. |
(package private) HelpAdapter |
helpAdapter
The help window. |
(package private) javax.swing.JButton |
helpButton
GUI stuff. |
(package private) javax.swing.JButton |
importCandidatesButton
GUI stuff. |
(package private) javax.swing.JButton |
importPrivateKeyButton
GUI stuff. |
(package private) javax.swing.JButton |
importPublicKeyButton
GUI stuff. |
(package private) javax.swing.JButton |
importVotesButton
GUI stuff. |
[spec_public] (package private) java.security.PrivateKey |
privateKey
Private RSA key to decode the votes. |
[spec_public] (package private) java.security.PublicKey |
publicKey
Public key. |
[spec_public] (package private) java.util.ArrayList |
rawVotes
The (raw, imported) votes. |
(package private) javax.swing.JButton |
reportButton
GUI stuff. |
(package private) javax.swing.JButton |
restartButton
GUI stuff. |
[spec_public] (package private) int |
state
The state of the application. |
[spec_public] private static MenuPanel |
theInstance
The (single) menu panel instance. |
[spec_public] (package private) VoteSet |
voteSet
The counted votes. |
Fields inherited from class javax.swing.JPanel |
|
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_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 java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
private |
MenuPanel()
Constructs a menu panel. |
Method Summary | |
void |
addExitButtonListener(java.awt.event.ActionListener l)
Adds an action listener to the exit button. |
void |
clear()
Clears the list of candidates, the keys, the raw votes, and the counted votes. |
CandidateList |
getCandidateList()
Gets the candidate list. |
(package private) java.io.File |
getCurrentDir()
Gets the current directory used in file browser pop-ups. |
java.security.PrivateKey |
getPrivateKey()
Gets the imported private key or null if the key has not
been imported yet. |
java.security.PublicKey |
getPublicKey()
Gets the imported public key or null if the key has not
been imported yet. |
java.util.ArrayList |
getRawVotes()
Gets the raw votes list. |
int |
getState()
Gets the current state. |
static MenuPanel |
getTheMenuPanel()
Static factory method to get the menu panel instance. |
VoteSet |
getVoteSet()
Gets the vote set. |
static void |
main(java.lang.String[] arg)
Main method creates frame and calls constructor. |
void |
setCandidateList(CandidateList candidates)
Sets the candidate list. |
(package private) void |
setCurrentDir(non_null java.io.File currentDir)
Sets the current directory used in file browser pop-ups. |
void |
setEnabled(boolean b)
Enables/disables the GUI. |
private void |
setEnabled(boolean b0,
boolean b1,
boolean b2,
boolean b3,
boolean b4,
boolean b5,
boolean b6,
boolean b7,
boolean b8,
boolean b9)
Enables/disables the 10 task buttons of the GUI. |
void |
setPrivateKey(java.security.PrivateKey privateKey)
Sets the private key. |
void |
setPublicKey(java.security.PublicKey publicKey)
Sets the public key. |
void |
setRawVotes(non_null java.util.ArrayList rawVotes)
Sets the raw votes list. |
void |
setState(int state)
Sets the state to state . |
void |
setVoteSet(VoteSet voteSet)
Sets the vote set. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static MenuPanel theInstance
int state
javax.swing.JButton restartButton
javax.swing.JButton clearButton
javax.swing.JButton importCandidatesButton
javax.swing.JButton importVotesButton
javax.swing.JButton importPrivateKeyButton
javax.swing.JButton importPublicKeyButton
javax.swing.JButton decryptButton
javax.swing.JButton countButton
javax.swing.JButton reportButton
javax.swing.JButton helpButton
javax.swing.JButton exitButton
java.util.ArrayList rawVotes
VoteSet voteSet
CandidateList candidates
java.security.PrivateKey privateKey
java.security.PublicKey publicKey
java.io.File currentDir
HelpAdapter helpAdapter
Constructor Detail |
private MenuPanel()
getTheMenuPanel
instead.
Method Detail |
public static MenuPanel getTheMenuPanel()
public void setCandidateList(CandidateList candidates)
candidates
- the new candidate list.public CandidateList getCandidateList()
public java.util.ArrayList getRawVotes()
public void setRawVotes(non_null java.util.ArrayList rawVotes)
rawVotes
- the new raw votes list.public VoteSet getVoteSet()
public void setVoteSet(VoteSet voteSet)
voteSet
- the new vote set.public void setPrivateKey(java.security.PrivateKey privateKey)
privateKey
- the new private key.public void setPublicKey(java.security.PublicKey publicKey)
publicKey
- the new public key.public java.security.PrivateKey getPrivateKey()
null
if the key has not
been imported yet.
public java.security.PublicKey getPublicKey()
null
if the key has not
been imported yet.
public int getState()
public void setState(int state)
state
.
This automatically changes the GUI to reflect the change in state.
state
- the new state.public void setEnabled(boolean b)
setEnabled
in class javax.swing.JComponent
b
- a boolean indicating whether to enable or disable the GUI.private void setEnabled(boolean b0, boolean b1, boolean b2, boolean b3, boolean b4, boolean b5, boolean b6, boolean b7, boolean b8, boolean b9)
b0
- a boolean indicating whether to enable or disable button 1.b1
- a boolean indicating whether to enable or disable button 2.b2
- a boolean indicating whether to enable or disable button 3.b3
- a boolean indicating whether to enable or disable button 4.b4
- a boolean indicating whether to enable or disable button 5.b5
- a boolean indicating whether to enable or disable button 6.b6
- a boolean indicating whether to enable or disable button 7.b7
- a boolean indicating whether to enable or disable button 8.b8
- a boolean indicating whether to enable or disable button 9.b9
- a boolean indicating whether to enable or disable button 10.void setCurrentDir(non_null java.io.File currentDir)
currentDir
- the new current directory.java.io.File getCurrentDir()
public void addExitButtonListener(java.awt.event.ActionListener l)
l
- the action listener.public void clear()
public static void main(java.lang.String[] arg)
arg
- the command line arguments.
|
SOA © 2004 SoS Group All Rights Reserved |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |