本文整理匯總了Java中com.ait.lienzo.client.core.types.Transform類的典型用法代碼示例。如果您正苦於以下問題:Java Transform類的具體用法?Java Transform怎麽用?Java Transform使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Transform類屬於com.ait.lienzo.client.core.types包,在下文中一共展示了Transform類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: adjustViewportTransform
import com.ait.lienzo.client.core.types.Transform; //導入依賴的package包/類
private void adjustViewportTransform(final Viewport vp,
final Point2D delta) {
final Transform transform = vp.getTransform();
final Transform t = transform.copy().getInverse();
final Point2D translation = new Point2D(t.getTranslateX(),
t.getTranslateY()).mul(-1.0);
final double scaleX = transform.getScaleX();
final double scaleY = transform.getScaleY();
transform.reset();
final Point2D frameLocation = translation.add(delta);
transform.scale(scaleX,
scaleY).translate(frameLocation.getX(),
frameLocation.getY());
}
示例2: GridBodyColumnRenderContext
import com.ait.lienzo.client.core.types.Transform; //導入依賴的package包/類
public GridBodyColumnRenderContext(final double absoluteGridX,
final double absoluteGridY,
final double absoluteColumnX,
final double clipMinY,
final double clipMinX,
final int minVisibleRowIndex,
final int maxVisibleRowIndex,
final boolean isFloating,
final GridData model,
final Transform transform,
final GridRenderer renderer) {
this.absoluteGridX = absoluteGridX;
this.absoluteGridY = absoluteGridY;
this.absoluteColumnX = absoluteColumnX;
this.clipMinY = clipMinY;
this.clipMinX = clipMinX;
this.minVisibleRowIndex = minVisibleRowIndex;
this.maxVisibleRowIndex = maxVisibleRowIndex;
this.isFloating = isFloating;
this.model = model;
this.transform = transform;
this.renderer = renderer;
}
示例3: GridBodyRenderContext
import com.ait.lienzo.client.core.types.Transform; //導入依賴的package包/類
public GridBodyRenderContext(final double absoluteGridX,
final double absoluteGridY,
final double absoluteColumnOffsetX,
final double clipMinY,
final double clipMinX,
final int minVisibleRowIndex,
final int maxVisibleRowIndex,
final List<GridColumn<?>> blockColumns,
final boolean isSelectionLayer,
final Transform transform,
final GridRenderer renderer,
final SelectionsTransformer transformer) {
this.absoluteGridX = absoluteGridX;
this.absoluteGridY = absoluteGridY;
this.absoluteColumnOffsetX = absoluteColumnOffsetX;
this.clipMinY = clipMinY;
this.clipMinX = clipMinX;
this.minVisibleRowIndex = minVisibleRowIndex;
this.maxVisibleRowIndex = maxVisibleRowIndex;
this.blockColumns = blockColumns;
this.isSelectionLayer = isSelectionLayer;
this.transform = transform;
this.renderer = renderer;
this.transformer = transformer;
}
示例4: GridBodyCellRenderContext
import com.ait.lienzo.client.core.types.Transform; //導入依賴的package包/類
public GridBodyCellRenderContext(final double absoluteCellX,
final double absoluteCellY,
final double cellWidth,
final double cellHeight,
final double clipMinY,
final double clipMinX,
final int rowIndex,
final int columnIndex,
final boolean isFloating,
final Transform transform,
final GridRenderer renderer) {
this.absoluteCellX = absoluteCellX;
this.absoluteCellY = absoluteCellY;
this.cellWidth = cellWidth;
this.cellHeight = cellHeight;
this.clipMinY = clipMinY;
this.clipMinX = clipMinX;
this.rowIndex = rowIndex;
this.columnIndex = columnIndex;
this.isFloating = isFloating;
this.transform = transform;
this.renderer = renderer;
}
示例5: updatePinnedContext
import com.ait.lienzo.client.core.types.Transform; //導入依賴的package包/類
@Override
public void updatePinnedContext(final GridWidget gridWidget) throws IllegalStateException {
if (context == null) {
throw new IllegalStateException("'pinned' mode has not been entered.");
}
for (IMediator mediator : gridLayer.getViewport().getMediators()) {
if (mediator instanceof RestrictedMousePanMediator) {
((RestrictedMousePanMediator) mediator).setTransformMediator(new GridTransformMediator(gridWidget));
}
}
final Transform transform = gridWidget.getViewport().getTransform();
final double scaleX = context.getScaleX();
final double scaleY = context.getScaleY();
final double translateX = transform.getTranslateX() * scaleX;
final double translateY = transform.getTranslateY() * scaleY;
context = new PinnedContext(gridWidget,
translateX,
translateY,
context.getScaleX(),
context.getScaleY());
}
示例6: onMouseDown
import com.ait.lienzo.client.core.types.Transform; //導入依賴的package包/類
protected void onMouseDown(final NodeMouseDownEvent event) {
m_last = new Point2D(event.getX(),
event.getY());
m_dragging = true;
Transform transform = getTransform();
if (transform == null) {
setTransform(transform = new Transform());
}
m_inverseTransform = transform.getInverse();
m_inverseTransform.transform(m_last,
m_last);
setCursor(Style.Cursor.MOVE);
}
示例7: testLeftEdge
import com.ait.lienzo.client.core.types.Transform; //導入依賴的package包/類
@Test
public void testLeftEdge() {
final Bounds visibleBounds = new BaseBounds(-500,
-500,
1000,
1000);
final Transform test = new Transform().translate(1200.0,
0.0);
final Transform result = restriction.adjust(test,
visibleBounds);
assertNotNull(result);
assertEquals(1000.0,
result.getTranslateX(),
0.0);
assertEquals(0.0,
result.getTranslateY(),
0.0);
}
示例8: testRightEdge
import com.ait.lienzo.client.core.types.Transform; //導入依賴的package包/類
@Test
public void testRightEdge() {
final Bounds visibleBounds = new BaseBounds(-500,
-500,
1000,
1000);
final Transform test = new Transform().translate(-200.0,
0.0);
final Transform result = restriction.adjust(test,
visibleBounds);
assertNotNull(result);
assertEquals(0.0,
result.getTranslateX(),
0.0);
assertEquals(0.0,
result.getTranslateY(),
0.0);
}
示例9: testTopEdge
import com.ait.lienzo.client.core.types.Transform; //導入依賴的package包/類
@Test
public void testTopEdge() {
final Bounds visibleBounds = new BaseBounds(-500,
-500,
1000,
1000);
final Transform test = new Transform().translate(0.0,
1200.0);
final Transform result = restriction.adjust(test,
visibleBounds);
assertNotNull(result);
assertEquals(0.0,
result.getTranslateX(),
0.0);
assertEquals(1000.0,
result.getTranslateY(),
0.0);
}
示例10: testBottomEdge
import com.ait.lienzo.client.core.types.Transform; //導入依賴的package包/類
@Test
public void testBottomEdge() {
final Bounds visibleBounds = new BaseBounds(-500,
-500,
1000,
1000);
final Transform test = new Transform().translate(0.0,
-200.0);
final Transform result = restriction.adjust(test,
visibleBounds);
assertNotNull(result);
assertEquals(0.0,
result.getTranslateX(),
0.0);
assertEquals(0.0,
result.getTranslateY(),
0.0);
}
示例11: testGridNarrowerThanVisibleBounds
import com.ait.lienzo.client.core.types.Transform; //導入依賴的package包/類
@Test
public void testGridNarrowerThanVisibleBounds() {
when(grid.getX()).thenReturn(10.0);
when(grid.getY()).thenReturn(0.0);
when(grid.getWidth()).thenReturn(100.0);
when(grid.getHeight()).thenReturn(100.0);
final Bounds visibleBounds = new BaseBounds(-500,
-500,
1000,
1000);
final Transform test = new Transform().translate(1200.0,
0.0);
final Transform result = restriction.adjust(test,
visibleBounds);
assertNotNull(result);
assertEquals(-10.0,
result.getTranslateX(),
0.0);
assertEquals(0.0,
result.getTranslateY(),
0.0);
}
示例12: testGridShorterThanVisibleBounds
import com.ait.lienzo.client.core.types.Transform; //導入依賴的package包/類
@Test
public void testGridShorterThanVisibleBounds() {
when(grid.getX()).thenReturn(0.0);
when(grid.getY()).thenReturn(10.0);
when(grid.getWidth()).thenReturn(100.0);
when(grid.getHeight()).thenReturn(100.0);
final Bounds visibleBounds = new BaseBounds(-500,
-500,
1000,
1000);
final Transform test = new Transform().translate(1200.0,
0.0);
final Transform result = restriction.adjust(test,
visibleBounds);
assertNotNull(result);
assertEquals(0.0,
result.getTranslateX(),
0.0);
assertEquals(-10.0,
result.getTranslateY(),
0.0);
}
示例13: testGridWiderThanVisibleBoundsLeftEdge
import com.ait.lienzo.client.core.types.Transform; //導入依賴的package包/類
@Test
public void testGridWiderThanVisibleBoundsLeftEdge() {
when(grid.getX()).thenReturn(10.0);
when(grid.getY()).thenReturn(0.0);
when(grid.getWidth()).thenReturn(1100.0);
when(grid.getHeight()).thenReturn(100.0);
final Bounds visibleBounds = new BaseBounds(-500,
-500,
1000,
1000);
final Transform test = new Transform().translate(1200.0,
0.0);
final Transform result = restriction.adjust(test,
visibleBounds);
assertNotNull(result);
assertEquals(-10.0,
result.getTranslateX(),
0.0);
assertEquals(0.0,
result.getTranslateY(),
0.0);
}
示例14: testGridWiderThanVisibleBoundsRightEdge
import com.ait.lienzo.client.core.types.Transform; //導入依賴的package包/類
@Test
public void testGridWiderThanVisibleBoundsRightEdge() {
when(grid.getX()).thenReturn(10.0);
when(grid.getY()).thenReturn(0.0);
when(grid.getWidth()).thenReturn(1100.0);
when(grid.getHeight()).thenReturn(100.0);
final Bounds visibleBounds = new BaseBounds(-500,
-500,
1000,
1000);
final Transform test = new Transform().translate(-200.0,
0.0);
final Transform result = restriction.adjust(test,
visibleBounds);
assertNotNull(result);
assertEquals(-110.0,
result.getTranslateX(),
0.0);
assertEquals(0.0,
result.getTranslateY(),
0.0);
}
示例15: testGridTallerThanVisibleBoundsTopEdge
import com.ait.lienzo.client.core.types.Transform; //導入依賴的package包/類
@Test
public void testGridTallerThanVisibleBoundsTopEdge() {
when(grid.getX()).thenReturn(0.0);
when(grid.getY()).thenReturn(10.0);
when(grid.getWidth()).thenReturn(100.0);
when(grid.getHeight()).thenReturn(1100.0);
final Bounds visibleBounds = new BaseBounds(-500,
-500,
1000,
1000);
final Transform test = new Transform().translate(0.0,
1200.0);
final Transform result = restriction.adjust(test,
visibleBounds);
assertNotNull(result);
assertEquals(0.0,
result.getTranslateX(),
0.0);
assertEquals(-10.0,
result.getTranslateY(),
0.0);
}