net.sourceforge.olduvai.treejuxtaposer
Class SettingsFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by net.sourceforge.olduvai.treejuxtaposer.SettingsFrame
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ChangeListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class SettingsFrame
extends javax.swing.JFrame
implements java.awt.event.ActionListener, javax.swing.event.ChangeListener

GUI for settings. This class is heavily parameterized to support changes and additional settings options that may be added later.

Author:
jslack
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private static javax.swing.JLabel bcnScoreLabel
          Label for bcnScoreSlider.
private  javax.swing.JSlider bcnScoreSlider
          Slider for controling the BCN threshold for differences.
private static int DIM_MARK
          Index of Marked dimming option for dimming strings in dimString.
private static int DIM_UNMARK
          Index of Unmarked dimming option for dimming strings in dimString.
private  javax.swing.JCheckBox[] dimCheck
          Dimming check boxes.
private static javax.swing.JLabel dimLabel
          Dimming label title for both check boxes.
private static java.lang.String[] dimString
          Dimming strings for dimCheck checkbox.
private  javax.swing.JButton[] fontButton
          Buttons for font size control (smaller/bigger min/max).
private  javax.swing.JTextField[] fontEntry
          Text labels for font strings fontString.
private static javax.swing.JLabel fontLabel
          Main label for font size control.
private static java.lang.String[] fontString
          Min/Max labels for font size controls.
private static javax.swing.JLabel labelDensityLabel
          Label for labelDensitySlider.
private  int labelDensityMax
          Maximum value for label density.
private  javax.swing.JSlider labelDensitySlider
          Slider for label density.
private static int LEFT_MASK
          Mask to OR by to access left side labels for fonts.
private  javax.swing.JPanel leftPanel
          Objects on the left side of the GUI.
private static javax.swing.JLabel linewidthLabel
          Label for linewidthSlider.
private  javax.swing.JSlider linewidthSlider
          Slider for line width.
 javax.swing.JCheckBox linkCheck
          Checkbox for linked navigation.
private static java.lang.String linkString
          String for linkCheck checkbox.
private static int MAX_FONT
          Index for Max font.
private static int MAX_FONT_THRESHOLD
          Maximum legal font size.
private static int MIN_FONT
          Index for Min font.
private static int MIN_FONT_THRESHOLD
          Minimum legal font size.
private  javax.swing.JCheckBox progressiveOn
          Checkbox for progressive rendering toggle
private static int RIGHT_MASK
          Mask to OR by to access right side labels for fonts.
private  javax.swing.JPanel rightPanel
          Objects on the right side of the GUI.
private static int SHOW_DIFF
          Index for diffs in showString
private static int SHOW_LABEL
          Index for labels string in showString.
private  javax.swing.JCheckBox[] showCheck
          Toggle boxes for diffs and labels.
private static javax.swing.JLabel showLabel
          Title for toggle boxes in showCheck.
private static java.lang.String[] showString
          Strings for checkbox showCheck.
private  javax.swing.JButton snapshotButton
          Button for taking snapshots
private static java.lang.String snapshotLabel
          String for snapshot label
private static java.lang.String title
          Title for this frame.
private  TreeJuxtaposer tj
          Treejuxtaposer object for referencing state and all drawers.
private static java.lang.String toggleProgRenderString
          String for progressive rendering toggle
 
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.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
SettingsFrame(TreeJuxtaposer tj)
          Constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
          Update state of UI after a user event.
 boolean areLabelsOn()
          Flag check for testing if labels are on.
private  void initComponents()
          Initialize components and set up GUI.
 boolean isDiffOn()
          Flag check for testing if diffs are on.
 void prepareToShow()
          Post process updates of UI after a user action on the settings.
 void setLabelsOn(boolean on)
          Activate/deactivate state of drawing labels.
 void setLinkedNavigation(boolean on)
          Activate/deactivate state of linked navigation.
 void setStructDiff(boolean on)
          Activate/deactivate state of drawing diffs.
 void stateChanged(javax.swing.event.ChangeEvent evt)
          Other state changes not detectable by actionPerformed(ActionEvent), such as slider movement.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, 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, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, 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, 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, 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

tj

private TreeJuxtaposer tj
Treejuxtaposer object for referencing state and all drawers.


title

private static final java.lang.String title
Title for this frame.

See Also:
Constant Field Values

leftPanel

private javax.swing.JPanel leftPanel
Objects on the left side of the GUI. Sliders, font sizes, check boxes for linked navigation and progressive rendering.


rightPanel

private javax.swing.JPanel rightPanel
Objects on the right side of the GUI. Check boxes for diffs, labels, dimming, and snapshot button.


linewidthSlider

private javax.swing.JSlider linewidthSlider
Slider for line width. Also changes the block size.


linewidthLabel

private static final javax.swing.JLabel linewidthLabel
Label for linewidthSlider.


labelDensitySlider

private javax.swing.JSlider labelDensitySlider
Slider for label density.


labelDensityLabel

private static final javax.swing.JLabel labelDensityLabel
Label for labelDensitySlider.


labelDensityMax

private int labelDensityMax
Maximum value for label density.


bcnScoreSlider

