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


Java Transform.getScaleY方法代碼示例

本文整理匯總了Java中com.ait.lienzo.client.core.types.Transform.getScaleY方法的典型用法代碼示例。如果您正苦於以下問題:Java Transform.getScaleY方法的具體用法?Java Transform.getScaleY怎麽用?Java Transform.getScaleY使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.ait.lienzo.client.core.types.Transform的用法示例。


在下文中一共展示了Transform.getScaleY方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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());
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:BaseKeyboardOperation.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: 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

示例9: 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.getScaleY方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。