@Override public void actionPerformed(final ActionEvent EVENT) { if (EVENT.getSource().equals(CLOCK_TIMER)) { currentMilliSeconds = (System.currentTimeMillis() - start); secondPointerAngle = (currentMilliSeconds * ANGLE_STEP / 1000); minutePointerAngle = (secondPointerAngle % 1000) / 30; minutes = (currentMilliSeconds) % 60000; seconds = (currentMilliSeconds) % 60; milliSeconds = (currentMilliSeconds) % 1000; repaint(INNER_BOUNDS); } } // </editor-fold>
@Override public void actionPerformed(final ActionEvent EVENT) { if (EVENT.getSource().equals(CLOCK_TIMER)) { currentMilliSeconds = (System.currentTimeMillis() - start); secondPointerAngle = (currentMilliSeconds * ANGLE_STEP / 1000); minutePointerAngle = (secondPointerAngle % 1000) / 30; minutes = (currentMilliSeconds) % 60000; seconds = (currentMilliSeconds) % 60; milliSeconds = (currentMilliSeconds) % 1000; repaint(INNER_BOUNDS); } } // </editor-fold>
/** * Resets the stopwatch */ public void reset() { setRunning(false); start = 0; repaint(INNER_BOUNDS); }
/** * Resets the stopwatch */ public void reset() { setRunning(false); start = 0; repaint(INNER_BOUNDS); }
/** * Start or stop the stopwatch * @param RUNNING */ public void setRunning(final boolean RUNNING) { running = RUNNING; if (RUNNING) { if (!CLOCK_TIMER.isRunning()) { CLOCK_TIMER.start(); start = System.currentTimeMillis(); repaint(INNER_BOUNDS); } } else { if (CLOCK_TIMER.isRunning()) { CLOCK_TIMER.stop(); } } }
/** * Start or stop the stopwatch * @param RUNNING */ public void setRunning(final boolean RUNNING) { running = RUNNING; if (RUNNING) { if (!CLOCK_TIMER.isRunning()) { CLOCK_TIMER.start(); start = System.currentTimeMillis(); repaint(INNER_BOUNDS); } } else { if (CLOCK_TIMER.isRunning()) { CLOCK_TIMER.stop(); } } }
public void setFlatNeedle(final boolean FLAT_NEEDLE) { flatNeedle = FLAT_NEEDLE; init(getWidth(), getWidth()); repaint(INNER_BOUNDS); }
public void setFlatNeedle(final boolean FLAT_NEEDLE) { flatNeedle = FLAT_NEEDLE; init(getWidth(), getWidth()); repaint(INNER_BOUNDS); }
@Override public void setPreferredSize(final Dimension DIM) { final int SIZE = DIM.width <= DIM.height ? DIM.width : DIM.height; super.setPreferredSize(new Dimension(SIZE, SIZE)); calcInnerBounds(); init(getGaugeBounds().width, getGaugeBounds().height); setInitialized(true); invalidate(); repaint(); }
@Override public void setMinimumSize(final Dimension DIM) { int width = DIM.width < 50 ? 50 : DIM.width; int height = DIM.height < 50 ? 50 : DIM.height; final int SIZE = width <= height ? width : height; super.setMinimumSize(new Dimension(SIZE, SIZE)); calcInnerBounds(); init(getGaugeBounds().width, getGaugeBounds().height); setInitialized(true); invalidate(); repaint(); }
@Override public void setMaximumSize(final Dimension DIM) { int width = DIM.width > 1080 ? 1080 : DIM.width; int height = DIM.height > 1080 ? 1080 : DIM.height; final int SIZE = width <= height ? width : height; super.setMaximumSize(new Dimension(SIZE, SIZE)); calcInnerBounds(); init(getGaugeBounds().width, getGaugeBounds().height); setInitialized(true); invalidate(); repaint(); }
@Override public void setMinimumSize(final Dimension DIM) { int width = DIM.width < 50 ? 50 : DIM.width; int height = DIM.height < 50 ? 50 : DIM.height; final int SIZE = width <= height ? width : height; super.setMinimumSize(new Dimension(SIZE, SIZE)); calcInnerBounds(); init(getGaugeBounds().width, getGaugeBounds().height); setInitialized(true); invalidate(); repaint(); }
@Override public void setMaximumSize(final Dimension DIM) { int width = DIM.width > 1080 ? 1080 : DIM.width; int height = DIM.height > 1080 ? 1080 : DIM.height; final int SIZE = width <= height ? width : height; super.setMaximumSize(new Dimension(SIZE, SIZE)); calcInnerBounds(); init(getGaugeBounds().width, getGaugeBounds().height); setInitialized(true); invalidate(); repaint(); }
@Override public void setPreferredSize(final Dimension DIM) { final int SIZE = DIM.width <= DIM.height ? DIM.width : DIM.height; super.setPreferredSize(new Dimension(SIZE, SIZE)); calcInnerBounds(); init(getGaugeBounds().width, getGaugeBounds().height); setInitialized(true); invalidate(); repaint(); }