当前位置: 首页>>代码示例>>Java>>正文


Java AffineTransform.equals方法代码示例

本文整理汇总了Java中java.awt.geom.AffineTransform.equals方法的典型用法代码示例。如果您正苦于以下问题:Java AffineTransform.equals方法的具体用法?Java AffineTransform.equals怎么用?Java AffineTransform.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.geom.AffineTransform的用法示例。


在下文中一共展示了AffineTransform.equals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setGraphicsConfigInfo

import java.awt.geom.AffineTransform; //导入方法依赖的package包/类
synchronized void setGraphicsConfigInfo(AffineTransform at,
                                        double pw, double ph) {
    Point2D.Double pt = new Point2D.Double(pw, ph);
    at.transform(pt, pt);

    if (pgConfig == null ||
        defaultDeviceTransform == null ||
        !at.equals(defaultDeviceTransform) ||
        deviceWidth != (int)pt.getX() ||
        deviceHeight != (int)pt.getY()) {

            deviceWidth = (int)pt.getX();
            deviceHeight = (int)pt.getY();
            defaultDeviceTransform = at;
            pgConfig = null;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:RasterPrinterJob.java

示例2: emitTransform

import java.awt.geom.AffineTransform; //导入方法依赖的package包/类
void emitTransform(AffineTransform transform) {

            if (transform != null && transform.equals(mTransform) == false) {
                double[] matrix = new double[6];
                transform.getMatrix(matrix);
                mPSStream.println("[" + (float)matrix[0]
                                  + " " + (float)matrix[1]
                                  + " " + (float)matrix[2]
                                  + " " + (float)matrix[3]
                                  + " " + (float)matrix[4]
                                  + " " + (float)matrix[5]
                                  + "] concat");

                mTransform = transform;
            }
        }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:PSPrinterJob.java

示例3: main

import java.awt.geom.AffineTransform; //导入方法依赖的package包/类
public static void main(final String[] args) {
    final GraphicsEnvironment ge =
            GraphicsEnvironment.getLocalGraphicsEnvironment();
    final GraphicsConfiguration gc =
            ge.getDefaultScreenDevice().getDefaultConfiguration();
    final VolatileImage vi = gc.createCompatibleVolatileImage(200, 200);
    final SunGraphics2D sg2d = (SunGraphics2D) vi.createGraphics();

    sg2d.constrain(0, 61, 100, 100);
    final AffineTransform expected = sg2d.cloneTransform();
    sg2d.setTransform(sg2d.getTransform());
    final AffineTransform actual = sg2d.cloneTransform();
    sg2d.dispose();
    vi.flush();
    if (!expected.equals(actual)) {
        System.out.println("Expected = " + expected);
        System.out.println("Actual = " + actual);
        throw new RuntimeException("Wrong transform");
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:21,代码来源:TransformSetGet.java

示例4: displayChanged

import java.awt.geom.AffineTransform; //导入方法依赖的package包/类
/**
 * Called from SunGraphicsEnv when there has been a display mode change.
 * Note that we simply invalidate hardware surfaces here; we do not
 * attempt to recreate or re-render them.  This is to avoid threading
 * conflicts with the native toolkit and associated threads.  Instead,
 * we just nullify the old surface data object and wait for a future
 * method in the rendering process to recreate the surface.
 */
public void displayChanged() {
    lostSurface = true;
    if (sdAccel != null) {
        // First, nullify the software surface.  This guards against
        // using a SurfaceData that was created in a different
        // display mode.
        sdBackup = null;
        // Now, invalidate the old hardware-based SurfaceData
        // Note that getBackupSurface may set sdAccel to null so we have to invalidate it before
        SurfaceData oldData = sdAccel;
        sdAccel = null;
        oldData.invalidate();
        sdCurrent = getBackupSurface();
    }
    // Update graphicsConfig for the vImg in case it changed due to
    // this display change event
    vImg.updateGraphicsConfig();

    // Compare the Graphics configuration transforms to determine
    // whether the software backed surface needs to be invalidated.
    AffineTransform atUpdated = vImg.getGraphicsConfig()
                                    .getDefaultTransform();
    if (!isAccelerationEnabled()) {
        if (!atUpdated.equals(atCurrent)) {
            // Ideally there is no need to re-create a software surface.
            // But some OSs allow changes to display state at runtime. Such
            // a provision would cause mismatch in graphics configuration of
            // the display and the surface. Hence we re-create the software
            // surface as well.
            sdBackup = null;
            sdCurrent = getBackupSurface();
        } else {
            // Software backed surface was not invalidated.
            lostSurface = false;
        }
    }

    // Update the AffineTransformation backing the volatile image
    atCurrent = atUpdated;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:49,代码来源:VolatileSurfaceManager.java


注:本文中的java.awt.geom.AffineTransform.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。