@Override public void setMinimumSize(final Dimension DIM) { int width = DIM.width < 40 ? 40 : DIM.width; int height = DIM.height < 18 ? 18 : DIM.height; super.setMinimumSize(new Dimension(width, height)); calcInnerBounds(); init(INNER_BOUNDS.width, (int) (0.45 * INNER_BOUNDS.width)); invalidate(); repaint(); }
/** * Set the position of the light that affects the gradient of the battery frame * @param LIGHT_POSITION */ public void setLightPosition(final Orientation LIGHT_POSITION) { lightPosition = LIGHT_POSITION; init(getWidth(), getHeight()); repaint(INNER_BOUNDS); }
@Override public void setMinimumSize(final Dimension DIM) { int width = DIM.width < 40 ? 40 : DIM.width; int height = DIM.height < 18 ? 18 : DIM.height; super.setMinimumSize(new Dimension(width, height)); calcInnerBounds(); init(INNER_BOUNDS.width, (int) (0.45 * INNER_BOUNDS.width)); invalidate(); repaint(); }
/** * Sets the current charge of the battery as integer from 0 - 100 * @param VALUE */ public void setValue(final int VALUE) { value = VALUE < 0 ? 0 : (VALUE > 100 ? 100 : VALUE); init(getWidth(), getHeight()); repaint(INNER_BOUNDS); }
/** * Set the position of the light that affects the gradient of the battery frame * @param LIGHT_POSITION */ public void setLightPosition(final Orientation LIGHT_POSITION) { lightPosition = LIGHT_POSITION; init(getWidth(), getHeight()); repaint(INNER_BOUNDS); }
/** * Sets the current charge of the battery as integer from 0 - 100 * @param VALUE */ public void setValue(final int VALUE) { value = VALUE < 0 ? 0 : (VALUE > 100 ? 100 : VALUE); init(getWidth(), getHeight()); repaint(INNER_BOUNDS); }
@Override public void setMaximumSize(final Dimension DIM) { int width = DIM.width > 1920 ? 1920 : DIM.width; int height = DIM.height > 864 ? 864 : DIM.height; super.setMaximumSize(new Dimension(width, height)); calcInnerBounds(); init(INNER_BOUNDS.width, (int) (0.45 * INNER_BOUNDS.width)); invalidate(); repaint(); }
@Override public void setMaximumSize(final Dimension DIM) { int width = DIM.width > 1920 ? 1920 : DIM.width; int height = DIM.height > 864 ? 864 : DIM.height; super.setMaximumSize(new Dimension(width, height)); calcInnerBounds(); init(INNER_BOUNDS.width, (int) (0.45 * INNER_BOUNDS.width)); invalidate(); repaint(); }