@Test public void testResetFrame() throws Exception { int id1 = addRandomPoint(); int id2 = addRandomPoint(); addRandomPoint(); int fid1 = data.createFrame("Frame1"); data.movePoint(id1, new SimpleVector(4,5,6)); int id4 = addRandomPoint(); int fid2 = data.createFrame("Frame2"); data.movePoint(id4, new SimpleVector(1,2,3)); data.movePoint(id2, new SimpleVector(10,20,30)); data.selectFrame(fid2); data.movePoint(id1, new SimpleVector(0,0,0)); assert data.getPoint(id1).x == 0; data.undoA(); assert data.getPoint(id1).x == 4; data.redoA(); assert data.getPoint(id1).x == 0; data.selectFrame(-1); assert data.getPoint(id1).x == 4; data.selectFrame(fid1); assert data.getPoint(id1).x == 4; data.selectFrame(fid2); assert data.getPoint(id1).x == 0; data.resetFrame(data.getSelectedFrame()); assert data.getPoint(id1).x == 4; data.undoA(); assert data.getPoint(id1).x == 0; data.redoA(); assert data.getPoint(id1).x == 4; data.resetFrame(fid1); assert data.getPoint(id1).x == 4; while (data.canUndoA()) { data.undoA(); } data.redoA(); data.redoA(); data.redoA(); data.redoA(); data.redoA(); data.selectFrame(fid1); assert data.getPoint(id1).x == 4; data.undoA(); assert data.getPoint(id1).x == 4; }
@Override public final boolean resetFrame(int frameId) { synchronized (VitcoSettings.SYNC) { boolean result = false; if (dataContainer.frames.containsKey(frameId)) { historyManagerA.applyIntent(new ResetFrameIntent(frameId, false)); result = true; } return result; } }
AnimationData extends GeneralData implements AnimationDataInterface { @Override public final boolean resetFrame(int frameId) { synchronized (VitcoSettings.SYNC) { boolean result = false; if (dataContainer.frames.containsKey(frameId)) { historyManagerA.applyIntent(new ResetFrameIntent(frameId, false)); result = true; } return result; } } }
AnimationData extends GeneralData implements AnimationDataInterface { @Override public final boolean resetFrame(int frameId) { synchronized (VitcoSettings.SYNC) { boolean result = false; if (dataContainer.frames.containsKey(frameId)) { historyManagerA.applyIntent(new ResetFrameIntent(frameId, false)); result = true; } return result; } } protected  AnimationData(); }
AnimationData extends GeneralData implements AnimationDataInterface { @Override public final boolean resetFrame(int frameId) { synchronized (VitcoSettings.SYNC) { boolean result = false; if (dataContainer.frames.containsKey(frameId)) { historyManagerA.applyIntent(new ResetFrameIntent(frameId, false)); result = true; } return result; } } protected  AnimationData(); @Override final boolean isValid(int pointId); @Override final int addPoint(SimpleVector position); @Override final boolean removePoint(int pointId); @Override final boolean movePoint(int pointId, SimpleVector pos); @Override final boolean areConnected(int id1, int id2); @Override final boolean connect(int id1, int id2); @Override final boolean clearA(); @Override final boolean disconnect(int id1, int id2); @Override final ExtendedVector getPoint(int pointId); @Override final ExtendedVector[] getPoints(); @Override final ExtendedVector[][] getLines(); @Override final void undoA(); @Override final void redoA(); @Override final boolean canUndoA(); @Override final boolean canRedoA(); @Override final boolean selectFrame(int frameId); @Override final int getSelectedFrame(); @Override final int createFrame(String frameName); @Override final boolean deleteFrame(int frameId); @Override final boolean renameFrame(int frameId, String newName); @Override final Integer[] getFrames(); @Override final boolean resetFrame(int frameId); @Override final String getFrameName(int frameId); }
AnimationData extends GeneralData implements AnimationDataInterface { @Override public final boolean resetFrame(int frameId) { synchronized (VitcoSettings.SYNC) { boolean result = false; if (dataContainer.frames.containsKey(frameId)) { historyManagerA.applyIntent(new ResetFrameIntent(frameId, false)); result = true; } return result; } } protected  AnimationData(); @Override final boolean isValid(int pointId); @Override final int addPoint(SimpleVector position); @Override final boolean removePoint(int pointId); @Override final boolean movePoint(int pointId, SimpleVector pos); @Override final boolean areConnected(int id1, int id2); @Override final boolean connect(int id1, int id2); @Override final boolean clearA(); @Override final boolean disconnect(int id1, int id2); @Override final ExtendedVector getPoint(int pointId); @Override final ExtendedVector[] getPoints(); @Override final ExtendedVector[][] getLines(); @Override final void undoA(); @Override final void redoA(); @Override final boolean canUndoA(); @Override final boolean canRedoA(); @Override final boolean selectFrame(int frameId); @Override final int getSelectedFrame(); @Override final int createFrame(String frameName); @Override final boolean deleteFrame(int frameId); @Override final boolean renameFrame(int frameId, String newName); @Override final Integer[] getFrames(); @Override final boolean resetFrame(int frameId); @Override final String getFrameName(int frameId);  }