public void setShadow(Shadow.ShadowJSO shadow) { if (Objects.nonNull(shadow)) { context.setShadowColor(shadow.getColor()); context.setShadowOffsetX(shadow.getOffset().getX()); context.setShadowOffsetY(shadow.getOffset().getY()); context.setShadowBlur(shadow.getBlur()); } else { context.setShadowColor("transparent"); context.setShadowOffsetX(0); context.setShadowOffsetY(0); context.setShadowBlur(0); } }
/** * Constructs a Shadow from a color (i.e. {@link Color} or {@link ColorName}), * a blur and an offset (offx, offy). * * @param color {@link Color} or {@link ColorName} * @param blur * @param offx * @param offy */ public Shadow(final IColor color, final int blur, final double offx, final double offy, final boolean onfill) { this(ShadowJSO.make(normalizeShadowColor(color), blur, onfill, new Point2D(offx, offy).getJSO())); }
/** * Constructs a Shadow from a color (i.e. {@link Color} or {@link ColorName}), * a blur and an offset (offx, offy). * * @param color {@link Color} or {@link ColorName} * @param blur * @param offx * @param offy */ public Shadow(final IColor color, final int blur, final double offx, final double offy) { this(ShadowJSO.make(normalizeShadowColor(color), blur, true, new Point2D(offx, offy).getJSO())); }
/** * Constructs a Shadow from a color (i.e. {@link Color} or {@link ColorName}), * a blur and an offset (offx, offy). * * @param color {@link Color} or {@link ColorName} * @param blur * @param offx * @param offy */ public Shadow(final IColor color, final int blur, final double offx, final double offy) { this(ShadowJSO.make(normalizeShadowColor(color), blur, true, new Point2D(offx, offy).getJSO())); }
/** * Constructs a Shadow from a color (i.e. {@link Color} or {@link ColorName}), * a blur and an offset (offx, offy). * * @param color {@link Color} or {@link ColorName} * @param blur * @param offx * @param offy */ public Shadow(IColor color, int blur, double offx, double offy, boolean onfill) { this(ShadowJSO.make(normalizeShadowColor(color), blur, onfill, new Point2D(offx, offy).getJSO())); }
/** * Constructs a Shadow from a color (i.e. {@link Color} or {@link ColorName}), * a blur and an offset (offx, offy). * * @param color {@link Color} or {@link ColorName} * @param blur * @param offx * @param offy */ public Shadow(IColor color, int blur, double offx, double offy) { this(ShadowJSO.make(normalizeShadowColor(color), blur, true, new Point2D(offx, offy).getJSO())); }
/** * Constructs a Shadow from a color (i.e. {@link Color} or {@link ColorName}), * a blur and an offset (offx, offy). * * @param color {@link Color} or {@link ColorName} * @param blur * @param offx * @param offy */ public Shadow(final IColor color, final int blur, final double offx, final double offy, final boolean onfill) { this(ShadowJSO.make(normalizeShadowColor(color), blur, onfill, new Point2D(offx, offy).getJSO())); }
/** * Sets the color as a {@link Color} or {@link ColorName}. * * @param color {@link Color} or {@link ColorName} * @return this Shadow */ public final Shadow setColor(final IColor color) { m_jso.setColor(normalizeShadowColor(color)); return this; }
/** * Sets the color as a string. * * @param offset Point2D * @return this Shadow */ public final Shadow setOffset(final Point2D offset) { m_jso.setOffset(offset.getJSO()); return this; }
/** * Sets the color as a string. * * @param offset Point2D * @return this Shadow */ public final Shadow setOffset(final Point2D offset) { m_jso.setOffset(offset.getJSO()); return this; }
/** * Returns the offset as a Point2D. * @return Point2D */ public final boolean getOnFill() { return m_jso.getOnFill(); }
/** * Returns the offset as a Point2D. * @return Point2D */ public final boolean getOnFill() { return m_jso.getOnFill(); }
/** * Sets the color as a string. * * @param offset Point2D * @return this Shadow */ public final Shadow setOnFill(final boolean onfill) { m_jso.setOnFill(onfill); return this; }
/** * Constructs a Shadow from a color (as a String), a blur and an offset (offx, offy). * * @param color String * @param blur * @param offx * @param offy */ public Shadow(final String color, final int blur, final double offx, final double offy, final boolean onfill) { this(ShadowJSO.make(normalizeShadowColor(color), blur, onfill, new Point2D(offx, offy).getJSO())); }
/** * Constructs a Shadow from a color (as a String), a blur and an offset (offx, offy). * * @param color String * @param blur * @param offx * @param offy */ public Shadow(final String color, final int blur, final double offx, final double offy) { this(ShadowJSO.make(normalizeShadowColor(color), blur, true, new Point2D(offx, offy).getJSO())); }
/** * Constructs a Shadow from a color (as a String), a blur and an offset (offx, offy). * * @param color String * @param blur * @param offx * @param offy */ public Shadow(final String color, final int blur, final double offx, final double offy) { this(ShadowJSO.make(normalizeShadowColor(color), blur, true, new Point2D(offx, offy).getJSO())); }
/** * Constructs a Shadow from a color (as a String), a blur and an offset (offx, offy). * * @param color String * @param blur * @param offx * @param offy */ public Shadow(final String color, final int blur, final double offx, final double offy, final boolean onfill) { this(ShadowJSO.make(normalizeShadowColor(color), blur, onfill, new Point2D(offx, offy).getJSO())); }
/** * Sets the blur. * * @param blur int * @return this Shadow */ public final Shadow setBlur(final int blur) { m_jso.setBlur(blur); return this; }
/** * Returns the offset as a Point2D. * @return Point2D */ public final Point2D getOffset() { return new Point2D(m_jso.getOffset()); }
/** * Returns the blur. * @return String */ public final int getBlur() { return m_jso.getBlur(); }