devisor2.grid.GUI.dialogs
Class OptionsDialog
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
devisor2.grid.GUI.dialogs.OptionsDialog
- All Implemented Interfaces:
- javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants
- public class OptionsDialog
- extends javax.swing.JDialog
This class represents the OptionsDialog for the DeViSoR2 application.
On various tabbed panes (tabsheets), the user can set all options
for the application. All options are managed internally in the class
Options in package options, which also defines the default values
which can be restored if the user wants to.
Like every dialog in the application, it is controlled via two static
methods: "initialize" has to be called once (e.g. in the startup class)
and again every time the look&feel is changed. then, the dialog can be
displayed whenever neccessary using the "showDialog" method.
This is how the dialog works:
The user can change the options via TextInputFields, secondary dialogs,
tables and other GUI-only elements. This only affects the representation
in the dialog (i.e. in the GUI), nothing is written back into the
Options instance.
If the user clicks on CANCEL, all changes that have beed made are
ignored and the dialog is closed. Accordingly, all changes are ignored
if the user clicks the LOAD respectively RESTORE DEFAULTS buttons.
Only if the user clicks on APPLY or SAVE, the Options instance is
updated before closing the dialog or writing the Options file to disk.
Note that updating might take quite a while, especially when GUI elements
such as the menu (for accelerators) or even the whole GUI (for look&feel)
are reconfigured and repainted.
A short description of the settings and how they are managed:
- The internal storage of Options is described in the Options class, see
there for details. Note that only Strings are stored.
- everything that is represented by a String (such as paths etc) are
stored the way they are without further changes.
- Path input is implemented in two ways: the user can directly type
the path into a textfield (followed by a short check by the program
of course), or he can use the dialog provided to browse the directory
tree to his destination path.
- The draw flags on the DRAW tab sheet are stored as String literals
true<\code> and false<\code> respectively.
- To assign new colors to certain elements and displayed items, an
instance of the default JColorChooser Dialog is displayed when the
corresponding button is clicked. Colors are converted to an integer
representing the color in the RGBA model.
- Accelerator input is implemented as follows: In a JTable, all available
functions that accelerators can be assigned to are listed, allowing the
user to pick the function he wants to reassign. Then, the modifier and
key can be changed via radiobuttons and a combobox. The user has to
click the APPLY button explicitly to notify the table (the data model
of which holds the accelerators). Note that APPLY only updates the table
and not the Options instance, consistent with the general behaviour of
this dialog. Assigning the NONE accelerator to a function disables
keyboard support for the specified function. This can be accomplished
by clicking the REMOVE button.
- as soon as other options are added, i will update this description
subsequently
- See Also:
options.Options
,
Serialized Form
Nested classes inherited from class javax.swing.JDialog |
javax.swing.JDialog.AccessibleJDialog |
Nested classes inherited from class java.awt.Dialog |
java.awt.Dialog.AccessibleAWTDialog |
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 |
Fields inherited from class javax.swing.JDialog |
accessibleContext, rootPane, rootPaneCheckingEnabled |
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, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Methods inherited from class javax.swing.JDialog |
addImpl, createRootPane, dialogInit, 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.Dialog |
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, 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, removeNotify, 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, remove, 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 |
OptionsDialog
public OptionsDialog(MainFrame parent)
- creates a new Dialog and sets up its gui.
please don't use this constructor directly, use the two static
methods provided.
- Parameters:
parent
- - the mainframe connects the dialog to the rest of the
application.
setFocusToGeneral
public void setFocusToGeneral()
- sets the focus to the General tab
setFocusToDraw
public void setFocusToDraw()
- sets the focus to the Draw tab
setFocusToColor
public void setFocusToColor()
- sets the focus to the Color tab
setFocusToAccelerator
public void setFocusToAccelerator()
- sets the focus to the Accelerator tab
setFocusToMisc
public void setFocusToMisc()
- sets the focus to the Misc tab
initialize
public static void initialize(MainFrame parent)
- this is one of the two important methods in this class.
it instantiates a new dialog object and sets up its gui
- Parameters:
parent
- - the parent frame for the dialog it is centered on
showDialog
public static void showDialog()
- if initialize() has been called before (i.e. the dialog has been
instanciated), this method just lets the dialog pop up modally on the
screen.
showGeneral
public static void showGeneral()
- shows the dialog with initial focus to the general tab
showDraw
public static void showDraw()
- shows the dialog with initial focus to the draw tab
showColor
public static void showColor()
- shows the dialog with initial focus to the Color tab
showAccelerator
public static void showAccelerator()
- shows the dialog with initial focus to the accelerator tab
showMisc
public static void showMisc()
- shows the dialog with initial focus to the misc tab
updateGUI
public void updateGUI()
- reads all values in the Options class and sets the GUI elements
accordingly
updateOptions
public void updateOptions()
- reads all values from the GUI elements and sets the Options
class accordingly
getDevHomeTextField
public javax.swing.JTextField getDevHomeTextField()
- quick getters and setters for the ones used from outside
getPathTextField
public javax.swing.JTextField getPathTextField()
getTrigenTextField
public javax.swing.JTextField getTrigenTextField()
getFeatlibTextField
public javax.swing.JTextField getFeatlibTextField()
getKeySelectionComboBox
public javax.swing.JComboBox getKeySelectionComboBox()
getCTRLbutton
public javax.swing.JRadioButton getCTRLbutton()
getALTbutton
public javax.swing.JRadioButton getALTbutton()
getSHIFTbutton
public javax.swing.JRadioButton getSHIFTbutton()
getNONEbutton
public javax.swing.JRadioButton getNONEbutton()
getSnapCheck
public javax.swing.JCheckBox getSnapCheck()
getSnapXTF
public javax.swing.JTextField getSnapXTF()
getSnapYTF
public javax.swing.JTextField getSnapYTF()
getEpsilonSlider
public javax.swing.JSlider getEpsilonSlider()
getAcceleratorTableData
public java.util.Vector getAcceleratorTableData()
getAcceleratorTable
public javax.swing.JTable getAcceleratorTable()
getColornodeLabel
public javax.swing.JLabel getColornodeLabel()
getColoredgeLabel
public javax.swing.JLabel getColoredgeLabel()
getColoredgebaseLabel
public javax.swing.JLabel getColoredgebaseLabel()
getColorelementLabel
public javax.swing.JLabel getColorelementLabel()
getNumberboundaryLabel
public javax.swing.JLabel getNumberboundaryLabel()
getNumbernodeLabel
public javax.swing.JLabel getNumbernodeLabel()
getNumberedgeLabel
public javax.swing.JLabel getNumberedgeLabel()
getNumberelementLabel
public javax.swing.JLabel getNumberelementLabel()
getHighlightselectionLabel
public javax.swing.JLabel getHighlightselectionLabel()
getHighlightrectLabel
public javax.swing.JLabel getHighlightrectLabel()
getMiscgridLabel
public javax.swing.JLabel getMiscgridLabel()
getMiscbackgroundLabel
public javax.swing.JLabel getMiscbackgroundLabel()
getMisclassoLabel
public javax.swing.JLabel getMisclassoLabel()
getFill0Label
public javax.swing.JLabel getFill0Label()
getFill1Label
public javax.swing.JLabel getFill1Label()
getFill2Label
public javax.swing.JLabel getFill2Label()
getFill3Label
public javax.swing.JLabel getFill3Label()
getFill4Label
public javax.swing.JLabel getFill4Label()
getFill5Label
public javax.swing.JLabel getFill5Label()
getFill6Label
public javax.swing.JLabel getFill6Label()
getFill7Label
public javax.swing.JLabel getFill7Label()
getFill8Label
public javax.swing.JLabel getFill8Label()
getFill9Label
public javax.swing.JLabel getFill9Label()
getFill10Label
public javax.swing.JLabel getFill10Label()
getFill11Label
public javax.swing.JLabel getFill11Label()
getFill12Label
public javax.swing.JLabel getFill12Label()
getFill13Label
public javax.swing.JLabel getFill13Label()
getFill14Label
public javax.swing.JLabel getFill14Label()
getFill15Label
public javax.swing.JLabel getFill15Label()
getBound0Label
public javax.swing.JLabel getBound0Label()
getBound1Label
public javax.swing.JLabel getBound1Label()
getBound2Label
public javax.swing.JLabel getBound2Label()
getBound3Label
public javax.swing.JLabel getBound3Label()
getBound4Label
public javax.swing.JLabel getBound4Label()
getBound5Label
public javax.swing.JLabel getBound5Label()
getBound6Label
public javax.swing.JLabel getBound6Label()
getBound7Label
public javax.swing.JLabel getBound7Label()
getBound8Label
public javax.swing.JLabel getBound8Label()
getBound9Label
public javax.swing.JLabel getBound9Label()
getBound10Label
public javax.swing.JLabel getBound10Label()
getBound11Label
public javax.swing.JLabel getBound11Label()
getBound12Label
public javax.swing.JLabel getBound12Label()
getBound13Label
public javax.swing.JLabel getBound13Label()
getBound14Label
public javax.swing.JLabel getBound14Label()
getBound15Label
public javax.swing.JLabel getBound15Label()