当前位置: 首页>>代码示例>>Java>>正文


Java InnerShadow.setInput方法代码示例

本文整理汇总了Java中javafx.scene.effect.InnerShadow.setInput方法的典型用法代码示例。如果您正苦于以下问题:Java InnerShadow.setInput方法的具体用法?Java InnerShadow.setInput怎么用?Java InnerShadow.setInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.effect.InnerShadow的用法示例。


在下文中一共展示了InnerShadow.setInput方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initGraphics

import javafx.scene.effect.InnerShadow; //导入方法依赖的package包/类
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();
}
 
开发者ID:Simego,项目名称:FXImgurUploader,代码行数:37,代码来源:SignalTowerSkin.java

示例2: initGraphics

import javafx.scene.effect.InnerShadow; //导入方法依赖的package包/类
private void initGraphics() {
    size   = getSkinnable().getPrefWidth() < getSkinnable().getPrefHeight() ? getSkinnable().getPrefWidth() : getSkinnable().getPrefHeight();

    frame = new Circle(0.5 * size, 0.5 * size, 0.5 * size);
    frame.setStroke(null);
    frame.setVisible(getSkinnable().isFrameVisible());

    main = new Circle(0.5 * size, 0.5 * size, 0.36 * size);
    main.setStroke(null);

    innerShadow = new InnerShadow();
    innerShadow.setRadius(0.090 * main.getLayoutBounds().getWidth());
    innerShadow.setColor(Color.BLACK);
    innerShadow.setBlurType(BlurType.GAUSSIAN);
    innerShadow.setInput(null);

    glow = new DropShadow();
    glow.setRadius(0.45 * main.getLayoutBounds().getWidth());
    glow.setColor((Color) getSkinnable().getLedColor());
    glow.setBlurType(BlurType.GAUSSIAN);
    glow.setInput(innerShadow);

    highlight = new Circle(0.5 * size, 0.5 * size, 0.29 * size);
    highlight.setStroke(null);

    getChildren().setAll(frame, main, highlight);
}
 
开发者ID:HanSolo,项目名称:JFX8CustomControls,代码行数:28,代码来源:LedSkin.java

示例3: recalc

import javafx.scene.effect.InnerShadow; //导入方法依赖的package包/类
private void recalc() {
    double size  = getWidth() < getHeight() ? getWidth() : getHeight();

    ledOffShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 0.07 * size, 0, 0, 0);
    
    ledOnShadow  = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 0.07 * size, 0, 0, 0);
    ledOnShadow.setInput(new DropShadow(BlurType.TWO_PASS_BOX, ledColor.get(), 0.36 * size, 0, 0, 0));
    
    frameGradient = new LinearGradient(0.14 * size, 0.14 * size,
                                       0.84 * size, 0.84 * size,
                                       false, CycleMethod.NO_CYCLE,
                                       new Stop(0.0, Color.rgb(20, 20, 20, 0.65)),
                                       new Stop(0.15, Color.rgb(20, 20, 20, 0.65)),
                                       new Stop(0.26, Color.rgb(41, 41, 41, 0.65)),
                                       new Stop(0.26, Color.rgb(41, 41, 41, 0.64)),
                                       new Stop(0.85, Color.rgb(200, 200, 200, 0.41)),
                                       new Stop(1.0, Color.rgb(200, 200, 200, 0.35)));

    ledOnGradient = new LinearGradient(0.25 * size, 0.25 * size,
                                       0.74 * size, 0.74 * size,
                                       false, CycleMethod.NO_CYCLE,
                                       new Stop(0.0, ledColor.get().deriveColor(0d, 1d, 0.77, 1d)),
                                       new Stop(0.49, ledColor.get().deriveColor(0d, 1d, 0.5, 1d)),
                                       new Stop(1.0, ledColor.get()));

    ledOffGradient = new LinearGradient(0.25 * size, 0.25 * size,
                                        0.74 * size, 0.74 * size,
                                        false, CycleMethod.NO_CYCLE,
                                        new Stop(0.0, ledColor.get().deriveColor(0d, 1d, 0.20, 1d)),
                                        new Stop(0.49, ledColor.get().deriveColor(0d, 1d, 0.13, 1d)),
                                        new Stop(1.0, ledColor.get().deriveColor(0d, 1d, 0.2, 1d)));

    highlightGradient = new RadialGradient(0, 0,
                                           0.3 * size, 0.3 * size,
                                           0.29 * size,
                                           false, CycleMethod.NO_CYCLE,
                                           new Stop(0.0, Color.WHITE),
                                           new Stop(1.0, Color.TRANSPARENT));
    draw();
}
 
