java.awt.geom.AffineTransform.equals()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(149)

本文整理了Java中java.awt.geom.AffineTransform.equals()方法的一些代码示例,展示了AffineTransform.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AffineTransform.equals()方法的具体详情如下:
包路径:java.awt.geom.AffineTransform
类名称:AffineTransform
方法名:equals

AffineTransform.equals介绍

暂无

代码示例

代码示例来源:origin: nodebox/nodebox

  1. @Override
  2. public boolean equals(Object obj) {
  3. if (!(obj instanceof Transform)) return false;
  4. return getAffineTransform().equals(((Transform) obj).getAffineTransform());
  5. }

代码示例来源:origin: apache/pdfbox

  1. return false;
  2. return !(this.xform != other.xform && (this.xform == null || !this.xform.equals(other.xform)));

代码示例来源:origin: org.apache.xmlgraphics/xmlgraphics-commons

  1. /**
  2. * Check the current transform.
  3. * The transform for the current state is the combination of all
  4. * transforms in the current state. The parameter is compared
  5. * against this current transform.
  6. *
  7. * @param tf the transform the check against
  8. * @return true if the new transform is different then the current transform
  9. */
  10. public boolean checkTransform(AffineTransform tf) {
  11. return !tf.equals(this.transform);
  12. }

代码示例来源:origin: org.apache.sis.core/sis-referencing

  1. /**
  2. * Compares this matrix with the given object for equality, including error terms (if any).
  3. */
  4. @Override
  5. public boolean equals(final Object obj) {
  6. if (obj instanceof AffineMatrix) {
  7. final AffineMatrix other = (AffineMatrix) obj;
  8. return transform.equals(other.transform) && Arrays.equals(errors, other.errors);
  9. }
  10. return false;
  11. }

代码示例来源:origin: org.apache.xmlgraphics/batik-gvt

  1. /**
  2. * Sets the base transform applied to MouseEvent coordinates prior
  3. * to dispatch.
  4. * @param t the affine transform
  5. */
  6. public void setBaseTransform(AffineTransform t) {
  7. if ((baseTransform != t) &&
  8. ((baseTransform == null) || (!baseTransform.equals(t))))
  9. // new Display transform so events are not where user
  10. // thinks they were.
  11. eventQueue.clear();
  12. baseTransform = t;
  13. }

代码示例来源:origin: apache/sis

  1. /**
  2. * Compares this matrix with the given object for equality, including error terms (if any).
  3. */
  4. @Override
  5. public boolean equals(final Object obj) {
  6. if (obj instanceof AffineMatrix) {
  7. final AffineMatrix other = (AffineMatrix) obj;
  8. return transform.equals(other.transform) && Arrays.equals(errors, other.errors);
  9. }
  10. return false;
  11. }

代码示例来源:origin: apache/batik

  1. /**
  2. * Sets the base transform applied to MouseEvent coordinates prior
  3. * to dispatch.
  4. * @param t the affine transform
  5. */
  6. public void setBaseTransform(AffineTransform t) {
  7. if ((baseTransform != t) &&
  8. ((baseTransform == null) || (!baseTransform.equals(t))))
  9. // new Display transform so events are not where user
  10. // thinks they were.
  11. eventQueue.clear();
  12. baseTransform = t;
  13. }

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

  1. /**
  2. * Sets the base transform applied to MouseEvent coordinates prior
  3. * to dispatch.
  4. * @param t the affine transform
  5. */
  6. public void setBaseTransform(AffineTransform t) {
  7. if ((baseTransform != t) &&
  8. ((baseTransform == null) || (!baseTransform.equals(t))))
  9. // new Display transform so events are not where user
  10. // thinks they were.
  11. eventQueue.clear();
  12. baseTransform = t;
  13. }

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

  1. public boolean equals(LinearGradient that) {
  2. return x1 == that.x1 &&
  3. y1 == that.y1 &&
  4. x2 == that.x2 &&
  5. y2 == that.y2 &&
  6. isRelativeToFigureBounds == that.isRelativeToFigureBounds &&
  7. Arrays.equals(stopOffsets, that.stopOffsets) &&
  8. Arrays.equals(stopOpacities, that.stopOpacities) &&
  9. Arrays.equals(stopColors, that.stopColors) &&
  10. transform.equals(that.transform);
  11. }
  12. }

代码示例来源:origin: sc.fiji/TrakEM2_

  1. public boolean isIdentical(final History.Step<?> step) {
  2. if (step.getClass() != TransformationStep.class) return false;
  3. final HashMap<Displayable,AffineTransform> m = ((TransformationStep)step).ht;
  4. // cheap test:
  5. if (m.size() != this.ht.size()) return false;
  6. // Check each:
  7. for (final Map.Entry<Displayable,AffineTransform> e : m.entrySet()) {
  8. final AffineTransform aff = this.ht.get(e.getKey());
  9. if (null == aff) return false; // at least one Displayable is missing
  10. if (!aff.equals(e.getValue())) return false; // at least one Displayable has a different AffineTransform
  11. }
  12. return true;
  13. }
  14. }

