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

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

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

Node.resizeRelocate介绍

暂无

代码示例

代码示例来源:origin: org.fxmisc.flowless/flowless

  1. @Override
  2. public void resizeRelocate(
  3. Node node, double b0, double l0, double breadth, double length) {
  4. node.resizeRelocate(l0, b0, length, breadth);
  5. }

代码示例来源:origin: org.fxmisc.flowless/flowless

  1. @Override
  2. public void resizeRelocate(
  3. Node node, double b0, double l0, double breadth, double length) {
  4. node.resizeRelocate(b0, l0, breadth, length);
  5. }

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

  1. @Override
  2. protected void layoutChildren() {
  3. this.activeNodes.entrySet().forEach(e -> {
  4. if (!this.yOffsetData.containsKey(e.getKey())) {
  5. return;
  6. }
  7. double x = 0;
  8. double y = this.yOffsetData.get(e.getKey()).doubleValue();
  9. double width = getWidth();
  10. double height = getLineHeight();
  11. e.getValue().resizeRelocate(x, y, width, height);
  12. });
  13. }

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

  1. @Override
  2. protected void layoutChildren() {
  3. synchronized (this.sync) {
  4. this.activeNodes.entrySet().forEach(e -> {
  5. double x = 0;
  6. double y = e.getKey().intValue() * getLineHeight() - getYOffset();
  7. double width = getWidth();
  8. double height = getLineHeight();
  9. e.getValue().resizeRelocate(x, y, width, height);
  10. });
  11. }
  12. }

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

  1. @Override
  2. protected void layoutChildren() {
  3. Iterator<Entry<TextAnnotation, Node>> iterator = this.usedNodes.entrySet().iterator();
  4. while (iterator.hasNext()) {
  5. Entry<TextAnnotation, Node> entry = iterator.next();
  6. com.google.common.collect.Range<Integer> range = entry.getKey().getRange();
  7. double x = getCharLocation(range.lowerEndpoint().intValue());
  8. double width = getCharLocation(range.upperEndpoint().intValue()) -x;
  9. entry.getValue().resizeRelocate(x, 0, width, getHeight());
  10. }
  11. }

代码示例来源:origin: no.tornado/tornadofx-controls

  1. protected void layoutChildren(double x, double y, double w, double h) {
  2. for (Node node : getChildren()) {
  3. if (getSkinnable().getOrientation() == Orientation.VERTICAL) {
  4. double prefHeight = node.prefHeight(-1);
  5. node.resizeRelocate(x, y, w, prefHeight);
  6. y += prefHeight;
  7. } else {
  8. double prefWidth = node.prefWidth(-1);
  9. node.resizeRelocate(x, y, prefWidth, h);
  10. x += prefWidth;
  11. }
  12. }
  13. }

代码示例来源:origin: eu.mihosoft.vrl.workflow/vworkflows-fx

  1. @Override
  2. protected void layoutChildren() {
  3. int count = 0;
  4. double width = getHeight();
  5. double height = getHeight();
  6. for (Node n : getManagedChildren()) {
  7. double x = (width + spacing) * count;
  8. n.resizeRelocate(x, 0, width, height);
  9. count++;
  10. }
  11. }

代码示例来源:origin: org.jfxtras/jfxtras-window

  1. @Override
  2. protected void layoutChildren() {
  3. int count = 0;
  4. double width = getHeight();
  5. double height = getHeight();
  6. for (Node n : getManagedChildren()) {
  7. double x = (width + spacing) * count;
  8. n.resizeRelocate(x, 0, width, height);
  9. count++;
  10. }
  11. }

代码示例来源:origin: no.tornado/tornadofx-controls

  1. /**
  2. * Lay out the columns of the TableRow, then add the expanded content node below if this row is currently expanded.
  3. */
  4. @Override
  5. protected void layoutChildren(double x, double y, double w, double h) {
  6. super.layoutChildren(x, y, w, h);
  7. if (isExpanded()) getContent().resizeRelocate(0.0, tableRowPrefHeight, w, h - tableRowPrefHeight);
  8. }
  9. }

代码示例来源:origin: org.controlsfx/controlsfx

  1. /**
  2. * Lay out the columns of the TableRow, then add the expanded content node below if this row is currently expanded.
  3. */
  4. @Override
  5. protected void layoutChildren(double x, double y, double w, double h) {
  6. super.layoutChildren(x, y, w, h);
  7. if (isExpanded()) getContent().resizeRelocate(0.0, tableRowPrefHeight, w, h - tableRowPrefHeight);
  8. }
  9. }

代码示例来源:origin: eu.mihosoft.vrl.workflow/vworkflows-fx

  1. @Override
  2. protected void layoutChildren() {
  3. int count = 0;
  4. double width = getHeight();
  5. double height = getHeight();
  6. for (Node n : getManagedChildren()) {
  7. double x = (width + spacing) * count;
  8. n.resizeRelocate(x, 0, width, height);
  9. count++;
  10. }
  11. }

代码示例来源:origin: org.controlsfx/controlsfx

  1. @Override
  2. protected void layoutChildren(double contentX, double contentY, double contentWidth, double contentHeight) {
  3. double total = getSkinnable().getTotal();
  4. List<T> segments = getSkinnable().getSegments();
  5. int size = segments.size();
  6. double x = contentX;
  7. double y = contentY + contentHeight;
  8. for (int i = 0; i < size; i++) {
  9. SegmentedBar.Segment segment = segments.get(i);
  10. Node segmentNode = segmentNodes.get(segment);
  11. double segmentValue = segment.getValue();
  12. if (getSkinnable().getOrientation().equals(Orientation.HORIZONTAL)) {
  13. double segmentWidth = segmentValue / total * contentWidth;
  14. segmentNode.resizeRelocate(x, contentY, segmentWidth, contentHeight);
  15. x += segmentWidth;
  16. } else {
  17. double segmentHeight = segmentValue / total * contentHeight;
  18. segmentNode.resizeRelocate(contentX, y - segmentHeight, contentWidth, segmentHeight);
  19. y -= segmentHeight;
  20. }
  21. }
  22. }
  23. }

代码示例来源:origin: no.tornado/tornadofx-controls

  1. protected void layoutChildren(double contentX, double contentY, double contentWidth, double contentHeight) {
  2. double usedLineWidth = 0;
  3. double hgap = getSkinnable().getHgap().doubleValue();
  4. double vgap = getSkinnable().getVgap().doubleValue();
  5. double prefHeight = getPrefRowHeight();
  6. for (Node node : getChildren()) {
  7. double prefWidth = node.prefWidth(prefHeight);
  8. if (usedLineWidth + prefWidth > contentWidth && usedLineWidth > 0) {
  9. usedLineWidth = 0;
  10. contentY += prefHeight + vgap;
  11. }
  12. double x = usedLineWidth + contentX;
  13. node.resizeRelocate(x, contentY, prefWidth, prefHeight);
  14. usedLineWidth += prefWidth + hgap;
  15. }
  16. }

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

  1. e.getValue().resizeRelocate(x, y + dy, width, height);
  2. });

代码示例来源:origin: org.controlsfx/controlsfx

  1. private void addLocation(WorldMapView.Location location) {
  2. Point2D coordinates = getLocationCoordinates(location);
  3. Callback<WorldMapView.Location, Node> locationViewFactory = getSkinnable().getLocationViewFactory();
  4. Node view = locationViewFactory.call(location);
  5. if (view == null) {
  6. throw new IllegalArgumentException("location view factory returned NULL");
  7. }
  8. view.getStyleClass().add(DEFAULT_STYLE_LOCATION);
  9. view.setManaged(false);
  10. locationsGroup.getChildren().add(view);
  11. view.applyCss();
  12. view.resizeRelocate(coordinates.getX(), coordinates.getY(), view.prefWidth(-1), view.prefHeight(-1));
  13. locationMap.put(location, view);
  14. }

代码示例来源:origin: org.controlsfx/controlsfx

  1. @Override protected void layoutChildren(double x, double y, double w, double h) {
  2. final double notificationBarHeight = notificationBar.prefHeight(w);
  3. notificationBar.resize(w, notificationBarHeight);
  4. // layout the content
  5. if (content != null) {
  6. content.resizeRelocate(x, y, w, h);
  7. }
  8. // and update the clip so that the notification bar does not draw outside
  9. // the bounds of the notification pane
  10. clip.setX(x);
  11. clip.setY(y);
  12. clip.setWidth(w);
  13. clip.setHeight(h);
  14. }

代码示例来源:origin: com.miglayout/miglayout-javafx

  1. public Node createReplacement(Node node)
  2. {
  3. Rectangle2D b = getBounds(node);
  4. Node replNode = new ImageView(node.snapshot(new SnapshotParameters(), null));
  5. replacedNodeMap.put(node, replNode);
  6. replNode.setUserData(node);
  7. replNode.setManaged(false);
  8. replNode.setId(ANIM_REPLACE_ID);
  9. replNode.resizeRelocate(b.getMinX(), b.getMinY(), b.getWidth(), b.getHeight());
  10. return replNode;
  11. }

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

  1. super.layoutChildren();
  2. if (this.resizeLeft != null) {
  3. this.resizeLeft.resizeRelocate(0, this.getResizeHandleSize(), this.getResizeHandleSize(), getHeight() - 2 * this.getResizeHandleSize());
  4. this.resizeLeft.visibleProperty().bind(this.resizeable);
  5. this.resizeRight.resizeRelocate(getWidth() - this.getResizeHandleSize(), this.getResizeHandleSize(), this.getResizeHandleSize(), getHeight() - 2 * this.getResizeHandleSize());
  6. this.resizeRight.visibleProperty().bind(this.resizeable);
  7. this.resizeTop.resizeRelocate(this.getResizeHandleSize(), 0, getWidth() - this.getResizeHandleSize(), this.getResizeHandleSize());
  8. this.resizeTop.visibleProperty().bind(this.resizeable);
  9. this.resizeBottom.resizeRelocate(this.getResizeHandleSize(), getHeight() - this.getResizeHandleSize(), getWidth() - this.getResizeHandleSize(), this.getResizeHandleSize());
  10. this.resizeBottom.visibleProperty().bind(this.resizeable);
  11. this.resizeCornerRightBottom.resizeRelocate(getWidth() - this.getResizeHandleSize(), getHeight() - this.getResizeHandleSize(), this.getResizeHandleSize(), this.getResizeHandleSize());
  12. this.resizeCornerRightBottom.visibleProperty().bind(this.resizeable);
  13. this.resizeCornerRightTop.resizeRelocate(getWidth() - this.getResizeHandleSize(), 0, this.getResizeHandleSize(), this.getResizeHandleSize());
  14. this.resizeCornerRightTop.visibleProperty().bind(this.resizeable);
  15. this.resizeCornerLeftBottom.resizeRelocate(0, getHeight() - this.getResizeHandleSize(), this.getResizeHandleSize(), this.getResizeHandleSize());
  16. this.resizeCornerLeftBottom.visibleProperty().bind(this.resizeable);
  17. this.resizeCornerLeftTop.resizeRelocate(0, 0, this.getResizeHandleSize(), this.getResizeHandleSize());
  18. this.resizeCornerLeftTop.visibleProperty().bind(this.resizeable);

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

  1. @Override
  2. protected void layoutChildren() {
  3. int space = 0;
  4. int w = 16;
  5. this.horizontal.resizeRelocate(0, getHeight() - w, getWidth() - w , w);
  6. this.vertical.resizeRelocate(getWidth() - w, 0, w, getHeight()- w);
  7. if (this.center != null) {
  8. this.clip.setX(0);
  9. this.clip.setY(0);
  10. this.clip.setWidth(getWidth() - w - space);
  11. this.clip.setHeight(getHeight() - w - space);
  12. this.center.resizeRelocate(0, 0, getWidth() - w - space, getHeight() - w - space);
  13. }
  14. }

代码示例来源:origin: org.fxmisc.richtext/richtextfx

  1. @Override
  2. protected
  3. void layoutChildren() {
  4. Insets ins = getInsets();
  5. double w = getWidth() - ins.getLeft() - ins.getRight();
  6. double h = getHeight() - ins.getTop() - ins.getBottom();
  7. double graphicWidth = getGraphicPrefWidth();
  8. text.resizeRelocate(graphicWidth + ins.getLeft(), ins.getTop(), w - graphicWidth, h);
  9. graphic.ifPresent(g -> g.resizeRelocate(graphicOffset.get() + ins.getLeft(), ins.getTop(), graphicWidth, h));
  10. }

相关文章

Node类方法