本文整理汇总了Java中javafx.scene.effect.InnerShadow类的典型用法代码示例。如果您正苦于以下问题:Java InnerShadow类的具体用法?Java InnerShadow怎么用?Java InnerShadow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InnerShadow类属于javafx.scene.effect包,在下文中一共展示了InnerShadow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initGraphics
import javafx.scene.effect.InnerShadow; //导入依赖的package包/类
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);
}
示例2: InnerShadowSample
import javafx.scene.effect.InnerShadow; //导入依赖的package包/类
public InnerShadowSample() {
Text sample = new Text(0,100,"Shadow");
sample.setFont(Font.font("Arial Black",80));
sample.setFill(Color.web("#BBBBBB"));
final InnerShadow innerShadow = new InnerShadow();
innerShadow.setRadius(5d);
innerShadow.setOffsetX(2);
innerShadow.setOffsetY(2);
sample.setEffect(innerShadow);
getChildren().add(sample);
// REMOVE ME
setControls(
new SimplePropertySheet.PropDesc("Text Fill", sample.fillProperty()),
new SimplePropertySheet.PropDesc("Inner Shadow Radius", innerShadow.radiusProperty(), 0d,60d),
new SimplePropertySheet.PropDesc("Inner Shadow Offset X", innerShadow.offsetXProperty(), -10d, 10d),
new SimplePropertySheet.PropDesc("Inner Shadow Offset Y", innerShadow.offsetYProperty(), -10d, 10d),
new SimplePropertySheet.PropDesc("Inner Shadow Color", innerShadow.colorProperty())
);
// END REMOVE ME
}
示例3: updateChordOutlines
import javafx.scene.effect.InnerShadow; //导入依赖的package包/类
/**
* Updates all the chord cues (suggested chords and chord indicator).
*/
public void updateChordOutlines() {
//Reset border and pressed.
chordButtons.forEach((c, btn) ->
{
if (c == getChord())
btn.setEffect(new InnerShadow(10, Color.RED));
else
btn.setEffect(null);
btn.setBorder(new Color(0, 0, 0, 0), 3);
});
//Outline the suggested chords
ChordProgressionHelper.getPossibleChordProgressions(getChord()).forEach((c, strength) ->
chordButtons.get(c).setBorder(new Color(1, 0.843, 0, strength / 3 + 0.5), strength * 2 + 2));
}
示例4: FocusBorder
import javafx.scene.effect.InnerShadow; //导入依赖的package包/类
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);
}
示例5: setSelectedFocusBorder
import javafx.scene.effect.InnerShadow; //导入依赖的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);
}
}
}
示例6: setFocusBorder
import javafx.scene.effect.InnerShadow; //导入依赖的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);
}
}
}
示例7: initGraphics
import javafx.scene.effect.InnerShadow; //导入依赖的package包/类
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);
}
示例8: initGraphics
import javafx.scene.effect.InnerShadow; //导入依赖的package包/类
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);
}
示例9: initGraphics
import javafx.scene.effect.InnerShadow; //导入依赖的package包/类
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);
}
示例10: Clock
import javafx.scene.effect.InnerShadow; //导入依赖的package包/类
public Clock(Color onColor, Color offColor) {
// create effect for on LEDs
Glow onEffect = new Glow(1.7f);
onEffect.setInput(new InnerShadow());
// create effect for on dot LEDs
Glow onDotEffect = new Glow(1.7f);
onDotEffect.setInput(new InnerShadow(5,Color.BLACK));
// create effect for off LEDs
InnerShadow offEffect = new InnerShadow();
// create digits
digits = new Digit[7];
for (int i = 0; i < 6; i++) {
Digit digit = new Digit(onColor, offColor, onEffect, offEffect);
digit.setLayoutX(i * 80 + ((i + 1) % 2) * 20);
digits[i] = digit;
getChildren().add(digit);
}
// create dots
Group dots = new Group(
new Circle(80 + 54 + 20, 44, 6, onColor),
new Circle(80 + 54 + 17, 64, 6, onColor),
new Circle((80 * 3) + 54 + 20, 44, 6, onColor),
new Circle((80 * 3) + 54 + 17, 64, 6, onColor));
dots.setEffect(onDotEffect);
getChildren().add(dots);
// update digits to current time and start timer to update every second
refreshClocks();
play();
}
示例11: Clock
import javafx.scene.effect.InnerShadow; //导入依赖的package包/类
public Clock(Color onColor, Color offColor) {
// create effect for on LEDs
Glow onEffect = new Glow(1.7f);
onEffect.setInput(new InnerShadow());
// create effect for on dot LEDs
Glow onDotEffect = new Glow(1.7f);
onDotEffect.setInput(new InnerShadow(5,Color.BLACK));
// create effect for off LEDs
InnerShadow offEffect = new InnerShadow();
// create digits
digits = new Digit[7];
for (int i = 0; i < 6; i++) {
Digit digit = new Digit(onColor, offColor, onEffect, offEffect);
digit.setLayoutX(i * 80 + ((i + 1) % 2) * 20);
digits[i] = digit;
getChildren().add(digit);
}
// create dots
Group dots = new Group(
new Circle(80 + 54 + 20, 44, 6, onColor),
new Circle(80 + 54 + 17, 64, 6, onColor),
new Circle((80 * 3) + 54 + 20, 44, 6, onColor),
new Circle((80 * 3) + 54 + 17, 64, 6, onColor));
dots.setEffect(onDotEffect);
getChildren().add(dots);
// update digits to current time and start timer to update every second
refreshClocks();
}
示例12: createIconContent
import javafx.scene.effect.InnerShadow; //导入依赖的package包/类
public static Node createIconContent() {
Text sample = new Text("FX");
sample.setFont(Font.font(Font.getDefault().getFamily(), FontWeight.BOLD,80));
sample.setStyle("-fx-font-size: 80px;");
sample.setFill(Color.web("#aaaaaa"));
final InnerShadow innerShadow = new InnerShadow();
innerShadow.setRadius(4);
innerShadow.setOffsetX(1);
innerShadow.setOffsetY(1);
innerShadow.setColor(Color.web("#333333"));
sample.setEffect(innerShadow);
return sample;
}
示例13: addNumericValidation
import javafx.scene.effect.InnerShadow; //导入依赖的package包/类
public static void addNumericValidation(TextField textField, int maxValue) {
textField.textProperty().addListener(new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
if (isOk(newValue, maxValue)) {
textField.setStyle(null); // reset
textField.setEffect(null); // reset
} else {
textField.setStyle("-fx-focus-color: #f25f29; -fx-faint-focus-color: #f25f2933;"); // Red focus
textField.setEffect(new InnerShadow(3, new Color(1, 0, 0, 1))); // Red highlight
}
}
});
}
示例14: CurveCable
import javafx.scene.effect.InnerShadow; //导入依赖的package包/类
public CurveCable() {
super();
setId(UUID.randomUUID().toString());
// Modify the control points as the coordinate of the curve change
startXProperty().addListener((observable, oldValue, newValue) -> {
computeHangPoint();
});
startYProperty().addListener((observable, oldValue, newValue) -> {
computeHangPoint();
});
endXProperty().addListener((observable, oldValue, newValue) -> {
computeHangPoint();
});
endYProperty().addListener((observable, oldValue, newValue) -> {
computeHangPoint();
});
// Add a context menu to the plug
setOnMouseClicked(new ContextMenuHandler(this));
setStrokeWidth(7.5);
setStrokeLineCap(StrokeLineCap.ROUND);
setFill(null);
setColor(Color.RED);
setEffect(new InnerShadow());
autosize();
addEventFilter(MouseEvent.MOUSE_DRAGGED, mouseEvent -> moveCable(mouseEvent));
}
示例15: setStyle
import javafx.scene.effect.InnerShadow; //导入依赖的package包/类
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);
}