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 start location to the final destination, where the progress is the
percentage of the total move to display.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classprotected class -
Field Summary
FieldsModifier 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, viewerFields inherited from class ghidra.graph.job.AbstractAnimatorJob
animator, isShortcut, log, TOO_BIG_TO_ANIMATE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractGraphTransitionJob(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.booleanReturns true if the job can be told to stop running, but to still perform any final work before being done.protected voidprotected org.jdesktop.animation.timing.Animatorprotected voidfinished()A callback given when this animator has run to completion.protected LayoutPositions<V, E> protected abstract voidCreate the vertex locations that will be transitioned over the life of this animator.protected voidvoidsetPercentComplete(double percentComplete) Callback from our animator.voidshortcut()Tells this job to stop running, but to still perform any final work before being done.protected Point2DtoLocation(V v) protected voidupdatePointFromPercentComplete(AbstractGraphTransitionJob<V, E>.TransitionPoints transitionPoints, double percentComplete, Point2D updatePoint) Methods inherited from class ghidra.graph.job.AbstractGraphVisibilityTransitionJob
getEdges, getEdges, isTooBigToAnimate, updateOpacityMethods 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:GraphJobReturns true if the job can be told to stop running, but to still perform any final work before being done.- Specified by:
canShortcutin interfaceGraphJob- Overrides:
canShortcutin classAbstractAnimatorJob- Returns:
- true if the job can be shortcut
-
shortcut
public void shortcut()Description copied from interface:GraphJobTells 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:
shortcutin interfaceGraphJob- Overrides:
shortcutin classAbstractAnimatorJob
-
createAnimator
protected org.jdesktop.animation.timing.Animator createAnimator()- Overrides:
createAnimatorin classAbstractGraphVisibilityTransitionJob<V extends VisualVertex,E extends VisualEdge<V>>
-
finished
protected void finished()Description copied from class:AbstractAnimatorJobA callback given when this animator has run to completion. This will be called whether the animator is stopped prematurely or ends naturally.- Overrides:
finishedin classAbstractGraphVisibilityTransitionJob<V extends VisualVertex,E extends VisualEdge<V>>
-
setPercentComplete
public void setPercentComplete(double percentComplete) Callback from our animator.- Overrides:
setPercentCompletein 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
-