本文整理汇总了Java中javafx.scene.effect.DropShadow.setRadius方法的典型用法代码示例。如果您正苦于以下问题:Java DropShadow.setRadius方法的具体用法?Java DropShadow.setRadius怎么用?Java DropShadow.setRadius使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.effect.DropShadow
的用法示例。
在下文中一共展示了DropShadow.setRadius方法的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);
}
示例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);
}
}
}
示例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);
}
}
}
示例4: LettersPane
import javafx.scene.effect.DropShadow; //导入方法依赖的package包/类
public LettersPane() {
setId("LettersPane");
setPrefSize(480,480);
setFocusTraversable(true);
setOnMousePressed(new EventHandler<MouseEvent>() {
@Override public void handle(MouseEvent me) {
requestFocus();
me.consume();
}
});
setOnKeyPressed(new EventHandler<KeyEvent>() {
@Override public void handle(KeyEvent ke) {
createLetter(ke.getText());
ke.consume();
}
});
// create press keys text
pressText = new Text("Press Keys");
pressText.setTextOrigin(VPos.TOP);
pressText.setFont(new Font(Font.getDefault().getFamily(), 40));
pressText.setLayoutY(5);
pressText.setFill(Color.rgb(80, 80, 80));
DropShadow effect = new DropShadow();
effect.setRadius(0);
effect.setOffsetY(1);
effect.setColor(Color.WHITE);
pressText.setEffect(effect);
getChildren().add(pressText);
}
示例5: generateElevationShadow
import javafx.scene.effect.DropShadow; //导入方法依赖的package包/类
public static DropShadow generateElevationShadow(final double elevation) {
final DropShadow dropShadow = new DropShadow();
dropShadow.setRadius(elevation * 1.0f);
dropShadow.setOffsetY(elevation / 6);
double alpha = 0.32f + elevation / 100f;
dropShadow.setColor(Color.web("rgba(0,0,0," + alpha + ")"));
return dropShadow;
}
示例6: initializeIdLabel
import javafx.scene.effect.DropShadow; //导入方法依赖的package包/类
private void initializeIdLabel() {
final Location location = controller.getLocation();
final Label idLabel = controller.idLabel;
final DropShadow ds = new DropShadow();
ds.setRadius(2);
ds.setSpread(1);
idLabel.setEffect(ds);
idLabel.textProperty().bind((location.idProperty()));
// Center align the label
idLabel.widthProperty().addListener((obsWidth, oldWidth, newWidth) -> idLabel.translateXProperty().set(newWidth.doubleValue() / -2));
idLabel.heightProperty().addListener((obsHeight, oldHeight, newHeight) -> idLabel.translateYProperty().set(newHeight.doubleValue() / -2));
final ObjectProperty<Color> color = location.colorProperty();
final ObjectProperty<Color.Intensity> colorIntensity = location.colorIntensityProperty();
// Delegate to style the label based on the color of the location
final BiConsumer<Color, Color.Intensity> updateColor = (newColor, newIntensity) -> {
idLabel.setTextFill(newColor.getTextColor(newIntensity));
ds.setColor(newColor.getColor(newIntensity));
};
updateColorDelegates.add(updateColor);
// Set the initial color
updateColor.accept(color.get(), colorIntensity.get());
// Update the color of the circle when the color of the location is updated
color.addListener((obs, old, newColor) -> updateColor.accept(newColor, colorIntensity.get()));
}
示例7: initializeClippedBackgroundImage
import javafx.scene.effect.DropShadow; //导入方法依赖的package包/类
private void initializeClippedBackgroundImage() {
DebugConsole.getDefault().info(this.getClass(), "Initialize ClippedBackgroundImage"); // NOI18N
// The ClippedBackgroundImage
final String imageName = this.getPropertyBackground(KEY__BACKGROUND__1366x768_IMAGE);
final String widthAsString = this.getPropertyBackground(KEY__BACKGROUND__1366x768_WIDTH);
final String heigthAsString = this.getPropertyBackground(KEY__BACKGROUND__1366x768_HEIGHT);
// final String imageName = this.getPropertyBackground(KEY__BACKGROUND__3840x2160_IMAGE);
// final String widthAsString = this.getPropertyBackground(KEY__BACKGROUND__3840x2160_WIDTH);
// final String heigthAsString = this.getPropertyBackground(KEY__BACKGROUND__3840x2160_HEIGHT);
final Image iClippedBackgroundImage = ResourcesFacade.getDefault().getImageLoader().loadBackground(
imageName, widthAsString, heigthAsString);
final double fitHeight = Double.parseDouble(heigthAsString);
final double fitWidth = Double.parseDouble(widthAsString);
ivClippedBackgroundImage.setFitHeight(fitHeight);
ivClippedBackgroundImage.setFitWidth(fitWidth);
ivClippedBackgroundImage.setImage(iClippedBackgroundImage);
// clip image by circle
final Circle clipCircle = new Circle(300.0d);
clipCircle.setLayoutX(fitWidth / 2);
clipCircle.setLayoutY(fitHeight / 2);
ivClippedBackgroundImage.setClip(clipCircle);
// The border for the ClippedBackgroundImage
final DropShadow dropShadow = new DropShadow();
dropShadow.setRadius(5.0);
dropShadow.setColor(Color.CORNFLOWERBLUE);
dropShadow.setSpread(0.15);
cClippedBackgroundImage.setEffect(dropShadow);
}
示例8: 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);
}
示例9: ToggleSwitch
import javafx.scene.effect.DropShadow; //导入方法依赖的package包/类
public ToggleSwitch() {
Rectangle background = new Rectangle(100, 50);
background.setArcWidth(50);
background.setArcHeight(50);
background.setFill(Color.WHITE);
background.setStroke(Color.LIGHTGRAY);
Circle trigger = new Circle(25);
trigger.setCenterX(25);
trigger.setCenterY(25);
trigger.setFill(Color.WHITE);
trigger.setStroke(Color.LIGHTGRAY);
DropShadow shadow = new DropShadow();
shadow.setRadius(2);
trigger.setEffect(shadow);
translateAnimation.setNode(trigger);
fillAnimation.setShape(background);
getChildren().addAll(background, trigger);
switchedOn.addListener((obs, oldState, newState) -> {
boolean isOn = newState.booleanValue();
translateAnimation.setToX(isOn ? 100 - 50 : 0);
fillAnimation.setFromValue(isOn ? Color.WHITE : Color.LIGHTGREEN);
fillAnimation.setToValue(isOn ? Color.LIGHTGREEN : Color.WHITE);
animation.play();
});
setOnMouseClicked(event -> {
switchedOn.set(!switchedOn.get());
});
}
示例10: ToggleSwitch
import javafx.scene.effect.DropShadow; //导入方法依赖的package包/类
ToggleSwitch(final boolean initialState, final double width, final double height) {
final Rectangle background = new Rectangle(width, height);
background.setArcWidth(height);
background.setArcHeight(height);
background.setFill(Color.WHITE);
background.setStroke(Color.LIGHTGRAY);
final Circle trigger = new Circle(height / 2);
trigger.setCenterX(height / 2);
trigger.setCenterY(height / 2);
trigger.setFill(Color.WHITE);
trigger.setStroke(Color.LIGHTGRAY);
final DropShadow shadow = new DropShadow();
shadow.setRadius(2);
trigger.setEffect(shadow);
translateAnimation.setNode(trigger);
fillAnimation.setShape(background);
translateAnimation.setFromX(0);
translateAnimation.setToX(width - height);
fillAnimation.setFromValue(Color.WHITE);
fillAnimation.setToValue(Color.LIMEGREEN);
getChildren().addAll(background, trigger);
switchedOn.addListener((obs, oldState, newState) -> {
animation.setRate(newState ? 1 : -1);
animation.play();
});
setOnMouseClicked(event -> switchedOn.set(!switchedOn.get()));
switchedOn.set(initialState);
}
示例11: ToggleSwitch
import javafx.scene.effect.DropShadow; //导入方法依赖的package包/类
public ToggleSwitch() {
Rectangle background = new Rectangle(50, 25);
background.setArcWidth(25);
background.setArcHeight(25);
background.setFill(Color.WHITE);
background.setStroke(Color.LIGHTGRAY);
Circle trigger = new Circle(12.5);
trigger.setCenterX(12.5);
trigger.setCenterY(12.5);
trigger.setFill(Color.WHITE);
trigger.setStroke(Color.LIGHTGRAY);
DropShadow shadow = new DropShadow();
shadow.setRadius(2);
trigger.setEffect(shadow);
translateAnimation.setNode(trigger);
fillAnimation.setShape(background);
getChildren().addAll(background, trigger);
switchedOn.addListener((obs, oldState, newState) -> {
boolean isOn = newState;
translateAnimation.setToX(isOn ? 50 - 25 : 0);
fillAnimation.setFromValue(isOn ? Color.WHITE : Color.LIGHTGREEN);
fillAnimation.setToValue(isOn ? Color.LIGHTGREEN : Color.WHITE);
animation.play();
});
setOnMouseClicked(event -> {
switchedOn.set(!switchedOn.get());
});
}
示例12: 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;
}
示例13: 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);
}
示例14: LettersPane
import javafx.scene.effect.DropShadow; //导入方法依赖的package包/类
public LettersPane() {
System.out.println("font ::: " + defaultFont);
System.out.println("family ::: " + family);
setId("LettersPane");
setPrefSize(480, 480);
setFocusTraversable(true);
setOnMousePressed(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent me) {
requestFocus();
me.consume();
}
});
// new Thread(() -> {
// Scanner scan = new Scanner(System.in);
// while (scan.hasNext()) {
// createLetter(scan.nextLine());
// }
// }).start();
// setOnKeyReleased(ke -> {
//
// // System.out.println(ke.getCharacter());
// System.out.println(ke.getText());
// createLetter(ke.getText());
// ke.consume();
// });
setOnKeyPressed(ke -> {
System.out.println(ke.getCharacter());
System.out.println(ke.getText());
createLetter(ke.getText());
ke.consume();
});
// create press keys text
pressText = new Text("Press Keys");
pressText.setTextOrigin(VPos.TOP);
pressText.setFont(new Font(family, 40));
pressText.setLayoutY(5);
pressText.setFill(Color.rgb(80, 80, 80));
DropShadow effect = new DropShadow();
effect.setRadius(0);
effect.setOffsetY(1);
effect.setColor(Color.WHITE);
pressText.setEffect(effect);
getChildren().add(pressText);
}
示例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);
}
}
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);
}