本文整理匯總了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;
}
}
示例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;
}
}
示例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");
}
}
示例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;
}