本文整理汇总了Java中com.ait.lienzo.client.core.types.Transform.getTranslateX方法的典型用法代码示例。如果您正苦于以下问题:Java Transform.getTranslateX方法的具体用法?Java Transform.getTranslateX怎么用?Java Transform.getTranslateX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ait.lienzo.client.core.types.Transform
的用法示例。
在下文中一共展示了Transform.getTranslateX方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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());
}
示例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: 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();
}
示例4: 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;
}
示例5: 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);
}
示例6: 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()));
}
示例7: 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;
}
示例8: getTranslation
import com.ait.lienzo.client.core.types.Transform; //导入方法依赖的package包/类
private Point2D getTranslation(final GuidedDecisionTableView gridWidget) {
final double boundsPadding = GuidedDecisionTableModellerBoundsHelper.BOUNDS_PADDING;
final Transform t = gridLayer.getViewport().getTransform();
final double requiredTranslateX = boundsPadding - gridWidget.getX();
final double requiredTranslateY = boundsPadding - gridWidget.getY();
final double actualTranslateX = t.getTranslateX();
final double actualTranslateY = t.getTranslateY();
final double dx = requiredTranslateX - actualTranslateX;
final double dy = requiredTranslateY - actualTranslateY;
return new Point2D(dx,
dy);
}
示例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 = 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;
}
示例10: getNodeMouseEnterHandler
import com.ait.lienzo.client.core.types.Transform; //导入方法依赖的package包/类
NodeMouseEnterHandler getNodeMouseEnterHandler(final ExpressionEditorDefinition<Expression> definition,
final Rectangle r) {
return (event) -> {
final Transform transform = editorTypesContainer.getViewport().getTransform();
final double tx = transform.getTranslateX();
final double ty = transform.getTranslateY();
final double absoluteCellX = editorTypesContainer.getAbsoluteLocation().getX() - tx;
final double absoluteCellY = editorTypesContainer.getAbsoluteLocation().getY() - ty;
tooltip.show(definition,
absoluteCellX,
absoluteCellY,
r);
};
}
示例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;
}