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


Java Transform类代码示例

本文整理汇总了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());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:BaseKeyboardOperation.java

示例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;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:GridBodyColumnRenderContext.java

示例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;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:26,代码来源:GridBodyRenderContext.java

示例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;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:GridBodyCellRenderContext.java

示例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());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:DefaultPinnedModeManager.java

示例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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:RestrictedMousePanMediator.java

示例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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:BoundaryTransformMediatorTest.java

示例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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:BoundaryTransformMediatorTest.java

示例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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:BoundaryTransformMediatorTest.java

示例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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:BoundaryTransformMediatorTest.java

示例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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:25,代码来源:GridTransformMediatorTest.java

示例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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:25,代码来源:GridTransformMediatorTest.java

示例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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:25,代码来源:GridTransformMediatorTest.java

示例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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:25,代码来源:GridTransformMediatorTest.java

示例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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:25,代码来源:GridTransformMediatorTest.java


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