當前位置: 首頁>>代碼示例>>Java>>正文


Java Transform.getTranslateX方法代碼示例

本文整理匯總了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());
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:24,代碼來源:DefaultPinnedModeManager.java

示例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();
}
 
開發者ID:kiegroup,項目名稱:drools-wb,代碼行數:20,代碼來源:RadarMenuBuilder.java

示例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();
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:14,代碼來源:GridLienzoScrollHandler.java

示例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;
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:34,代碼來源:BoundaryTransformMediator.java

示例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);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:31,代碼來源:DefaultPinnedModeManager.java

示例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()));
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:16,代碼來源:DefaultGridLayer.java

示例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;
}
 
開發者ID:kiegroup,項目名稱:drools-wb,代碼行數:36,代碼來源:BoundaryTransformMediator.java

示例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);
}
 
開發者ID:kiegroup,項目名稱:drools-wb,代碼行數:13,代碼來源:GuidedDecisionTableModellerViewImpl.java

示例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;
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:36,代碼來源:BoundaryTransformMediator.java

示例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);
    };
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:15,代碼來源:UndefinedExpressionColumnRenderer.java

示例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;
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:51,代碼來源:GridTransformMediator.java


注:本文中的com.ait.lienzo.client.core.types.Transform.getTranslateX方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。