protected void initGraphics() { // Set initial size if (Double.compare(tile.getPrefWidth(), 0.0) <= 0 || Double.compare(tile.getPrefHeight(), 0.0) <= 0 || Double.compare(tile.getWidth(), 0.0) <= 0 || Double.compare(tile.getHeight(), 0.0) <= 0) { if (tile.getPrefWidth() > 0 && tile.getPrefHeight() > 0) { tile.setPrefSize(tile.getPrefWidth(), tile.getPrefHeight()); } else { tile.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } shadow = new DropShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 3, 0, 0, 0); notifyRegion = new NotifyRegion(); enableNode(notifyRegion, false); pane = new Pane(notifyRegion); pane.setBorder(new Border(new BorderStroke(tile.getBorderColor(), BorderStrokeStyle.SOLID, new CornerRadii(PREFERRED_WIDTH * 0.025), new BorderWidths(tile.getBorderWidth())))); pane.setBackground(new Background(new BackgroundFill(tile.getBackgroundColor(), new CornerRadii(PREFERRED_WIDTH * 0.025), Insets.EMPTY))); getChildren().setAll(pane); }
public Toast(final String msg) { label = new Label(msg); String style = "-fx-background-color:black;" + "-fx-background-radius:10;" + "-fx-font: 16px \"Microsoft YaHei\";" + "-fx-text-fill:white;-fx-padding:10;"; label.setStyle(style); DropShadow dropShadow = new DropShadow(); dropShadow.setBlurType(BlurType.THREE_PASS_BOX); dropShadow.setWidth(40); dropShadow.setHeight(40); dropShadow.setRadius(19.5); dropShadow.setOffsetX(0); dropShadow.setOffsetY(00); dropShadow.setColor(Color.color(0, 0, 0)); label.setEffect(dropShadow); }
private void initGraphics() { backgroundCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT); backgroundCtx = backgroundCanvas.getGraphicsContext2D(); foregroundCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT); foregroundCtx = foregroundCanvas.getGraphicsContext2D(); ledInnerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.BLACK, 0.2 * PREFERRED_WIDTH, 0, 0, 0); ledDropShadow = new DropShadow(BlurType.TWO_PASS_BOX, getSkinnable().getBarColor(), 0.3 * PREFERRED_WIDTH, 0, 0, 0); pane = new Pane(backgroundCanvas, foregroundCanvas); pane.setBorder(new Border(new BorderStroke(getSkinnable().getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(1)))); pane.setBackground(new Background(new BackgroundFill(getSkinnable().getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY))); getChildren().setAll(pane); }
public LcdSkin(Gauge gauge) { super(gauge); width = PREFERRED_WIDTH; height = PREFERRED_HEIGHT; valueOffsetLeft = 0.0; valueOffsetRight = 0.0; digitalFontSizeFactor = 1.0; backgroundTextBuilder = new StringBuilder(); valueFormatString = new StringBuilder("%.").append(Integer.toString(gauge.getDecimals())).append("f").toString(); otherFormatString = new StringBuilder("%.").append(Integer.toString(gauge.getTickLabelDecimals())).append("f").toString(); locale = gauge.getLocale(); sections = gauge.getSections(); sectionColorMap = new HashMap<>(sections.size()); currentValueListener = o -> handleEvents("REDRAW"); updateSectionColors(); FOREGROUND_SHADOW.setOffsetX(0); FOREGROUND_SHADOW.setOffsetY(1); FOREGROUND_SHADOW.setColor(Color.rgb(0, 0, 0, 0.5)); FOREGROUND_SHADOW.setBlurType(BlurType.TWO_PASS_BOX); FOREGROUND_SHADOW.setRadius(2); initGraphics(); registerListeners(); }
public void closeWithReason(String reason) { // Store the reason reasonQueue.offer(reason); if (!closed.compareAndSet(false, true)) { return; } // Slide out & dispose Platform.runLater(() -> { if (webView != null) { ImageView imageView = new ImageView(webView.snapshot(null, null)); animatedPane.getChildren().set(0, imageView); dropShadow.setBlurType(BlurType.TWO_PASS_BOX); } TranslateTransition slideOut = new TranslateTransition(Duration.millis(TRANSLATION_MS), animatedPane); slideOut.setInterpolator(Interpolator.EASE_IN); slideOut.setByX(translationDistance); slideOut.setOnFinished(e -> dispose()); slideOut.play(); }); }
private void initGraphics() { frame = new Region(); frame.setOpacity(getSkinnable().isFrameVisible() ? 1 : 0); led = new Region(); led.setStyle("-led-color: " + Util.colorToCss((Color) getSkinnable().getLedColor()) + ";"); innerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 8, 0d, 0d, 0d); glow = new DropShadow(BlurType.TWO_PASS_BOX, (Color) getSkinnable().getLedColor(), 20, 0d, 0d, 0d); glow.setInput(innerShadow); highlight = new Region(); // Set the appropriate style classes changeStyle(); // Add all nodes getChildren().setAll(frame, led, highlight); }
public LcdSkin(final Lcd CONTROL) { super(CONTROL); valueOffsetLeft = 0.0; valueOffsetRight = 0.0; digitalFontSizeFactor = 1.0; backgroundTextBuilder = new StringBuilder(); decBuffer = new StringBuilder(16); FOREGROUND_SHADOW.setOffsetX(0); FOREGROUND_SHADOW.setOffsetY(1); FOREGROUND_SHADOW.setColor(Color.rgb(0, 0, 0, 0.5)); FOREGROUND_SHADOW.setBlurType(BlurType.TWO_PASS_BOX); FOREGROUND_SHADOW.setRadius(2); init(); initGraphics(); registerListeners(); }
public LcdClockSkin(final LcdClock CONTROL) { super(CONTROL); aspectRatio = PREFERRED_HEIGHT / PREFERRED_WIDTH; valueOffsetRight = 0.0; digitalFontSizeFactor = 1.0; backgroundTextBuilder = new StringBuilder(); FOREGROUND_SHADOW.setOffsetX(0); FOREGROUND_SHADOW.setOffsetY(1); FOREGROUND_SHADOW.setColor(Color.rgb(0, 0, 0, 0.5)); FOREGROUND_SHADOW.setBlurType(BlurType.TWO_PASS_BOX); FOREGROUND_SHADOW.setRadius(2); adjustDateFormat(); init(); initGraphics(); registerListeners(); }
private static Image generateBrokenHeartImage() { FontAwesomeIconView newHeart = new FontAwesomeIconView(FontAwesomeIcon.HEART); newHeart.setGlyphSize(graphicFontSize); FontAwesomeIconView newBolt = new FontAwesomeIconView(FontAwesomeIcon.BOLT); newBolt.setGlyphSize(graphicFontSize); newBolt.setScaleX(0.65); newBolt.setScaleY(0.65); newBolt.setTranslateX(-1.0); newHeart.setFill(brokenColor); newBolt.setFill(Color.WHITE); StackPane generated = new StackPane( newHeart, newBolt ); StackPane.setAlignment(newBolt, Pos.CENTER); StackPane.setAlignment(newHeart, Pos.CENTER); generated.setBlendMode(BlendMode.MULTIPLY); generated.setEffect( new DropShadow(BlurType.GAUSSIAN, heartDefaultColor, 7.0, 0.25, 0.0, 0.0)); return CellUtils.makeSnapshotWithTransparency(generated); }
public HorizontalShadowAnimation(Labeled label) { if (label == null) { throw new NullPointerException(); } labeled = label; originalEffect = label.getEffect(); dropShadow.setBlurType(BlurType.ONE_PASS_BOX); setInitialShadow(label); EventHandler<ActionEvent> onFinished = new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { label.effectProperty().unbind(); labeled.setEffect(originalEffect); } }; KeyValue endValue = new KeyValue(dropShadow.widthProperty(), 0, Interpolator.EASE_BOTH); KeyFrame endFrame = new KeyFrame(Duration.millis(150), onFinished, endValue); animation.getKeyFrames().addAll(endFrame); animation.setCycleCount(1); animation.setAutoReverse(false); }
public FocusBorder() { InnerShadow innerFocus = new InnerShadow(); innerFocus.setColor(Color.rgb(104, 155, 201, 0.8)); innerFocus.setBlurType(BlurType.ONE_PASS_BOX); innerFocus.setRadius(5.0); innerFocus.setChoke(0.8); innerFocus.setOffsetX(0.0); setSpread(0.6); setColor(Color.rgb(120, 171, 217)); setBlurType(BlurType.ONE_PASS_BOX); setRadius(6.5); setOffsetX(0.0); setOffsetY(0.0); setInput(innerFocus); }
private void setSelectedFocusBorder() { InnerShadow innerFocus = new InnerShadow(); innerFocus.setColor(Color.rgb(104, 155, 201, 0.7)); innerFocus.setBlurType(BlurType.ONE_PASS_BOX); innerFocus.setRadius(6.5); innerFocus.setChoke(0.7); innerFocus.setOffsetX(0.0); innerFocus.setOffsetY(0.0); DropShadow outerFocus = new DropShadow(); outerFocus.setColor(Color.rgb(104, 155, 201)); outerFocus.setBlurType(BlurType.ONE_PASS_BOX); outerFocus.setRadius(7.0); outerFocus.setSpread(0.7); outerFocus.setOffsetX(0.0); outerFocus.setOffsetY(0.0); outerFocus.setInput(innerFocus); for (Node child : getChildren()) { if (child instanceof StackPane) { child.setEffect(outerFocus); } } }
private void setFocusBorder() { InnerShadow innerFocus = new InnerShadow(); innerFocus.setColor(Color.rgb(104, 155, 201)); innerFocus.setBlurType(BlurType.ONE_PASS_BOX); innerFocus.setRadius(6.5); innerFocus.setChoke(0.7); innerFocus.setOffsetX(0.0); innerFocus.setOffsetY(0.0); DropShadow outerFocus = new DropShadow(); outerFocus.setColor(Color.rgb(104, 155, 201)); outerFocus.setBlurType(BlurType.ONE_PASS_BOX); outerFocus.setRadius(5.0); outerFocus.setSpread(0.6); outerFocus.setOffsetX(0.0); outerFocus.setOffsetY(0.0); outerFocus.setInput(innerFocus); for (Node child : getChildren()) { if (child instanceof StackPane) { child.setEffect(outerFocus); } } }
private void initGraphics() { frame = new Region(); frame.getStyleClass().setAll("frame"); frame.setOpacity(getSkinnable().isFrameVisible() ? 1 : 0); led = new Region(); led.getStyleClass().setAll("main"); led.setStyle("-led-color: " + (getSkinnable().getLedColor()).toString().replace("0x", "#") + ";"); innerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 8, 0d, 0d, 0d); glow = new DropShadow(BlurType.TWO_PASS_BOX, (Color) getSkinnable().getLedColor(), 20, 0d, 0d, 0d); glow.setInput(innerShadow); highlight = new Region(); highlight.getStyleClass().setAll("highlight"); getChildren().addAll(frame, led, highlight); }
private void initGraphics() { frame = new Region(); frame.getStyleClass().setAll("frame"); frame.setOpacity(isFrameVisible() ? 1 : 0); led = new Region(); led.getStyleClass().setAll("main"); led.setStyle("-led-color: " + (getLedColor()).toString().replace("0x", "#") + ";"); innerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 8, 0d, 0d, 0d); glow = new DropShadow(BlurType.TWO_PASS_BOX, getLedColor(), 20, 0d, 0d, 0d); glow.setInput(innerShadow); highlight = new Region(); highlight.getStyleClass().setAll("highlight"); // Add all nodes getChildren().addAll(frame, led, highlight); }
private void initGraphics() { shadow = new DropShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.5), 5, 0, 0, 5); menu = new Region(); //menu.setEffect(shadow); menu.getStyleClass().add("menu"); item1 = new FunMenuItem(); item1.setOpacity(0); item2 = new FunMenuItem(); item2.setOpacity(0); item3 = new FunMenuItem(); item3.setOpacity(0); item4 = new FunMenuItem(); item4.setOpacity(0); button = new Region(); button.setPickOnBounds(true); button.getStyleClass().add("rotating-button"); cross = new Region(); cross.setMouseTransparent(true); cross.getStyleClass().add("cross"); getChildren().setAll(menu, item1, item2, item3, item4, button, cross); }
public void setStyle(Node control) { DropShadow dropShadow = new DropShadow(); dropShadow.setBlurType(BlurType.ONE_PASS_BOX); dropShadow.setColor(Color.GREEN); dropShadow.setRadius(10); dropShadow.setSpread(0.5); dropShadow.setOffsetX(10); dropShadow.setOffsetY(15); control.setEffect(dropShadow); }
public void setStyle(Node control) { InnerShadow innerShadow = new InnerShadow(); innerShadow.setBlurType(BlurType.GAUSSIAN); innerShadow.setColor(Color.GREEN); innerShadow.setRadius(6); innerShadow.setChoke(0.5); innerShadow.setOffsetX(1); innerShadow.setOffsetY(2); control.setEffect(innerShadow); }
List<NamedEffect> getNamedEffectList() { List<NamedEffect> nes = new ArrayList<NamedEffect>(); nes.add(new NamedEffect("colored", new DropShadow() {{ setColor(Color.GREEN);}})); nes.add(new NamedEffect("height: 40", new DropShadow() {{ setHeight(40);}})); nes.add(new NamedEffect("width: 40", new DropShadow() {{ setWidth(40);}})); nes.add(new NamedEffect("spread: 0.7", new DropShadow() {{ setSpread(0.7f);}})); for (final BlurType bt : BlurType.values()) { nes.add(new NamedEffect("bt:" + bt.name(), new DropShadow() {{ setBlurType(bt);}})); } nes.add(new NamedEffect("offset: 10, 20", new DropShadow() {{ setOffsetX(10);setOffsetY(20);}})); return nes; }
List<NamedEffect> getNamedEffectList() { List<NamedEffect> nes = new ArrayList<NamedEffect>(); nes.add(new NamedEffect("colored", new InnerShadow() {{ setColor(Color.GREEN);}})); nes.add(new NamedEffect("height: 40", new InnerShadow() {{ setHeight(40);}})); nes.add(new NamedEffect("width: 40", new InnerShadow() {{ setWidth(40);}})); nes.add(new NamedEffect("radius: 40", new InnerShadow() {{ setRadius(40);}})); for (final BlurType bt : BlurType.values()) { nes.add(new NamedEffect("bt:" + bt.name(), new InnerShadow() {{ setBlurType(bt);}})); } nes.add(new NamedEffect("choke: 0.7", new InnerShadow() {{ setChoke(0.7f);}})); nes.add(new NamedEffect("offset: 10, 20", new InnerShadow() {{ setOffsetX(10);setOffsetY(20);}})); return nes; }
List<NamedEffect> getNamedEffectList() { List<NamedEffect> nes = new ArrayList<NamedEffect>(); nes.add(new NamedEffect("colored", new Shadow() {{ setColor(Color.GREEN);}})); nes.add(new NamedEffect("height: 40", new Shadow() {{ setHeight(40);}})); nes.add(new NamedEffect("width: 40", new Shadow() {{ setWidth(40);}})); nes.add(new NamedEffect("radius: 40", new Shadow() {{ setRadius(40);}})); for (final BlurType bt : BlurType.values()) { nes.add(new NamedEffect("bt:" + bt.name(), new Shadow() {{ setBlurType(bt);}})); } return nes; }
public LcdClockSkin(Clock clock) { super(clock); digitalFontSizeFactor = 1.0; backgroundTextBuilder = new StringBuilder(); FOREGROUND_SHADOW.setOffsetX(0); FOREGROUND_SHADOW.setOffsetY(1); FOREGROUND_SHADOW.setColor(Color.rgb(0, 0, 0, 0.5)); FOREGROUND_SHADOW.setBlurType(BlurType.TWO_PASS_BOX); FOREGROUND_SHADOW.setRadius(2); adjustDateFormat(); initGraphics(); registerListeners(); }
private void initGraphics() { // Set initial size if (Double.compare(getWidth(), 0) <= 0 || Double.compare(getHeight(), 0) <= 0 || Double.compare(getPrefWidth(), 0) <= 0 || Double.compare(getPrefHeight(), 0) <= 0) { setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } // Apply the base CSS style class to the control getStyleClass().add("led"); // Create the needed nodes and apply their CSS style classes frame = new Region(); frame.getStyleClass().setAll("frame"); main = new Region(); main.getStyleClass().setAll("main"); // We handle effects in code because we have to chain them and // we need to calculate the shadow spread dependent of the size innerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 8, 0, 0, 0); glow = new DropShadow(BlurType.TWO_PASS_BOX, getColor(), 20, 0, 0, 0); glow.setInput(innerShadow); highlight = new Region(); highlight.getStyleClass().setAll("highlight"); // Add all nodes getChildren().addAll(frame, main, highlight); }
private void initGraphics() { if (Double.compare(control.getPrefWidth(), 0.0) <= 0 || Double.compare(control.getPrefHeight(), 0.0) <= 0 || Double.compare(control.getWidth(), 0.0) <= 0 || Double.compare(control.getHeight(), 0.0) <= 0) { if (control.getPrefWidth() > 0 && control.getPrefHeight() > 0) { control.setPrefSize(control.getPrefWidth(), control.getPrefHeight()); } else { control.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } frame = new Region(); frame.getStyleClass().setAll("frame"); main = new Region(); main.getStyleClass().setAll("main"); main.setStyle(String.join("", "-color: ", control.getColor().toString().replace("0x", "#"), ";")); innerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 8, 0, 0, 0); glow = new DropShadow(BlurType.TWO_PASS_BOX, control.getColor(), 20, 0, 0, 0); glow.setInput(innerShadow); highlight = new Region(); highlight.getStyleClass().setAll("highlight"); getChildren().addAll(frame, main, highlight); }
private void initGraphics() { green = new Region(); green.getStyleClass().setAll("green"); yellow = new Region(); yellow.getStyleClass().setAll("yellow"); red = new Region(); red.getStyleClass().setAll("red"); rack = new Region(); rack.getStyleClass().setAll("rack"); bodyDropShadow = new DropShadow(BlurType.TWO_PASS_BOX, Color.web("0x000000a6"), 0.0133333333 * PREFERRED_WIDTH, 1.0, 0d, 2d); bodyInnerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.web("0x000000a6"), 0.0133333333 * PREFERRED_WIDTH, 1.0, 1.4142135623730951, 1.4142135623730951); bodyInnerShadow.setInput(bodyDropShadow); body = new Region(); body.getStyleClass().setAll("body"); body.setEffect(bodyInnerShadow); roof = new Region(); roof.getStyleClass().setAll("roof"); pane = new Pane(); pane.getChildren().setAll(green, yellow, red, rack, body, roof); getChildren().setAll(pane); resize(); }
/** * this method is used to add shadow effect to the node, * however the shadow is not real ( gets affected with node transformations) * <p> * use {@link #createMaterialNode(Node, int)} instead to generate a real shadow */ public static void setDepth(Node control, int level) { level = level < 0 ? 0 : level; level = level > 5 ? 5 : level; control.setEffect(new DropShadow(BlurType.GAUSSIAN, depth[level].getColor(), depth[level].getRadius(), depth[level].getSpread(), depth[level].getOffsetX(), depth[level].getOffsetY())); }
public ElevationEffect() { super(); setRadius(10); setWidth(21); setHeight(21); setBlurType(BlurType.GAUSSIAN); setColor(new Color(0, 0, 0, 0.3)); }
public ElevationEffect(double rad) { super(); setRadius(rad); setWidth(21); setHeight(21); setBlurType(BlurType.GAUSSIAN); setColor(new Color(0, 0, 0, 0.3)); }
private DropShadow createDropShadow() { DropShadow dropShadow = new DropShadow(); dropShadow.setColor(Color.rgb(0, 0, 0, 0.8)); dropShadow.setBlurType(BlurType.TWO_PASS_BOX); dropShadow.setOffsetY(2); dropShadow.setRadius(DEFAULT_DROP_SHADOW_RADIUS); return dropShadow; }
private Node createImageBox() { ImageView imageView = new ImageView(getClass().getResource("/img/cachoeira.png").toExternalForm()); imageView.setEffect(new DropShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.8), 4, 0, 0, 2)); VBox imageVBox = new VBox(imageView); VBox.setVgrow(imageVBox, Priority.ALWAYS); imageVBox.setAlignment(Pos.CENTER); return imageVBox; }
/** * Sets {@link Tooltip} for a {@link Node} which nicely shows {@link ImageView} inside. * * @param nodeToHaveTooltip * The Node for installing Tooltip. * * @param imageView * The ImageView to show inside Tooltip. */ public static void setImageViewTooltip(Node nodeToHaveTooltip, ImageView imageView) { // Add shadow to ImageView so the actual image will be clearly distinguishable from // tooltip's background. DropShadow shadow = new DropShadow(BlurType.ONE_PASS_BOX, Color.GREY, 5.0, 1.0, 0.0, 0.0); imageView.setEffect(shadow); // TODO: If image is big and StreamSis window is close to the edge, Tooltip is hiding right // after it is shown. Need to find workaround. Tooltip fullPreviewTP = new Tooltip(); fullPreviewTP.setGraphic(imageView); fullPreviewTP.setAnchorLocation(AnchorLocation.WINDOW_BOTTOM_LEFT); // fullPreviewTP.setStyle("-fx-effect: dropshadow(three-pass-box, black, 10,0.5,0,0);"); Tooltip.install(nodeToHaveTooltip, fullPreviewTP); }
@Override protected void configure() { // Invisble at first. setVisible(false); dropShadow = new DropShadow(); dropShadow.setSpread(1); dropShadow.setBlurType(BlurType.GAUSSIAN); // Brightness effect. spriteImage.setEffect(dropShadow); }
@Override protected void configure() { dropShadow = new DropShadow(); dropShadow.setSpread(1); dropShadow.setBlurType(BlurType.GAUSSIAN); // Brightness effect. spriteImage.setEffect(dropShadow); }
public VUMeter() { for(int i=0; i<bars.length;i++) { bars[i] = new Rectangle(26, 2); bars[i].setFill(BAR_COLOR); bars[i].setX(-13); bars[i].setY(1-(i*4)); } getChildren().addAll(bars); setEffect(DropShadowBuilder.create().blurType(BlurType.TWO_PASS_BOX).radius(10).spread(0.4).color(Color.web("#b10000")).build()); }
private void drawPois() { double poiRadius = size * 0.02; Color poiColor = Color.color(getRadarColorAsColor().getRed(), getRadarColorAsColor().getGreen(), getRadarColorAsColor().getBlue(), 0.4); poiCtx.clearRect(0, 0, size, size); poiCtx.save(); poiCtx.setEffect(new DropShadow(BlurType.TWO_PASS_BOX, poiColor, 3 * poiRadius, 0.5, 0, 0)); for (Poi poi : pois.values()) { RadialGradient gradient = new RadialGradient(0, 0, centerX + poi.getX() * size * 0.5, centerY + poi.getY() * size * 0.5, poiRadius, false, CycleMethod.NO_CYCLE, poiStops); poiCtx.setFill(gradient); poiCtx.fillOval(centerX + poi.getX() * size * 0.5 - poiRadius, centerY + poi.getY() * size * 0.5 - poiRadius, 2 * poiRadius, 2 * poiRadius); } poiCtx.restore(); }
public Shadow(boolean pillShadow) { setColor(Color.rgb(172, 172, 184)); setBlurType(BlurType.ONE_PASS_BOX); setRadius(2.0); setSpread(0.1); setOffsetX(0.0); setOffsetY(0.8); if (pillShadow) { setOffsetX(1.0); setOffsetY(0.5); setWidth(1.0); } }