本文整理匯總了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();
}