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


Java Viewport.getTransform方法代码示例

本文整理汇总了Java中com.ait.lienzo.client.core.shape.Viewport.getTransform方法的典型用法代码示例。如果您正苦于以下问题:Java Viewport.getTransform方法的具体用法?Java Viewport.getTransform怎么用?Java Viewport.getTransform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ait.lienzo.client.core.shape.Viewport的用法示例。


在下文中一共展示了Viewport.getTransform方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: adjustViewportTransform

import com.ait.lienzo.client.core.shape.Viewport; //导入方法依赖的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: flipToGridWidget

import com.ait.lienzo.client.core.shape.Viewport; //导入方法依赖的package包/类
@Override
public void flipToGridWidget(final GridWidget gridWidget) {
    if (!isGridPinned()) {
        return;
    }
    for (GridWidget gw : gridWidgets) {
        gw.setAlpha(gw.equals(gridWidget) ? 1.0 : 0.0);
        gw.setVisible(gw.equals(gridWidget));
    }

    final Point2D translation = new Point2D(gridWidget.getX(),
                                            gridWidget.getY()).mul(-1.0);
    final Viewport vp = gridWidget.getViewport();
    final Transform transform = vp.getTransform();
    transform.reset();
    transform.translate(translation.getX(),
                        translation.getY());

    updatePinnedContext(gridWidget);

    batch(new GridLayerRedrawManager.PrioritizedCommand(0) {
        @Override
        public void execute() {
            select(gridWidget);
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:28,代码来源:DefaultGridLayer.java

示例3: updateVisibleBounds

import com.ait.lienzo.client.core.shape.Viewport; //导入方法依赖的package包/类
private void updateVisibleBounds() {
    final Viewport viewport = getViewport();
    Transform transform = viewport.getTransform();
    if (transform == null) {
        viewport.setTransform(transform = new Transform());
    }
    final double x = (PADDING - transform.getTranslateX()) / transform.getScaleX();
    final double y = (PADDING - transform.getTranslateY()) / transform.getScaleY();
    bounds.setX(x);
    bounds.setY(y);
    bounds.setHeight(Math.max(0,
                              (viewport.getHeight() - PADDING * 2) / transform.getScaleX()));
    bounds.setWidth(Math.max(0,
                             (viewport.getWidth() - PADDING * 2) / transform.getScaleY()));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:16,代码来源:DefaultGridLayer.java

示例4: getTransform

import com.ait.lienzo.client.core.shape.Viewport; //导入方法依赖的package包/类
Transform getTransform() {
    final Viewport viewport = getDefaultGridLayer().getViewport();

    return viewport.getTransform();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:6,代码来源:GridLienzoScrollPosition.java


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