当前位置: 首页>>代码示例>>Java>>正文


Java NodeMouseClickHandler类代码示例

本文整理汇总了Java中com.ait.lienzo.client.core.event.NodeMouseClickHandler的典型用法代码示例。如果您正苦于以下问题:Java NodeMouseClickHandler类的具体用法?Java NodeMouseClickHandler怎么用?Java NodeMouseClickHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NodeMouseClickHandler类属于com.ait.lienzo.client.core.event包,在下文中一共展示了NodeMouseClickHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: build

import com.ait.lienzo.client.core.event.NodeMouseClickHandler; //导入依赖的package包/类
public TemplateShape build(final String templateName,
                           final NodeMouseClickHandler clickHandler) {

    final TemplateShape templateShape = new TemplateShape();
    final Shape shape = drawShape();
    final Rectangle bounding = drawBoundingBox();
    final Text description = drawDescription(templateName);

    //Attach handles for drag operation
    shape.addNodeMouseClickHandler(clickHandler);
    bounding.addNodeMouseClickHandler(clickHandler);
    description.addNodeMouseClickHandler(clickHandler);

    //Build Template Shape
    templateShape.setBounding(bounding);
    templateShape.setShape(shape);
    templateShape.setDescription(description);

    return templateShape;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:StencilTemplateBuilder.java

示例2: WiresBaseShape

import com.ait.lienzo.client.core.event.NodeMouseClickHandler; //导入依赖的package包/类
public WiresBaseShape() {
    id = UUID.uuid();
    setDraggable(true);

    //Clicking the Group selects the Shape
    addNodeMouseClickHandler(new NodeMouseClickHandler() {
        @Override
        public void onNodeMouseClick(final NodeMouseClickEvent nodeMouseClickEvent) {
            selectionManager.selectShape(WiresBaseShape.this);
        }
    });

    //Update Control positions when Shape is dragged
    addNodeDragMoveHandler(new NodeDragMoveHandler() {
        @Override
        public void onNodeDragMove(final NodeDragMoveEvent nodeDragMoveEvent) {
            updateControlLocations();
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:WiresBaseShape.java

示例3: setup

import com.ait.lienzo.client.core.event.NodeMouseClickHandler; //导入依赖的package包/类
@Before
@SuppressWarnings("unchecked")
public void setup() throws Exception {
    super.init();
    when(buttonsFactory.dropRight(any(Group.class))).thenReturn(buttonGridItem);
    when(decoratorsFactory.button()).thenReturn(buttonDecorator);
    when(buttonDecorator.configure(any(Consumer.class))).thenReturn(buttonDecorator);
    when(buttonDecorator.setBoundingBox(any(BoundingBox.class))).thenReturn(buttonDecorator);
    when(buttonDecorator.setPadding(anyDouble())).thenReturn(buttonDecorator);
    when(buttonDecorator.copy()).thenReturn(buttonDecorator);
    when(buttonGridItem.tooltip(any(TooltipItem.class))).thenReturn(buttonGridItem);
    when(buttonGridItem.grid(any(Point2DGrid.class))).thenReturn(buttonGridItem);
    when(buttonGridItem.decorate(any(DecoratorItem.class))).thenReturn(buttonGridItem);
    when(buttonGridItem.decorateGrid(any(DecoratorItem.class))).thenReturn(buttonGridItem);
    when(buttonGridItem.onMouseEnter(any(NodeMouseEnterHandler.class))).thenReturn(buttonGridItem);
    when(buttonGridItem.onMouseExit(any(NodeMouseExitHandler.class))).thenReturn(buttonGridItem);
    when(buttonGridItem.onClick(any(NodeMouseClickHandler.class))).thenReturn(buttonGridItem);
    this.tested = new MorphActionsToolboxView(glyphRenderers,
                                              toolboxFactory);
    when(toolbox.getView()).thenReturn(tested);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:22,代码来源:MorphActionsToolboxViewTest.java

示例4: testClick

import com.ait.lienzo.client.core.event.NodeMouseClickHandler; //导入依赖的package包/类
@Test
public void testClick() {
    NodeMouseClickHandler handler = mock(NodeMouseClickHandler.class);
    final ButtonItemImpl cascade = tested.onClick(handler);
    assertEquals(tested,
                 cascade);
    ;
    verify(groupItemPrim,
           times(1)).setListening(eq(true));
    verify(groupItemPrim,
           times(1)).addNodeMouseClickHandler(eq(handler));
    verify(registrations,
           times(1)).register(eq(clickReg));
    tested.destroy();
    verify(clickReg,
           times(1)).removeHandler();
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:18,代码来源:ButtonItemImplTest.java

示例5: getTemplateClickHandler

import com.ait.lienzo.client.core.event.NodeMouseClickHandler; //导入依赖的package包/类
private NodeMouseClickHandler getTemplateClickHandler(final String templateName) {
    return new NodeMouseClickHandler() {
        @Override
        public void onNodeMouseClick(final NodeMouseClickEvent event) {
            bayesianEvent.fire(new BayesianTemplateSelectedEvent(templateName));
        }
    };
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:9,代码来源:TemplatesGroup.java

示例6: getClearCanvasClickHandler

import com.ait.lienzo.client.core.event.NodeMouseClickHandler; //导入依赖的package包/类
private NodeMouseClickHandler getClearCanvasClickHandler() {
    return new NodeMouseClickHandler() {
        @Override
        public void onNodeMouseClick(final NodeMouseClickEvent event) {
            if (Window.confirm("Are you sure to clean the canvas?")) {
                clearEvent.fire(new ClearEvent());
            }
        }
    };
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:11,代码来源:ActionsGroup.java

示例7: build

import com.ait.lienzo.client.core.event.NodeMouseClickHandler; //导入依赖的package包/类
public ActionShape build(final NodeMouseClickHandler clickHandler,
                         final ImageResource img) {
    final Rectangle bounding = getBoundingImage(clickHandler);
    final ActionShape shape = new ActionShape();
    shape.setBounding(bounding);
    new Picture(img,
                shape::setPicture,
                WIDTH_PICTURE,
                HEIGHT_PICTURE,
                false);
    return shape;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:13,代码来源:StencilActionBuilder.java

示例8: build

import com.ait.lienzo.client.core.event.NodeMouseClickHandler; //导入依赖的package包/类
public LayerShape build(final WiresBaseShape shape,
                        final ShapeFactory factory) {
    final LayerShape layerShape = new LayerShape();
    final Rectangle bounding = drawBoundingBox();
    final ShapeGlyph glyph = factory.getGlyph();

    //Get display name to show in Panel
    final String name = (shape instanceof OverridesFactoryDescription) ? ((OverridesFactoryDescription) shape).getDescription() : factory.getShapeDescription();
    final Text description = drawDescription(name);

    //Clicking on the Shape selects it - Lienzo doesn't support bubbling click events down through
    //overlapping items as it uses a bitmap SelectionLayer to detect mouse-clicks. Therefore we need
    //to attach the handler to all elements
    final NodeMouseClickHandler handler = new NodeMouseClickHandler() {
        @Override
        public void onNodeMouseClick(final NodeMouseClickEvent nodeMouseClickEvent) {
            shapeSelectedEvent.fire(new ShapeSelectedEvent(shape));
        }
    };
    layerShape.addNodeMouseClickHandler(handler);

    //Build Layer Shape
    layerShape.setBounding(bounding);
    layerShape.setDescription(description);
    layerShape.setGroup(scaleGlyph(glyph));

    return layerShape;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:29,代码来源:StencilLayerBuilder.java

示例9: testAddButton

import com.ait.lienzo.client.core.event.NodeMouseClickHandler; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected void testAddButton(final Consumer<MouseClickEvent> clickEventConsumer) {
    // Verify tootlip.
    verify(toolboxTooltip,
           times(1)).createItem(eq("title1"));
    verify(buttonItem,
           times(1)).tooltip(any(TooltipItem.class));
    // Verify mouse enter.
    final ArgumentCaptor<NodeMouseEnterHandler> enterHandlerArgumentCaptor =
            ArgumentCaptor.forClass(NodeMouseEnterHandler.class);
    verify(buttonItem,
           times(1)).onMouseEnter(enterHandlerArgumentCaptor.capture());
    final NodeMouseEnterHandler enterHandler = enterHandlerArgumentCaptor.getValue();
    final NodeMouseEnterEvent mouseEnterEvent = mock(NodeMouseEnterEvent.class);
    enterHandler.onNodeMouseEnter(mouseEnterEvent);
    verify(canvasView,
           times(1)).setCursor(eq(AbstractCanvas.Cursors.POINTER));
    // Verify mouse exit.
    final ArgumentCaptor<NodeMouseExitHandler> exitHandlerArgumentCaptor =
            ArgumentCaptor.forClass(NodeMouseExitHandler.class);
    verify(buttonItem,
           times(1)).onMouseExit(exitHandlerArgumentCaptor.capture());
    final NodeMouseExitHandler exitHandler = exitHandlerArgumentCaptor.getValue();
    final NodeMouseExitEvent mouseExitEvent = mock(NodeMouseExitEvent.class);
    exitHandler.onNodeMouseExit(mouseExitEvent);
    verify(canvasView,
           times(1)).setCursor(eq(AbstractCanvas.Cursors.AUTO));
    // Verify mouse click.
    final ArgumentCaptor<NodeMouseClickHandler> clickHandlerArgumentCaptor =
            ArgumentCaptor.forClass(NodeMouseClickHandler.class);
    verify(buttonItem,
           times(1)).onClick(clickHandlerArgumentCaptor.capture());
    final NodeMouseClickHandler clickHandler = clickHandlerArgumentCaptor.getValue();
    final NodeMouseClickEvent mouseClickEvent = mock(NodeMouseClickEvent.class);
    when(mouseClickEvent.getMouseEvent()).thenReturn(mock(MouseEvent.class));
    clickHandler.onNodeMouseClick(mouseClickEvent);
    verify(clickEventConsumer,
           times(1)).accept(any(MouseClickEvent.class));
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:40,代码来源:AbstractActionsToolboxViewTest.java

示例10: onClick

import com.ait.lienzo.client.core.event.NodeMouseClickHandler; //导入依赖的package包/类
@Override
public ButtonItemImpl onClick(final NodeMouseClickHandler handler) {
    assert null != handler;
    removeClickHandlerRegistration();
    clickHandlerRegistration = item
            .getPrimitive()
            .setListening(true)
            .addNodeMouseClickHandler(handler);
    item.registrations().register(clickHandlerRegistration);
    return this;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:12,代码来源:ButtonItemImpl.java

示例11: testClick

import com.ait.lienzo.client.core.event.NodeMouseClickHandler; //导入依赖的package包/类
@Test
public void testClick() {
    NodeMouseClickHandler handler = mock(NodeMouseClickHandler.class);
    tested.onClick(handler);
    verify(button,
           times(1)).onClick(eq(handler));
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:8,代码来源:ButtonGridItemImplTest.java

示例12: setUp

import com.ait.lienzo.client.core.event.NodeMouseClickHandler; //导入依赖的package包/类
@Before
@SuppressWarnings("unchecked")
public void setUp() {
    when(groupItem.registrations()).thenReturn(registrations);
    when(groupItem.getPrimitive()).thenReturn(groupItemPrim);
    when(groupItemPrim.setListening(anyBoolean())).thenReturn(groupItemPrim);
    when(groupItemPrim.setDraggable(anyBoolean())).thenReturn(groupItemPrim);
    when(groupItemPrim.addNodeMouseClickHandler(any(NodeMouseClickHandler.class))).thenReturn(clickReg);
    when(groupItemPrim.addNodeDragStartHandler(any(NodeDragStartHandler.class))).thenReturn(dragStartReg);
    when(groupItemPrim.addNodeDragMoveHandler(any(NodeDragMoveHandler.class))).thenReturn(dragMoveReg);
    when(groupItemPrim.addNodeDragEndHandler(any(NodeDragEndHandler.class))).thenReturn(dragEndReg);
    when(groupItem.asPrimitive()).thenReturn(groupItemGroup);
    when(boundingPoints.getBoundingBox()).thenReturn(boundingBox);
    when(groupItem.getBoundingBox()).thenReturn(() -> boundingBox);
    doAnswer(invocationOnMock -> {
        ((Command) invocationOnMock.getArguments()[0]).execute();
        ((Command) invocationOnMock.getArguments()[1]).execute();
        return groupItem;
    }).when(groupItem).show(any(Command.class),
                            any(Command.class));
    doAnswer(invocationOnMock -> {
        ((Command) invocationOnMock.getArguments()[0]).execute();
        ((Command) invocationOnMock.getArguments()[1]).execute();
        return groupItem;
    }).when(groupItem).hide(any(Command.class),
                            any(Command.class));
    tested =
            new ButtonItemImpl(groupItem)
                    .useHideExecutor(hideExecutor)
                    .useShowExecutor(showExecutor);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:32,代码来源:ButtonItemImplTest.java

示例13: getGridMouseClickHandler

import com.ait.lienzo.client.core.event.NodeMouseClickHandler; //导入依赖的package包/类
protected NodeMouseClickHandler getGridMouseClickHandler(final GridSelectionManager selectionManager) {
    return new BaseGridWidgetMouseClickHandler(this,
                                               selectionManager,
                                               renderer);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:6,代码来源:BaseGridWidget.java

示例14: getGridMouseCellSelectorClickHandler

import com.ait.lienzo.client.core.event.NodeMouseClickHandler; //导入依赖的package包/类
protected NodeMouseClickHandler getGridMouseCellSelectorClickHandler(final GridSelectionManager selectionManager) {
    return new GridCellSelectorMouseClickHandler(this,
                                                 selectionManager,
                                                 renderer);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:6,代码来源:BaseGridWidget.java

示例15: getBoundingImage

import com.ait.lienzo.client.core.event.NodeMouseClickHandler; //导入依赖的package包/类
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;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:7,代码来源:StencilActionBuilder.java


注:本文中的com.ait.lienzo.client.core.event.NodeMouseClickHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。