/** * 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 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 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(); }
private void init(final int WIDTH) { if (WIDTH <= 1) { return; } if (ledImageOff != null) { ledImageOff.flush(); } ledImageOff = create_LED_Image(WIDTH, 0, ledColor, ledType); if (ledImageOn != null) { ledImageOn.flush(); } ledImageOn = create_LED_Image(WIDTH, 1, ledColor, ledType); if (ledOn) { setCurrentLedImage(ledImageOn); } else { setCurrentLedImage(ledImageOff); } } // </editor-fold>
ledColor = LedColor.RED_LED; customLedColor = new CustomLedColor(Color.RED); ledImageOff = create_LED_Image(16, 0, ledColor, LedType.ROUND); ledImageOn = create_LED_Image(16, 1, ledColor, LedType.ROUND); currentLedImage = ledImageOff; LED_BLINKING_TIMER = new javax.swing.Timer(500, this);
private void init(final int WIDTH) { if (WIDTH <= 1) { return; } if (ledImageOff != null) { ledImageOff.flush(); } ledImageOff = create_LED_Image(WIDTH, 0, ledColor, ledType); if (ledImageOn != null) { ledImageOn.flush(); } ledImageOn = create_LED_Image(WIDTH, 1, ledColor, ledType); if (ledOn) { setCurrentLedImage(ledImageOn); } else { setCurrentLedImage(ledImageOff); } } // </editor-fold>
ledColor = LedColor.RED_LED; customLedColor = new CustomLedColor(Color.RED); ledImageOff = create_LED_Image(16, 0, ledColor, LedType.ROUND); ledImageOn = create_LED_Image(16, 1, ledColor, LedType.ROUND); currentLedImage = ledImageOff; LED_BLINKING_TIMER = new javax.swing.Timer(500, this);