|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectds.ov2.gui.Gui_actions
public class Gui_actions
Actions for the main window of the graphical demonstrator.
Nested Class Summary | |
---|---|
class |
Gui_actions.Bases_selection_abort_exception
Exception for when the base selection dialog is aborted. |
Field Summary | |
---|---|
private Applet_list_actions |
applet_list_actions
Actions for the applet list dialog. |
private Bases_actions |
bases_actions
Actions for the base selection dialog. |
private Card_protocols |
card_protocols
Card protocol instance. |
private Config_actions |
config_actions
Actions for the config dialog. |
private boolean |
initialization_finished
GUI initialization order seems to depend in some parts on the order in which the GUI elements have been created in the netbeans GUI. |
Progress_messages |
progress_window
The progress window. |
Terminal_thread |
terminal_thread
Terminal thread instance. |
Constructor Summary | |
---|---|
Gui_actions(Card_protocols card_protocols)
Constructor. |
Method Summary | |
---|---|
void |
applet_selection_changed(ItemEvent e,
Ov_demo_gui gui)
Called when the applet type is changed in the applet type combobox. |
(package private) void |
apply_config(Config_window cw)
Change our state to match to the new configuration. |
BigInteger |
bigint_of_number_spinner(JSpinner spinner)
Read the value of a spinner holding a BigInteger . |
int |
check_key_size(Ov_demo_gui gui,
int user_key_size)
Check whether the user selected user_key_size makes
sense for the current applet type. |
void |
clear_message_pane(JTextPane pane)
Clear a message pane. |
(package private) void |
default_initialization(Ov_demo_gui gui)
Default initialization of the internal state. |
void |
disable_card_maintenance(Ov_demo_gui gui)
Method to be called when a card is removed and the PTLS office tab is selected. |
void |
enable_card_maintenance(Ov_demo_gui gui)
Method to be called when a card is inserted and the PTLS office tab is selected. |
void |
entry_automatic_changed(Ov_demo_gui gui)
Method to be called when the run-automatically check box changes state in the entry gate tab. |
void |
entry_run_button(Ov_demo_gui gui)
Method to be called when the run-entry-protocol button is pressed in the entry gate tab. |
Applet_list_window |
get_applet_list_window()
Return the applet list window or throw an assertion if no such window is registered. |
void |
gui_error(Component parent_window,
String message,
String title)
Show an error message to the user and wait until he acknoledges. |
void |
gui_warning(Component parent_window,
String message,
String title)
Show a warning message to the user and wait until he acknowledges. |
int |
int_of_number_spinner(JSpinner spinner)
Read the value of a spinner holding an integer. |
void |
lenstra_exponent_box_changed(ItemEvent e,
Ov_demo_gui gui)
Method to be called when the automatic exponent size check box in the PTLS office tab is selected. |
Number |
number_of_number_spinner(JSpinner spinner)
Read out the value of a spinner. |
void |
progress_dismiss_button()
Action for the dismiss button of the progress window. |
void |
ptls_automaton_resign_button(Ov_demo_gui gui)
Method to be called when the obtain-new-signature button is pressed in the PTLS automaton tab. |
void |
ptls_office_card_status(Ov_demo_gui gui)
Method to be called when the status-&-delete button in the PTLS office tab is pressed. |
void |
ptls_office_install_all(Ov_demo_gui gui)
Method to be called when the reinstall-and-personalize button is pressed. |
void |
ptls_office_install_applet(Ov_demo_gui gui)
Method to be called when the install button is pressed. |
void |
ptls_office_personalize(Ov_demo_gui gui)
Action method for the PTLS office "Personalize" button. |
void |
ptls_office_reset_applet(Ov_demo_gui gui)
Method to be called when the applet reset button is pressed. |
(package private) void |
ptls_parameters_missing(Ov_demo_gui gui)
Method to be called when the user tries to select a different tab without having configured a set of PTLS parameters. |
void |
ptls_params_invalidate_action(Ov_demo_gui gui)
Method to be called when we lost our PTLS parameters. |
void |
ptls_params_load_from_file(Ov_demo_gui gui,
String file_name)
Read PTLS parameters from file file . |
void |
ptls_params_load(Ov_demo_gui gui)
Method to be called when the Load-from-file button for loading PTLS parameters is pressed. |
void |
ptls_params_new_ex(Ov_demo_gui gui)
Method to be called when the create-new button to generate new PTLS parameters is pressed. |
void |
ptls_params_new(Ov_demo_gui gui)
Method to be called when the create-new button to generate new PTLS parameters is pressed. |
void |
ptls_params_ready_action(Ov_demo_gui gui)
Method to be called when we obtained some PTLS parameters. |
void |
ptls_params_save(Ov_demo_gui gui)
Method to be called when Save-to-file button for saving the current PTLS parameters is pressed. |
void |
report_exception_maybe(Component parent_window,
String title,
Exception ex,
String ex_name)
Possibly report an escaping exception as error message. |
void |
rsa_key_size_change(Ov_demo_gui gui)
Method to be called when the exponent length must be adjusted to the base langth. |
(package private) void |
select_automaton(Ov_demo_gui gui)
Method to be called when the PTLS automaton tab is selected. |
(package private) void |
select_entry_gate(Ov_demo_gui gui)
Method to be called when the entry gate tab is selected. |
(package private) void |
select_office(Ov_demo_gui gui)
Method to be executed when the PTLS office tab is selected. |
void |
set_bases(Ov_demo_gui gui)
Method to be called at the end of PTLS parameter generation when the choose-bases-randomly box is not checked. |
(package private) void |
start_action(Ov_demo_gui gui)
Run on application startup. |
(package private) void |
toolbar_config_button(Ov_demo_gui gui)
Method to run when the config button in the toolbar is pressed. |
void |
toolbar_progress_button()
Action for the progress log button in the toolbar. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Card_protocols card_protocols
private final Config_actions config_actions
private final Bases_actions bases_actions
private final Applet_list_actions applet_list_actions
public Terminal_thread terminal_thread
public Progress_messages progress_window
Ov_demo
, because this class and Progress_messages
are mutually dependent and an instance of
this class is created first.
private boolean initialization_finished
default_initialization
.
Constructor Detail |
---|
public Gui_actions(Card_protocols card_protocols)
select_office
.
card_protocols
- instance with card and terminal actionsMethod Detail |
---|
void default_initialization(Ov_demo_gui gui)
initialization_finished
. This method sets
Gui_state.card_terminal
, starts the terminal thread and
sets its first action and initializes the key size spinners
acording to the default applet type. At the very end
appropriate actions are executed to satisfy the command line
options.
gui
- the GUI windowvoid start_action(Ov_demo_gui gui)
gui
- the GUI windowpublic void gui_warning(Component parent_window, String message, String title)
parent_window
- the parent window of the warningmessage
- warning to showtitle
- title of the warning dialogpublic void gui_error(Component parent_window, String message, String title)
parent_window
- the parent window of the warningmessage
- warning to showtitle
- title of the warning dialogpublic void clear_message_pane(JTextPane pane)
pane
- the text pane to clearvoid apply_config(Config_window cw)
cw
- the just closed config window.void toolbar_config_button(Ov_demo_gui gui)
gui
- the GUI windowpublic void toolbar_progress_button()
public void progress_dismiss_button()
void select_office(Ov_demo_gui gui)
gui
- the GUI windowvoid ptls_parameters_missing(Ov_demo_gui gui)
gui
- the GUI windowvoid select_automaton(Ov_demo_gui gui)
gui
- the GUI windowvoid select_entry_gate(Ov_demo_gui gui)
gui
- the GUI windowpublic void applet_selection_changed(ItemEvent e, Ov_demo_gui gui)
e
- item event of the combo boxgui
- the GUI windowpublic void lenstra_exponent_box_changed(ItemEvent e, Ov_demo_gui gui)
e
- event from the check box, telling us whether it got
selectedgui
- the GUI windowpublic Number number_of_number_spinner(JSpinner spinner)
BigInteger's
. Therefore this method
returns some super class, which must be downcast appropriately.
spinner
- the spinner to read outpublic int int_of_number_spinner(JSpinner spinner)
spinner
- the spinner to read outpublic BigInteger bigint_of_number_spinner(JSpinner spinner)
BigInteger
.
spinner
- the spinner to read outpublic int check_key_size(Ov_demo_gui gui, int user_key_size)
user_key_size
makes
sense for the current applet type. If not warnings are
displayed and, at the users options, the key size is adjusted.
gui
- the GUI windowuser_key_size
- the key size the user selected
public void rsa_key_size_change(Ov_demo_gui gui)
gui
- the GUI windowpublic void ptls_params_ready_action(Ov_demo_gui gui)
gui
- the GUI windowpublic void ptls_params_invalidate_action(Ov_demo_gui gui)
gui
- the GUI windowpublic void ptls_params_load_from_file(Ov_demo_gui gui, String file_name)
file
. Adapt the state of
the GUI apropriately if successful. Displays an error message
if reading fails.
gui
- the GUI windowfile_name
- the file to readpublic void ptls_params_load(Ov_demo_gui gui)
ptls_params_load_from_file
for the real work.
gui
- the GUI windowpublic void ptls_params_save(Ov_demo_gui gui)
gui
- the GUI windowpublic void set_bases(Ov_demo_gui gui) throws Gui_actions.Bases_selection_abort_exception
gui
- the GUI window
Gui_actions.Bases_selection_abort_exception
- if the base selection
dialog is abortedpublic void ptls_params_new_ex(Ov_demo_gui gui) throws NoSuchAlgorithmException, Gui_actions.Bases_selection_abort_exception
ptls_params_new
method.
gui
- the GUI window
NoSuchAlgorithmException
- if no provider for RSA key
generation is present
Gui_actions.Bases_selection_abort_exception
- if the base selection
dialog is aborted.public void report_exception_maybe(Component parent_window, String title, Exception ex, String ex_name)
ex
being a null reference, if there is no
exception.
parent_window
- parent window for the error dialogtitle
- title of the error dialogex
- the escaping exception or nullex_name
- the exception namepublic void ptls_params_new(Ov_demo_gui gui)
ptls_params_new_ex
, which implements the
functionality. This method only catches all possible exceptions
and displays appropriate error messages.
gui
- the GUI windowpublic void enable_card_maintenance(Ov_demo_gui gui)
gui
- the GUI windowpublic void disable_card_maintenance(Ov_demo_gui gui)
gui
- the GUI windowpublic Applet_list_window get_applet_list_window()
public void ptls_office_card_status(Ov_demo_gui gui)
applet_list_actions
and display it. When
finished deregister the window with applet_list_actions
.
gui
- the GUI windowpublic void ptls_office_install_applet(Ov_demo_gui gui)
gui
- the GUI windowpublic void ptls_office_reset_applet(Ov_demo_gui gui)
gui
- the GUI windowpublic void ptls_office_personalize(Ov_demo_gui gui)
personalize_action
in the Terminal_thread
, which does
the job.
public void ptls_office_install_all(Ov_demo_gui gui)
gui
- the GUI windowpublic void ptls_automaton_resign_button(Ov_demo_gui gui)
gui
- the GUI windowpublic void entry_run_button(Ov_demo_gui gui)
gui
- the GUI windowpublic void entry_automatic_changed(Ov_demo_gui gui)
gui
- the GUI window
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |