javafx.scene.Node.setEffect()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(208)

本文整理了Java中javafx.scene.Node.setEffect()方法的一些代码示例,展示了Node.setEffect()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.setEffect()方法的具体详情如下:
包路径:javafx.scene.Node
类名称:Node
方法名:setEffect

Node.setEffect介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

  1. public static void pop(Node control) {
  2. control.setEffect(new DropShadow(BlurType.GAUSSIAN, Color.rgb(0, 0, 0, 0.26), 5, 0.05, 0, 1));
  3. }

代码示例来源:origin: jfoenixadmin/JFoenix

  1. /**
  2. * this method is used to add shadow effect to the node,
  3. * however the shadow is not real ( gets affected with node transformations)
  4. * <p>
  5. * use {@link #createMaterialNode(Node, int)} instead to generate a real shadow
  6. */
  7. public static void setDepth(Node control, int level) {
  8. level = level < 0 ? 0 : level;
  9. level = level > 5 ? 5 : level;
  10. control.setEffect(new DropShadow(BlurType.GAUSSIAN,
  11. depth[level].getColor(),
  12. depth[level].getRadius(),
  13. depth[level].getSpread(),
  14. depth[level].getOffsetX(),
  15. depth[level].getOffsetY()));
  16. }

代码示例来源:origin: jfoenixadmin/JFoenix

  1. level = level < 0 ? 0 : level;
  2. level = level > 5 ? 5 : level;
  3. container.setEffect(new DropShadow(BlurType.GAUSSIAN,
  4. depth[level].getColor(),
  5. depth[level].getRadius(),

代码示例来源:origin: stackoverflow.com

  1. for(int i=0;i<30;i++){
  2. Node seat = seats[i];
  3. seat.setOnMouseClicked(e->{
  4. seat.setEffect(lighting);
  5. });
  6. }

代码示例来源:origin: stackoverflow.com

  1. private final Glow glow = new Glow(.8);
  2. private void setupHover(XYChart.Series<String, Number> series) {
  3. for (final XYChart.Data<String, Number> dt : series.getData()) {
  4. final Node n = dt.getNode();
  5. n.setEffect(null);
  6. n.setOnMouseEntered(new EventHandler<MouseEvent>() {
  7. @Override
  8. public void handle(MouseEvent e) {
  9. n.setEffect(glow);
  10. }
  11. });
  12. n.setOnMouseExited(new EventHandler<MouseEvent>() {
  13. @Override
  14. public void handle(MouseEvent e) {
  15. n.setEffect(null);
  16. }
  17. });
  18. n.setOnMouseClicked(new EventHandler<MouseEvent>() {
  19. @Override
  20. public void handle(MouseEvent e) {
  21. System.out.println("openDetailsScreen(<selected Bar>)");
  22. System.out.println(dt.getXValue() + " : " + dt.getYValue());
  23. }
  24. });
  25. }
  26. }

代码示例来源:origin: com.jfoenix/jfoenix

  1. public static void pop(Node control) {
  2. control.setEffect(new DropShadow(BlurType.GAUSSIAN, Color.rgb(0, 0, 0, 0.26), 5, 0.05, 0, 1));
  3. }

代码示例来源:origin: com.github.giulianini.jestures/jestures

  1. /**
  2. * Blur in depth.
  3. *
  4. * @param node
  5. * the root node
  6. * @param blur
  7. * the {@link GaussianBlur}
  8. */
  9. public static void blurDeeply(final Node node, final GaussianBlur blur) {
  10. node.setEffect(blur);
  11. if (node instanceof Parent) {
  12. final Parent parent = (Parent) node;
  13. final ObservableList<Node> children = parent.getChildrenUnmodifiable();
  14. for (final Node child : children) {
  15. ViewUtilities.blurDeeply(child, blur);
  16. }
  17. }
  18. }

代码示例来源:origin: com.aquafx-project/aquafx

  1. private void setDropShadow() {
  2. for (Node child : getChildren()) {
  3. if (child.getStyleClass().get(0).equals("box")) {
  4. child.setEffect(new Shadow(false));
  5. }
  6. }
  7. }

代码示例来源:origin: com.aquafx-project/aquafx

  1. private void setDropShadow() {
  2. for (Node child : getChildren()) {
  3. if (child.getStyleClass().get(0).equals("radio")) {
  4. child.setEffect(new Shadow(false));
  5. }
  6. }
  7. }

代码示例来源:origin: com.aquafx-project/aquafx

  1. @Override protected void handleControlPropertyChanged(String p) {
  2. super.handleControlPropertyChanged(p);
  3. if (p == "FOCUSED") {
  4. if (getSkinnable().isFocused()) {
  5. setFocusBorder();
  6. } else {
  7. for (Node child : getChildren()) {
  8. if (child.getStyleClass().get(0).equals("thumb")) {
  9. child.setEffect(null);
  10. }
  11. }
  12. }
  13. }
  14. }

代码示例来源:origin: com.jfoenix/jfoenix

  1. /**
  2. * this method is used to add shadow effect to the node,
  3. * however the shadow is not real ( gets affected with node transformations)
  4. * <p>
  5. * use {@link #createMaterialNode(Node, int)} instead to generate a real shadow
  6. */
  7. public static void setDepth(Node control, int level) {
  8. level = level < 0 ? 0 : level;
  9. level = level > 5 ? 5 : level;
  10. control.setEffect(new DropShadow(BlurType.GAUSSIAN,
  11. depth[level].getColor(),
  12. depth[level].getRadius(),
  13. depth[level].getSpread(),
  14. depth[level].getOffsetX(),
  15. depth[level].getOffsetY()));
  16. }

代码示例来源:origin: com.jfoenix/jfoenix

  1. level = level < 0 ? 0 : level;
  2. level = level > 5 ? 5 : level;
  3. container.setEffect(new DropShadow(BlurType.GAUSSIAN,
  4. depth[level].getColor(),
  5. depth[level].getRadius(),

代码示例来源:origin: com.aquafx-project/aquafx

  1. private void setFocusBorder() {
  2. getFocusBorder().setInnerFocusColor((Color) innerFocusColorProperty().get());
  3. getFocusBorder().setColor((Color) outerFocusColorProperty().get());
  4. for (Node child : getChildren()) {
  5. if (child.getStyleClass().get(0).equals("thumb")) {
  6. child.setEffect(getFocusBorder());
  7. getSkinnable().impl_reapplyCSS();
  8. }
  9. }
  10. }

代码示例来源:origin: com.aquafx-project/aquafx

  1. private void setFocusBorder() {
  2. getFocusBorder().setInnerFocusColor((Color) innerFocusColorProperty().get());
  3. getFocusBorder().setColor((Color) outerFocusColorProperty().get());
  4. for (Node child : getChildren()) {
  5. if (child instanceof StackPane) {
  6. child.setEffect(getFocusBorder());
  7. }
  8. }
  9. }

代码示例来源:origin: stackoverflow.com

  1. @Override
  2. public void handle(MouseEvent arg0) {
  3. node.setEffect(ds);
  4. node.setCursor(Cursor.HAND);
  5. lbl.setText("X-value=" + data.getXValue().toString() + "\nY-value=" + data.getYValue().toString());
  6. @Override
  7. public void handle(MouseEvent arg0) {
  8. node.setEffect(null);
  9. node.setCursor(Cursor.DEFAULT);
  10. lbl.setText("");

代码示例来源:origin: stackoverflow.com

  1. node.setEffect(ds);
  2. node.setCursor(Cursor.HAND);
  3. node.setEffect(null);
  4. node.setCursor(Cursor.DEFAULT);

代码示例来源:origin: stackoverflow.com

  1. caption.setText(String.valueOf(data.getPieValue()) + "%");
  2. caption.setVisible(true);
  3. node.setEffect(new Glow());
  4. public void handle(MouseEvent e) {
  5. caption.setVisible(false);
  6. node.setEffect(null);

代码示例来源:origin: com.aquafx-project/aquafx

  1. private void setSelectedFocusBorder() {
  2. InnerShadow innerFocus = new InnerShadow();
  3. innerFocus.setColor((Color) innerFocusColorProperty().get());
  4. innerFocus.setBlurType(BlurType.ONE_PASS_BOX);
  5. innerFocus.setRadius(6.5);
  6. innerFocus.setChoke(0.7);
  7. innerFocus.setOffsetX(0.0);
  8. innerFocus.setOffsetY(0.0);
  9. DropShadow outerFocus = new DropShadow();
  10. outerFocus.setColor((Color) outerFocusColorProperty().get());
  11. outerFocus.setBlurType(BlurType.ONE_PASS_BOX);
  12. outerFocus.setRadius(7.0);
  13. outerFocus.setSpread(0.7);
  14. outerFocus.setOffsetX(0.0);
  15. outerFocus.setOffsetY(0.0);
  16. outerFocus.setInput(innerFocus);
  17. for (Node child : getChildren()) {
  18. if (child instanceof StackPane) {
  19. child.setEffect(outerFocus);
  20. }
  21. }
  22. }

代码示例来源:origin: com.aquafx-project/aquafx

  1. private void setFocusBorder() {
  2. InnerShadow innerFocus = new InnerShadow();
  3. innerFocus.setColor((Color) innerFocusColorProperty().get());
  4. innerFocus.setBlurType(BlurType.ONE_PASS_BOX);
  5. innerFocus.setRadius(6.5);
  6. innerFocus.setChoke(0.7);
  7. innerFocus.setOffsetX(0.0);
  8. innerFocus.setOffsetY(0.0);
  9. DropShadow outerFocus = new DropShadow();
  10. outerFocus.setColor((Color) outerFocusColorProperty().get());
  11. outerFocus.setBlurType(BlurType.ONE_PASS_BOX);
  12. outerFocus.setRadius(5.0);
  13. outerFocus.setSpread(0.6);
  14. outerFocus.setOffsetX(0.0);
  15. outerFocus.setOffsetY(0.0);
  16. outerFocus.setInput(innerFocus);
  17. for (Node child : getChildren()) {
  18. if (child instanceof StackPane) {
  19. child.setEffect(outerFocus);
  20. }
  21. }
  22. }

相关文章

Node类方法