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
Modifier and TypeClassDescriptionprotected class
protected class
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map
<E, List<AbstractGraphTransitionJob<V, E>.ArticulationTransitionPoints>> A start and end point for each edge articulationprotected final VisualGraphLayout
<V, E> protected Map
<V, AbstractGraphTransitionJob<V, E>.TransitionPoints> A start and end point for each vertexFields 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
ModifierConstructorDescriptionprotected
AbstractGraphTransitionJob
(GraphViewer<V, E> viewer, boolean useAnimation) -
Method Summary
Modifier and TypeMethodDescriptionprotected LayoutPositions
<V, E> calculateDefaultLayoutLocations
(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
Returns true if the job can be told to stop running, but to still perform any final work before being done.protected void
protected org.jdesktop.animation.timing.Animator
protected void
finished()
A callback given when this animator has run to completion.protected LayoutPositions
<V, E> protected abstract void
Create the vertex locations that will be transitioned over the life of this animator.protected void
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 Point2D
toLocation
(V v) protected void
updatePointFromPercentComplete
(AbstractGraphTransitionJob<V, E>.TransitionPoints transitionPoints, double percentComplete, 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 Details
-
graphLayout
-
vertexLocations
protected Map<V extends VisualVertex,AbstractGraphTransitionJob<V extends VisualVertex, vertexLocationsE extends VisualEdge<V>>.TransitionPoints> A start and end point for each vertex -
edgeArticulationLocations
protected Map<E extends VisualEdge<V>,List<AbstractGraphTransitionJob<V extends VisualVertex, edgeArticulationLocationsE extends VisualEdge<V>>.ArticulationTransitionPoints>> A start and end point for each edge articulation -
finalEdgeArticulations
-
-
Constructor Details
-
AbstractGraphTransitionJob
-
-
Method Details
-
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<V, E>.TransitionPoints transitionPoints, double percentComplete, Point2D updatePoint) -
installFinalEdgeArticulations
protected void installFinalEdgeArticulations() -
calculateDefaultLayoutLocations
-
getCurrentLayoutLocations
-
toLocation
-
clearLocationCache
protected void clearLocationCache() -
calculateDefaultLayoutLocations
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
-