本文整理了Java中javafx.scene.Node.setEffect()
方法的一些代码示例,展示了Node.setEffect()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.setEffect()
方法的具体详情如下:
包路径:javafx.scene.Node
类名称:Node
方法名:setEffect
暂无
代码示例来源:origin: jfoenixadmin/JFoenix
public static void pop(Node control) {
control.setEffect(new DropShadow(BlurType.GAUSSIAN, Color.rgb(0, 0, 0, 0.26), 5, 0.05, 0, 1));
}
代码示例来源:origin: jfoenixadmin/JFoenix
/**
* 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()));
}
代码示例来源:origin: jfoenixadmin/JFoenix
level = level < 0 ? 0 : level;
level = level > 5 ? 5 : level;
container.setEffect(new DropShadow(BlurType.GAUSSIAN,
depth[level].getColor(),
depth[level].getRadius(),
代码示例来源:origin: stackoverflow.com
for(int i=0;i<30;i++){
Node seat = seats[i];
seat.setOnMouseClicked(e->{
seat.setEffect(lighting);
});
}
代码示例来源:origin: stackoverflow.com
private final Glow glow = new Glow(.8);
private void setupHover(XYChart.Series<String, Number> series) {
for (final XYChart.Data<String, Number> dt : series.getData()) {
final Node n = dt.getNode();
n.setEffect(null);
n.setOnMouseEntered(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent e) {
n.setEffect(glow);
}
});
n.setOnMouseExited(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent e) {
n.setEffect(null);
}
});
n.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent e) {
System.out.println("openDetailsScreen(<selected Bar>)");
System.out.println(dt.getXValue() + " : " + dt.getYValue());
}
});
}
}
代码示例来源:origin: com.jfoenix/jfoenix
public static void pop(Node control) {
control.setEffect(new DropShadow(BlurType.GAUSSIAN, Color.rgb(0, 0, 0, 0.26), 5, 0.05, 0, 1));
}
代码示例来源:origin: com.github.giulianini.jestures/jestures
/**
* Blur in depth.
*
* @param node
* the root node
* @param blur
* the {@link GaussianBlur}
*/
public static void blurDeeply(final Node node, final GaussianBlur blur) {
node.setEffect(blur);
if (node instanceof Parent) {
final Parent parent = (Parent) node;
final ObservableList<Node> children = parent.getChildrenUnmodifiable();
for (final Node child : children) {
ViewUtilities.blurDeeply(child, blur);
}
}
}
代码示例来源:origin: com.aquafx-project/aquafx
private void setDropShadow() {
for (Node child : getChildren()) {
if (child.getStyleClass().get(0).equals("box")) {
child.setEffect(new Shadow(false));
}
}
}
代码示例来源:origin: com.aquafx-project/aquafx
private void setDropShadow() {
for (Node child : getChildren()) {
if (child.getStyleClass().get(0).equals("radio")) {
child.setEffect(new Shadow(false));
}
}
}
代码示例来源:origin: com.aquafx-project/aquafx
@Override protected void handleControlPropertyChanged(String p) {
super.handleControlPropertyChanged(p);
if (p == "FOCUSED") {
if (getSkinnable().isFocused()) {
setFocusBorder();
} else {
for (Node child : getChildren()) {
if (child.getStyleClass().get(0).equals("thumb")) {
child.setEffect(null);
}
}
}
}
}
代码示例来源:origin: com.jfoenix/jfoenix
/**
* 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()));
}
代码示例来源:origin: com.jfoenix/jfoenix
level = level < 0 ? 0 : level;
level = level > 5 ? 5 : level;
container.setEffect(new DropShadow(BlurType.GAUSSIAN,
depth[level].getColor(),
depth[level].getRadius(),
代码示例来源:origin: com.aquafx-project/aquafx
private void setFocusBorder() {
getFocusBorder().setInnerFocusColor((Color) innerFocusColorProperty().get());
getFocusBorder().setColor((Color) outerFocusColorProperty().get());
for (Node child : getChildren()) {
if (child.getStyleClass().get(0).equals("thumb")) {
child.setEffect(getFocusBorder());
getSkinnable().impl_reapplyCSS();
}
}
}
代码示例来源:origin: com.aquafx-project/aquafx
private void setFocusBorder() {
getFocusBorder().setInnerFocusColor((Color) innerFocusColorProperty().get());
getFocusBorder().setColor((Color) outerFocusColorProperty().get());
for (Node child : getChildren()) {
if (child instanceof StackPane) {
child.setEffect(getFocusBorder());
}
}
}
代码示例来源:origin: stackoverflow.com
@Override
public void handle(MouseEvent arg0) {
node.setEffect(ds);
node.setCursor(Cursor.HAND);
lbl.setText("X-value=" + data.getXValue().toString() + "\nY-value=" + data.getYValue().toString());
@Override
public void handle(MouseEvent arg0) {
node.setEffect(null);
node.setCursor(Cursor.DEFAULT);
lbl.setText("");
代码示例来源:origin: stackoverflow.com
node.setEffect(ds);
node.setCursor(Cursor.HAND);
node.setEffect(null);
node.setCursor(Cursor.DEFAULT);
代码示例来源:origin: stackoverflow.com
caption.setText(String.valueOf(data.getPieValue()) + "%");
caption.setVisible(true);
node.setEffect(new Glow());
public void handle(MouseEvent e) {
caption.setVisible(false);
node.setEffect(null);
代码示例来源:origin: com.aquafx-project/aquafx
private void setSelectedFocusBorder() {
InnerShadow innerFocus = new InnerShadow();
innerFocus.setColor((Color) innerFocusColorProperty().get());
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) outerFocusColorProperty().get());
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);
}
}
}
代码示例来源:origin: com.aquafx-project/aquafx
private void setFocusBorder() {
InnerShadow innerFocus = new InnerShadow();
innerFocus.setColor((Color) innerFocusColorProperty().get());
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) outerFocusColorProperty().get());
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);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!