开发者ID:HanSolo,项目名称:JFX8CustomControls,代码行数:41,代码来源:Led.java

示例4: initGraphics

import javafx.scene.effect.InnerShadow; //导入方法依赖的package包/类
private void initGraphics() {
    dropShadow  = new DropShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), PREFERRED_WIDTH * 0.016, 0.0, 0, PREFERRED_WIDTH * 0.028);
    highlight   = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(255, 255, 255, 0.2), PREFERRED_WIDTH * 0.008, 0.0, 0, PREFERRED_WIDTH * 0.008);
    innerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.2), PREFERRED_WIDTH * 0.008, 0.0, 0, -PREFERRED_WIDTH * 0.008);
    highlight.setInput(innerShadow);
    dropShadow.setInput(highlight);

    barArc = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.46, PREFERRED_HEIGHT * 0.46, BAR_START_ANGLE, 0);
    barArc.setType(ArcType.OPEN);
    barArc.setStrokeLineCap(StrokeLineCap.ROUND);
    barArc.setFill(null);
    barArc.setStroke(barColor.get());

    double center = PREFERRED_WIDTH * 0.5;
    ring = Shape.subtract(new Circle(center, center, PREFERRED_WIDTH * 0.42),
                          new Circle(center, center, PREFERRED_WIDTH * 0.3));
    ring.setFill(color.get());
    ring.setEffect(dropShadow);

    mainCircle = new Circle();
    mainCircle.setFill(color.get().darker().darker());

    text = new Text(String.format(Locale.US, formatString, getTargetValue()));
    text.setFill(Color.WHITE);
    text.setTextOrigin(VPos.CENTER);

    indicatorRotate = new Rotate(-ANGLE_RANGE *  0.5, center, center);

    indicatorGlow        = new DropShadow(BlurType.TWO_PASS_BOX, getIndicatorColor(), PREFERRED_WIDTH * 0.02, 0.0, 0, 0);
    indicatorInnerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.5), PREFERRED_WIDTH * 0.008, 0.0, 0, PREFERRED_WIDTH * 0.008);
    indicatorHighlight   = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(255, 255, 255, 0.35), PREFERRED_WIDTH * 0.008, 0.0, 0, -PREFERRED_WIDTH * 0.008);
    indicatorHighlight.setInput(indicatorInnerShadow);

    indicator = new Circle();
    indicator.setFill(color.get().darker());
    indicator.setStroke(color.get().darker().darker());
    indicator.setMouseTransparent(true);
    indicator.getTransforms().add(indicatorRotate);

    Group indicatorGroup = new Group(indicator);
    indicatorGroup.setEffect(indicatorHighlight);

    symbol = new Region();
    symbol.getStyleClass().setAll("symbol");
    symbol.setCacheHint(CacheHint.SPEED);

    icon = new FontIcon();
    icon.setTextOrigin(VPos.CENTER);

    iconPane = new StackPane(symbol, icon);

    pane = new Pane(barArc, ring, mainCircle, text, indicatorGroup, iconPane);
    pane.setPrefSize(PREFERRED_HEIGHT, PREFERRED_HEIGHT);
    pane.setBackground(new Background(new BackgroundFill(color.get().darker(), new CornerRadii(1024), Insets.EMPTY)));
    pane.setEffect(highlight);

    getChildren().setAll(pane);
}
 
