endrov.windowLineage
Class LineageView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by endrov.windowLineage.LineageView
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class LineageView
extends javax.swing.JPanel

The lineage view is so specific to the view that there is no point in separating it.

See Also:
Serialized Form

Nested Class Summary
static class LineageView.ClickRegion
          Mouse click handler
 class LineageView.ClickRegionName
          Mouse click handler: on a name panel
static class LineageView.ExpRenderSetting
           
static class LineageView.KeyFramePos
           
static class LineageView.ParticleState
          Cached information about particle
static class LineageView.ScaleBar
           
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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
 Lineage currentLin
           
 java.util.LinkedList<LineageView.ExpRenderSetting> listExpRenderSettings
           
 boolean showCurframeLine
           
 boolean showEvents
           
 boolean showExpDot
           
 boolean showExpLine
           
 boolean showExpSolid
           
 boolean showFrameLines
           
 boolean showHorizontalTree
           
 boolean showKeyFrames
           
 boolean showLabel
           
 boolean showScale
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
LineageView()
           
 
Method Summary
 void clickRegion(java.awt.event.MouseEvent e)
          Handle mouse click in view
 java.util.Set<java.lang.String> collectExpNames()
           
 void drawFrameLines(java.awt.Graphics2D g, endrov.windowLineage.LineageView.LineageState linstate, int width, int height)
          Draw the lines for frames, in the background
 void drawScalebars(java.awt.Graphics g, HierarchicalPainter.Camera cam)
          Draw all scalebars
 void foldAll()
           
 EvDecimal getCameraFrame()
          Get frame position
 LineageView.ClickRegion getClickRegion(java.awt.event.MouseEvent e)
           
 EvDecimal getFrameFromCursor(int mx, int my)
           
 LineageView.KeyFramePos getKeyFrame(int x, int y)
          Get key frame closest to given position
 Lineage getLineage()
           
 Tuple<java.lang.Integer,java.lang.Integer> getRotatedWidthHeight()
          Get width and height of the screen, taking rotation into account
 boolean getShowEvents()
           
 boolean getShowKeyFrames()
           
 boolean getShowLabel()
           
 void goToRoot()
          Move camera to root, repaint
 void goToSelected()
          Move camera to selected particles
 void paintComponent(java.awt.Graphics g)
          Draw everything
 void paintToGraphics(java.awt.Graphics2D h, boolean toScreen, Lineage lin, endrov.windowLineage.LineageView.LineageState linstate, int width, int height)
          Render to graphics area
 void pan(int dx, int dy)
          Move camera.
 void setCameraFrame(double frame)
          Set frame position
 void setCurrentFrame(double frame)
           
 void setExpRenderSettings(java.util.Collection<LineageView.ExpRenderSetting> settings)
           
 void unfoldAll()
           
 javax.vecmath.Vector2d uvToXY(javax.vecmath.Vector2d v)
           
 javax.vecmath.Vector2d xyToUV(javax.vecmath.Vector2d v)
          UV are coordinates after the tree has optionally been rotated.
 void zoom(double factorX, int midx, double factorY, int midy)
          General zooming relative to a point on the screen
 void zoomAll()
          Zoom to fit everything.
 void zoomX(double factor, int midx)
           
 void zoomY(double factor, int midy)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currentLin

public Lineage currentLin

showFrameLines

public boolean showFrameLines

showCurframeLine

public boolean showCurframeLine

showKeyFrames

public boolean showKeyFrames

showEvents

public boolean showEvents

showExpLine

public boolean showExpLine

showExpSolid

public boolean showExpSolid

showExpDot

public boolean showExpDot

showLabel

public boolean showLabel

showScale

public boolean showScale

showHorizontalTree

public boolean showHorizontalTree

listExpRenderSettings

public final java.util.LinkedList<LineageView.ExpRenderSetting> listExpRenderSettings
Constructor Detail

LineageView

public LineageView()
Method Detail

getShowKeyFrames

public boolean getShowKeyFrames()

getShowLabel

public boolean getShowLabel()

getShowEvents

public boolean getShowEvents()

getRotatedWidthHeight

public Tuple<java.lang.Integer,java.lang.Integer> getRotatedWidthHeight()
Get width and height of the screen, taking rotation into account


setExpRenderSettings

public void setExpRenderSettings(java.util.Collection<LineageView.ExpRenderSetting> settings)

collectExpNames

public java.util.Set<java.lang.String> collectExpNames()

getFrameFromCursor

public EvDecimal getFrameFromCursor(int mx,
                                    int my)

pan

public void pan(int dx,
                int dy)
Move camera. Does not redraw


xyToUV

public javax.vecmath.Vector2d xyToUV(javax.vecmath.Vector2d v)
UV are coordinates after the tree has optionally been rotated. untested!!


uvToXY

public javax.vecmath.Vector2d uvToXY(javax.vecmath.Vector2d v)

zoom

public void zoom(double factorX,
                 int midx,
                 double factorY,
                 int midy)
General zooming relative to a point on the screen


zoomX

public void zoomX(double factor,
                  int midx)

zoomY

public void zoomY(double factor,
                  int midy)

setCameraFrame

public void setCameraFrame(double frame)
Set frame position


getCameraFrame

public EvDecimal getCameraFrame()
Get frame position


goToRoot

public void goToRoot()
Move camera to root, repaint


goToSelected

public void goToSelected()
Move camera to selected particles


zoomAll

public void zoomAll()
Zoom to fit everything. Redraw.


getKeyFrame

public LineageView.KeyFramePos getKeyFrame(int x,
                                           int y)
Get key frame closest to given position


getLineage

public Lineage getLineage()

foldAll

public void foldAll()

unfoldAll

public void unfoldAll()

paintComponent

public void paintComponent(java.awt.Graphics g)
Draw everything

Overrides:
paintComponent in class javax.swing.JComponent

paintToGraphics

public void paintToGraphics(java.awt.Graphics2D h,
                            boolean toScreen,
                            Lineage lin,
                            endrov.windowLineage.LineageView.LineageState linstate,
                            int width,
                            int height)
Render to graphics area


clickRegion

public void clickRegion(java.awt.event.MouseEvent e)
Handle mouse click in view


getClickRegion

public LineageView.ClickRegion getClickRegion(java.awt.event.MouseEvent e)

drawScalebars

public void drawScalebars(java.awt.Graphics g,
                          HierarchicalPainter.Camera cam)
Draw all scalebars


drawFrameLines

public void drawFrameLines(java.awt.Graphics2D g,
                           endrov.windowLineage.LineageView.LineageState linstate,
                           int width,
                           int height)
Draw the lines for frames, in the background


setCurrentFrame

public void setCurrentFrame(double frame)