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


Java Mediators类代码示例

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


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

示例1: testSetupMouseDragSynchronization

import com.ait.lienzo.client.core.mediator.Mediators; //导入依赖的package包/类
@Test
public void testSetupMouseDragSynchronization() {

    final RestrictedMousePanMediator mediator = mock(RestrictedMousePanMediator.class);
    final LienzoPanel lienzoPanel = mock(LienzoPanel.class);
    final Viewport viewport = mock(Viewport.class);
    final Mediators mediators = mock(Mediators.class);

    doReturn(mediator).when(gridLienzoScrollHandler).makeRestrictedMousePanMediator();
    doReturn(lienzoPanel).when(gridLienzoScrollHandler).getLienzoPanel();
    doReturn(viewport).when(lienzoPanel).getViewport();
    doReturn(mediators).when(viewport).getMediators();

    gridLienzoScrollHandler.setupMouseDragSynchronization();

    verify(mediators).push(mediator);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:GridLienzoScrollHandlerTest.java

示例2: testGetMousePanMediator

import com.ait.lienzo.client.core.mediator.Mediators; //导入依赖的package包/类
@Test
public void testGetMousePanMediator() {

    final RestrictedMousePanMediator expectedMediator = mock(RestrictedMousePanMediator.class);
    final LienzoPanel lienzoPanel = mock(LienzoPanel.class);
    final Viewport viewport = mock(Viewport.class);
    final Mediators mediators = mock(Mediators.class);

    doReturn(lienzoPanel).when(gridLienzoScrollHandler).getLienzoPanel();
    doReturn(viewport).when(lienzoPanel).getViewport();
    doReturn(mediators).when(viewport).getMediators();
    doReturn(expectedMediator).when(gridLienzoScrollHandler).makeRestrictedMousePanMediator();

    gridLienzoScrollHandler.setupMouseDragSynchronization();

    final RestrictedMousePanMediator actualMediator = gridLienzoScrollHandler.getMousePanMediator();

    assertEquals(expectedMediator,
                 actualMediator);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:GridLienzoScrollHandlerTest.java

示例3: testSetup

import com.ait.lienzo.client.core.mediator.Mediators; //导入依赖的package包/类
@Test
public void testSetup() throws Exception {
    final AbsolutePanel mainPanel = mock(AbsolutePanel.class);
    final Transform transform = mock(Transform.class);
    final Viewport viewport = mock(Viewport.class);
    final Mediators mediators = mock(Mediators.class);
    final Element element = mock(Element.class);

    doReturn(transform).when(transform).scale(anyDouble());

    doReturn(transform).when(view).newTransform();

    doReturn(mediators).when(viewport).getMediators();

    doReturn(element).when(mockGridPanel).getElement();
    doReturn(mainPanel).when(mockGridPanel).getScrollPanel();
    doReturn(viewport).when(mockGridPanel).getViewport();

    view.setup();

    verify(view).setupGridPanel();
    verify(mediators).push(restrictedMousePanMediator);
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:24,代码来源:GuidedDecisionTableModellerViewImplTest.java

示例4: setup

import com.ait.lienzo.client.core.mediator.Mediators; //导入依赖的package包/类
@Before
public void setup() {
    this.manager = new DefaultPinnedModeManager(gridLayer) {
        @Override
        protected void doEnterPinnedMode(final Command onStartCommand,
                                         final GridWidget gridWidget,
                                         final Set<GridWidget> gridWidgetsToFadeFromView,
                                         final Set<IPrimitive<?>> gridWidgetConnectorsToFadeFromView) {
            assertEquals(DefaultPinnedModeManagerTest.this.gridWidget,
                         gridWidget);
            assertTrue(gridWidgetsToFadeFromView.isEmpty());
            assertTrue(gridWidgetConnectorsToFadeFromView.isEmpty());
            onStartCommand.execute();
        }

        @Override
        protected void doExitPinnedMode(final Command onCompleteCommand,
                                        final Set<GridWidget> gridWidgetsToFadeIntoView,
                                        final Set<IPrimitive<?>> gridWidgetConnectorsToFadeIntoView) {
            assertTrue(gridWidgetsToFadeIntoView.isEmpty());
            assertTrue(gridWidgetConnectorsToFadeIntoView.isEmpty());
            onCompleteCommand.execute();
        }
    };
    this.mediators = new Mediators(viewport);
    this.mediators.push(new RestrictedMousePanMediator(gridLayer));

    when(gridLayer.getViewport()).thenReturn(viewport);
    when(gridLayer.getDefaultTransformMediator()).thenReturn(defaultMediator);
    when(gridWidget.getViewport()).thenReturn(viewport);
    when(gridWidget.getLayer()).thenReturn(layer);
    when(viewport.getMediators()).thenReturn(mediators);
    when(viewport.getTransform()).thenReturn(transform);
    when(transform.copy()).thenReturn(transform);
    when(transform.getInverse()).thenReturn(transform);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:37,代码来源:DefaultPinnedModeManagerTest.java

示例5: testRadarIsUpdatedAfterScrolling

import com.ait.lienzo.client.core.mediator.Mediators; //导入依赖的package包/类
@Test
public void testRadarIsUpdatedAfterScrolling() throws Exception {
    final ArgumentCaptor<ScrollHandler> scrollHandler = ArgumentCaptor.forClass(ScrollHandler.class);
    final ScrollEvent scrollEvent = mock(ScrollEvent.class);
    final AbsolutePanel mainPanel = mock(AbsolutePanel.class);
    final Transform transform = mock(Transform.class);
    final Viewport viewport = mock(Viewport.class);
    final Mediators mediators = mock(Mediators.class);
    final Element element = mock(Element.class);

    doReturn(transform).when(transform).scale(anyDouble());

    doReturn(presenter).when(view).getPresenter();
    doReturn(transform).when(view).newTransform();

    doReturn(mediators).when(viewport).getMediators();

    doReturn(element).when(mockGridPanel).getElement();
    doReturn(mainPanel).when(mockGridPanel).getScrollPanel();
    doReturn(viewport).when(mockGridPanel).getViewport();

    view.setupGridPanel();

    verify(mainPanel).addDomHandler(scrollHandler.capture(),
                                    eq(ScrollEvent.getType()));

    scrollHandler.getValue().onScroll(scrollEvent);

    verify(presenter).updateRadar();
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:31,代码来源:GuidedDecisionTableModellerViewImplTest.java

示例6: getMediators

import com.ait.lienzo.client.core.mediator.Mediators; //导入依赖的package包/类
private Mediators getMediators() {
    final Viewport viewport = gridLayer.getViewport();
    final Mediators mediators = viewport.getMediators();
    return mediators;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:6,代码来源:DefaultPinnedModeManager.java

示例7: setup

import com.ait.lienzo.client.core.mediator.Mediators; //导入依赖的package包/类
@Before
public void setup() {
    this.uiColumn1 = new RowNumberColumn();
    this.uiColumn2 = new BaseGridColumn<>(new BaseHeaderMetaData("title"),
                                          columnRenderer,
                                          100.0);
    this.uiModel = new BaseGridData() {{
        setHeaderRowCount(2);
    }};
    uiModel.appendColumn(uiColumn1);
    uiModel.appendColumn(uiColumn2);
    uiModel.appendRow(new BaseGridRow());
    uiModel.appendRow(new BaseGridRow());
    uiModel.appendRow(new BaseGridRow());

    this.mediators = new Mediators(viewport);

    when(renderer.getHeaderHeight()).thenReturn(64.0);
    when(renderer.getHeaderRowHeight()).thenReturn(32.0);

    when(layer.getViewport()).thenReturn(viewport);
    when(viewport.getElement()).thenReturn(element);
    when(viewport.getMediators()).thenReturn(mediators);
    when(element.getStyle()).thenReturn(style);
    when(gridWidget.getModel()).thenReturn(uiModel);
    when(gridWidget.getViewport()).thenReturn(viewport);
    when(gridWidget.getRenderer()).thenReturn(renderer);
    when(gridWidget.getRendererHelper()).thenReturn(helper);
    when(gridWidget.getWidth()).thenReturn(150.0);
    when(gridWidget.getHeight()).thenReturn(124.0);
    when(gridWidget.getAbsoluteX()).thenReturn(100.0);
    when(gridWidget.getAbsoluteY()).thenReturn(100.0);

    final BaseGridRendererHelper.RenderingInformation ri = new BaseGridRendererHelper.RenderingInformation(mock(Bounds.class),
                                                                                                           uiModel.getColumns(),
                                                                                                           new BaseGridRendererHelper.RenderingBlockInformation(uiModel.getColumns(),
                                                                                                                                                                0.0,
                                                                                                                                                                0.0,
                                                                                                                                                                0.0,
                                                                                                                                                                100),
                                                                                                           new BaseGridRendererHelper.RenderingBlockInformation(Collections.emptyList(),
                                                                                                                                                                0.0,
                                                                                                                                                                0.0,
                                                                                                                                                                0.0,
                                                                                                                                                                0.0),
                                                                                                           0,
                                                                                                           2,
                                                                                                           new ArrayList<Double>() {{
                                                                                                               add(20.0);
                                                                                                               add(40.0);
                                                                                                               add(60.0);
                                                                                                           }},
                                                                                                           false,
                                                                                                           false,
                                                                                                           0,
                                                                                                           2,
                                                                                                           0);
    when(helper.getRenderingInformation()).thenReturn(ri);

    final GridWidgetDnDHandlersState wrappedState = new GridWidgetDnDHandlersState();
    this.state = spy(wrappedState);

    final GridWidgetDnDMouseMoveHandler wrapped = new GridWidgetDnDMouseMoveHandler(layer,
                                                                                    state);
    this.handler = spy(wrapped);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:67,代码来源:GridWidgetDnDMouseMoveHandlerTest.java


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