本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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;
}
示例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);
}