private javax.swing.JSlider bcnScoreSlider
Slider for controling the BCN threshold for differences.


bcnScoreLabel

private static final javax.swing.JLabel bcnScoreLabel
Label for bcnScoreSlider.


fontLabel

private static final javax.swing.JLabel fontLabel
Main label for font size control.


fontString

private static final java.lang.String[] fontString
Min/Max labels for font size controls.


fontEntry

private javax.swing.JTextField[] fontEntry
Text labels for font strings fontString.


fontButton

private javax.swing.JButton[] fontButton
Buttons for font size control (smaller/bigger min/max).


MIN_FONT

private static final int MIN_FONT
Index for Min font. OR by LEFT_MASK or RIGHT_MASK to get smaller or bigger button.

See Also:
Constant Field Values

MAX_FONT

private static final int MAX_FONT
Index for Max font. OR by LEFT_MASK or RIGHT_MASK to get smaller or bigger button.

See Also:
Constant Field Values

LEFT_MASK

private static final int LEFT_MASK
Mask to OR by to access left side labels for fonts.

See Also:
Constant Field Values

RIGHT_MASK

private static final int RIGHT_MASK
Mask to OR by to access right side labels for fonts.

See Also:
Constant Field Values

MIN_FONT_THRESHOLD

private static final int MIN_FONT_THRESHOLD
Minimum legal font size.

See Also:
Constant Field Values

MAX_FONT_THRESHOLD

private static final int MAX_FONT_THRESHOLD
Maximum legal font size.

See Also:
Constant Field Values

linkCheck

public javax.swing.JCheckBox linkCheck
Checkbox for linked navigation.


linkString

private static final java.lang.String linkString
String for linkCheck checkbox.

See Also:
Constant Field Values

showLabel

private static final javax.swing.JLabel showLabel
Title for toggle boxes in showCheck.


showCheck

private javax.swing.JCheckBox[] showCheck
Toggle boxes for diffs and labels.


showString

private static final java.lang.String[] showString
Strings for checkbox showCheck.


SHOW_DIFF

private static final int SHOW_DIFF
Index for diffs in showString

See Also:
Constant Field Values

SHOW_LABEL

private static final int SHOW_LABEL
Index for labels string in showString.

See Also:
Constant Field Values

dimLabel

private static final javax.swing.JLabel dimLabel
Dimming label title for both check boxes.


dimCheck

private javax.swing.JCheckBox[] dimCheck
Dimming check boxes.


dimString

private static final java.lang.String[] dimString
Dimming strings for dimCheck checkbox.


DIM_MARK

private static final int DIM_MARK
Index of Marked dimming option for dimming strings in dimString.

See Also:
Constant Field Values

DIM_UNMARK

private static final int DIM_UNMARK
Index of Unmarked dimming option for dimming strings in dimString.

See Also:
Constant Field Values

snapshotButton

private javax.swing.JButton snapshotButton
Button for taking snapshots


snapshotLabel

private static final java.lang.String snapshotLabel
String for snapshot label

See Also:
Constant Field Values

progressiveOn

private javax.swing.JCheckBox progressiveOn
Checkbox for progressive rendering toggle


toggleProgRenderString

private static final java.lang.String toggleProgRenderString
String for progressive rendering toggle

See Also:
Constant Field Values
Constructor Detail

SettingsFrame

public SettingsFrame(TreeJuxtaposer tj)
Constructor. Calls initComponents() to create GUI.

Throws:
java.awt.HeadlessException
Method Detail

initComponents

private void initComponents()
Initialize components and set up GUI. This is only run as part of the constructor, which sets up the main state variables for this class.


stateChanged

public void stateChanged(javax.swing.event.ChangeEvent evt)
Other state changes not detectable by actionPerformed(ActionEvent), such as slider movement.

Specified by:
stateChanged in interface javax.swing.event.ChangeListener
Parameters:
evt - State change event.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Update state of UI after a user event.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
evt - The user event.

prepareToShow

public void prepareToShow()
Post process updates of UI after a user action on the settings. Updates font sizes (min/max), linked navigation state, and dimming (marked/unmarked). Other state updates have been migrated to act on the state of the widgets, not using TJ for holding state at all.


setStructDiff

public void setStructDiff(boolean on)
Activate/deactivate state of drawing diffs.

Parameters:
on - If true, diffs will be highlighted. False does not highlight diffs.

isDiffOn

public boolean isDiffOn()
Flag check for testing if diffs are on. Replaces state machine.

Returns:
State of diff flag, showCheck[SHOW_DIFF].

setLabelsOn

public void setLabelsOn(boolean on)
Activate/deactivate state of drawing labels.

Parameters:
on - If true, labels will be drawn. False does not draw labels.

setLinkedNavigation

public void setLinkedNavigation(boolean on)
Activate/deactivate state of linked navigation. Does not perform redraw.

Parameters:
on - If true, do linked navigation with quasi-mode box dragging. False does not do linked navigation.

areLabelsOn

public boolean areLabelsOn()
Flag check for testing if labels are on. Replaces state machine.

Returns:
State of label flag, showCheck[SHOW_LABEL].