本文整理了Java中javafx.scene.Node.localToScreen()
方法的一些代码示例,展示了Node.localToScreen()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.localToScreen()
方法的具体详情如下:
包路径:javafx.scene.Node
类名称:Node
方法名:localToScreen
暂无
代码示例来源:origin: stackoverflow.com
Node node = ...
Point2D screenCoordiantes = node.localToScreen(localX, localY);
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls
public Collection<? extends HoverTarget> findHoverTargets(Point2D localLocation) {
return this.usedNodes.entrySet().stream()
.filter(e->e.getValue().getBoundsInParent().contains(localLocation))
.map(e->{
TextAnnotation annotation = e.getKey();
Bounds bounds = e.getValue().getBoundsInLocal();
Point2D anchor = new Point2D(bounds.getMinX(), bounds.getMaxY());
HoverTarget annotationTarget = new HoverTarget(annotation, toGlobal(annotation.getRange()), e.getValue().localToScreen(anchor), e.getValue().localToScreen(bounds));
return annotationTarget;
})
.collect(Collectors.toList());
}
代码示例来源:origin: org.fxmisc.richtext/richtextfx
public <T extends Node & Caret> Bounds getCaretBoundsOnScreen(T caret) {
layout(); // ensure layout, is a no-op if not dirty
checkWithinParagraph(caret);
Bounds localBounds = caret.getBoundsInLocal();
return caret.localToScreen(localBounds);
}
代码示例来源:origin: com.cedarsoft.commons/javafx
private void show(@Nonnull Node parent) {
Bounds bounds = parent.localToScreen(parent.getLayoutBounds());
show(parent, bounds.getMinX() + 5, bounds.getMinY() + bounds.getHeight() + 5);
}
代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol
@Override
public RNode<T> moveTo(Duration d, double x, double y) {
Bounds bounds = node.localToScreen(node.getBoundsInLocal());
controller.run(Move.to(d,bounds.getMinX() + x, bounds.getMinY() + y));
return null;
}
代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol
@Override
public RNode<T> moveTo(double x, double y) {
Bounds bounds = node.localToScreen(node.getBoundsInLocal());
controller.run(Move.to(bounds.getMinX() + x, bounds.getMinY() + y));
return this;
}
代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol
@Override
public RNode<T> dragTo(double x, double y) {
Bounds bounds = node.localToScreen(node.getBoundsInLocal());
controller.run(Drag.to(bounds.getWidth() / 2, bounds.getHeight() / 2, x, y));
return this;
}
代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol
@Override
public RNode<T> dragTo(Duration d, double x, double y) {
Bounds bounds = node.localToScreen(node.getBoundsInLocal());
controller.run(Drag.to(d, bounds.getWidth() / 2, bounds.getHeight() / 2, x, y));
return this;
}
代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol
@Override
public Point2D center() {
Bounds bounds = node.localToScreen(node.getBoundsInLocal());
return new Point2D(bounds.getMinX() + bounds.getWidth()/2, bounds.getMinY() + bounds.getHeight()/2);
}
代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol
@Override
public RNode<T> dragBy(double dx, double dy) {
Bounds bounds = node.localToScreen(node.getBoundsInLocal());
controller.run(Drag.by( bounds.getMinX() + bounds.getWidth() / 2, bounds.getMinY() + bounds.getHeight() / 2, dx, dy));
return this;
}
代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol
@Override
public RNode<T> dragBy(Duration d, double dx, double dy) {
Bounds bounds = node.localToScreen(node.getBoundsInLocal());
controller.run(Drag.by(d, bounds.getMinX() + bounds.getWidth() / 2, bounds.getMinY() + bounds.getHeight() / 2, dx, dy));
return this;
}
代码示例来源:origin: org.fxmisc.richtext/richtextfx
/**
* Sets up the code to fire a {@code BEGIN} event when the mouse becomes stationary over the node and has not
* moved for the given amount of time ({@code delay}), and to fire a {@code END} event when the stationary
* mouse moves again. Note: any previously installed delays will be removed without creating memory leaks.
*/
public void install(Duration delay) {
if(installed != null) {
installed.unsubscribe();
}
installed = events(delay).<Event>map(either -> either.unify(
pos -> MouseStationaryEvent.beginAt(node.localToScreen(pos)),
stop -> MouseStationaryEvent.end()))
.subscribe(evt -> Event.fireEvent(node, evt));
}
代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol
double y;
Bounds bounds = node.localToScreen(node.getBoundsInLocal());
switch (position.getHpos()) {
case CENTER:
代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol
double y;
Bounds bounds = node.localToScreen(node.getBoundsInLocal());
switch (referencePoint.getHpos()) {
case CENTER:
代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol
double y;
Bounds bounds = node.localToScreen(node.getBoundsInLocal());
switch (referencePoint.getHpos()) {
case CENTER:
代码示例来源:origin: org.tentackle/tentackle-fx
/**
* Updates the location when the effective size is known.
*/
protected void updateLocation() {
Bounds linkedNodeBounds = linkedNode.localToScreen(linkedNode.getBoundsInLocal());
Point2D linkedNodeLocation = linkedNode.localToScreen(0.0, 0.0);
if (linkedNodeBounds != null && linkedNodeLocation != null) {
switch (note.getPosition()) {
case BOTTOM:
note.setAnchorX(linkedNodeLocation.getX() + linkedNodeBounds.getWidth() / 2 - note.getWidth() / 2);
note.setAnchorY(linkedNodeLocation.getY() + linkedNodeBounds.getHeight() - CIRCLE_RADIUS);
break;
case TOP:
note.setAnchorX(linkedNodeLocation.getX() + linkedNodeBounds.getWidth() / 2 - note.getWidth() / 2);
note.setAnchorY(linkedNodeLocation.getY() - note.getHeight() + CIRCLE_RADIUS);
break;
case LEFT:
note.setAnchorX(linkedNodeLocation.getX() - note.getWidth() + CIRCLE_RADIUS);
note.setAnchorY(linkedNodeLocation.getY() + linkedNodeBounds.getHeight() / 2 - note.getHeight() / 2);
break;
default: // RIGHT
note.setAnchorX(linkedNodeLocation.getX() + linkedNodeBounds.getWidth() - CIRCLE_RADIUS);
note.setAnchorY(linkedNodeLocation.getY() + linkedNodeBounds.getHeight() / 2 - note.getHeight() / 2);
}
}
}
代码示例来源:origin: org.controlsfx/controlsfx
requireNonNull(owner);
Bounds bounds = owner.localToScreen(owner.getBoundsInLocal());
内容来源于网络,如有侵权,请联系作者删除!