本文整理了Java中javafx.scene.shape.Line.setTranslateY()
方法的一些代码示例,展示了Line.setTranslateY()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Line.setTranslateY()
方法的具体详情如下:
包路径:javafx.scene.shape.Line
类名称:Line
方法名:setTranslateY
暂无
代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls
@Override
public void attach(StyledTextNode node, Text textNode) {
Line l = (Line) textNode.getUserData();
if( l == null ) {
l = new Line();
l.setManaged(false);
l.setEndX(textNode.getBoundsInLocal().getWidth());
l.setTranslateY(textNode.getBaselineOffset() + 2.0);
textNode.setUserData(l);
}
node.getChildren().add(l);
}
代码示例来源:origin: org.copper-engine/copper-monitoring-client
@Override
public void handle(MouseEvent event) {
Point2D scenePoint = chart.localToScene(event.getSceneX(), event.getSceneY());
Point2D position = chartWrap.sceneToLocal(scenePoint.getX(), scenePoint.getY());
Bounds chartAreaBounds = chartArea.localToScene(chartArea.getBoundsInLocal());
valueMarker.setStartY(0);
valueMarker.setEndY(chartWrap.sceneToLocal(chartAreaBounds).getMaxY() - chartWrap.sceneToLocal(chartAreaBounds).getMinY());
valueMarker.setStartX(0);
valueMarker.setEndX(0);
valueMarker.setTranslateX(position.getX() - chartWrap.getWidth() / 2);
double ydelta = chartArea.localToScene(0, 0).getY() - chartWrap.localToScene(0, 0).getY();
valueMarker.setTranslateY(-ydelta * 2);
}
});
内容来源于网络,如有侵权,请联系作者删除!