代码示例来源:origin: org.apache.xmlgraphics/batik-swing

  1. /**
  2. * Computes the initial value of the transform used for rendering.
  3. * Return true if a repaint is required, otherwise false.
  4. */
  5. protected boolean computeRenderingTransform() {
  6. initialTransform = new AffineTransform();
  7. if (!initialTransform.equals(renderingTransform)) {
  8. setRenderingTransform(initialTransform, false);
  9. return true;
  10. }
  11. return false;
  12. }

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

  1. /**
  2. * Computes the initial value of the transform used for rendering.
  3. * Return true if a repaint is required, otherwise false.
  4. */
  5. protected boolean computeRenderingTransform() {
  6. initialTransform = new AffineTransform();
  7. if (!initialTransform.equals(renderingTransform)) {
  8. setRenderingTransform(initialTransform, false);
  9. return true;
  10. }
  11. return false;
  12. }

代码示例来源:origin: apache/batik

  1. /**
  2. * Computes the initial value of the transform used for rendering.
  3. * Return true if a repaint is required, otherwise false.
  4. */
  5. protected boolean computeRenderingTransform() {
  6. initialTransform = new AffineTransform();
  7. if (!initialTransform.equals(renderingTransform)) {
  8. setRenderingTransform(initialTransform, false);
  9. return true;
  10. }
  11. return false;
  12. }

代码示例来源:origin: eseifert/vectorgraphics2d

  1. public boolean isDefault() {
  2. return hints.isEmpty() && background.equals(DEFAULT_BACKGROUND) &&
  3. color.equals(DEFAULT_COLOR) && composite.equals(DEFAULT_COMPOSITE) &&
  4. font.equals(DEFAULT_FONT) && paint.equals(DEFAULT_PAINT) &&
  5. stroke.equals(DEFAULT_STROKE) && transform.equals(DEFAULT_TRANSFORM) &&
  6. xorMode.equals(DEFAULT_XOR_MODE) && clip == DEFAULT_CLIP;
  7. }
  8. }

代码示例来源:origin: org.icepdf.os/icepdf-core

  1. /**
  2. * Sets the graphics state CTM to a new transform, the old CTM transform is
  3. * lost. The new CTM value is added to the shapes stack.
  4. *
  5. * @param af the AffineTranform object to set the CTM to.
  6. */
  7. public void set(AffineTransform af) {
  8. // appling a CTM can be expensive, so only do it if it's needed.
  9. if (!CTM.equals(af)) {
  10. CTM = new AffineTransform(af);
  11. }
  12. shapes.add(new TransformDrawCmd(new AffineTransform(CTM)));
  13. }

代码示例来源:origin: org.icepdf.os/icepdf-core

  1. public FontFile deriveFont(AffineTransform at) {
  2. OFont font = new OFont(this);
  3. // clear font metric cache if we change the font's transform
  4. if (!font.getTransform().equals(this.awtFont.getTransform())) {
  5. this.echarAdvanceCache.clear();
  6. }
  7. font.awtFont = this.awtFont.deriveFont(at);
  8. font.maxCharBounds = this.maxCharBounds;
  9. return font;
  10. }

代码示例来源:origin: apache/fop

  1. /**
  2. * Check the current transform.
  3. * The transform for the current state is the combination of all
  4. * transforms in the current state. The parameter is compared
  5. * against this current transform.
  6. *
  7. * @param tf the transform the check against
  8. * @return true if the new transform is different then the current transform
  9. */
  10. public boolean checkTransform(AffineTransform tf) {
  11. return !tf.equals(getData().getTransform());
  12. }

代码示例来源:origin: sc.fiji/TrakEM2_

  1. public boolean isIdenticalTo(final Object ob) {
  2. if (!(ob instanceof LayerSet)) return false;
  3. final LayerSet layerset = (LayerSet) ob;
  4. if (layerset.layer_width != this.width || layerset.height != this.height || layerset != this.ls) return false;
  5. final ArrayList<Displayable> col = ls.getDisplayables();
  6. col.addAll(ls.getZDisplayables());
  7. for (final Displayable d : col) {
  8. final AffineTransform aff = this.affines.get(d);
  9. if (null == aff) return false;
  10. if (!aff.equals(d.getAffineTransform())) return false;
  11. }
  12. return true;
  13. }

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

  1. /**
  2. * Computes the transform used for rendering.
  3. * Returns true if the component needs to be repainted.
  4. */
  5. protected boolean computeRenderingTransform() {
  6. if ((svgDocument == null) || (gvtRoot == null))
  7. return false;
  8. boolean ret = updateRenderingTransform();
  9. initialTransform = new AffineTransform();
  10. if (!initialTransform.equals(getRenderingTransform())) {
  11. setRenderingTransform(initialTransform, false);
  12. ret = true;
  13. }
  14. return ret;
  15. }

代码示例来源:origin: eseifert/vectorgraphics2d

  1. @Override
  2. public void setTransform(AffineTransform tx) {
  3. if (isDisposed() || tx == null || state.getTransform().equals(tx)) {
  4. return;
  5. }
  6. emit(new SetTransformCommand(tx));
  7. state.setTransform(tx);
  8. }

相关文章