开发者ID:HanSolo,项目名称:regulators,代码行数:59,代码来源:Regulator.java

示例5: initGraphics

import javafx.scene.effect.InnerShadow; //导入方法依赖的package包/类
private void initGraphics() {
    dropShadow  = new DropShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), PREFERRED_WIDTH * 0.016, 0.0, 0, PREFERRED_WIDTH * 0.028);
    highlight   = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(255, 255, 255, 0.2), PREFERRED_WIDTH * 0.008, 0.0, 0, PREFERRED_WIDTH * 0.008);
    innerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.2), PREFERRED_WIDTH * 0.008, 0.0, 0, -PREFERRED_WIDTH * 0.008);
    highlight.setInput(innerShadow);
    dropShadow.setInput(highlight);

    Stop[] stops = {
        new Stop(0.0, Color.rgb(135, 255, 190)),
        new Stop(0.125, Color.rgb(254, 190, 106)),
        new Stop(0.389, Color.rgb(252, 84, 68)),
        new Stop(0.611, Color.rgb(99, 195, 255)),
        new Stop(1.0, Color.rgb(125, 255, 190))
    };

    barGradient = new ConicalGradient(stops);

    barArc = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.46, PREFERRED_HEIGHT * 0.46, BAR_START_ANGLE, 0);
    barArc.setType(ArcType.OPEN);
    barArc.setStrokeLineCap(StrokeLineCap.ROUND);
    barArc.setFill(null);
    barArc.setStroke(barGradient.getImagePattern(new Rectangle(0, 0, PREFERRED_WIDTH, PREFERRED_HEIGHT)));

    overlayBarArc = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.46, PREFERRED_HEIGHT * 0.46, BAR_START_ANGLE, 0);
    overlayBarArc.setType(ArcType.OPEN);
    overlayBarArc.setStrokeLineCap(StrokeLineCap.ROUND);
    overlayBarArc.setFill(null);
    overlayBarArc.setStroke(Color.rgb(0, 0, 0, 0.3));
    overlayBarArc.setVisible((int) targetValue.get() != (int) currentValue.get());

    double center = PREFERRED_WIDTH * 0.5;
    ring = Shape.subtract(new Circle(center, center, PREFERRED_WIDTH * 0.42),
                          new Circle(center, center, PREFERRED_WIDTH * 0.3));
    ring.setFill(color.get());
    ring.setEffect(dropShadow);

    mainCircle = new Circle();
    mainCircle.setFill(color.get().darker().darker());

    text = new Text(String.format(Locale.US, formatString, currentValue.get()));
    text.setFill(textColor.get());
    text.setTextOrigin(VPos.CENTER);

    targetText = new Text(String.format(Locale.US, formatString, targetValue.get()));
    targetText.setFill(textColor.get().darker());
    targetText.setTextOrigin(VPos.CENTER);
    targetText.setVisible((int) targetValue.get() != (int) currentValue.get());

    indicatorRotate = new Rotate(-ANGLE_RANGE *  0.5, center, center);

    indicatorGlow        = new DropShadow(BlurType.TWO_PASS_BOX, getIndicatorColor(), PREFERRED_WIDTH * 0.02, 0.0, 0, 0);
    indicatorInnerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.5), PREFERRED_WIDTH * 0.008, 0.0, 0, PREFERRED_WIDTH * 0.008);
    indicatorHighlight   = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(255, 255, 255, 0.35), PREFERRED_WIDTH * 0.008, 0.0, 0, -PREFERRED_WIDTH * 0.008);
    indicatorHighlight.setInput(indicatorInnerShadow);

    indicator = new Circle();
    indicator.setFill(color.get().darker());
    indicator.setStroke(color.get().darker().darker());
    indicator.setMouseTransparent(true);
    indicator.getTransforms().add(indicatorRotate);

    Group indicatorGroup = new Group(indicator);
    indicatorGroup.setEffect(indicatorHighlight);

    symbol = new Region();
    symbol.getStyleClass().setAll("symbol");
    symbol.setCacheHint(CacheHint.SPEED);

    icon = new FontIcon();
    icon.setTextOrigin(VPos.CENTER);

    iconPane = new StackPane(symbol, icon);

    pane = new Pane(barArc, overlayBarArc, ring, mainCircle, text, targetText, indicatorGroup, iconPane);
    pane.setPrefSize(PREFERRED_HEIGHT, PREFERRED_HEIGHT);
    pane.setBackground(new Background(new BackgroundFill(color.get().darker(), new CornerRadii(1024), Insets.EMPTY)));
    pane.setEffect(highlight);

    getChildren().setAll(pane);
}
 
