ucot.ui.gui.dialog
Class SettingsDialog

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by javax.swing.JDialog
                      extended by ucot.ui.gui.dialog.SettingsDialog
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class SettingsDialog
extends javax.swing.JDialog

Settings dialog for UCOT program. There are different kinds of settings available for modification through UCOT (G)UI, and this dialog allows user to change the values for those settings.

This settings dialog uses the ModulePropertyInterface offered by the UCOT modules and after changing the values each component's applyProperties method is called.

Author:
ilanliuk, tujupien
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Nested classes/interfaces inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private static java.lang.String BROWSE_BUTTON_CLICKED
           
static java.lang.String BROWSE_BUTTON_TITLE
           
private  java.awt.event.ActionListener buttonListener
           
static java.lang.String DEFAULT_HEURISTIC_LABEL
           
static java.lang.String DEFAULT_PARSER_LABEL
           
static java.lang.String DIALOG_TITLE
           
static java.lang.String DOT_COLOR_LABEL
           
static java.lang.String DOT_HIGHLIGHT_COLOR_LABEL
           
static java.lang.String DOT_PATH_LABEL
           
private  int dotPathIndex
           
static java.lang.String ENTITY_TYPE_TITLE
           
static java.lang.String ENTITY_TYPES_GOING_TO_BE_REMOVED_QUESTION
           
static java.lang.String EPS_TO_PDF_PATH_LABEL
           
private  int epsToPDFpathIndex
           
static java.lang.String EXTERNAL_FILES_TITLE
           
private  java.util.Vector<javax.swing.JButton> fileBrowserButtons
           
private  java.util.Vector<javax.swing.JTextField> fileTextFields
           
static java.lang.String GENERAL_SETTINGS_TITLE
           
static java.lang.String GRAPH_SETTINGS_TITLE
           
private  java.util.Vector<javax.swing.JComboBox> graphComboBoxes
           
private  javax.swing.JComboBox heuristicComboBox
           
private  int highlightColorIndex
           
private static int HORIZONTAL_GAP
           
static java.lang.String INCORRECT_PATH_TO_FILE_QUESTION
           
private  java.util.logging.Logger logger
           
static java.lang.String MAIN_CANCEL_BUTTON
           
static java.lang.String MAIN_CANCEL_BUTTON_ACTION
           
static java.lang.String MAIN_OK_BUTTON
           
static java.lang.String MAIN_OK_BUTTON_ACTION
           
private  int normalColorIndex
           
private  GraphicalUI owner
           
private  javax.swing.JComboBox parserComboBox
           
private  java.lang.String result
           
private static long serialVersionUID
           
private  javax.swing.JList typeList
           
private  javax.swing.DefaultListModel typeListModel
           
private static int VERTICAL_GAP
           
 
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
 
Constructor Summary
SettingsDialog(GraphicalUI owner)
          Default constructor for SettingsDialog.
 
Method Summary
private  void buttonBrowseClicked(java.awt.event.ActionEvent e)
          Method for browsing files and putting the selected file to the correct text box.
private  void createButtonListener()
          This method initializes ActionListener for all buttons.
private  javax.swing.JPanel createEntityTypesPanel()
          Initialize JPanel for entity types.
private  javax.swing.JPanel createExternalFilesPanel()
          This method creates a panel containing text boxes and browse buttons for modifying the path all external files that are associated with this program.
private  javax.swing.JPanel createGeneralPanel()
          Initialize panel for general settings, like default parser and heuristics etc.
private  javax.swing.JPanel createGraphSettingsPanel()
           
 java.lang.String getResult()
          Method for figuring out how the user exited the dialog.
private  void mainCancelButtonClicked()
          User just clicked cancel button and we just need close the dialog without saving anything.
private  void mainOKButtonClicked()
          User clicked Apply and we just save the settings and vanish.
static java.lang.String showDialog(GraphicalUI owner)
          Static method to create and show SettingsDialog.
private  void updateEntityTypes()
           
 
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, 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, dispose, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, 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, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, 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, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

owner

private GraphicalUI owner

logger

private java.util.logging.Logger logger

buttonListener

private java.awt.event.ActionListener buttonListener

result

private java.lang.String result

parserComboBox

private javax.swing.JComboBox parserComboBox

heuristicComboBox

private javax.swing.JComboBox heuristicComboBox

typeList

private javax.swing.JList typeList

typeListModel

private javax.swing.DefaultListModel typeListModel

fileTextFields

private java.util.Vector<javax.swing.JTextField> fileTextFields

fileBrowserButtons

private java.util.Vector<javax.swing.JButton> fileBrowserButtons

dotPathIndex

private int dotPathIndex

epsToPDFpathIndex

private int epsToPDFpathIndex

