use of com.ait.lienzo.client.core.types.Transform in project drools-wb by kiegroup.
the class GuidedDecisionTableModellerViewImplTest method testRadarIsUpdatedAfterScrolling.
@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();
}
use of com.ait.lienzo.client.core.types.Transform in project drools-wb by kiegroup.
the class RadarMenuBuilderTest method testOnDragVisibleBounds.
@Test
public void testOnDragVisibleBounds() {
final ArgumentCaptor<Transform> transformArgumentCaptor = ArgumentCaptor.forClass(Transform.class);
builder.onDragVisibleBounds(10, 10);
verify(modellerViewport, times(1)).setTransform(transformArgumentCaptor.capture());
final Transform result = transformArgumentCaptor.getValue();
assertNotNull(result);
assertEquals(-10.0, result.getTranslateX(), 0.0);
assertEquals(-10.0, result.getTranslateY(), 0.0);
verify(modellerLayer, times(1)).batch();
}
use of com.ait.lienzo.client.core.types.Transform in project drools-wb by kiegroup.
the class RadarMenuBuilderTest method testOnDragVisibleBoundsScaled50pct.
@Test
public void testOnDragVisibleBoundsScaled50pct() {
final ArgumentCaptor<Transform> transformArgumentCaptor = ArgumentCaptor.forClass(Transform.class);
transform.scale(0.5, 0.5);
builder.onDragVisibleBounds(10, 10);
verify(modellerViewport, times(1)).setTransform(transformArgumentCaptor.capture());
final Transform result = transformArgumentCaptor.getValue();
assertNotNull(result);
assertEquals(-5.0, result.getTranslateX(), 0.0);
assertEquals(-5.0, result.getTranslateY(), 0.0);
verify(modellerLayer, times(1)).batch();
verify(modellerView).refreshScrollPosition();
}
use of com.ait.lienzo.client.core.types.Transform in project drools-wb by kiegroup.
the class ColumnHeaderPopOverImpl method getScreenY.
private int getScreenY(final GuidedDecisionTableModellerView modellerView, final GuidedDecisionTableView.Presenter dtPresenter) {
final GridWidget gridWidget = dtPresenter.getView();
final double gy = gridWidget.getY();
final GridLayer layer = modellerView.getGridLayerView();
final int containerY = layer.getDomElementContainer().getAbsoluteTop();
final double vy = layer.getVisibleBounds().getY();
final Transform t = layer.getViewport().getTransform();
final Group header = gridWidget.getHeader();
final double headerHeight = gridWidget.getRenderer().getHeaderHeight();
final double headerRowHeight = gridWidget.getRenderer().getHeaderRowHeight();
final double offsetY = header == null ? 0 : header.getY();
final int screenY = containerY + (int) ((gy - vy + offsetY + headerHeight - headerRowHeight / 2) * t.getScaleX());
return screenY;
}
Aggregations