开发者ID:HanSolo,项目名称:regulators,代码行数:81,代码来源:FeedbackRegulator.java

示例6: draw

import javafx.scene.effect.InnerShadow; //导入方法依赖的package包/类
private void draw() {
    double size = getWidth() < getHeight() ? getWidth() : getHeight();

    canvas.setWidth(size);
    canvas.setHeight(size);

    ctx.clearRect(0, 0, size, size);

    if (isFrameVisible()) { //frame
        Paint frame = new LinearGradient(0.14 * size, 0.14 * size,
                                         0.84 * size, 0.84 * size,
                                         false, CycleMethod.NO_CYCLE,
                                         new Stop(0.0, Color.rgb(20, 20, 20, 0.65)),
                                         new Stop(0.15, Color.rgb(20, 20, 20, 0.65)),
                                         new Stop(0.26, Color.rgb(41, 41, 41, 0.65)),
                                         new Stop(0.26, Color.rgb(41, 41, 41, 0.64)),
                                         new Stop(0.85, Color.rgb(200, 200, 200, 0.41)),
                                         new Stop(1.0, Color.rgb(200, 200, 200, 0.35)));
        ctx.setFill(frame);
        ctx.fillOval(0, 0, size, size);
    }

    InnerShadow innerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 0.07 * size, 0, 0, 0);
    if (isOn()) { //on
        ctx.save();
        Paint on = new LinearGradient(0.25 * size, 0.25 * size,
                                      0.74 * size, 0.74 * size,
                                      false, CycleMethod.NO_CYCLE,
                                      new Stop(0.0, ((Color)ledColor.get()).deriveColor(0d, 1d, 0.77, 1d)),
                                      new Stop(0.49, ((Color)ledColor.get()).deriveColor(0d, 1d, 0.5, 1d)),
                                      new Stop(1.0, ((Color)ledColor.get())));
        innerShadow.setInput(new DropShadow(BlurType.TWO_PASS_BOX, (Color)ledColor.get(), 0.36 * size, 0, 0, 0));
        ctx.setEffect(innerShadow);
        ctx.setFill(on);
        ctx.fillOval(0.14 * size, 0.14 * size, 0.72 * size, 0.72 * size);
        ctx.restore();
    } else { // off
        ctx.save();
        Paint off = new LinearGradient(0.25 * size, 0.25 * size,
                                       0.74 * size, 0.74 * size,
                                       false, CycleMethod.NO_CYCLE,
                                       new Stop(0.0, ((Color)ledColor.get()).deriveColor(0d, 1d, 0.20, 1d)),
                                       new Stop(0.49, ((Color)ledColor.get()).deriveColor(0d, 1d, 0.13, 1d)),
                                       new Stop(1.0, ((Color)ledColor.get()).deriveColor(0d, 1d, 0.2, 1d)));
        ctx.setEffect(innerShadow);
        ctx.setFill(off);
        ctx.fillOval(0.14 * size, 0.14 * size, 0.72 * size, 0.72 * size);
        ctx.restore();
    }

    //highlight
    Paint highlight = new RadialGradient(0, 0,
                                         0.3 * size, 0.3 * size,
                                         0.29 * size,
                                         false, CycleMethod.NO_CYCLE,
                                         new Stop(0.0, Color.WHITE),
                                         new Stop(1.0, Color.TRANSPARENT));
    ctx.setFill(highlight);
    ctx.fillOval(0.21 * size, 0.21 * size, 0.58 * size, 0.58 * size);
}
 
