本文整理汇总了Java中com.ait.lienzo.client.core.shape.MultiPath类的典型用法代码示例。如果您正苦于以下问题:Java MultiPath类的具体用法?Java MultiPath怎么用?Java MultiPath使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MultiPath类属于com.ait.lienzo.client.core.shape包,在下文中一共展示了MultiPath类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderSelector
import com.ait.lienzo.client.core.shape.MultiPath; //导入依赖的package包/类
@Override
public Group renderSelector(final double width,
final double height,
final BaseGridRendererHelper.RenderingInformation renderingInformation) {
final Group g = new Group();
final MultiPath selector = theme.getSelector()
.M(0.5,
0.5)
.L(0.5,
height)
.L(width,
height)
.L(width,
0.5)
.L(0.5,
0.5)
.setListening(false);
g.add(selector);
return g;
}
示例2: createLine
import com.ait.lienzo.client.core.shape.MultiPath; //导入依赖的package包/类
private static Object[] createLine(final double x1,
final double y1,
final double x2,
final double y2) {
final MultiPath head = new MultiPath();
final MultiPath tail = new MultiPath()
.M(DECORATOR_RADIUS,
-DECORATOR_RADIUS)
.circle(DECORATOR_RADIUS)
.setFillColor(ColorName.BLACK)
.setFillAlpha(1);
final DirectionalLine line = new DirectionalLine(x1,
y1,
x2,
y2);
line.setDashArray(new DashArray(4,
4));
line.setDraggable(true);
line.setSelectionStrokeOffset(SELECTION_OFFSET);
line.setHeadOffset(head.getBoundingBox().getHeight());
line.setTailOffset(tail.getBoundingBox().getHeight());
final MultiPathDecorator headDecorator = new MultiPathDecorator(head);
final MultiPathDecorator tailDecorator = new MultiPathDecorator(tail);
return new Object[]{line, headDecorator, tailDecorator};
}
示例3: createLine
import com.ait.lienzo.client.core.shape.MultiPath; //导入依赖的package包/类
private static Object[] createLine(final double x1,
final double y1,
final double x2,
final double y2) {
final MultiPath head = new MultiPath();
final MultiPath tail = new MultiPath();
final DirectionalLine line = new DirectionalLine(x1,
y1,
x2,
y2);
line.setDashArray(new DashArray(2,
6));
line.setDraggable(true);
line.setSelectionStrokeOffset(SELECTION_OFFSET);
line.setHeadOffset(head.getBoundingBox().getHeight());
line.setTailOffset(tail.getBoundingBox().getHeight());
final MultiPathDecorator headDecorator = new MultiPathDecorator(head);
final MultiPathDecorator tailDecorator = new MultiPathDecorator(tail);
return new Object[]{line, headDecorator, tailDecorator};
}
示例4: createLine
import com.ait.lienzo.client.core.shape.MultiPath; //导入依赖的package包/类
static Object[] createLine(final double... points) {
// The head decorator must be not visible, as connectors are unidirectional.
final MultiPath head = new MultiPath();
final MultiPath tail = new MultiPath()
.M(DECORATOR_WIDTH,
DECORATOR_HEIGHT)
.L(0,
DECORATOR_HEIGHT)
.L(DECORATOR_WIDTH / 2,
0)
.Z()
.setFillColor(ColorName.BLACK)
.setFillAlpha(1);
final OrthogonalPolyLine line =
new OrthogonalPolyLine(Point2DArray.fromArrayOfDouble(points));
line.setCornerRadius(5);
line.setDraggable(true);
line.setSelectionStrokeOffset(SELECTION_OFFSET);
line.setHeadOffset(head.getBoundingBox().getHeight());
line.setTailOffset(tail.getBoundingBox().getHeight());
final MultiPathDecorator headDecorator = new MultiPathDecorator(head);
final MultiPathDecorator tailDecorator = new MultiPathDecorator(tail);
return new Object[]{line, headDecorator, tailDecorator};
}
示例5: PictureShapeView
import com.ait.lienzo.client.core.shape.MultiPath; //导入依赖的package包/类
public PictureShapeView(final String uri,
final double width,
final double height) {
super(ShapeViewSupportedEvents.DESKTOP_NO_RESIZE_EVENT_TYPES,
new MultiPath()
.rect(0,
0,
width,
height)
.setStrokeAlpha(0)
.setFillAlpha(0));
this.picture = new Picture(uri,
picture -> {
scalePicture(picture,
width,
height);
addChild(picture);
refresh();
});
super.setResizable(false);
}
示例6: testCreateLine
import com.ait.lienzo.client.core.shape.MultiPath; //导入依赖的package包/类
@Test
public void testCreateLine() {
Object[] line = ConnectorView.createLine(0, 0, 10, 10);
MultiPathDecorator head = (MultiPathDecorator) line[1];
MultiPath headPath = head.getPath();
BoundingBox headBoundingBox = headPath.getBoundingBox();
MultiPathDecorator tail = (MultiPathDecorator) line[2];
MultiPath tailPath = tail.getPath();
BoundingBox tailBoundingBox = tailPath.getBoundingBox();
assertEquals(0, headBoundingBox.getWidth(), 0);
assertEquals(0, headBoundingBox.getHeight(), 0);
assertNotEquals(0, tailBoundingBox.getWidth(), 0);
assertNotEquals(0, tailBoundingBox.getHeight(), 0);
}
示例7: DecoratedShapeView
import com.ait.lienzo.client.core.shape.MultiPath; //导入依赖的package包/类
public DecoratedShapeView(final ViewEventType[] supportedEventTypes,
final WiresScalableContainer scalableContainer,
final Shape<?> theShape,
final double width,
final double height) {
super(setupDecorator(new MultiPath(),
0,
0,
width,
height),
scalableContainer);
setEventHandlerManager(new ViewEventHandlerManager(getGroup(),
theShape,
supportedEventTypes));
this.theShape = theShape;
this.scalableContainer = scalableContainer;
theShape.setFillBoundsForSelection(true);
scalableContainer.addScalable(theShape);
resize(0,
0,
width,
height,
false);
}
示例8: create
import com.ait.lienzo.client.core.shape.MultiPath; //导入依赖的package包/类
/**
* Append the path parts for a stage.
* @param path The source multipath
* @param w The stage width
* @param h The stage height
* @param voffset The chevron "V" offset
*/
private static MultiPath create(final MultiPath path,
final double w,
final double h,
final double voffset) {
path.M(0,
0).L(w,
0).L(w + voffset,
h / 2).L(w,
h).L(0,
h).L(voffset,
h / 2).L(0,
0).Z().close();
return path
.setFillColor(ColorName.LIGHTGOLDENRODYELLOW)
.setStrokeColor(ColorName.BLACK);
}
示例9: setup
import com.ait.lienzo.client.core.shape.MultiPath; //导入依赖的package包/类
public void setup() {
this.shapes = new ArrayList<>();
this.handler = getLayoutHandler();
this.container = spy(new MockCaseManagementShape());
this.container.setLayoutHandler(handler);
//Shapes are at (0,15), (0,30) and (0,45) by default. Set by LayoutManager.
for (int i = 0; i < 3; i++) {
final int index = i;
final WiresShape shape = new WiresShape(new MultiPath()) {
@Override
public String toString() {
return "WiresShape:" + index;
}
};
container.add(shape);
shapes.add(shape);
}
}
示例10: checkDropZonesAreAddedForCaseManagementShapesWithDropZone
import com.ait.lienzo.client.core.shape.MultiPath; //导入依赖的package包/类
@Test
public void checkDropZonesAreAddedForCaseManagementShapesWithDropZone() {
final MultiPath dropZone = mock(MultiPath.class);
when(dropZone.getAttributes()).thenReturn(mock(Attributes.class));
when(dropZone.getPathPartListArray()).thenReturn(new NFastArrayList<>());
final AbstractCaseManagementShape shape = mock(AbstractCaseManagementShape.class);
when(shape.getDropZone()).thenReturn(Optional.of(dropZone));
when(dropZone.getActualPathPartListArray()).thenReturn(new NFastArrayList<PathPartList>());
picker.addSupplementaryPaths(shape);
verify(picker,
times(1)).addDropZone(eq(shape));
verify(picker,
times(1)).drawShape(anyString(),
anyDouble(),
eq(dropZone),
any(PickerPart.class),
eq(true));
}
示例11: Tooltip
import com.ait.lienzo.client.core.shape.MultiPath; //导入依赖的package包/类
public Tooltip() {
this.path =
new MultiPath()
.setFillColor(PATH_FILL_COLOR)
.setStrokeColor(PATH_STROKE_COLOR);
this.text =
new Text("")
.setFillColor(TEXT_COLOR);
this.group =
new Group()
.setAlpha(0)
.add(path)
.add(text);
this.padding = 5;
this.direction = Direction.EAST;
this.animationHandle = null;
}
示例12: setUpGroupDecorator
import com.ait.lienzo.client.core.shape.MultiPath; //导入依赖的package包/类
private static MultiPath setUpGroupDecorator(final MultiPath primitive,
final Group group) {
final BoundingBox boundingBox = group.getBoundingBox();
final double width = boundingBox.getWidth();
final double height = boundingBox.getHeight();
return primitive
.clear()
.rect(0,
0,
width,
height)
.setFillAlpha(0.01)
.setStrokeAlpha(0.01)
.setListening(true)
.setFillBoundsForSelection(true)
.moveToTop();
}
示例13: testInit
import com.ait.lienzo.client.core.shape.MultiPath; //导入依赖的package包/类
@Test
public void testInit() {
assertNotNull(tested.getPrimitive());
assertTrue(tested.getPrimitive() instanceof MultiPath);
assertEquals(groupItem,
tested.getGroupItem());
assertEquals(boundingBox,
tested.getBoundingBox().get());
assertFalse(tested.isDecorated());
assertFalse(tested.hasTooltip());
assertFalse(tested.isVisible());
verify(group,
times(1)).setListening(eq(false));
verify(groupItem,
times(1)).add(eq(tested.getPrimitive()));
verify(groupItemPrimitive,
times(1)).add(eq(group));
}
示例14: doGenerate
import com.ait.lienzo.client.core.shape.MultiPath; //导入依赖的package包/类
@Override
public StringBuffer doGenerate(final MultiPathDefinition input) throws GeneratorException {
final String path = input.getPath();
final Map<String, Object> root = new HashMap<String, Object>();
root.put("className",
MultiPath.class.getName());
root.put("path",
path);
// Generate the code using the given template.
try {
return writeTemplate(root);
} catch (final GenerationException e) {
throw new GeneratorException(e);
}
}
示例15: getSelector
import com.ait.lienzo.client.core.shape.MultiPath; //导入依赖的package包/类
@Override
public MultiPath getSelector() {
final MultiPath selector = new MultiPath()
.setStrokeWidth(2.0)
.setStrokeColor(ColorName.RED)
.setShadow(new Shadow(ColorName.DARKRED,
4,
0.0,
0.0));
return selector;
}