本文整理了Java中javafx.scene.shape.Rectangle.relocate
方法的一些代码示例,展示了Rectangle.relocate
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rectangle.relocate
方法的具体详情如下:
包路径:javafx.scene.shape.Rectangle
类名称:Rectangle
方法名:relocate
暂无
代码示例来源:origin: stackoverflow.com
canvas.setPrefSize(200,200);
Rectangle rectangle = new Rectangle(100,100,Color.RED);
rectangle.relocate(70,70);
canvas.getChildren().add(rectangle);
canvas.setOnMousePressed(MousePressedEventHandler);
代码示例来源:origin: org.controlsfx/controlsfx
private void updateClip() {
final Rating control = getSkinnable();
final double h = control.getHeight() - (snappedTopInset() + snappedBottomInset());
final double w = control.getWidth() - (snappedLeftInset() + snappedRightInset());
if (isVertical()) {
final double y = h * rating / control.getMax() ;
forgroundClipRect.relocate(0, h - y);
forgroundClipRect.setWidth(control.getWidth());
forgroundClipRect.setHeight(y);
} else {
final double x = w * rating / control.getMax();
forgroundClipRect.setWidth(x);
forgroundClipRect.setHeight(control.getHeight());
}
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
/**
* Compute the needed clip for stage's shadow border
*
* @param newBounds
* @param shadowVisible
*/
void setShadowClip(Bounds newBounds) {
external.relocate(newBounds.getMinX() - SHADOW_WIDTH, newBounds.getMinY() - SHADOW_WIDTH);
internal.setX(SHADOW_WIDTH);
internal.setY(SHADOW_WIDTH);
internal.setWidth(newBounds.getWidth());
internal.setHeight(newBounds.getHeight());
internal.setArcWidth(shadowRectangle.getArcWidth()); // shadowRectangle
// CSS cannot be
// applied on
// this
internal.setArcHeight(shadowRectangle.getArcHeight());
external.setWidth(newBounds.getWidth() + SHADOW_WIDTH * 2);
external.setHeight(newBounds.getHeight() + SHADOW_WIDTH * 2);
Shape clip = Shape.subtract(external, internal);
shadowRectangle.setClip(clip);
}
内容来源于网络,如有侵权,请联系作者删除!