本文整理汇总了Java中com.ait.lienzo.client.core.types.Transform.getScaleX方法的典型用法代码示例。如果您正苦于以下问题:Java Transform.getScaleX方法的具体用法?Java Transform.getScaleX怎么用?Java Transform.getScaleX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ait.lienzo.client.core.types.Transform
的用法示例。
在下文中一共展示了Transform.getScaleX方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: onDragVisibleBounds
import com.ait.lienzo.client.core.types.Transform; //导入方法依赖的package包/类
@Override
public void onDragVisibleBounds(final double canvasX,
final double canvasY) {
final double _canvasX = -canvasX;
final double _canvasY = -canvasY;
final Transform oldTransform = modeller.getView().getGridLayerView().getViewport().getTransform();
final double scaleX = oldTransform.getScaleX();
final double scaleY = oldTransform.getScaleY();
final double translateX = oldTransform.getTranslateX();
final double translateY = oldTransform.getTranslateY();
final double dx = _canvasX - (translateX / scaleX);
final double dy = _canvasY - (translateY / scaleY);
final Transform newTransform = oldTransform.copy().translate(dx,
dy);
modeller.getView().getGridLayerView().getViewport().setTransform(newTransform);
modeller.getView().getGridLayerView().batch();
modeller.getView().refreshScrollPosition();
}
示例3: getScreenX
import com.ait.lienzo.client.core.types.Transform; //导入方法依赖的package包/类
private int getScreenX(final GuidedDecisionTableModellerView modellerView,
final GuidedDecisionTableView.Presenter dtPresenter,
final int uiColumnIndex) {
final GridWidget gridWidget = dtPresenter.getView();
final GridColumn<?> uiColumn = gridWidget.getModel().getColumns().get(uiColumnIndex);
final double gx = gridWidget.getX();
final GridLayer layer = modellerView.getGridLayerView();
final int containerX = layer.getDomElementContainer().getAbsoluteLeft();
final double vx = layer.getVisibleBounds().getX();
final Transform t = layer.getViewport().getTransform();
final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper();
final BaseGridRendererHelper.RenderingInformation ri = rendererHelper.getRenderingInformation();
final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = ri.getFloatingBlockInformation();
final double offsetX = floatingBlockInformation.getColumns().contains(uiColumn) ? floatingBlockInformation.getX() : 0;
final int screenX = containerX + (int) ((gx - vx + offsetX + rendererHelper.getColumnOffset(uiColumn) + uiColumn.getWidth() / 2) * t.getScaleX());
return screenX;
}
示例4: getScreenY
import com.ait.lienzo.client.core.types.Transform; //导入方法依赖的package包/类
private int getScreenY(final GuidedDecisionTableModellerView modellerView,
final GuidedDecisionTableView.Presenter dtPresenter) {
final GridWidget gridWidget = dtPresenter.getView();
final double gy = gridWidget.getY();
final GridLayer layer = modellerView.getGridLayerView();
final int containerY = layer.getDomElementContainer().getAbsoluteTop();
final double vy = layer.getVisibleBounds().getY();
final Transform t = layer.getViewport().getTransform();
final Group header = gridWidget.getHeader();
final double headerHeight = gridWidget.getRenderer().getHeaderHeight();
final double headerRowHeight = gridWidget.getRenderer().getHeaderRowHeight();
final double offsetY = header == null ? 0 : header.getY();
final int screenY = containerY + (int) ((gy - vy + offsetY + headerHeight - headerRowHeight / 2) * t.getScaleX());
return screenY;
}
示例5: updateGridLienzoTransform
import com.ait.lienzo.client.core.types.Transform; //导入方法依赖的package包/类
void updateGridLienzoTransform(final Double currentXPosition,
final Double currentYPosition) {
final Transform oldTransform = getViewport().getTransform();
final Double dx = currentXPosition - (oldTransform.getTranslateX() / oldTransform.getScaleX());
final Double dy = currentYPosition - (oldTransform.getTranslateY() / oldTransform.getScaleY());
final Transform newTransform = oldTransform.copy().translate(dx,
dy);
getViewport().setTransform(newTransform);
getDefaultGridLayer().batch();
}
示例6: adjust
import com.ait.lienzo.client.core.types.Transform; //导入方法依赖的package包/类
@Override
public Transform adjust(final Transform transform,
final Bounds visibleBounds) {
Transform newTransform = transform.copy();
final double scaleX = transform.getScaleX();
final double scaleY = transform.getScaleY();
final double translateX = newTransform.getTranslateX();
final double translateY = newTransform.getTranslateY();
final double scaledTranslateX = translateX / scaleX;
final double scaledTranslateY = translateY / scaleY;
final double visibleBoundsWidth = visibleBounds.getWidth();
final double visibleBoundsHeight = visibleBounds.getHeight();
if (-scaledTranslateX < minX) {
newTransform = newTransform.translate(-scaledTranslateX - minX,
0);
}
if (-scaledTranslateY < minY) {
newTransform = newTransform.translate(0,
-scaledTranslateY - minY);
}
if (-scaledTranslateX + visibleBoundsWidth > maxX) {
newTransform = newTransform.translate(-scaledTranslateX + visibleBoundsWidth - maxX,
0);
}
if (-scaledTranslateY + visibleBoundsHeight > maxY) {
newTransform = newTransform.translate(0,
-scaledTranslateY + visibleBoundsHeight - maxY);
}
return newTransform;
}
示例7: enterPinnedMode
import com.ait.lienzo.client.core.types.Transform; //导入方法依赖的package包/类
@Override
public void enterPinnedMode(final GridWidget gridWidget,
final Command onStartCommand) {
if (context != null) {
return;
}
final Transform transform = gridWidget.getViewport().getTransform();
final double translateX = transform.getTranslateX();
final double translateY = transform.getTranslateY();
final double scaleX = transform.getScaleX();
final double scaleY = transform.getScaleY();
final PinnedContext newState = new PinnedContext(gridWidget,
translateX,
translateY,
scaleX,
scaleY);
final Set<GridWidget> gridWidgetsToFadeFromView = new HashSet<>(gridLayer.getGridWidgets());
gridWidgetsToFadeFromView.remove(gridWidget);
final Set<IPrimitive<?>> gridWidgetConnectorsToFadeFromView = gridLayer.getGridWidgetConnectors();
doEnterPinnedMode(() -> {
context = newState;
onStartCommand.execute();
enableGridTransformMediator(gridWidget);
},
gridWidget,
gridWidgetsToFadeFromView,
gridWidgetConnectorsToFadeFromView);
}
示例8: updateVisibleBounds
import com.ait.lienzo.client.core.types.Transform; //导入方法依赖的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()));
}
示例9: adjust
import com.ait.lienzo.client.core.types.Transform; //导入方法依赖的package包/类
@Override
public Transform adjust(final Transform transform,
final Bounds visibleBounds) {
updateBounds();
Transform newTransform = transform.copy();
final double scaleX = transform.getScaleX();
final double scaleY = transform.getScaleY();
final double translateX = newTransform.getTranslateX();
final double translateY = newTransform.getTranslateY();
final double scaledTranslateX = translateX / scaleX;
final double scaledTranslateY = translateY / scaleY;
final double visibleBoundsWidth = visibleBounds.getWidth();
final double visibleBoundsHeight = visibleBounds.getHeight();
if (-scaledTranslateX < minX) {
newTransform = newTransform.translate(-scaledTranslateX - minX,
0);
}
if (-scaledTranslateY < minY) {
newTransform = newTransform.translate(0,
-scaledTranslateY - minY);
}
if (-scaledTranslateX + visibleBoundsWidth > maxX) {
newTransform = newTransform.translate(-scaledTranslateX + visibleBoundsWidth - maxX,
0);
}
if (-scaledTranslateY + visibleBoundsHeight > maxY) {
newTransform = newTransform.translate(0,
-scaledTranslateY + visibleBoundsHeight - maxY);
}
return newTransform;
}
示例10: adjust
import com.ait.lienzo.client.core.types.Transform; //导入方法依赖的package包/类
@Override
public Transform adjust(final Transform transform,
final Bounds visibleBounds) {
updateBounds();
Transform newTransform = transform.copy();
final double scaleX = transform.getScaleX();
final double scaleY = transform.getScaleY();
final double translateX = newTransform.getTranslateX();
final double translateY = newTransform.getTranslateY();
final double scaledTranslateX = translateX / scaleX;
final double scaledTranslateY = translateY / scaleY;
final double visibleBoundsWidth = maxX > visibleBounds.getWidth() ? visibleBounds.getWidth() : maxX;
final double visibleBoundsHeight = maxY > visibleBounds.getHeight() ? visibleBounds.getHeight() : maxY;
if (-scaledTranslateX < minX) {
newTransform = newTransform.translate(-scaledTranslateX - minX,
0);
}
if (-scaledTranslateY < minY) {
newTransform = newTransform.translate(0,
-scaledTranslateY - minY);
}
if (-scaledTranslateX + visibleBoundsWidth > maxX) {
newTransform = newTransform.translate(-scaledTranslateX + visibleBoundsWidth - maxX,
0);
}
if (-scaledTranslateY + visibleBoundsHeight > maxY) {
newTransform = newTransform.translate(0,
-scaledTranslateY + visibleBoundsHeight - maxY);
}
return newTransform;
}
示例11: adjust
import com.ait.lienzo.client.core.types.Transform; //导入方法依赖的package包/类
@Override
public Transform adjust(final Transform transform,
final Bounds visibleBounds) {
Transform newTransform = transform.copy();
final double minX = gridWidget.getX();
final double minY = gridWidget.getY();
final double gridWidth = gridWidget.getWidth();
final double gridHeight = gridWidget.getHeight();
final double maxX = gridWidget.getX() + gridWidth;
final double maxY = gridWidget.getY() + gridHeight;
final double scaleX = transform.getScaleX();
final double scaleY = transform.getScaleY();
final double translateX = newTransform.getTranslateX();
final double translateY = newTransform.getTranslateY();
final double scaledTranslateX = translateX / scaleX;
final double scaledTranslateY = translateY / scaleY;
final double visibleBoundsWidth = visibleBounds.getWidth();
final double visibleBoundsHeight = visibleBounds.getHeight();
if (gridWidth <= visibleBoundsWidth) {
newTransform = newTransform.translate(-scaledTranslateX - minX,
0);
} else {
if (-scaledTranslateX < minX) {
newTransform = newTransform.translate(-scaledTranslateX - minX,
0);
}
if (-scaledTranslateX + visibleBoundsWidth > maxX) {
newTransform = newTransform.translate(-scaledTranslateX + visibleBoundsWidth - maxX,
0);
}
}
if (gridHeight <= visibleBoundsHeight) {
newTransform = newTransform.translate(0,
-scaledTranslateY - minY);
} else {
if (-scaledTranslateY < minY) {
newTransform = newTransform.translate(0,
-scaledTranslateY - minY);
}
if (-scaledTranslateY + visibleBoundsHeight > maxY) {
newTransform = newTransform.translate(0,
-scaledTranslateY + visibleBoundsHeight - maxY);
}
}
return newTransform;
}