本文整理汇总了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());
}
示例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);
}
});
}
示例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()));
}
示例4: getTransform
import com.ait.lienzo.client.core.shape.Viewport; //导入方法依赖的package包/类
Transform getTransform() {
final Viewport viewport = getDefaultGridLayer().getViewport();
return viewport.getTransform();
}