|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.olduvai.accordiondrawer.AccordionDrawer
net.sourceforge.olduvai.treejuxtaposer.drawer.AccordionTreeDrawer
net.sourceforge.olduvai.treejuxtaposer.AccordionTreeDrawerFinal
public class AccordionTreeDrawerFinal
A class that implements the abstract methods left in AccordionTreeDrawer, mainly user interface and application-specific hooks for TreeJuxtaposer.
TreeJuxtaposer
,
AccordionTreeDrawer
,
AccordionDrawer
Field Summary | |
---|---|
private int |
actionmode
state of interaction: 0, 1, 2, 3, 4, 5, 6, 7, 11 |
private static int |
actionmodeDefault
ActionMode: default to mouseover action |
private static int |
ALL
BOTH X and Y directions |
private static int |
ALL_GROUPS
After a user selects 'a' for all groups, keytarget will be set to this value. |
private static int |
DEVELOPER
Developer mode for keytarget |
private int[] |
dragEnd
The X/Y pixel location of a mouse dragging action at it's current position. |
private int[] |
dragStart
The X/Y pixel location of a mouse dragging action at the start. |
private int |
growDirectionDefault
Growing direction, default to 1 |
protected static int |
HORIZ
HORIZ direction X |
protected boolean |
jump
true: do jump cuts, false: use the number default number of steps in each animation |
private int |
keytarget
Store previous keystroke if a developer key action happened (".") |
private static int |
keytargetDefault
Default key target is Mouse over interaction M_ACT in StateFrame |
private static int |
MOUSEOVER
ActionMode: Base state of cursor interaction, no action buttons pushed, any node that is under the cursor will be highlighted. |
private TreeNode |
mouseOverNode
The current 'focus' object under the cursor, a TreeNode. |
private static int |
MOVE_STUCKPOS
ActionMode: move a stuck line (hidden feature) |
private static int |
NODE
Mark mode: single node |
private static int |
NONE
value of NONE for keytarget and actionmode |
private TreeNode |
pickedNode
The currently picked node (flash drawing). |
private TreeNode |
pickedNodeOld
The previously picked node (flash drawing). |
private static int |
RECT_CREATE
ActionMode: Mouse drag to create an interaction box |
private static int |
RECT_FREEMOVE
ActionMode: Mouse movement with active interaction box (no drag) |
private static int |
RECT_FREEMOVEAGAIN
ActionMode: Mouse movement after dragging the active interaction box (no current drag) |
private static int |
RECT_RESHAPE
ActionMode: Mouse dragging movement with active interaction box |
private int |
selectionResolutionDefault
Mark mode default: 1 |
private static int |
ST_FREEMOVE
ActionMode: Free move state with shift pressed |
private static int |
ST_FREEMOVEAGAIN
ActionMode: Free move state with shift pressed following a reshape |
private static int |
ST_RESHAPE
ActionMode: Free move state with shift pressed during a mouse drag event |
private static int |
SUBTREE
Mark mode: subtree |
private TreeJuxtaposer |
tj
The treejuxtaposer object for referencing the program instance that responds to user actions found in this class. |
protected static int |
VERT
VERT direction Y |
Fields inherited from class net.sourceforge.olduvai.treejuxtaposer.drawer.AccordionTreeDrawer |
---|
countDrawnFrame, countDrawnScene, cumFrameTime, drawnlabelsize, flashLabelBox, fullyQualified, internalDrawCount, labelAtLeaves, labelbuffer, labeloffset, labelPixels, leafDrawCount, lineLength, linePixel, linePos, maxFontHeight, minFontHeight, objectColor, pickFuzz, pixelDiv, popupFontHeight, rootNode, tree |
Constructor Summary | |
---|---|
AccordionTreeDrawerFinal(Tree t,
int w,
int h,
TreeJuxtaposer thetj,
javax.swing.JProgressBar jpb)
Constructor for a drawer with defined key and mouse interaction methods, and bindings from the drawer to the TreeJuxtaposer application. |
Method Summary | |
---|---|
void |
actionmodeReset()
Initialize or reset the state of all object state. |
private int |
closeToStuck()
Helper function to determine if the cursor is close to a stuck line, within pickFuzz. |
protected void |
customGLInit(javax.media.opengl.GL gl)
Stub function. |
private void |
drawActiveSubtreeBox()
Make an InteractionBox from the GridCells nearest to the box of the cursor position, and update the view with a flash draw. |
private int |
findChildNumber(TreeNode parentNode,
TreeNode originalNode)
Find the child index of the originalNode as a child of the parent node |
void |
flashDown()
Function to handle a down arrow action by the user. |
void |
flashLeft()
Function to handle a left arrow action by the user. |
void |
flashRight()
Function to handle a right arrow action by the user. |
void |
flashUp()
Function to handle an up arrow action by the user. |
java.util.ArrayList |
getColorsForCellGeom(CellGeom c)
Wrapper for TreeJuxtaposer call to TreeJuxtaposer.getColorsForRange(int, int, AccordionTreeDrawer) . |
java.util.ArrayList |
getColorsForRange(int objmin,
int objmax)
Wrapper function for TreeJuxtaposer.getColorsForRange(int, int, AccordionTreeDrawer) |
RangeList |
getRangeByKey(int key)
Get the range list (marked group) by the given key |
void |
keyPressed(java.awt.event.KeyEvent e)
Capture the press of a key. |
void |
keyReleased(java.awt.event.KeyEvent e)
Capture the release of a keystroke. |
void |
keyTyped(java.awt.event.KeyEvent e)
Used when hitting a key should trigger an atomic action. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Mouse click function, currently not fully supported, but can be used to move stuck positions. |
void |
mouseDragged(java.awt.event.MouseEvent e)
Mouse drag function, for updating mouse position events during a mouse press, such as stretching. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Mouse entry function. |
void |
mouseExited(java.awt.event.MouseEvent e)
Mouse exit function, for when mouse leaves drawing canvas' parent. |
void |
mouseMoved(java.awt.event.MouseEvent e)
Mouse movement function, for updating mouse position events, such as highlighting. |
private boolean |
mouseOutOfWindow(java.awt.event.MouseEvent e)
Helper to determine if the cursor is out of the canvas. |
private void |
mouseover(int x,
int y)
Simple cursor location update and picking, called by mouseMoved(MouseEvent) . |
void |
mousePressed(java.awt.event.MouseEvent e)
Mouse press function, for updating interaction box events, setting up new boxes or stretching a created one. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Mouse release function, for updating mouse position events, such as highlighting. |
private void |
newMouseOver(TreeNode originalNode,
TreeNode newNode)
Called by any of the arrow action functions, to update the drawer with a flash draw. |
private void |
reshaperectangle(InteractionBox stretchBox,
boolean doOther)
Box stretching function used by mouseDragged(MouseEvent) . |
private TreeNode |
rightAlignFind(TreeNode parentNode,
TreeNode originalNode,
int originalNodeChildNumber,
boolean goingDown)
Find the right aligned cell that is below (above) the original node, using the parent node as reference. |
void |
seedQueue()
Wrapper function for TreeJuxtaposer.seedQueue(AccordionTreeDrawerFinal) . |
java.lang.String |
toString()
Convert tree into name used by screen shot writer. |
Methods inherited from class net.sourceforge.olduvai.treejuxtaposer.drawer.AccordionTreeDrawer |
---|
addToDrawQueue, decreaseLabelBuffer, decreaseMaxFontHeight, decreaseMinFontHeight, doFlash, drawGeom, drawPostFrame, drawPostScene, drawPreContFrame, drawPreNewFrame, drawRange, drawRange, finalize, flashDraw, getCanvasDrawable, getLabelBuffer, getLeaf, getListOfLeaves, getMaxFontHeight, getMinFontHeight, getNodeByKey, getNodeByName, getObjectColor, getTree, increaseLabelBuffer, increaseMaxFontHeight, increaseMinFontHeight, initCells, makeBox, pickGeom, preDraw, resetSplitValues, setLabelBuffer, setLabelBuffer, setMaxFontHeight, setMinFontHeight, setObjectColor, shutdown |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private TreeJuxtaposer tj
private int[] dragStart
private int[] dragEnd
private TreeNode mouseOverNode
protected static final int HORIZ
protected static final int VERT
private static final int ALL
private int growDirectionDefault
private static final int ALL_GROUPS
private static final int NODE
private static final int SUBTREE
private int selectionResolutionDefault
private int keytarget
private static final int DEVELOPER
private static final int NONE
keytarget
and actionmode
private static final int keytargetDefault
private int actionmode
private static final int MOUSEOVER
private static final int ST_FREEMOVE
private static final int ST_FREEMOVEAGAIN
private static final int ST_RESHAPE
private static final int RECT_CREATE
private static final int RECT_FREEMOVE
private static final int RECT_FREEMOVEAGAIN
private static final int RECT_RESHAPE
private static final int actionmodeDefault
private static final int MOVE_STUCKPOS
protected boolean jump
private TreeNode pickedNode
private TreeNode pickedNodeOld
Constructor Detail |
---|
public AccordionTreeDrawerFinal(Tree t, int w, int h, TreeJuxtaposer thetj, javax.swing.JProgressBar jpb)
t
- Tree for this drawer.w
- width of the canvas in pixels.h
- height of the canvas in pixels.thetj
- TreeJuxtaposer object that uses this drawer.jpb
- Progress bar.Method Detail |
---|
public java.util.ArrayList getColorsForRange(int objmin, int objmax)
TreeJuxtaposer.getColorsForRange(int, int, AccordionTreeDrawer)
getColorsForRange
in class AccordionTreeDrawer
objmin
- start of range to get colors for.objmax
- end of range to get colors for.
private void drawActiveSubtreeBox()
public void actionmodeReset()
private void mouseover(int x, int y)
mouseMoved(MouseEvent)
.
x
- cursor horizontal position.y
- cursor vertical position.private void reshaperectangle(InteractionBox stretchBox, boolean doOther)
mouseDragged(MouseEvent)
.
stretchBox
- Box that is stretching, following a call to InteractionBox.updateDrag(int[])
.doOther
- if true, will also stretch interaction boxes in other drawers, for linked navigation.public void mouseEntered(java.awt.event.MouseEvent e)
e
- Mouse event object.public void mouseExited(java.awt.event.MouseEvent e)
e
- Mouse event object.private boolean mouseOutOfWindow(java.awt.event.MouseEvent e)
e
- Mouse event, for cursor position.
private int closeToStuck()
public void mouseClicked(java.awt.event.MouseEvent e)
e
- The mouse click event.public void mousePressed(java.awt.event.MouseEvent e)
e
- The mouse event, for updating the interaction box.public void mouseReleased(java.awt.event.MouseEvent e)
e
- The mouse event, for updating interaction boxes.public void mouseDragged(java.awt.event.MouseEvent e)
e
- The mouse event, for updating positions of interaction boxes.public void mouseMoved(java.awt.event.MouseEvent e)
mouseover(int, int)
.
e
- The mouse event, for updating the position.public void keyTyped(java.awt.event.KeyEvent e)
keyPressed(KeyEvent)
/keyReleased(KeyEvent)
pair that could be used in
conjunction with mouseclicks.
private void newMouseOver(TreeNode originalNode, TreeNode newNode)
originalNode
- Starting tree node.newNode
- New tree node to highlight.private int findChildNumber(TreeNode parentNode, TreeNode originalNode)
parentNode
- Parent node of the original nodeoriginalNode
- Node to get child index of
private TreeNode rightAlignFind(TreeNode parentNode, TreeNode originalNode, int originalNodeChildNumber, boolean goingDown)
parentNode
- parent of the original nodeoriginalNode
- the originating node to find a cousin oforiginalNodeChildNumber
- the index of the original node in the list of its parents childrengoingDown
- true for down arrow action, false for up arrow
public void flashLeft()
public void flashRight()
public void flashDown()
public void flashUp()
public void keyPressed(java.awt.event.KeyEvent e)
e
- The key event.public void keyReleased(java.awt.event.KeyEvent e)
e
- The key event.public void seedQueue()
TreeJuxtaposer.seedQueue(AccordionTreeDrawerFinal)
.
seedQueue
in class AccordionDrawer
public java.util.ArrayList getColorsForCellGeom(CellGeom c)
TreeJuxtaposer.getColorsForRange(int, int, AccordionTreeDrawer)
. Get the color for a given TreeNode.
getColorsForCellGeom
in class AccordionDrawer
c
- TreeNode to get color for.
public RangeList getRangeByKey(int key)
getRangeByKey
in class AccordionTreeDrawer
key
- range ID
protected void customGLInit(javax.media.opengl.GL gl)
customGLInit
in class AccordionDrawer
AccordionDrawer.init(GLAutoDrawable)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |