當前位置: 首頁>>代碼示例>>Java>>正文


Java DropShadow.setBlurType方法代碼示例

本文整理匯總了Java中javafx.scene.effect.DropShadow.setBlurType方法的典型用法代碼示例。如果您正苦於以下問題:Java DropShadow.setBlurType方法的具體用法?Java DropShadow.setBlurType怎麽用?Java DropShadow.setBlurType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.effect.DropShadow的用法示例。


在下文中一共展示了DropShadow.setBlurType方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: Toast

import javafx.scene.effect.DropShadow; //導入方法依賴的package包/類
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);
}
 
開發者ID:linchaolong,項目名稱:ApkToolPlus,代碼行數:18,代碼來源:Toast.java

示例2: setSelectedFocusBorder

import javafx.scene.effect.DropShadow; //導入方法依賴的package包/類
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);
        }
    }
}
 
開發者ID:cis422s14team5,項目名稱:WatchlistPro,代碼行數:25,代碼來源:AquaCheckBoxSkin.java

示例3: setFocusBorder

import javafx.scene.effect.DropShadow; //導入方法依賴的package包/類
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);
        }
    }
}
 
開發者ID:cis422s14team5,項目名稱:WatchlistPro,代碼行數:25,代碼來源:AquaCheckBoxSkin.java

示例4: setStyle

import javafx.scene.effect.DropShadow; //導入方法依賴的package包/類
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);
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:12,代碼來源:ControlsCssStylesFactory.java

示例5: createDropShadow

import javafx.scene.effect.DropShadow; //導入方法依賴的package包/類
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;
}
 
開發者ID:khasang,項目名稱:Cachoeira,代碼行數:9,代碼來源:MaterialButton.java

示例6: configure

import javafx.scene.effect.DropShadow; //導入方法依賴的package包/類
@Override
protected void configure() {
	// Invisble at first.
	setVisible(false);

	dropShadow = new DropShadow();
	dropShadow.setSpread(1);
	dropShadow.setBlurType(BlurType.GAUSSIAN);

	// Brightness effect.
	spriteImage.setEffect(dropShadow);
}
 
開發者ID:ipfaffen,項目名稱:prishonor,代碼行數:13,代碼來源:ElementPortal.java

示例7: configure

import javafx.scene.effect.DropShadow; //導入方法依賴的package包/類
@Override
protected void configure() {
	dropShadow = new DropShadow();
	dropShadow.setSpread(1);
	dropShadow.setBlurType(BlurType.GAUSSIAN);

	// Brightness effect.
	spriteImage.setEffect(dropShadow);
}
 
開發者ID:ipfaffen,項目名稱:prishonor,代碼行數:10,代碼來源:ElementExplosion.java

示例8: initGraphics

import javafx.scene.effect.DropShadow; //導入方法依賴的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

示例9: initGraphics

import javafx.scene.effect.DropShadow; //導入方法依賴的package包/類
@Override protected void initGraphics() {
    // Set initial size
    if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 ||
        Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) {
        if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) {
            clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight());
        } else {
            clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }

    sectionsAndAreasCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    sectionsAndAreasCtx    = sectionsAndAreasCanvas.getGraphicsContext2D();

    tickCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    tickCtx    = tickCanvas.getGraphicsContext2D();

    alarmPane = new Pane();

    hour  = new Rectangle(3, 60);
    hour.setArcHeight(3);
    hour.setArcWidth(3);
    hour.setStroke(null);
    hour.setFill(clock.getHourColor());
    hour.getTransforms().setAll(hourRotate);

    minute = new Rectangle(3, 96);
    minute.setArcHeight(3);
    minute.setArcWidth(3);
    minute.setStroke(null);
    minute.setFill(clock.getMinuteColor());
    minute.getTransforms().setAll(minuteRotate);

    second = new Path();
    second.setFillRule(FillRule.EVEN_ODD);
    second.setStroke(null);
    second.setFill(clock.getSecondColor());
    second.getTransforms().setAll(secondRotate);
    enableNode(second, clock.isSecondsVisible());

    dropShadow = new DropShadow();
    dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
    dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
    dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
    dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);

    knob = new Circle(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, 4.5);
    knob.setStroke(null);
    knob.setFill(clock.getKnobColor());
    knob.setEffect(dropShadow);

    shadowGroupHour   = new Group(hour);
    shadowGroupMinute = new Group(minute);
    shadowGroupSecond = new Group(second);

    shadowGroupHour.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
    shadowGroupMinute.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
    shadowGroupSecond.setEffect(clock.getShadowsEnabled() ? dropShadow : null);

    title = new Text("");
    title.setVisible(clock.isTitleVisible());
    title.setManaged(clock.isTitleVisible());

    text = new Text("");
    text.setVisible(clock.isTextVisible());
    text.setManaged(clock.isTextVisible());

    pane = new Pane(sectionsAndAreasCanvas, tickCanvas, alarmPane, title, text, shadowGroupHour, shadowGroupMinute, shadowGroupSecond, knob);
    pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth()))));
    pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));

    getChildren().setAll(pane);
}
 
開發者ID:HanSolo,項目名稱:Medusa,代碼行數:74,代碼來源:DBClockSkin.java

示例10: initGraphics

import javafx.scene.effect.DropShadow; //導入方法依賴的package包/類
@Override protected void initGraphics() {
    // Set initial size
    if (Double.compare(getSkinnable().getPrefWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getPrefHeight(), 0.0) <= 0 ||
        Double.compare(getSkinnable().getWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getHeight(), 0.0) <= 0) {
        if (getSkinnable().getPrefWidth() > 0 && getSkinnable().getPrefHeight() > 0) {
            getSkinnable().setPrefSize(getSkinnable().getPrefWidth(), getSkinnable().getPrefHeight());
        } else {
            getSkinnable().setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }

    sectionsAndAreasCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    sectionsAndAreasCtx    = sectionsAndAreasCanvas.getGraphicsContext2D();

    tickCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    tickCtx    = tickCanvas.getGraphicsContext2D();

    alarmPane = new Pane();

    hour = new Rectangle(3, 60);
    hour.setArcHeight(3);
    hour.setArcWidth(3);
    hour.setStroke(getSkinnable().getHourColor());
    hour.getTransforms().setAll(hourRotate);

    minute = new Rectangle(3, 96);
    minute.setArcHeight(3);
    minute.setArcWidth(3);
    minute.setStroke(getSkinnable().getMinuteColor());
    minute.getTransforms().setAll(minuteRotate);

    second = new Rectangle(1, 96);
    second.setArcHeight(1);
    second.setArcWidth(1);
    second.setStroke(getSkinnable().getSecondColor());
    second.getTransforms().setAll(secondRotate);
    second.setVisible(getSkinnable().isSecondsVisible());
    second.setManaged(getSkinnable().isSecondsVisible());

    knob = new Circle(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, 4.5);
    knob.setStroke(Color.web("#282a3280"));

    dropShadow = new DropShadow();
    dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
    dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
    dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
    dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);

    shadowGroupHour   = new Group(hour);
    shadowGroupMinute = new Group(minute);
    shadowGroupSecond = new Group(second, knob);

    shadowGroupHour.setEffect(getSkinnable().getShadowsEnabled() ? dropShadow : null);
    shadowGroupMinute.setEffect(getSkinnable().getShadowsEnabled() ? dropShadow : null);
    shadowGroupSecond.setEffect(getSkinnable().getShadowsEnabled() ? dropShadow : null);

    title = new Text("");
    title.setVisible(getSkinnable().isTitleVisible());
    title.setManaged(getSkinnable().isTitleVisible());

    dateText = new Text("");
    dateText.setVisible(getSkinnable().isDateVisible());
    dateText.setManaged(getSkinnable().isDateVisible());

    text = new Text("");
    text.setVisible(getSkinnable().isTextVisible());
    text.setManaged(getSkinnable().isTextVisible());

    pane = new Pane(sectionsAndAreasCanvas, tickCanvas, alarmPane, title, dateText, text, shadowGroupHour, shadowGroupMinute, shadowGroupSecond);
    pane.setBorder(new Border(new BorderStroke(getSkinnable().getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(getSkinnable().getBorderWidth()))));
    pane.setBackground(new Background(new BackgroundFill(getSkinnable().getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));

    getChildren().setAll(pane);
}
 
開發者ID:HanSolo,項目名稱:Medusa,代碼行數:75,代碼來源:ClockSkin.java

示例11: initGraphics

import javafx.scene.effect.DropShadow; //導入方法依賴的package包/類
@Override protected void initGraphics() {
    // Set initial size
    if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 ||
        Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) {
        if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) {
            clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight());
        } else {
            clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }

    sectionsAndAreasCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    sectionsAndAreasCtx    = sectionsAndAreasCanvas.getGraphicsContext2D();

    tickCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    tickCtx    = tickCanvas.getGraphicsContext2D();

    alarmPane = new Pane();

    hour  = new Path();
    hour.setFillRule(FillRule.EVEN_ODD);
    hour.setStroke(null);
    hour.setFill(clock.getHourColor());
    hour.getTransforms().setAll(hourRotate);

    minute = new Path();
    minute.setFillRule(FillRule.EVEN_ODD);
    minute.setStroke(null);
    minute.setFill(clock.getMinuteColor());
    minute.getTransforms().setAll(minuteRotate);

    dropShadow = new DropShadow();
    dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
    dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
    dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
    dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);

    shadowGroup = new Group(hour, minute);
    shadowGroup.setEffect(clock.getShadowsEnabled() ? dropShadow : null);

    title = new Text("");
    title.setVisible(clock.isTitleVisible());
    title.setManaged(clock.isTitleVisible());

    dateText = new Text("");
    dateText.setVisible(clock.isDateVisible());
    dateText.setManaged(clock.isDateVisible());

    text = new Text("");
    text.setVisible(clock.isTextVisible());
    text.setManaged(clock.isTextVisible());

    pane = new Pane(sectionsAndAreasCanvas, tickCanvas, alarmPane, title, dateText, text, shadowGroup);
    pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth()))));
    pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));

    getChildren().setAll(pane);
}
 
開發者ID:HanSolo,項目名稱:Medusa,代碼行數:59,代碼來源:FatClockSkin.java

示例12: initGraphics

import javafx.scene.effect.DropShadow; //導入方法依賴的package包/類
@Override protected void initGraphics() {
    // Set initial size
    if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 ||
        Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) {
        if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) {
            clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight());
        } else {
            clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }

    sectionsAndAreasCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    sectionsAndAreasCtx    = sectionsAndAreasCanvas.getGraphicsContext2D();

    tickCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    tickCtx    = tickCanvas.getGraphicsContext2D();

    alarmPane = new Pane();

    hour  = new Path();
    hour.setFillRule(FillRule.EVEN_ODD);
    hour.setStroke(null);
    hour.getTransforms().setAll(hourRotate);

    minute = new Path();
    minute.setFillRule(FillRule.EVEN_ODD);
    minute.setStroke(null);
    minute.getTransforms().setAll(minuteRotate);

    second = new Path();
    second.setFillRule(FillRule.EVEN_ODD);
    second.setStroke(null);
    second.getTransforms().setAll(secondRotate);
    second.setVisible(clock.isSecondsVisible());
    second.setManaged(clock.isSecondsVisible());

    dropShadow = new DropShadow();
    dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
    dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
    dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
    dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);

    shadowGroupHour   = new Group(hour);
    shadowGroupMinute = new Group(minute);
    shadowGroupSecond = new Group(second);

    shadowGroupHour.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
    shadowGroupMinute.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
    shadowGroupSecond.setEffect(clock.getShadowsEnabled() ? dropShadow : null);

    title = new Text("");
    title.setVisible(clock.isTitleVisible());
    title.setManaged(clock.isTitleVisible());

    dateText = new Text("");
    dateText.setVisible(clock.isDateVisible());
    dateText.setManaged(clock.isDateVisible());

    dateNumber = new Text("");
    dateNumber.setVisible(clock.isDateVisible());
    dateNumber.setManaged(clock.isDateVisible());

    text = new Text("");
    text.setVisible(clock.isTextVisible());
    text.setManaged(clock.isTextVisible());

    pane = new Pane(sectionsAndAreasCanvas, tickCanvas, alarmPane, title, dateText, dateNumber, text, shadowGroupHour, shadowGroupMinute, shadowGroupSecond);
    pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth()))));
    pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));

    getChildren().setAll(pane);
}
 
開發者ID:HanSolo,項目名稱:Medusa,代碼行數:73,代碼來源:PearClockSkin.java

示例13: initGraphics

import javafx.scene.effect.DropShadow; //導入方法依賴的package包/類
@Override protected void initGraphics() {
    // Set initial size
    if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 ||
        Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) {
        if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) {
            clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight());
        } else {
            clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }

    sectionsAndAreasCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    sectionsAndAreasCtx    = sectionsAndAreasCanvas.getGraphicsContext2D();

    tickCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    tickCtx    = tickCanvas.getGraphicsContext2D();

    alarmPane = new Pane();

    hour  = new Path();
    hour.setFillRule(FillRule.EVEN_ODD);
    hour.setStroke(null);
    hour.getTransforms().setAll(hourRotate);

    minute = new Path();
    minute.setFillRule(FillRule.EVEN_ODD);
    minute.setStroke(null);
    minute.getTransforms().setAll(minuteRotate);

    second = new Path();
    second.setFillRule(FillRule.EVEN_ODD);
    second.setStroke(null);
    second.getTransforms().setAll(secondRotate);
    second.setVisible(clock.isSecondsVisible());
    second.setManaged(clock.isSecondsVisible());

    centerDot = new Circle();
    centerDot.setFill(Color.WHITE);

    dropShadow = new DropShadow();
    dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
    dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
    dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
    dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);

    shadowGroupHour   = new Group(hour);
    shadowGroupMinute = new Group(minute);
    shadowGroupSecond = new Group(second);

    shadowGroupHour.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
    shadowGroupMinute.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
    shadowGroupSecond.setEffect(clock.getShadowsEnabled() ? dropShadow : null);

    title = new Text("");
    title.setVisible(clock.isTitleVisible());
    title.setManaged(clock.isTitleVisible());

    dateText = new Text("");
    dateText.setVisible(clock.isDateVisible());
    dateText.setManaged(clock.isDateVisible());

    dateNumber = new Text("");
    dateNumber.setVisible(clock.isDateVisible());
    dateNumber.setManaged(clock.isDateVisible());

    text = new Text("");
    text.setVisible(clock.isTextVisible());
    text.setManaged(clock.isTextVisible());

    pane = new Pane(sectionsAndAreasCanvas, tickCanvas, alarmPane, title, dateText, dateNumber, text, shadowGroupMinute, shadowGroupHour, shadowGroupSecond, centerDot);
    pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth()))));
    pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));

    getChildren().setAll(pane);
}
 
開發者ID:HanSolo,項目名稱:Medusa,代碼行數:76,代碼來源:IndustrialClockSkin.java

示例14: initGraphics

import javafx.scene.effect.DropShadow; //導入方法依賴的package包/類
@Override protected void initGraphics() {
    // Set initial size
    if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 ||
        Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) {
        if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) {
            clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight());
        } else {
            clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }

    sectionsAndAreasCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    sectionsAndAreasCtx    = sectionsAndAreasCanvas.getGraphicsContext2D();

    tickCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
    tickCtx    = tickCanvas.getGraphicsContext2D();

    alarmPane = new Pane();

    hour  = new Path();
    hour.setFillRule(FillRule.EVEN_ODD);
    hour.setStroke(null);
    hour.getTransforms().setAll(hourRotate);

    minute = new Path();
    minute.setFillRule(FillRule.EVEN_ODD);
    minute.setStroke(null);
    minute.getTransforms().setAll(minuteRotate);

    second = new Path();
    second.setFillRule(FillRule.EVEN_ODD);
    second.setStroke(null);
    second.getTransforms().setAll(secondRotate);
    second.setVisible(clock.isSecondsVisible());
    second.setManaged(clock.isSecondsVisible());

    knob = new Circle(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.0148448);
    knob.setStroke(null);

    dropShadow = new DropShadow();
    dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
    dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
    dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
    dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);

    shadowGroupHour   = new Group(hour);
    shadowGroupMinute = new Group(minute);
    shadowGroupSecond = new Group(second, knob);

    shadowGroupHour.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
    shadowGroupMinute.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
    shadowGroupSecond.setEffect(clock.getShadowsEnabled() ? dropShadow : null);

    title = new Text("");
    title.setVisible(clock.isTitleVisible());
    title.setManaged(clock.isTitleVisible());

    dateNumber = new Text("");
    dateNumber.setVisible(clock.isDateVisible());
    dateNumber.setManaged(clock.isDateVisible());

    text = new Text("");
    text.setVisible(clock.isTextVisible());
    text.setManaged(clock.isTextVisible());

    pane = new Pane(sectionsAndAreasCanvas, tickCanvas, alarmPane, title, dateNumber, text, shadowGroupHour, shadowGroupMinute, shadowGroupSecond);
    pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth()))));
    pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));

    getChildren().setAll(pane);
}
 
開發者ID:HanSolo,項目名稱:Medusa,代碼行數:72,代碼來源:PlainClockSkin.java

示例15: initGraphics

import javafx.scene.effect.DropShadow; //導入方法依賴的package包/類
@Override protected void initGraphics() {
    // Set initial size
    if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 ||
        Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) {
        if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) {
            clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight());
        } else {
            clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }

    minuteTickMarks = new Path();
    minuteTickMarks.setFillRule(FillRule.EVEN_ODD);
    minuteTickMarks.setFill(null);
    minuteTickMarks.setStroke(clock.getMinuteColor());
    minuteTickMarks.setStrokeLineCap(StrokeLineCap.ROUND);

    hourTickMarks = new Path();
    hourTickMarks.setFillRule(FillRule.EVEN_ODD);
    hourTickMarks.setFill(null);
    hourTickMarks.setStroke(clock.getHourColor());
    hourTickMarks.setStrokeLineCap(StrokeLineCap.ROUND);

    hour = new Rectangle(3, 60);
    hour.setArcHeight(3);
    hour.setArcWidth(3);
    hour.setStroke(clock.getHourColor());
    hour.getTransforms().setAll(hourRotate);

    minute = new Rectangle(3, 96);
    minute.setArcHeight(3);
    minute.setArcWidth(3);
    minute.setStroke(clock.getMinuteColor());
    minute.getTransforms().setAll(minuteRotate);

    second = new Rectangle(1, 96);
    second.setArcHeight(1);
    second.setArcWidth(1);
    second.setStroke(clock.getSecondColor());
    second.getTransforms().setAll(secondRotate);
    second.setVisible(clock.isSecondsVisible());
    second.setManaged(clock.isSecondsVisible());

    knob = new Circle(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, 4.5);
    knob.setStroke(Color.web("#282a3280"));

    dropShadow = new DropShadow();
    dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
    dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
    dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
    dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);

    shadowGroupHour   = new Group(hour);
    shadowGroupMinute = new Group(minute);
    shadowGroupSecond = new Group(second, knob);

    shadowGroupHour.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
    shadowGroupMinute.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
    shadowGroupSecond.setEffect(clock.getShadowsEnabled() ? dropShadow : null);

    title = new Text("");
    title.setTextOrigin(VPos.TOP);
    Helper.enableNode(title, clock.isTitleVisible());

    amPmText = new Text(clock.getTime().get(ChronoField.AMPM_OF_DAY) == 0 ? "AM" : "PM");

    dateText = new Text("");
    Helper.enableNode(dateText, clock.isDateVisible());

    text = new Text("");
    Helper.enableNode(text, clock.isTextVisible());

    pane = new Pane(hourTickMarks, minuteTickMarks, title, amPmText, dateText, text, shadowGroupHour, shadowGroupMinute, shadowGroupSecond);
    pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(PREFERRED_WIDTH * 0.025), new BorderWidths(clock.getBorderWidth()))));
    pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(PREFERRED_WIDTH * 0.025), Insets.EMPTY)));

    getChildren().setAll(pane);
}
 
開發者ID:HanSolo,項目名稱:Medusa,代碼行數:79,代碼來源:TileClockSkin.java


注:本文中的javafx.scene.effect.DropShadow.setBlurType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。