diff --git a/res/icons/fast_forwarding_co.png b/res/icons/fast_forwarding_co.png new file mode 100644 index 0000000..608d941 --- /dev/null +++ b/res/icons/fast_forwarding_co.png Binary files differ diff --git a/src/org/ntlab/actions/FastForwardAnimationAction.java b/src/org/ntlab/actions/FastForwardAnimationAction.java new file mode 100644 index 0000000..b1f734a --- /dev/null +++ b/src/org/ntlab/actions/FastForwardAnimationAction.java @@ -0,0 +1,28 @@ +package org.ntlab.actions; + +import java.awt.event.ActionEvent; + +import org.ntlab.deltaViewer.IMagnetRON; +import org.ntlab.deltaViewer.MagnetRONFrame; + +public class FastForwardAnimationAction extends AbstractMagnetRONAction { + + private static final long serialVersionUID = -7485589008525481164L; + + public FastForwardAnimationAction(IMagnetRON magnetRON) { + super("Fast-Forward", magnetRON); + } + + public FastForwardAnimationAction(String name, IMagnetRON magnetRON) { + super(name, magnetRON); + } + + @Override + public void actionPerformed(ActionEvent e) { + if (super.magnetRON instanceof MagnetRONFrame) { + MagnetRONFrame magnetRONFrame = (MagnetRONFrame) super.magnetRON; + magnetRONFrame.fastForwardAnimation(); + } + } + +} diff --git a/src/org/ntlab/deltaViewer/CollaborationViewer.java b/src/org/ntlab/deltaViewer/CollaborationViewer.java index 4188f52..9c6949d 100644 --- a/src/org/ntlab/deltaViewer/CollaborationViewer.java +++ b/src/org/ntlab/deltaViewer/CollaborationViewer.java @@ -337,8 +337,8 @@ } MagnetRONAnimation pbjVxCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - pbjVxCellAnim.setTotalCycleCount(10); - pbjVxCellAnim.setDelay(100); + pbjVxCellAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + pbjVxCellAnim.setDelay(getMagnetRONAnimationDelayMillis()); pbjVxCellAnim.init(objVxCell, objVx.getInitialX(), objVx.getInitialY(), threadPoolExecutor); pbjVxCellAnim.syncPlay(); methodExecToVertexMap.get(methodExec).getArguments().remove(objVx); @@ -363,8 +363,8 @@ } } MagnetRONAnimation objVxCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - objVxCellAnim.setTotalCycleCount(10); - objVxCellAnim.setDelay(100); + objVxCellAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + objVxCellAnim.setDelay(getMagnetRONAnimationDelayMillis()); objVxCellAnim.init(objVxCell, objVx.getInitialX(), objVx.getInitialY(), threadPoolExecutor); objVxCellAnim.syncPlay(); methodExecToVertexMap.get(methodExec).getLocals().remove(objVx); diff --git a/src/org/ntlab/deltaViewer/DeltaViewer.java b/src/org/ntlab/deltaViewer/DeltaViewer.java index 487c974..93e64bd 100644 --- a/src/org/ntlab/deltaViewer/DeltaViewer.java +++ b/src/org/ntlab/deltaViewer/DeltaViewer.java @@ -300,8 +300,8 @@ // deltaAnimation.setVertexAnimation(cell, new mxPoint(vo.getInitialX(), vo.getInitialY())); // deltaAnimation.startVertexAnimation(); MagnetRONAnimation vertexAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - vertexAnim.setTotalCycleCount(10); - vertexAnim.setDelay(100); + vertexAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + vertexAnim.setDelay(getMagnetRONAnimationDelayMillis()); vertexAnim.init(cell, vo.getInitialX(), vo.getInitialY(), threadPoolExecutor); vertexAnim.play(); methodExecToVertexMap.get(methodExec).getArguments().remove(vo); @@ -317,8 +317,8 @@ // deltaAnimation.setVertexAnimation(cell, new mxPoint(vo.getInitialX(), vo.getInitialY())); // deltaAnimation.startVertexAnimation(); MagnetRONAnimation vertexAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - vertexAnim.setTotalCycleCount(10); - vertexAnim.setDelay(100); + vertexAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + vertexAnim.setDelay(getMagnetRONAnimationDelayMillis()); vertexAnim.init(cell, vo.getInitialX(), vo.getInitialY(), threadPoolExecutor); vertexAnim.play(); methodExecToVertexMap.get(methodExec).getLocals().remove(vo); diff --git a/src/org/ntlab/deltaViewer/MagnetRONFrame.java b/src/org/ntlab/deltaViewer/MagnetRONFrame.java index c6ccdf9..8dbfd69 100644 --- a/src/org/ntlab/deltaViewer/MagnetRONFrame.java +++ b/src/org/ntlab/deltaViewer/MagnetRONFrame.java @@ -23,6 +23,7 @@ import javax.swing.JFrame; import javax.swing.JToolBar; +import org.ntlab.actions.FastForwardAnimationAction; import org.ntlab.actions.PauseAnimationAction; import org.ntlab.actions.StartAnimationAction; import org.ntlab.actions.StopAnimationAction; @@ -72,7 +73,9 @@ private Map argsMap = new HashMap<>(); private IObjectCallGraph objectCallGraph; private IAliasCollector aliasCollector; - private Thread animationThread; + + private volatile Thread animationThread; + private boolean threadSuspended = false; public MagnetRONFrame() throws HeadlessException { super(FRAME_TITLE); @@ -87,13 +90,16 @@ JToolBar toolBar = new JToolBar(); Image startImage = null; + Image fastForwardImage = null; Image pauseImage = null; Image stopImage = null; URL startUrl = this.getClass().getResource("/icons/resume_co.png"); + URL fastForwardUrl = this.getClass().getResource("/icons/fast_forwarding_co.png"); URL pauseUrl = this.getClass().getResource("/icons/suspend_co.png"); URL stopUrl = this.getClass().getResource("/icons/terminate_co.png"); try { startImage = this.createImage((ImageProducer) startUrl.getContent()); + fastForwardImage = this.createImage((ImageProducer) fastForwardUrl.getContent()); pauseImage = this.createImage((ImageProducer) pauseUrl.getContent()); stopImage = this.createImage((ImageProducer) stopUrl.getContent()); }catch(Exception e){ @@ -103,6 +109,9 @@ JButton startButton = new JButton(new ImageIcon(startImage, "Start")); startButton.addActionListener(new StartAnimationAction(this)); toolBar.add(startButton); + JButton fastForwardButton = new JButton(new ImageIcon(fastForwardImage, "Fast-Forward")); + fastForwardButton.addActionListener(new FastForwardAnimationAction(this)); + toolBar.add(fastForwardButton); JButton suspendButton = new JButton(new ImageIcon(pauseImage, "Pause")); suspendButton.addActionListener(new PauseAnimationAction(this)); toolBar.add(suspendButton); @@ -578,14 +587,10 @@ setTitle(FRAME_TITLE); viewer.clear(); + viewer.setAnimationSpeed(1.0); viewer.init(objectCallGraph, aliasCollector, new CollaborationLayout()); - List aliasList = new ArrayList<>(aliasCollector.getAliasList()); - -// dv.setCoordinatorPoint(1200, 100); viewer.initAnimation(); -// for(int i = 0; i < aliasList.size(); i++) { -// System.out.println(aliasList.get(i).getObjectId() + ", " + aliasList.get(i).getMethodSignature() + " l." + aliasList.get(i).getLineNo() + " : " + aliasList.get(i).getAliasType().toString()); -// } + List aliasList = new ArrayList<>(aliasCollector.getAliasList()); for (int i = 0; i <= aliasList.size(); i++) { viewer.stepToAnimation(i); } @@ -596,36 +601,72 @@ }; animationThread.start(); } else { + viewer.setAnimationSpeed(1.0); resumeAnimation(); } } + public void fastForwardAnimation() { + if (animationThread != null) { + System.out.println(TAG + ": animationTreadisInterrupted=" + animationThread.isInterrupted()); + double animationSpeed = viewer.getAnimationSpeed(); + if (!threadSuspended) { + if (animationSpeed < 2.0) { + viewer.setAnimationSpeed(animationSpeed + 0.25); + } else if (animationSpeed < 10.0) { + viewer.setAnimationSpeed(animationSpeed + 1.0); + } + } else { + viewer.setAnimationSpeed(animationSpeed); + resumeAnimation(); + } + } + } + @Override - synchronized public void pauseAnimation() { + public synchronized void pauseAnimation() { if (animationThread != null) { animationThread.suspend(); -// while(true) { +// while(true) { +// try { +// animationThread.wait(); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } +// } +// +// Thread thisThread = Thread.currentThread(); + threadSuspended = true; +// while (animationThread == thisThread) { // try { -// animationThread.wait(); -// } catch (InterruptedException e) { +// Thread.sleep(1L); +// synchronized(this) { +// while (threadSuspended && animationThread == thisThread) +// wait(); +// } +// } catch (InterruptedException e){ // e.printStackTrace(); // } +// repaint(); // } } } @Override - synchronized public void resumeAnimation() { + public synchronized void resumeAnimation() { if (animationThread != null) { animationThread.resume(); + threadSuspended = false; +// notify(); } } @Override - public void stopAnimation() { + public synchronized void stopAnimation() { if (animationThread != null) { animationThread.stop(); animationThread = null; +// notify(); } } diff --git a/src/org/ntlab/deltaViewer/MagnetRONViewer.java b/src/org/ntlab/deltaViewer/MagnetRONViewer.java index 24fd78e..7b80015 100644 --- a/src/org/ntlab/deltaViewer/MagnetRONViewer.java +++ b/src/org/ntlab/deltaViewer/MagnetRONViewer.java @@ -61,14 +61,11 @@ // Test code (will be deleted) private static final String TAG = MagnetRONViewer.class.getSimpleName(); + + protected static final Dimension DEFAULT_COMPONENT_SIZE = new Dimension(1300, 700); - protected static Dimension DEFAULT_COMPONENT_SIZE = new Dimension(1300, 700); - - protected static Dimension DEFAULT_OBJECT_VERTEX_SIZE = new Dimension(70, 70); - protected static Dimension DEFAULT_METHOD_EXECUTION_VERTEX_SIZE = new Dimension(55, 20); - - protected static long DEFAULT_THREAD_SLEEP_MILLIS = 1100L; - protected static long POSTPONE_ANIMATION_MILLIS = 250L; + protected static final Dimension DEFAULT_OBJECT_VERTEX_SIZE = new Dimension(70, 70); + protected static final Dimension DEFAULT_METHOD_EXECUTION_VERTEX_SIZE = new Dimension(55, 20); protected IAliasCollector aliasCollector; @@ -76,13 +73,22 @@ protected Map methodExecToVertexMap = new LinkedHashMap<>(); protected Map edgeMap = new HashMap<>(); - protected mxGraphComponent mxgraphComponent; protected DeltaGraphAdapter mxgraph; protected mxICell mxDefaultParent; - protected ThreadPoolExecutor threadPoolExecutor; protected int curFrame = 0; + + protected double animationSpeed = DEFAULT_ANIMATION_SPEED; + protected static final double DEFAULT_ANIMATION_SPEED = 1.0; + + protected ThreadPoolExecutor threadPoolExecutor; + protected long animationDelayMillis = DEFAULT_ANIMATION_DELAY_MILLIS; + protected static final long DEFAULT_ANIMATION_DELAY_MILLIS = 250L; + protected int magnetRONAnimationTotalCycleCount = DEFAULT_MAGNETRON_ANIMATION_TOTAL_CYCLE_COUNT; + protected static final int DEFAULT_MAGNETRON_ANIMATION_TOTAL_CYCLE_COUNT = 10; + protected long magnetRONAnimationDelayMillis = DEFAULT_MAGNETRON_ANIMATION_DELAY_MILLIS; + protected static final long DEFAULT_MAGNETRON_ANIMATION_DELAY_MILLIS = 100L; private boolean fAutoTracking = false; @@ -276,8 +282,8 @@ } } MagnetRONAnimation objVxCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - objVxCellAnim.setTotalCycleCount(10); - objVxCellAnim.setDelay(100); + objVxCellAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + objVxCellAnim.setDelay(getMagnetRONAnimationDelayMillis()); objVxCellAnim.init(objVxCell, objVx.getInitialX(), objVx.getInitialY(), threadPoolExecutor); objVxCellAnim.syncPlay(); } @@ -328,8 +334,8 @@ } } MagnetRONAnimation objVxCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - objVxCellAnim.setTotalCycleCount(10); - objVxCellAnim.setDelay(100); + objVxCellAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + objVxCellAnim.setDelay(getMagnetRONAnimationDelayMillis()); objVxCellAnim.init(objVxCell, objVx.getInitialX(), objVx.getInitialY(), threadPoolExecutor); objVxCellAnim.syncPlay(); } @@ -373,8 +379,8 @@ } } MagnetRONAnimation dstObjVxCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - dstObjVxCellAnim.setTotalCycleCount(10); - dstObjVxCellAnim.setDelay(100); + dstObjVxCellAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + dstObjVxCellAnim.setDelay(getMagnetRONAnimationDelayMillis()); dstObjVxCellAnim.init(dstObjVxCell, dstObjVx.getInitialX(), dstObjVx.getInitialY(), threadPoolExecutor); dstObjVxCellAnim.syncPlay(); @@ -428,8 +434,8 @@ } } MagnetRONAnimation dstObjVxCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - dstObjVxCellAnim.setTotalCycleCount(10); - dstObjVxCellAnim.setDelay(100); + dstObjVxCellAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + dstObjVxCellAnim.setDelay(getMagnetRONAnimationDelayMillis()); dstObjVxCellAnim.init(dstObjVxCell, dstObjVx.getInitialX(), dstObjVx.getInitialY(), threadPoolExecutor); dstObjVxCellAnim.syncPlay(); @@ -458,7 +464,7 @@ MethodExecution methodExec = alias.getMethodExecution(); if (!methodExecToVertexMap.containsKey(methodExec) && methodExec.isStatic()) { createMethodExecutionVertex(objId, methodExec.getSignature(), methodExec); - sleepMainThread(POSTPONE_ANIMATION_MILLIS); + sleepMainThread(getAnimationDelayMillis()); } // destination ObjectVertex MethodExecutionVertex dstMethodExecVx = methodExecToVertexMap.get(methodExec); @@ -560,8 +566,8 @@ double srcObjVxCellDstY = dstMethodExecVxCell.getGeometry().getY() + dstMethodExecVxCellHt; MagnetRONAnimation srcObjVxCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - srcObjVxCellAnim.setTotalCycleCount(10); - srcObjVxCellAnim.setDelay(100); + srcObjVxCellAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + srcObjVxCellAnim.setDelay(getMagnetRONAnimationDelayMillis()); srcObjVxCellAnim.init(srcObjVxCell, srcObjVxCellDstX, srcObjVxCellDstY, threadPoolExecutor); srcObjVxCellAnim.syncPlay(); @@ -659,10 +665,10 @@ dstMethodExecVxCell.getGeometry().getY() - overlapHt + (srcObjVxCellHt * dstMethodExecVxArgumentsSize)); MagnetRONAnimation srcObjVxCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - srcObjVxCellAnim.setTotalCycleCount(10); - srcObjVxCellAnim.setDelay(100); + srcObjVxCellAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + srcObjVxCellAnim.setDelay(getMagnetRONAnimationDelayMillis()); srcObjVxCellAnim.init(srcObjVxCell, srcObjVxCellDstPt.getX(), srcObjVxCellDstPt.getY(), threadPoolExecutor); - sleepMainThread(POSTPONE_ANIMATION_MILLIS); + sleepMainThread(getAnimationDelayMillis()); srcObjVxCellAnim.syncPlay(); // If the animation didn't work to the end. @@ -719,8 +725,8 @@ double srcObjVxCellDstY = dstMethodExecVxCell.getGeometry().getY() - overlapHt + (srcObjVxCellHt * dstMethodExecVxArgumentsSize); MagnetRONAnimation srcObjVxCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - srcObjVxCellAnim.setTotalCycleCount(10); - srcObjVxCellAnim.setDelay(100); + srcObjVxCellAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + srcObjVxCellAnim.setDelay(getMagnetRONAnimationDelayMillis()); srcObjVxCellAnim.init(srcObjVxCell, srcObjVxCellDstX, srcObjVxCellDstY, threadPoolExecutor); srcObjVxCellAnim.syncPlay(); @@ -810,8 +816,8 @@ dstMethodExecVxCell.getGeometry().getY() + dstMethodExecVxCellHt); MagnetRONAnimation srcObjVxCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - srcObjVxCellAnim.setTotalCycleCount(10); - srcObjVxCellAnim.setDelay(100); + srcObjVxCellAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + srcObjVxCellAnim.setDelay(getMagnetRONAnimationDelayMillis()); srcObjVxCellAnim.init(srcObjVxCell, srcObjVxCellDstPt.getX(), srcObjVxCellDstPt.getY(), threadPoolExecutor); srcObjVxCellAnim.syncPlay(); @@ -877,13 +883,13 @@ // Test code (will be deleted) System.out.println(TAG + ": Translate " + objVxCell.getId() + ". Current point=" + objVxCell.getGeometry().getPoint() + ", Destination Point=" + dstPt); MagnetRONAnimation objVxCellTransAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - objVxCellTransAnim.setTotalCycleCount(10); - objVxCellTransAnim.setDelay(100); + objVxCellTransAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + objVxCellTransAnim.setDelay(getMagnetRONAnimationDelayMillis()); objVxCellTransAnim.init(objVxCell, dstPt.getX(), dstPt.getY(), threadPoolExecutor); objVxCellTransAnim.play(); MagnetRONAnimation objVxCellResizeAnim = new VertexResizeAnimation(mxgraph, getGraphComponent()); - objVxCellResizeAnim.setTotalCycleCount(10); - objVxCellResizeAnim.setDelay(100); + objVxCellResizeAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + objVxCellResizeAnim.setDelay(getMagnetRONAnimationDelayMillis()); objVxCellResizeAnim.init(objVxCell, dstDim.getWidth(), dstDim.getHeight(), threadPoolExecutor); objVxCellResizeAnim.play(); for (int i = 0; i < objVxCell.getChildCount(); i++) { @@ -896,8 +902,8 @@ // Test code (will be deleted) System.out.println(TAG + ": Translate " + objVxCellChild.getId() + " of " + objVxCell.getId() + ". Current point=" + objVxCellChild.getGeometry().getPoint() + ", Destination Point=" + childDstPt); MagnetRONAnimation childCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - childCellAnim.setTotalCycleCount(10); - childCellAnim.setDelay(100); + childCellAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + childCellAnim.setDelay(getMagnetRONAnimationDelayMillis()); childCellAnim.init(objVxCellChild, childDstPt.getX(), childDstPt.getY(), threadPoolExecutor); childCellAnim.play(); } @@ -1011,8 +1017,8 @@ } } MagnetRONAnimation objVxCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - objVxCellAnim.setTotalCycleCount(10); - objVxCellAnim.setDelay(100); + objVxCellAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + objVxCellAnim.setDelay(getMagnetRONAnimationDelayMillis()); objVxCellAnim.init(objVxcell, objVx.getInitialX(), objVx.getInitialY(), threadPoolExecutor); objVxCellAnim.play(); methodExecToVertexMap.get(calledMethodExec).getArguments().remove(objVx); @@ -1040,8 +1046,8 @@ } } MagnetRONAnimation objVxCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - objVxCellAnim.setTotalCycleCount(10); - objVxCellAnim.setDelay(100); + objVxCellAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + objVxCellAnim.setDelay(getMagnetRONAnimationDelayMillis()); objVxCellAnim.init(objVxCell, objVx.getInitialX(), objVx.getInitialY(), threadPoolExecutor); objVxCellAnim.play(); } @@ -1134,8 +1140,8 @@ } } MagnetRONAnimation objVxCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - objVxCellAnim.setTotalCycleCount(10); - objVxCellAnim.setDelay(100); + objVxCellAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + objVxCellAnim.setDelay(getMagnetRONAnimationDelayMillis()); objVxCellAnim.init(objVxCell, objVx.getInitialX(), objVx.getInitialY(), threadPoolExecutor); objVxCellAnim.syncPlay(); } @@ -1175,8 +1181,8 @@ } } MagnetRONAnimation objVxCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - objVxCellAnim.setTotalCycleCount(10); - objVxCellAnim.setDelay(100); + objVxCellAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + objVxCellAnim.setDelay(getMagnetRONAnimationDelayMillis()); objVxCellAnim.init(objVxCell, objVx.getInitialX(), objVx.getInitialY(), threadPoolExecutor); objVxCellAnim.syncPlay(); } @@ -1219,8 +1225,8 @@ // Animate an edge to shrink. MagnetRONAnimation edgeCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - edgeCellAnim.setTotalCycleCount(10); - edgeCellAnim.setDelay(100); + edgeCellAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + edgeCellAnim.setDelay(getMagnetRONAnimationDelayMillis()); edgeCellAnim.init(cloneDstMethodExecVxCell[0], srcMethodExecVxCellAbsPt.getX(), srcMethodExecVxCellAbsPt.getY() + srcMethodExecVxCell.getGeometry().getHeight(), threadPoolExecutor); edgeCellAnim.setOnFinished(new ActionListener() { @Override @@ -1265,7 +1271,7 @@ } catch (CloneNotSupportedException e) { e.printStackTrace(); } - sleepMainThread(POSTPONE_ANIMATION_MILLIS); + sleepMainThread(getAnimationDelayMillis()); } } @@ -1314,8 +1320,8 @@ // Animate an edge to stretch. MagnetRONAnimation edgeCellAnim = new TranslateAnimation(mxgraph, getGraphComponent()); - edgeCellAnim.setTotalCycleCount(10); - edgeCellAnim.setDelay(100); + edgeCellAnim.setTotalCycleCount(getMagnetRONAnimationTotalCycleCount()); + edgeCellAnim.setDelay(getMagnetRONAnimationDelayMillis()); edgeCellAnim.init(cloneDstMethodExecVxCell[0], dstMethodExecVxCellAbsPt.getX(), dstMethodExecVxCellAbsPt.getY(), threadPoolExecutor); edgeCellAnim.setOnFinished(new ActionListener() { @Override @@ -1637,6 +1643,26 @@ this.curFrame = numberFrame; } + public void setAnimationSpeed(double animationSpeed) { + this.animationSpeed = animationSpeed; + } + + public double getAnimationSpeed() { + return animationSpeed; + } + + protected long getAnimationDelayMillis() { + return (long) (animationDelayMillis / getAnimationSpeed()); + } + + protected int getMagnetRONAnimationTotalCycleCount() { + return (int) (magnetRONAnimationTotalCycleCount / getAnimationSpeed()); + } + + protected long getMagnetRONAnimationDelayMillis() { + return (long) (magnetRONAnimationDelayMillis / getAnimationSpeed()); + } + protected static String[] formatFieldName(String fieldName) { String fieldNames[] = fieldName.split("\\."); String names[] = new String[] {fieldNames[0], fieldNames[fieldNames.length - 1]};