/** * Sets the image of the currently used led image. * @param CURRENT_LED_IMAGE */ private void setCurrentLedImage(final BufferedImage CURRENT_LED_IMAGE) { currentLedImage = CURRENT_LED_IMAGE; repaint(INNER_BOUNDS); }
/** * Sets the image of the currently used led image. * @param CURRENT_LED_IMAGE */ private void setCurrentLedImage(final BufferedImage CURRENT_LED_IMAGE) { currentLedImage = CURRENT_LED_IMAGE; repaint(INNER_BOUNDS); }
@Override public void actionPerformed(ActionEvent event) { if (event.getSource().equals(LED_BLINKING_TIMER)) { currentLedImage = ledOn == true ? getLedImageOn() : getLedImageOff(); ledOn ^= true; repaint(); } } // </editor-fold>
@Override public void actionPerformed(ActionEvent event) { if (event.getSource().equals(LED_BLINKING_TIMER)) { currentLedImage = ledOn == true ? getLedImageOn() : getLedImageOff(); ledOn ^= true; repaint(); } } // </editor-fold>
/** * Sets the state of the led * @param LED_ON */ public void setLedOn(final boolean LED_ON) { if (ledOn == LED_ON) {return;} ledOn = LED_ON; init(getWidth()); repaint(); }
/** * Sets the state of the led * @param LED_ON */ public void setLedOn(final boolean LED_ON) { if (ledOn == LED_ON) {return;} ledOn = LED_ON; init(getWidth()); 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(INNER_BOUNDS.width); initialized = true; invalidate(); repaint(); }
@Override public void setMinimumSize(final Dimension DIM) { int width = DIM.width < 16 ? 16 : DIM.width; int height = DIM.height < 16 ? 16 : DIM.height; final int SIZE = width <= height ? width : height; super.setMinimumSize(new Dimension(SIZE, SIZE)); calcInnerBounds(); init(INNER_BOUNDS.width); initialized = 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(INNER_BOUNDS.width); initialized = 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(INNER_BOUNDS.width); initialized = true; invalidate(); repaint(); }
@Override public void setMinimumSize(final Dimension DIM) { int width = DIM.width < 16 ? 16 : DIM.width; int height = DIM.height < 16 ? 16 : DIM.height; final int SIZE = width <= height ? width : height; super.setMinimumSize(new Dimension(SIZE, SIZE)); calcInnerBounds(); init(INNER_BOUNDS.width); initialized = 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(INNER_BOUNDS.width); initialized = true; invalidate(); repaint(); }
/** * Sets the color that will be used to calculate the custom led color * @param COLOR */ public void setCustomLedColor(final Color COLOR) { if (customLedColor.COLOR.equals(COLOR)) {return;} customLedColor = new CustomLedColor(COLOR); final boolean LED_WAS_ON = currentLedImage.equals(ledImageOn) ? true : false; flushImages(); ledImageOff = create_LED_Image(getWidth(), 0, ledColor, ledType); ledImageOn = create_LED_Image(getWidth(), 1, ledColor, ledType); currentLedImage = LED_WAS_ON == true ? ledImageOn : ledImageOff; repaint(); }
/** * Sets the color that will be used to calculate the custom led color * @param COLOR */ public void setCustomLedColor(final Color COLOR) { if (customLedColor.COLOR.equals(COLOR)) {return;} customLedColor = new CustomLedColor(COLOR); final boolean LED_WAS_ON = currentLedImage.equals(ledImageOn) ? true : false; flushImages(); ledImageOff = create_LED_Image(getWidth(), 0, ledColor, ledType); ledImageOn = create_LED_Image(getWidth(), 1, ledColor, ledType); currentLedImage = LED_WAS_ON == true ? ledImageOn : ledImageOff; repaint(); }
/** * Sets the type of LED. * @param LED_TYPE Possible values are ROUND, RECT_VERTICAL and RECT_HORIZONTAL */ public void setLedType(final LedType LED_TYPE) { if (ledType == LED_TYPE) {return;} ledType = LED_TYPE; final boolean LED_WAS_ON = currentLedImage.equals(ledImageOn) ? true : false; flushImages(); ledImageOff = create_LED_Image(getWidth(), 0, ledColor, ledType); ledImageOn = create_LED_Image(getWidth(), 1, ledColor, ledType); currentLedImage = LED_WAS_ON == true ? ledImageOn : ledImageOff; repaint(); }
/** * Sets the type of LED. * @param LED_TYPE Possible values are ROUND, RECT_VERTICAL and RECT_HORIZONTAL */ public void setLedType(final LedType LED_TYPE) { if (ledType == LED_TYPE) {return;} ledType = LED_TYPE; final boolean LED_WAS_ON = currentLedImage.equals(ledImageOn) ? true : false; flushImages(); ledImageOff = create_LED_Image(getWidth(), 0, ledColor, ledType); ledImageOn = create_LED_Image(getWidth(), 1, ledColor, ledType); currentLedImage = LED_WAS_ON == true ? ledImageOn : ledImageOff; repaint(); }
/** * Sets the color of the threshold led. * The LedColor is not a standard color but defines a * color scheme for the led. The default ledcolor is RED * @param LED_COLOR */ public void setLedColor(final LedColor LED_COLOR) { if (ledColor == LED_COLOR) {return;} if (LED_COLOR == null) { ledColor = LedColor.RED_LED; } else { ledColor = LED_COLOR; } final boolean LED_WAS_ON = currentLedImage.equals(ledImageOn) ? true : false; flushImages(); ledImageOff = create_LED_Image(getWidth(), 0, LED_COLOR, ledType); ledImageOn = create_LED_Image(getWidth(), 1, LED_COLOR, ledType); currentLedImage = LED_WAS_ON == true ? ledImageOn : ledImageOff; repaint(); }
/** * Sets the color of the threshold led. * The LedColor is not a standard color but defines a * color scheme for the led. The default ledcolor is RED * @param LED_COLOR */ public void setLedColor(final LedColor LED_COLOR) { if (ledColor == LED_COLOR) {return;} if (LED_COLOR == null) { ledColor = LedColor.RED_LED; } else { ledColor = LED_COLOR; } final boolean LED_WAS_ON = currentLedImage.equals(ledImageOn) ? true : false; flushImages(); ledImageOff = create_LED_Image(getWidth(), 0, LED_COLOR, ledType); ledImageOn = create_LED_Image(getWidth(), 1, LED_COLOR, ledType); currentLedImage = LED_WAS_ON == true ? ledImageOn : ledImageOff; repaint(); }