|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
net.sourceforge.olduvai.treejuxtaposer.StateFrame
public class StateFrame
GUI for marking and current stretching/squishing group.
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 int |
A_CLEAR
"Clear all" label and button index in clearButton . |
private java.awt.Canvas[] |
activeCanvas
Active color swatches for currently growing group color selection. |
private javax.swing.JPanel |
activeGroupPanel
Active group panel. |
protected int |
activeGrow
The current group that will be grown on an automated action, such as grow/shrink. |
private static java.lang.String[] |
activeLabel
Active group labels for user groups and automated marking. |
protected int |
activeMark
The current group that will be marked on user-directed marking actions. |
private javax.swing.JRadioButton[] |
activeMode
Buttons to select current active growing group, see activeLabel for their names. |
private javax.swing.JPanel |
activePanel
Active Panel Includes the following panels: grow direction, grow action, active group. |
private static javax.swing.JLabel |
activePanelLabel
Label for activePanel . |
protected int |
activeResolution
The current mark mode for internal nodes: either N_RES or S_RES (node, subtree) |
private javax.swing.ButtonGroup |
activeSelect
Group of buttons (one active at a time) for activeMode set of buttons. |
private static int |
B_GROW
Index for growing, for growButton . |
static int |
B_MODE
Horizontal AND vertical growing at the same time. |
private javax.swing.JPanel |
blank
Spacing panel. |
private static java.lang.String[] |
buttonLabel
Labels for grow and shrink for growButton . |
private static int |
CANVAS_SIZE
Edge length of squares used to show the color for each marking group. |
private javax.swing.JButton[] |
clearButton
Buttons for clearing, indexed by group clear G_CLEAR and clear all A_CLEAR . |
private static java.lang.String[] |
clearLabel
Labels for clearing user group buttons clearButton . |
private java.awt.Color[] |
color
|
private static java.lang.String[] |
colorTitle
Titles for color manipulation dialogs (window title), which pop up after selecting a group color swatch (canvas markCanvas or activeCanvas ). |
static int |
D_ACT
Automated difference group number |
static int |
F_ACT
Found (text search) group number |
private static int |
G_CLEAR
"Clear group" label and button index in clearButton . |
static int |
GA_ACT
1st group (A) |
static int |
GB_ACT
2nd group (B) |
static int |
GC_ACT
3rd group (C) |
static int |
GD_ACT
4th group (D) |
static int |
GE_ACT
5th group (E) |
static int |
GF_ACT
6th group (F) |
static int |
GG_ACT
7th group (G) |
static int |
GH_ACT
8th group (H) |
private javax.swing.JButton[] |
growButton
Grow/shrink buttons. |
protected int |
growDirection
The current mode for growing, either vertical, horizontal, or both directions simultaneously. |
private javax.swing.JPanel |
growDirectionPanel
Grow direction panel (horizontal, vertical, or both). |
private static javax.swing.JLabel |
growDirLabel
Label for growDirectionPanel . |
private static java.lang.String[] |
growLabel
Grow labels for growMode . |
private javax.swing.JRadioButton[] |
growMode
Radio buttons for stretching directions: horizontal, vertical, or both. |
private javax.swing.ButtonGroup |
growSelect
Button group for growMode . |
static int |
H_MODE
Horizontal growing. |
static java.awt.Color[] |
initialColor
Initial colors for groups. |
private static java.lang.String |
LCA
Label for least common ancestor checkboxes. |
static int |
LCA_ACT
Lowest common ancestor group number |
private javax.swing.JCheckBox |
LCAGroup
For growing by LCA when checked. |
javax.swing.JCheckBox |
LCAMark
For marking by LCA (ascend tree from marks to their LCA while this is checked) |
static int |
M_ACT
Mouseover group number |
private java.awt.Canvas[] |
markCanvas
Canvases for user-defined marks. |
private static java.lang.String[] |
markLabel
Label array for user-defined mark names. |
private javax.swing.JRadioButton[] |
markMode
Buttons for user-defined group marks. |
private javax.swing.JPanel |
markModePanel
Panel for markMode , user-defined group marks. |
private javax.swing.JPanel |
markPanel
User-defined marking group panel. |
private static javax.swing.JLabel |
markPanelLabel
Label for mark panel markPanel . |
private javax.swing.ButtonGroup |
markResolution
Button group for marking resolution, so only one of resolutionMode is selected. |
private javax.swing.ButtonGroup |
markSelect
User-defined marking group radio buttons ( markMode group), only one mark active at a time. |
static int |
N_RES
Node marking mode. |
private javax.swing.JButton |
resetButton
Reset button for unmarking previously marked user groups. |
private static java.lang.String[] |
resolutionLabel
Label for node N_RES and subtree S_RES marking. |
private javax.swing.JRadioButton[] |
resolutionMode
Resolution mode, for node N_RES or subtree S_RES marking modes. |
private javax.swing.JPanel |
resolutionPanel
Panel for marking resolution. |
private static javax.swing.JLabel |
resolutionTitle
Mark resolution (node or subtree marking) label. |
private static int |
S_GROW
Index for shrinking, for growButton . |
static int |
S_RES
Subtree marking mode. |
private static java.lang.String |
title
Title for the state frame (aka groups). |
private TreeJuxtaposer |
tj
Treejuxtaposer object, for referencing groups and other state. |
static int |
V_MODE
Vertical growing. |
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 | |
---|---|
StateFrame(TreeJuxtaposer tj)
Constructor for StateFrame. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt)
Button press action listener. |
protected void |
activeMarkAction(int mode)
Sets the current marking group (local state activeMark ) to mark when user selects 'm' to highlight nodes or subtrees. |
protected void |
activeModeAction(int mode)
Sets the current active group (local state activeGrow ) to automatically grow/shrink or perform other actions on. |
protected void |
activeResolutionAction(int mode)
Set the user group marking resolution to the given mode. |
int |
getActionGroup()
Returns the group number that is supposed to grow when grow option (bigger/smaller) is pressed. |
protected boolean |
getLCAGroup()
Test to see if LCA group checkbox LCAGroup is selected. |
protected boolean |
getLCAMark()
Test to see if LCA mark checkbox LCAMark is selected. |
protected int |
getMarkGroup()
Return the number corresponding to the active mark group. |
protected boolean |
growHorizontal()
Return true if growing horizontal, or in both directions. |
protected void |
growModeAction(int mode)
Handler for user-modifying grow direction not through the GUI. |
protected boolean |
growVertical()
Return true if growing vertical, or in both directions. |
private void |
initComponents()
Initialize GUI and set up listeners. |
void |
mouseClicked(java.awt.event.MouseEvent evt)
Mouse click handling on canvas objects (color swatches for marked groups). |
void |
mouseEntered(java.awt.event.MouseEvent evt)
Stub function. |
void |
mouseExited(java.awt.event.MouseEvent evt)
Stub function. |
void |
mousePressed(java.awt.event.MouseEvent evt)
Stub function. |
void |
mouseReleased(java.awt.event.MouseEvent evt)
Stub function. |
protected void |
setLCAGroup(boolean on)
Set state of LCA group checkbox LCAGroup . |
protected void |
setLCAMark(boolean on)
Set state of LCA marking checkbox LCAMark . |
private void |
unmarkAllGroups()
Clear all user marked groups, and LCA mark checkbox. |
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 |
---|
private static final java.lang.String title
private javax.swing.JPanel blank
private TreeJuxtaposer tj
private static final int CANVAS_SIZE
private javax.swing.JPanel activePanel
private static final javax.swing.JLabel activePanelLabel
activePanel
.
private javax.swing.JButton resetButton
private javax.swing.JPanel growDirectionPanel
private javax.swing.ButtonGroup growSelect
growMode
.
private javax.swing.JRadioButton[] growMode
private static final javax.swing.JLabel growDirLabel
growDirectionPanel
.
private static final java.lang.String[] growLabel
growMode
.
public static final int H_MODE
public static final int V_MODE
public static final int B_MODE
private javax.swing.JButton[] growButton
private static final java.lang.String[] buttonLabel
growButton
.
private static final int B_GROW
growButton
.
private static final int S_GROW
growButton
.
private javax.swing.JPanel activeGroupPanel
private java.awt.Canvas[] activeCanvas
private javax.swing.ButtonGroup activeSelect
activeMode
set of buttons.
private javax.swing.JRadioButton[] activeMode
activeLabel
for their names.
private static final java.lang.String[] activeLabel
markLabel
.
private static final java.lang.String[] colorTitle
markCanvas
or activeCanvas
).
public static final int GA_ACT
public static final int GB_ACT
public static final int GC_ACT
public static final int GD_ACT
public static final int GE_ACT
public static final int GF_ACT
public static final int GG_ACT
public static final int GH_ACT
public static final int M_ACT
public static final int D_ACT
public static final int F_ACT
public static final int LCA_ACT
private javax.swing.JPanel markPanel
private static final javax.swing.JLabel markPanelLabel
markPanel
.
private javax.swing.ButtonGroup markSelect
markMode
group), only one mark active at a time.
private javax.swing.JRadioButton[] markMode
private javax.swing.JPanel markModePanel
markMode
, user-defined group marks.
private static final java.lang.String[] markLabel
activeLabel
names.
private java.awt.Canvas[] markCanvas
private static final java.lang.String[] clearLabel
clearButton
.
private static final int G_CLEAR
clearButton
.
private static final int A_CLEAR
clearButton
.
private javax.swing.JButton[] clearButton
G_CLEAR
and clear all A_CLEAR
.
private static final javax.swing.JLabel resolutionTitle
private javax.swing.JPanel resolutionPanel
private javax.swing.ButtonGroup markResolution
resolutionMode
is selected.
private static final java.lang.String[] resolutionLabel
N_RES
and subtree S_RES
marking.
public static final int N_RES
S_RES
.
public static final int S_RES
N_RES
.
private javax.swing.JRadioButton[] resolutionMode
N_RES
or subtree S_RES
marking modes.
private static final java.lang.String LCA
private javax.swing.JCheckBox LCAGroup
public javax.swing.JCheckBox LCAMark
public static final java.awt.Color[] initialColor
private java.awt.Color[] color
protected int activeGrow
protected int activeMark
protected int growDirection
protected int activeResolution
N_RES
or S_RES
(node, subtree)
Constructor Detail |
---|
public StateFrame(TreeJuxtaposer tj)
tj
- The tree juxtaposer to reference for state and drawers.
HeadlessException
Method Detail |
---|
private void initComponents()
protected void growModeAction(int mode)
mode
- One of the defined directions horizontal H_MODE
, both B_MODE
, or vertical V_MODE
.protected void activeModeAction(int mode)
activeGrow
) to automatically grow/shrink or perform other actions on.
Compare to current mark group, which is the group that a selected region will be marked as.
The mode may be any group (user, diff, found, mouse-over, LCA) while the mark is only user.
mode
- Any staticly valued group such as user groups, diff, found, mouse-over and LCA.protected void activeMarkAction(int mode)
activeMark
) to mark when user selects 'm' to highlight nodes or subtrees.
Compare to current active group, which is the group that will be grown with automated actions.
The mode may be any user marking group only, while the active group may be any other group as well.
The group priority is then adjusted to make the last marked group visible over all others.
Difference marks are always top priority over user groups.
mode
- Any user marking group (GA_ACT
to GH_ACT
).protected void activeResolutionAction(int mode)
N_RES
and subtree S_RES
.
mode
- One of node N_RES
or subtree S_RES
, the marking resolution.private void unmarkAllGroups()
public void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed
in interface java.awt.event.ActionListener
evt
- Event to decipher.protected void setLCAMark(boolean on)
LCAMark
.
on
- Set to true if we want to mark objects in the LCA group color.protected boolean getLCAMark()
LCAMark
is selected.
protected void setLCAGroup(boolean on)
LCAGroup
.
on
- Set to true if we want to grow the LCA group with the bigger and smaller buttons.protected boolean getLCAGroup()
LCAGroup
is selected.
public void mouseClicked(java.awt.event.MouseEvent evt)
mouseClicked
in interface java.awt.event.MouseListener
evt
- Mouse click event, only detected on canvas objects markCanvas
or activeCanvas
.public int getActionGroup()
GA_ACT
, GB_ACT
, GC_ACT
, GD_ACT
, GE_ACT
, GF_ACT
, GG_ACT
, GH_ACT
,
or differences D_ACT
, mouseover M_ACT
, found items F_ACT
, or least common ancestor LCA_ACT
.
protected int getMarkGroup()
GA_ACT
, GB_ACT
, GC_ACT
, GD_ACT
, GE_ACT
, GF_ACT
, GG_ACT
, GH_ACT
.
protected boolean growHorizontal()
protected boolean growVertical()
public void mouseEntered(java.awt.event.MouseEvent evt)
mouseEntered
in interface java.awt.event.MouseListener
evt
- Mouse event object.public void mouseExited(java.awt.event.MouseEvent evt)
mouseExited
in interface java.awt.event.MouseListener
evt
- Mouse event object.public void mousePressed(java.awt.event.MouseEvent evt)
mousePressed
in interface java.awt.event.MouseListener
evt
- Mouse event object.public void mouseReleased(java.awt.event.MouseEvent evt)
mouseReleased
in interface java.awt.event.MouseListener
evt
- Mouse event object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |