本文整理了Java中com.ait.lienzo.client.core.shape.Rectangle
类的一些代码示例,展示了Rectangle
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rectangle
类的具体详情如下:
包路径:com.ait.lienzo.client.core.shape.Rectangle
类名称:Rectangle
[英]Rectangle is defined by a width and a height. It may have rounded corners.
[中]矩形由宽度和高度定义。它可能有圆角。
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-client
private SVGBasicShapeView rectangleBasicView(final double width, final double height) {
SVGPrimitiveShape mainShape = SVGPrimitiveFactory.newSVGPrimitiveShape(new com.ait.lienzo.client.core.shape.Rectangle(448.00, 448.00).setCornerRadius(15.00).setDraggable(false).setID("rectangle__sJZ2").setX(0.00).setY(0.00).setAlpha(1.00).setListening(true).setScale(1.00,1.00).setOffset(0.00,0.00).setFillAlpha(0.00).setStrokeColor("#000000").setStrokeWidth(5.00), false, null);
final SVGBasicShapeViewImpl view = new SVGBasicShapeViewImpl("rectangle", mainShape, width, height);
return view;
}
代码示例来源:origin: org.uberfire/uberfire-wires-bayesian-network-client
private Shape drawShape() {
final Rectangle rectangle = new Rectangle(20,
20);
rectangle.setX(5).setY(5)
.setStrokeColor(ShapesUtils.RGB_STROKE_SHAPE)
.setStrokeWidth(ShapesUtils.RGB_STROKE_WIDTH_SHAPE)
.setFillColor(ShapesUtils.RGB_FILL_SHAPE)
.setDraggable(false);
return rectangle;
}
代码示例来源:origin: com.ahome-it/lienzo-core
@Override
public RectangleSelectionProvider setSize(final double width, final double height)
{
shape.setWidth(width).setHeight(height);
return this;
}
代码示例来源:origin: org.uberfire/uberfire-wires-bayesian-network-client
private Rectangle drawBoundingBox() {
final Rectangle boundingBox = new Rectangle(ShapeFactoryUtil.WIDTH_BOUNDING_LAYER,
ShapeFactoryUtil.HEIGHT_BOUNDING_LAYER);
boundingBox.setStrokeColor(ShapeFactoryUtil.RGB_STROKE_BOUNDING)
.setStrokeWidth(1)
.setFillColor(ShapeFactoryUtil.RGB_FILL_BOUNDING)
.setDraggable(false);
return boundingBox;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-lienzo-extensions
public Rectangle createRectangle(final double width,
final double height) {
return new Rectangle(width + padding,
height + padding)
.setCornerRadius(5)
.setFillColor(ColorName.BLACK)
.setFillAlpha(0.01)
.setStrokeWidth(1)
.setStrokeColor(ColorName.BLACK)
.setStrokeAlpha(0);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client
private SVGBasicShapeView rectangleBasicView(final double width, final double height) {
SVGPrimitiveShape mainShape = SVGPrimitiveFactory.newSVGPrimitiveShape(new com.ait.lienzo.client.core.shape.Rectangle(448.00, 448.00).setCornerRadius(15.00).setDraggable(false).setID("rectangle__O2Gz").setX(0.00).setY(0.00).setAlpha(0.00).setListening(true).setScale(1.00,1.00).setOffset(0.00,0.00), false, null);
final SVGBasicShapeViewImpl view = new SVGBasicShapeViewImpl("rectangle", mainShape, width, height);
return view;
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-scratchpad
@Override
public void onMove(final double x,
final double y) {
controlPoint2.setY(controlPoint1.getY());
controlPoint3.setX(controlPoint1.getX());
rectangle.setX(x - getX());
rectangle.setY(y - getY());
rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX());
rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY());
bounding.setX(rectangle.getX() - (BOUNDARY_SIZE / 2));
bounding.setY(rectangle.getY() - (BOUNDARY_SIZE / 2));
bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE);
bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE);
}
}
代码示例来源:origin: kiegroup/appformer
private Rectangle getBoundingImage(final NodeMouseClickHandler clickHandler) {
final Rectangle bounding = new Rectangle(WIDTH_BOUNDING,
HEIGHT_BOUNDING).setX(0).setY(0).setStrokeColor(ColorName.WHITE.getValue());
bounding.addNodeMouseClickHandler(clickHandler);
return bounding;
}
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-scratchpad
@Override
public void onMove(double x,
double y) {
controlPoint1.setY(controlPoint2.getY());
controlPoint4.setX(controlPoint2.getX());
rectangle.setY(y - getY());
rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX());
rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY());
bounding.setY(rectangle.getY() - (BOUNDARY_SIZE / 2));
bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE);
bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE);
}
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-scratchpad
@Override
public void onMove(double x,
double y) {
controlPoint1.setX(controlPoint3.getX());
controlPoint4.setY(controlPoint3.getY());
rectangle.setX(x - getX());
rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX());
rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY());
bounding.setX(rectangle.getX() - (BOUNDARY_SIZE / 2));
bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE);
bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE);
}
}
代码示例来源:origin: org.uberfire/uberfire-wires-bayesian-network-client
public EditableBayesianNode(final Rectangle shape) {
this(shape.getWidth(),
shape.getHeight(),
shape.getX(),
shape.getY(),
BayesianUtils.getNodeColors()[0][0]);
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-scratchpad
@Override
public void onMove(double x,
double y) {
controlPoint2.setX(controlPoint4.getX());
controlPoint3.setY(controlPoint4.getY());
rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX());
rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY());
bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE);
bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE);
}
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-grids
@Override
public Rectangle getGridBoundary() {
final Rectangle boundary = new Rectangle(0,
0)
.setStrokeColor(ColorName.GREY)
.setStrokeWidth(0.5)
.setListening(false);
return boundary;
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-client
public void center() {
int x = (int) (width / 2 - substrate.getWidth() / 2);
int y = (int) (height / 2 - substrate.getHeight() / 2);
substrate.setX(x).setY(y);
progress.setX(x + 2).setY(y + 2);
progressPercentage.setX(x + substrate.getWidth() / 2).setY(y + 2 + progress.getHeight() / 2);
layer.batch();
}
代码示例来源:origin: com.ahome-it/lienzo-core
@Override
public RectangleSelectionProvider build()
{
shape = new Rectangle(1, 1).setStrokeWidth(1).setDashArray(5, 5).setStrokeColor("#0000CC");
return this;
}
代码示例来源:origin: kiegroup/appformer
@Override
public RendererCommand renderGridBoundary(final GridBoundaryRenderContext context) {
return (RenderGridBoundaryCommand) (rc) -> {
if (!rc.isSelectionLayer()) {
final double x = context.getX();
final double y = context.getY();
final double width = context.getWidth();
final double height = context.getHeight();
final Rectangle boundary = theme.getGridBoundary()
.setWidth(width)
.setHeight(height)
.setListening(false)
.setX(x + 0.5)
.setY(y + 0.5);
rc.getGroup().add(boundary);
}
};
}
代码示例来源:origin: org.uberfire/uberfire-wires-bayesian-network-client
private void setHeader(BayesVariable node,
EditableBayesianNode bayesianNode) {
bayesianNode.setHeader(new Rectangle(bayesianNode.getWidth(),
BayesianUtils.HEIGHT_HEADER));
bayesianNode.getHeader().setFillColor(colors[0][1]);
bayesianNode.getHeader().setX(bayesianNode.getHeader().getX());
bayesianNode.setTextHeader(drawText(node.getName(),
BayesianUtils.FONT_SIZE_HEADER_NODE,
BayesianUtils.LABEL_POSITION_X_DEFAULT,
BayesianUtils.LABEL_POSITION_Y_DEFAULT));
}
代码示例来源:origin: com.ahome-it/lienzo-core
@Override
public BoundingBox getBoundingBox()
{
return new BoundingBox(0, 0, getWidth(), getHeight());
}
代码示例来源:origin: org.dashbuilder/dashbuilder-lienzo-core
/**
* Constructor. Creates an instance of rectangle with rounded corners.
*
* @param width
* @param height
* @param cornerRadius
*/
public Rectangle(final double width, final double height, final double cornerRadius)
{
super(ShapeType.RECTANGLE);
setWidth(width).setHeight(height).setCornerRadius(cornerRadius);
}
代码示例来源:origin: org.drools/drools-wb-guided-dtable-editor-client
@Override
public void setVisibleBounds( final Bounds bounds ) {
radarLayer.remove( visibleBounds );
visibleBounds.setLocation( new Point2D( bounds.getX(),
bounds.getY() ) );
visibleBounds.setHeight( bounds.getHeight() );
visibleBounds.setWidth( bounds.getWidth() );
radarLayer.add( visibleBounds );
visibleBounds.moveToTop();
radarLayer.batch();
}
内容来源于网络,如有侵权,请联系作者删除!