/** * Checks if the triple buffer exists and creates a new one if * it does not. Also compares the size of the buffer with the * size of the graph and drops the buffer if it has a * different size. */ public void checkTripleBuffer() { if (tripleBuffer != null) { if (tripleBuffer.getWidth() != getWidth() || tripleBuffer.getHeight() != getHeight()) { // Resizes the buffer (destroys existing and creates new) destroyTripleBuffer(); } } if (tripleBuffer == null) { createTripleBuffer(getWidth(), getHeight()); } }
/** * Checks if the triple buffer exists and creates a new one if * it does not. Also compares the size of the buffer with the * size of the graph and drops the buffer if it has a * different size. */ public void checkTripleBuffer() { if (tripleBuffer != null) { if (tripleBuffer.getWidth() != getWidth() || tripleBuffer.getHeight() != getHeight()) { // Resizes the buffer (destroys existing and creates new) destroyTripleBuffer(); } } if (tripleBuffer == null) { createTripleBuffer(getWidth(), getHeight()); } }