@Test public void testGetLines() throws Exception { int id1 = addRandomPoint(); int id2 = addRandomPoint(); int id3 = addRandomPoint(); int id4 = addRandomPoint(); assert data.getLines().length == 0; data.connect(id1, id2); assert data.getLines()[0][0].equals(data.getPoint(id1)); assert data.getLines()[0][1].equals(data.getPoint(id2)); data.connect(id3, id4); assert data.getLines().length == 2; data.undoA(); assert data.getLines().length == 1; data.redoA(); data.disconnect(id1, id2); assert data.getLines().length == 1; while (data.canUndoA()) { data.undoA(); } assert data.getLines().length == 0; while (data.canRedoA()) { data.redoA(); } assert data.getLines().length == 1; }
@Override public final ExtendedVector[][] getLines() { synchronized (VitcoSettings.SYNC) { if (!lineBufferValid) { if (lineBuffer.length != dataContainer.lines.size()) { lineBuffer = new ExtendedVector[dataContainer.lines.size()][2]; } int i = 0; for (ExtendedLine line : dataContainer.lines.values()) { lineBuffer[i][0] = getPoint(line.point1); lineBuffer[i][1] = getPoint(line.point2); i++; } lineBufferValid = true; } return lineBuffer.clone(); } }
AnimationData extends GeneralData implements AnimationDataInterface { @Override public final ExtendedVector[][] getLines() { synchronized (VitcoSettings.SYNC) { if (!lineBufferValid) { if (lineBuffer.length != dataContainer.lines.size()) { lineBuffer = new ExtendedVector[dataContainer.lines.size()][2]; } int i = 0; for (ExtendedLine line : dataContainer.lines.values()) { lineBuffer[i][0] = getPoint(line.point1); lineBuffer[i][1] = getPoint(line.point2); i++; } lineBufferValid = true; } return lineBuffer.clone(); } } }
AnimationData extends GeneralData implements AnimationDataInterface { @Override public final ExtendedVector[][] getLines() { synchronized (VitcoSettings.SYNC) { if (!lineBufferValid) { if (lineBuffer.length != dataContainer.lines.size()) { lineBuffer = new ExtendedVector[dataContainer.lines.size()][2]; } int i = 0; for (ExtendedLine line : dataContainer.lines.values()) { lineBuffer[i][0] = getPoint(line.point1); lineBuffer[i][1] = getPoint(line.point2); i++; } lineBufferValid = true; } return lineBuffer.clone(); } } protected  AnimationData(); }
AnimationData extends GeneralData implements AnimationDataInterface { @Override public final ExtendedVector[][] getLines() { synchronized (VitcoSettings.SYNC) { if (!lineBufferValid) { if (lineBuffer.length != dataContainer.lines.size()) { lineBuffer = new ExtendedVector[dataContainer.lines.size()][2]; } int i = 0; for (ExtendedLine line : dataContainer.lines.values()) { lineBuffer[i][0] = getPoint(line.point1); lineBuffer[i][1] = getPoint(line.point2); i++; } lineBufferValid = true; } return lineBuffer.clone(); } } 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 ExtendedVector[][] getLines() { synchronized (VitcoSettings.SYNC) { if (!lineBufferValid) { if (lineBuffer.length != dataContainer.lines.size()) { lineBuffer = new ExtendedVector[dataContainer.lines.size()][2]; } int i = 0; for (ExtendedLine line : dataContainer.lines.values()) { lineBuffer[i][0] = getPoint(line.point1); lineBuffer[i][1] = getPoint(line.point2); i++; } lineBufferValid = true; } return lineBuffer.clone(); } } 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);  }