graphComboBoxes

private java.util.Vector<javax.swing.JComboBox> graphComboBoxes

normalColorIndex

private int normalColorIndex

highlightColorIndex

private int highlightColorIndex

MAIN_OK_BUTTON_ACTION

public static final java.lang.String MAIN_OK_BUTTON_ACTION
See Also:
Constant Field Values

MAIN_CANCEL_BUTTON_ACTION

public static final java.lang.String MAIN_CANCEL_BUTTON_ACTION
See Also:
Constant Field Values

BROWSE_BUTTON_CLICKED

private static final java.lang.String BROWSE_BUTTON_CLICKED
See Also:
Constant Field Values

HORIZONTAL_GAP

private static final int HORIZONTAL_GAP
See Also:
Constant Field Values

VERTICAL_GAP

private static final int VERTICAL_GAP
See Also:
Constant Field Values

DIALOG_TITLE

public static final java.lang.String DIALOG_TITLE

MAIN_OK_BUTTON

public static final java.lang.String MAIN_OK_BUTTON

MAIN_CANCEL_BUTTON

public static final java.lang.String MAIN_CANCEL_BUTTON

BROWSE_BUTTON_TITLE

public static final java.lang.String BROWSE_BUTTON_TITLE

DOT_PATH_LABEL

public static final java.lang.String DOT_PATH_LABEL

EPS_TO_PDF_PATH_LABEL

public static final java.lang.String EPS_TO_PDF_PATH_LABEL

EXTERNAL_FILES_TITLE

public static final java.lang.String EXTERNAL_FILES_TITLE

GENERAL_SETTINGS_TITLE

public static final java.lang.String GENERAL_SETTINGS_TITLE

GRAPH_SETTINGS_TITLE

public static final java.lang.String GRAPH_SETTINGS_TITLE

ENTITY_TYPE_TITLE

public static final java.lang.String ENTITY_TYPE_TITLE

DEFAULT_PARSER_LABEL

public static final java.lang.String DEFAULT_PARSER_LABEL

DEFAULT_HEURISTIC_LABEL

public static final java.lang.String DEFAULT_HEURISTIC_LABEL

INCORRECT_PATH_TO_FILE_QUESTION

public static final java.lang.String INCORRECT_PATH_TO_FILE_QUESTION

DOT_COLOR_LABEL

public static final java.lang.String DOT_COLOR_LABEL

DOT_HIGHLIGHT_COLOR_LABEL

public static final java.lang.String DOT_HIGHLIGHT_COLOR_LABEL

ENTITY_TYPES_GOING_TO_BE_REMOVED_QUESTION

public static final java.lang.String ENTITY_TYPES_GOING_TO_BE_REMOVED_QUESTION
Constructor Detail

SettingsDialog

public SettingsDialog(GraphicalUI owner)
               throws java.awt.HeadlessException

Default constructor for SettingsDialog. This constructor initializes the whole dialog, creates the layout and makes all defined properties available for modification.

Parameters:
owner - GraphicalUI that owns this dialog.
Throws:
If - something with the initialization of the (super) class goes wrong, a HeadlessException is thrown.
java.awt.HeadlessException
Method Detail

createGraphSettingsPanel

private javax.swing.JPanel createGraphSettingsPanel()

createExternalFilesPanel

private javax.swing.JPanel createExternalFilesPanel()

This method creates a panel containing text boxes and browse buttons for modifying the path all external files that are associated with this program.


createGeneralPanel

private javax.swing.JPanel createGeneralPanel()

Initialize panel for general settings, like default parser and heuristics etc.


createEntityTypesPanel

private javax.swing.JPanel createEntityTypesPanel()

Initialize JPanel for entity types.

Returns:
JPanel

updateEntityTypes

private void updateEntityTypes()

buttonBrowseClicked

private void buttonBrowseClicked(java.awt.event.ActionEvent e)

Method for browsing files and putting the selected file to the correct text box.


mainCancelButtonClicked

private void mainCancelButtonClicked()

User just clicked cancel button and we just need close the dialog without saving anything.


mainOKButtonClicked

private void mainOKButtonClicked()

User clicked Apply and we just save the settings and vanish.


createButtonListener

private void createButtonListener()

This method initializes ActionListener for all buttons.


getResult

public java.lang.String getResult()

Method for figuring out how the user exited the dialog.

Returns:
Returns either SettingsDialog.MAIN_OK_BUTTON_ACTION or SettingsDialog.MAIN_CANCEL_BUTTON_ACTION depending on how the user closed the dialog.

showDialog

public static java.lang.String showDialog(GraphicalUI owner)

Static method to create and show SettingsDialog.

Parameters:
owner - Owner of the dialog to be shown.