private void draw(LineSegment lineSeg, long initialTime, long endTime) {
            long drawTime = endTime - initialTime;

            double initX = originX + lineSeg.start.x;
            double initY = originY - lineSeg.start.y;

            double finalX = originX + lineSeg.end.x;
            double finalY = originY - lineSeg.end.y;

            int fromX = (int) initX;
            int fromY = (int) initY;

            boolean abort = false;
            long elapsedTime = System.currentTimeMillis() - initialTime;

            graphics.setPaint(lineSeg.color.color);

            while (!abort && elapsedTime + MILLIS_PER_FRAME < drawTime) {
                // while we have time remaining for this action
                double fractionDone = Math.max(elapsedTime * 1.0 / drawTime, 0);
                int toX = (int) Math.round(initX * (1 - fractionDone) + finalX * fractionDone);
                int toY = (int) Math.round(initY * (1 - fractionDone) + finalY * fractionDone);
                graphics.drawLine(fromX, fromY, toX, toY);
                drawLabel.repaint();

                try {
                    Thread.sleep(MILLIS_PER_FRAME);
                } catch (InterruptedException e) {
                    abort = true;
                }

                // update
                fromX = toX;
                fromY = toY;

                elapsedTime = System.currentTimeMillis() - initialTime;
            }

            // finish the line if we're still not done
            if (!abort && (fromX != finalX || fromY != finalY)) {
                graphics.drawLine(fromX, fromY, (int) finalX, (int) finalY);
                drawLabel.repaint();
            }
        }