public Indicator() { super(); init(getInnerBounds().width, getInnerBounds().height); } // </editor-fold>
@Override public Point2D getCenter() { return new Point2D.Double(bImage.getWidth() / 2.0 + getInnerBounds().x, bImage.getHeight() / 2.0 + getInnerBounds().y); }
@Override public Point2D getCenter() { return new Point2D.Double(bImage.getWidth() / 2.0 + getInnerBounds().x, bImage.getHeight() / 2.0 + getInnerBounds().y); }
public Indicator() { super(); init(getInnerBounds().width, getInnerBounds().height); } // </editor-fold>
/** * Sets the symbol to on or off * @param ON */ public void setOn(final boolean ON) { on = ON; init(getInnerBounds().width, getInnerBounds().height); repaint(getInnerBounds()); }
/** * Sets the custom color definition that is used to visualize the off state of the symbol * @param CUSTOM_OFF_COLOR */ public void setCustomOffColor(final CustomColorDef CUSTOM_OFF_COLOR) { customOffColor = CUSTOM_OFF_COLOR; init(getInnerBounds().width, getInnerBounds().height); repaint(getInnerBounds()); }
/** * Sets the type of symbol that will be drawn on the indicator * @param SYMBOL_TYPE */ public void setSymbolType(final SymbolType SYMBOL_TYPE) { symbolType = SYMBOL_TYPE; init(getInnerBounds().width, getInnerBounds().height); repaint(getInnerBounds()); }
/** * Sets the color definition that is used to visualize the on state of the symbol * @param ON_COLOR */ public void setOnColor(final ColorDef ON_COLOR) { onColor = ON_COLOR; init(getInnerBounds().width, getInnerBounds().height); repaint(getInnerBounds()); }
/** * Sets the custom color definition that will be used to visualize the on state of the symbol * @param CUSTOM_ON_COLOR */ public void setCustomOnColor(final CustomColorDef CUSTOM_ON_COLOR) { customOnColor = CUSTOM_ON_COLOR; init(getInnerBounds().width, getInnerBounds().height); repaint(getInnerBounds()); }
/** * Sets the symbol to on or off * @param ON */ public void setOn(final boolean ON) { on = ON; init(getInnerBounds().width, getInnerBounds().height); repaint(getInnerBounds()); }
/** * Sets the color definition that will be used to visualize the off state of the symbol * @param OFF_COLOR */ public void setOffColor(final ColorDef OFF_COLOR) { offColor = OFF_COLOR; init(getInnerBounds().width, getInnerBounds().height); repaint(getInnerBounds()); }
/** * Enables / disables the glow effect to the on state of the symbol * @param GLOW */ public void setGlow(final boolean GLOW) { glow = GLOW; init(getInnerBounds().width, getInnerBounds().height); repaint(getInnerBounds()); }
/** * Sets the color definition that will be used to visualize the off state of the symbol * @param OFF_COLOR */ public void setOffColor(final ColorDef OFF_COLOR) { offColor = OFF_COLOR; init(getInnerBounds().width, getInnerBounds().height); repaint(getInnerBounds()); }
/** * Enables / disables the glow effect to the on state of the symbol * @param GLOW */ public void setGlow(final boolean GLOW) { glow = GLOW; init(getInnerBounds().width, getInnerBounds().height); repaint(getInnerBounds()); }
/** * Sets the type of symbol that will be drawn on the indicator * @param SYMBOL_TYPE */ public void setSymbolType(final SymbolType SYMBOL_TYPE) { symbolType = SYMBOL_TYPE; init(getInnerBounds().width, getInnerBounds().height); repaint(getInnerBounds()); }
/** * Sets the color definition that is used to visualize the on state of the symbol * @param ON_COLOR */ public void setOnColor(final ColorDef ON_COLOR) { onColor = ON_COLOR; init(getInnerBounds().width, getInnerBounds().height); repaint(getInnerBounds()); }
/** * Sets the custom color definition that is used to visualize the off state of the symbol * @param CUSTOM_OFF_COLOR */ public void setCustomOffColor(final CustomColorDef CUSTOM_OFF_COLOR) { customOffColor = CUSTOM_OFF_COLOR; init(getInnerBounds().width, getInnerBounds().height); repaint(getInnerBounds()); }
/** * Sets the custom color definition that will be used to visualize the on state of the symbol * @param CUSTOM_ON_COLOR */ public void setCustomOnColor(final CustomColorDef CUSTOM_ON_COLOR) { customOnColor = CUSTOM_ON_COLOR; init(getInnerBounds().width, getInnerBounds().height); repaint(getInnerBounds()); }
@Override protected void paintComponent(Graphics g) { final Graphics2D G2 = (Graphics2D) g.create(); G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); G2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); G2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); G2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); // Translate the coordinate system related to insets G2.translate(getFramelessOffset().getX(), getFramelessOffset().getY()); // Draw combined background image G2.drawImage(bImage, 0, 0, null); // Draw the symbol image if (on) { G2.drawImage(symbolOnImage, 0, 0, null); } else { G2.drawImage(symbolOffImage, 0, 0, null); } // Draw combined foreground image G2.drawImage(fImage, 0, 0, null); if (!isEnabled()) { G2.drawImage(disabledImage, 0, 0, null); } // Translate the coordinate system back to original G2.translate(-getInnerBounds().x, -getInnerBounds().y); G2.dispose(); } // </editor-fold>
@Override protected void paintComponent(Graphics g) { final Graphics2D G2 = (Graphics2D) g.create(); G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); G2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); G2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); G2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); // Translate the coordinate system related to insets G2.translate(getFramelessOffset().getX(), getFramelessOffset().getY()); // Draw combined background image G2.drawImage(bImage, 0, 0, null); // Draw the symbol image if (on) { G2.drawImage(symbolOnImage, 0, 0, null); } else { G2.drawImage(symbolOffImage, 0, 0, null); } // Draw combined foreground image G2.drawImage(fImage, 0, 0, null); if (!isEnabled()) { G2.drawImage(disabledImage, 0, 0, null); } // Translate the coordinate system back to original G2.translate(-getInnerBounds().x, -getInnerBounds().y); G2.dispose(); } // </editor-fold>