本文整理了Java中com.ait.lienzo.client.core.shape.Line
类的一些代码示例,展示了Line
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Line
类的具体详情如下:
包路径:com.ait.lienzo.client.core.shape.Line
类名称:Line
[英]Line is a line segment between two points. The class can be used to draw regular lines as well as dashed lines. To create a dashed line, use one of the setDashArray() methods.
[中]直线是两点之间的线段。该类可用于绘制规则线和虚线。要创建虚线,请使用setDashArray()方法之一。
代码示例来源:origin: org.uberfire/uberfire-wires-core-grids
@Override
public Line getGridHeaderBodyDivider() {
final Line divider = new Line()
.setStrokeColor(ColorName.SLATEGRAY)
.setStrokeWidth(0.5);
return divider;
}
}
代码示例来源:origin: com.ahome-it/lienzo-core
@Override
public Line setPoint2DArray(final Point2DArray points)
{
return setPoints(points);
}
代码示例来源:origin: com.ahome-it/lienzo-core
@Override
public Point2DArray getPoint2DArray()
{
return getPoints();
}
代码示例来源:origin: org.kie.workbench/kie-wb-common-dmn-client
@Override
public Line getGridHeaderBodyDivider() {
return new Line()
.setStrokeColor(KIEColours.TABLE_GRID)
.setStrokeWidth(STROKE_WIDTH)
.setVisible(true);
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-lienzo
public static Line line(final int width,
final int height,
final double dAlpha,
final double dWidth,
final String dColor) {
return new Line(0, 0, width, height)
.setDraggable(false)
.setListening(false)
.setFillAlpha(0)
.setDashArray(5)
.setStrokeAlpha(dAlpha)
.setStrokeWidth(dWidth)
.setStrokeColor(dColor);
}
代码示例来源:origin: com.ahome-it/lienzo-core
private void drawHorizontalLine(final double pos, final double left, final double right, final int index)
{
Line line = (Line) m_lines[index];
if (line == null)
{
line = new Line(left, pos, right, pos);
line.setStrokeWidth(m_strokeWidth);
line.setStrokeColor(m_strokeColor);
line.setDashArray(m_dashArray);
getOverLayer().add(line);
m_lines[index] = line;
}
else
{
line.setPoints(new Point2DArray(new Point2D(left, pos), new Point2D(right, pos)));
}
}
代码示例来源:origin: com.ahome-it/lienzo-core
public StandardBackgroundGridLayer()
{
super(100, new Line().setAlpha(0.40).setStrokeWidth(1).setStrokeColor(ColorName.ROYALBLUE), 10, new Line().setAlpha(0.25).setStrokeWidth(1).setStrokeColor(ColorName.ROYALBLUE));
setTransformable(false).setListening(false).getElement().getStyle().setBackgroundColor(ColorName.WHITE.getColorString());
}
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-client
@PostConstruct
public void init() {
panel = new FocusableLienzoPanel(DEFAULT_SIZE_WIDTH,
DEFAULT_SIZE_HEIGHT);
initWidget(panel);
//Grid...
Line line1 = new Line(0,
0,
0,
0).setStrokeColor(ColorName.BLUE).setAlpha(0.5); // primary lines
Line line2 = new Line(0,
0,
0,
0).setStrokeColor(ColorName.GREEN).setAlpha(0.5); // secondary dashed-lines
line2.setDashArray(2,
2);
GridLayer gridLayer = new GridLayer(100,
line1,
25,
line2);
panel.setBackgroundLayer(gridLayer);
panel.getScene().add(canvasLayer);
}
代码示例来源:origin: com.ahome-it/lienzo-core
final double previousLineWidth = line.getStrokeWidth();
line.setStrokeWidth(previousLineWidth / scale);
final DashArray previousDashes = line.getDashArray();
line.setDashArray(dashes);
final Point2DArray points = line.getPoints();
line.drawWithTransforms(context, alpha, bounds);
line.setStrokeWidth(previousLineWidth); // restore stroke width
line.setDashArray(previousDashes);
代码示例来源:origin: org.uberfire/uberfire-wires-core-scratchpad
@Override
protected Line makeShape() {
final Line line = new Line(0 - (SHAPE_SIZE_X / 2),
0 - (SHAPE_SIZE_Y / 2),
SHAPE_SIZE_X / 2,
SHAPE_SIZE_Y / 2);
line.setStrokeColor(ShapesUtils.RGB_STROKE_SHAPE)
.setStrokeWidth(ShapesUtils.RGB_STROKE_WIDTH_SHAPE)
.setFillColor(ShapesUtils.RGB_FILL_SHAPE)
.setLineCap(LineCap.ROUND)
.setStrokeWidth(3)
.setDraggable(false);
return line;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-lienzo
private static Line createLine(CanvasGrid.GridLine line1) {
final Line line = new Line(0,
0,
0,
0)
.setStrokeColor(line1.getColor())
.setAlpha(line1.getAlpha())
.setStrokeWidth(line1.getWidth())
.setLineCap(LineCap.ROUND);
if (line1.getDashArray() > -1) {
line.setDashArray(1,
line1.getDashArray());
}
return line;
}
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-grids
final Line line = new Line(sp,
ep)
.setVisible(!isGridPinned())
.setStrokeColor(ColorName.DARKGRAY)
.setFillColor(ColorName.TAN)
.setStrokeWidth(2.0);
gridWidgetConnectors.put(connector,
line);
super.add(line);
line.moveToBottom();
代码示例来源:origin: org.uberfire/uberfire-wires-core-scratchpad
public WiresLine(final Line shape) {
final double x1 = shape.getPoints().get(0).getX();
final double y1 = shape.getPoints().get(0).getY();
final double x2 = shape.getPoints().get(1).getX();
final double y2 = shape.getPoints().get(1).getY();
bounding = new Line(x1,
y1,
x2,
y2);
bounding.setStrokeWidth(BOUNDARY_SIZE);
bounding.setAlpha(ALPHA_DESELECTED);
代码示例来源:origin: org.uberfire/uberfire-wires-core-trees
public WiresTreeNodeConnector() {
setStrokeColor(ShapesUtils.RGB_STROKE_SHAPE)
.setStrokeWidth(ShapesUtils.RGB_STROKE_WIDTH_SHAPE)
.setFillColor(ShapesUtils.RGB_FILL_SHAPE)
.setLineCap(LineCap.ROUND)
.setStrokeWidth(3)
.setDraggable(false);
}
}
代码示例来源:origin: org.dashbuilder/dashbuilder-lienzo-charts
public T buildValuesAxisIntervals() {
// Build the shapes axis instances (line for intervals and text for labels).
List<AxisBuilder.AxisLabel> yAxisLabels = valuesAxisBuilder[0].getLabels();
valuesAxisIntervals = new Line[yAxisLabels.size() + 1];
int x = 0;
for (AxisBuilder.AxisLabel yAxisLabel : yAxisLabels) {
valuesAxisIntervals[x] = new Line(0,0,0,0).setStrokeColor(ColorName.DARKGREY);
chartArea.add(valuesAxisIntervals[x]);
if (isShowValuesLabels()) {
BarChartLabel label = new BarChartLabel(yAxisLabel);
valuesLabels.add(label);
addValuesAxisIntervalLabel(label);
}
x++;
}
return (T) this;
}
代码示例来源:origin: org.dashbuilder/dashbuilder-lienzo-core
@Override
public Line create(final JSONObject node, final ValidationContext ctx) throws ValidationException
{
return new Line(node, ctx);
}
}
代码示例来源:origin: com.ahome-it/lienzo-charts
@Override
protected void doAnimateValues(Line line, Point2D p1, Point2D p2, Double w, Double h, IColor color, boolean isSeriesNew) {
line.setPoint2DArray(new Point2DArray(p1, p2)).setStrokeColor(color);
}
代码示例来源:origin: org.dashbuilder/dashbuilder-lienzo-charts
for (final Line line : valuesAxisIntervals) {
if (line != null) {
final double yClearDiff = yClearPos - line.getPoints().get(1).getY();
AnimationProperties animationProperties = new AnimationProperties();
animationProperties.push(AnimationProperty.Properties.Y(yClearDiff));
line.animate(AnimationTweener.LINEAR, animationProperties, CLEAR_ANIMATION_DURATION, animationCallback);
代码示例来源:origin: org.uberfire/uberfire-wires-core-scratchpad
@Override
public void setSelected(final boolean isSelected) {
if (isSelected) {
bounding.setAlpha(ALPHA_SELECTED);
} else {
bounding.setAlpha(ALPHA_DESELECTED);
}
}
代码示例来源:origin: com.ahome-it/lienzo-charts
final Point2D p2 = new Point2D(x, y);
final Line line = lines.get(i - 1);
line.moveToTop();
line.setDraggable(false);
内容来源于网络,如有侵权,请联系作者删除!