开发者ID:Simego,项目名称:FXImgurUploader,代码行数:61,代码来源:Led.java

示例7: draw

import javafx.scene.effect.InnerShadow; //导入方法依赖的package包/类
private void draw() {
    double size   = getWidth() < getHeight() ? getWidth() : getHeight();

    canvas.setWidth(size);
    canvas.setHeight(size);

    ctx.clearRect(0, 0, size, size);

    if (isFrameVisible()) { //frame
        Paint frame = new LinearGradient(0.14 * size, 0.14 * size,
                                         0.84 * size, 0.84 * size,
                                         false, CycleMethod.NO_CYCLE,
                                         new Stop(0.0, Color.rgb(20, 20, 20, 0.65)),
                                         new Stop(0.15, Color.rgb(20, 20, 20, 0.65)),
                                         new Stop(0.26, Color.rgb(41, 41, 41, 0.65)),
                                         new Stop(0.26, Color.rgb(41, 41, 41, 0.64)),
                                         new Stop(0.85, Color.rgb(200, 200, 200, 0.41)),
                                         new Stop(1.0, Color.rgb(200, 200, 200, 0.35)));
        ctx.setFill(frame);
        ctx.fillOval(0, 0, size, size);
    }

    InnerShadow innerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 0.07 * size, 0, 0, 0);
    if (isOn()) { //on
        ctx.save();
        Paint on = new LinearGradient(0.25 * size, 0.25 * size,
                                      0.74 * size, 0.74 * size,
                                      false, CycleMethod.NO_CYCLE,
                                      new Stop(0.0, ledColor.get().deriveColor(0d, 1d, 0.77, 1d)),
                                      new Stop(0.49, ledColor.get().deriveColor(0d, 1d, 0.5, 1d)),
                                      new Stop(1.0, ledColor.get()));
        innerShadow.setInput(new DropShadow(BlurType.TWO_PASS_BOX, ledColor.get(), 0.36 * size, 0, 0, 0));
        ctx.setEffect(innerShadow);
        ctx.setFill(on);
        ctx.fillOval(0.14 * size, 0.14 * size, 0.72 * size, 0.72 * size);
        ctx.restore();
    } else { // off
        ctx.save();
        Paint off = new LinearGradient(0.25 * size, 0.25 * size,
                                       0.74 * size, 0.74 * size,
                                       false, CycleMethod.NO_CYCLE,
                                       new Stop(0.0, ledColor.get().deriveColor(0d, 1d, 0.20, 1d)),
                                       new Stop(0.49, ledColor.get().deriveColor(0d, 1d, 0.13, 1d)),
                                       new Stop(1.0, ledColor.get().deriveColor(0d, 1d, 0.2, 1d)));
        ctx.setEffect(innerShadow);
        ctx.setFill(off);
        ctx.fillOval(0.14 * size, 0.14 * size, 0.72 * size, 0.72 * size);
        ctx.restore();
    }

    //highlight
    Paint highlight = new RadialGradient(0, 0,
                                         0.3 * size, 0.3 * size,
                                         0.29 * size,
                                         false, CycleMethod.NO_CYCLE,
                                         new Stop(0.0, Color.WHITE),
                                         new Stop(1.0, Color.TRANSPARENT));
    ctx.setFill(highlight);
    ctx.fillOval(0.21 * size, 0.21 * size, 0.58 * size, 0.58 * size);
}
 
开发者ID:Simego,项目名称:FXImgurUploader,代码行数:61,代码来源:Led.java


注:本文中的javafx.scene.effect.InnerShadow.setInput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。