Package ghidra.graph.job
Class AbstractGraphTransitionJob<V extends VisualVertex,E extends VisualEdge<V>>
- java.lang.Object
-
- ghidra.graph.job.AbstractAnimatorJob
-
- ghidra.graph.job.AbstractGraphVisibilityTransitionJob<V,E>
-
- ghidra.graph.job.AbstractGraphTransitionJob<V,E>
-
- Type Parameters:
V
- the vertex typeE
- the edge type
- All Implemented Interfaces:
GraphJob
- Direct Known Subclasses:
RelayoutFunctionGraphJob
public abstract class AbstractGraphTransitionJob<V extends VisualVertex,E extends VisualEdge<V>> extends AbstractGraphVisibilityTransitionJob<V,E>
A job to transition vertices in a graph for location and visibility. The parent class handled the opacity callback. The progress of the job is used by this class to move vertices from the the start location to the final destination, where the progress is the percentage of the total move to display.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractGraphTransitionJob.ArticulationTransitionPoints
protected class
AbstractGraphTransitionJob.TransitionPoints
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<E,java.util.List<AbstractGraphTransitionJob.ArticulationTransitionPoints>>
edgeArticulationLocations
A start and end point for each edge articulationprotected java.util.Map<E,java.util.List<java.awt.geom.Point2D>>
finalEdgeArticulations
protected VisualGraphLayout<V,E>
graphLayout
protected java.util.Map<V,AbstractGraphTransitionJob.TransitionPoints>
vertexLocations
A start and end point for each vertex-
Fields inherited from class ghidra.graph.job.AbstractGraphVisibilityTransitionJob
duration, FAST_DURATION, graph, NORMAL_DURATION, useAnimation, viewer
-
Fields inherited from class ghidra.graph.job.AbstractAnimatorJob
animator, isShortcut, log, TOO_BIG_TO_ANIMATE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractGraphTransitionJob(GraphViewer<V,E> viewer, boolean useAnimation)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected LayoutPositions<V,E>
calculateDefaultLayoutLocations()
LayoutPositions<V,E>
calculateDefaultLayoutLocations(java.util.Set<V> verticesToIgnore)
Calculates default vertex locations for the current graph by using the current layout, excluding those vertices in the given ignore set.boolean
canShortcut()
Returns true if the job can be told to stop running, but to still perform any final work before being done.protected void
clearLocationCache()
protected org.jdesktop.animation.timing.Animator
createAnimator()
protected void
finished()
A callback given when this animator has run to completion.protected LayoutPositions<V,E>
getCurrentLayoutLocations()
protected abstract void
initializeVertexLocations()
Create the vertex locations that will be transitioned over the life of this animator.protected void
installFinalEdgeArticulations()
void
setPercentComplete(double percentComplete)
Callback from our animator.void
shortcut()
Tells this job to stop running, but to still perform any final work before being done.protected java.awt.geom.Point2D
toLocation(V v)
protected void
updatePointFromPercentComplete(AbstractGraphTransitionJob.TransitionPoints transitionPoints, double percentComplete, java.awt.geom.Point2D updatePoint)
-
Methods inherited from class ghidra.graph.job.AbstractGraphVisibilityTransitionJob
getEdges, getEdges, isTooBigToAnimate, updateOpacity
-
Methods inherited from class ghidra.graph.job.AbstractAnimatorJob
dispose, execute, isFinished, setBusyListener, stop, toString, trace
-
-
-
-
Field Detail
-
graphLayout
protected final VisualGraphLayout<V extends VisualVertex,E extends VisualEdge<V>> graphLayout
-
vertexLocations
protected java.util.Map<V extends VisualVertex,AbstractGraphTransitionJob.TransitionPoints> vertexLocations
A start and end point for each vertex
-
edgeArticulationLocations
protected java.util.Map<E extends VisualEdge<V>,java.util.List<AbstractGraphTransitionJob.ArticulationTransitionPoints>> edgeArticulationLocations
A start and end point for each edge articulation
-
finalEdgeArticulations
protected java.util.Map<E extends VisualEdge<V>,java.util.List<java.awt.geom.Point2D>> finalEdgeArticulations
-
-
Constructor Detail
-
AbstractGraphTransitionJob
protected AbstractGraphTransitionJob(GraphViewer<V,E> viewer, boolean useAnimation)
-
-
Method Detail
-
initializeVertexLocations
protected abstract void initializeVertexLocations()
Create the vertex locations that will be transitioned over the life of this animator. The locations are inlayout space
. This method is expected to updatevertexLocations
(and optionallyedgeArticulationLocations
).
-
canShortcut
public boolean canShortcut()
Description copied from interface:GraphJob
Returns true if the job can be told to stop running, but to still perform any final work before being done.- Specified by:
canShortcut
in interfaceGraphJob
- Overrides:
canShortcut
in classAbstractAnimatorJob
- Returns:
- true if the job can be shortcut
-
shortcut
public void shortcut()
Description copied from interface:GraphJob
Tells this job to stop running, but to still perform any final work before being done.Note: if your job is multi-threaded, then you must make sure to end your thread and work before returning from this method. If that cannot be done in a timely manner, then your
GraphJob.canShortcut()
should return false.- Specified by:
shortcut
in interfaceGraphJob
- Overrides:
shortcut
in classAbstractAnimatorJob
-
createAnimator
protected org.jdesktop.animation.timing.Animator createAnimator()
- Overrides:
createAnimator
in classAbstractGraphVisibilityTransitionJob<V extends VisualVertex,E extends VisualEdge<V>>
-
finished
protected void finished()
Description copied from class:AbstractAnimatorJob
A callback given when this animator has run to completion. This will be called whether the animator is stopped prematurely or ends naturally.- Overrides:
finished
in classAbstractGraphVisibilityTransitionJob<V extends VisualVertex,E extends VisualEdge<V>>
-
setPercentComplete
public void setPercentComplete(double percentComplete)
Callback from our animator.- Overrides:
setPercentComplete
in classAbstractGraphVisibilityTransitionJob<V extends VisualVertex,E extends VisualEdge<V>>
-
updatePointFromPercentComplete
protected void updatePointFromPercentComplete(AbstractGraphTransitionJob.TransitionPoints transitionPoints, double percentComplete, java.awt.geom.Point2D updatePoint)
-
installFinalEdgeArticulations
protected void installFinalEdgeArticulations()
-
calculateDefaultLayoutLocations
protected LayoutPositions<V,E> calculateDefaultLayoutLocations()
-
getCurrentLayoutLocations
protected LayoutPositions<V,E> getCurrentLayoutLocations()
-
toLocation
protected java.awt.geom.Point2D toLocation(V v)
-
clearLocationCache
protected void clearLocationCache()
-
calculateDefaultLayoutLocations
public LayoutPositions<V,E> calculateDefaultLayoutLocations(java.util.Set<V> verticesToIgnore)
Calculates default vertex locations for the current graph by using the current layout, excluding those vertices in the given ignore set. The graph, layout and vertices will be unaltered.- Parameters:
verticesToIgnore
- The set of vertices which should be excluded from the layout process- Returns:
- The mapping of all arranged vertices to their respective locations
-
-