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

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

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

AffineTransform.equals介绍

暂无

代码示例

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

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

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

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

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

/**
 * Check the current transform.
 * The transform for the current state is the combination of all
 * transforms in the current state. The parameter is compared
 * against this current transform.
 *
 * @param tf the transform the check against
 * @return true if the new transform is different then the current transform
 */
public boolean checkTransform(AffineTransform tf) {
  return !tf.equals(this.transform);
}

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

/**
 * Compares this matrix with the given object for equality, including error terms (if any).
 */
@Override
public boolean equals(final Object obj) {
  if (obj instanceof AffineMatrix) {
    final AffineMatrix other = (AffineMatrix) obj;
    return transform.equals(other.transform) && Arrays.equals(errors, other.errors);
  }
  return false;
}

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

/**
 * Sets the base transform applied to MouseEvent coordinates prior
 * to dispatch.
 * @param t the affine transform
 */
public void setBaseTransform(AffineTransform t) {
  if ((baseTransform != t) &&
    ((baseTransform == null) || (!baseTransform.equals(t))))
    // new Display transform so events are not where user
    // thinks they were.
    eventQueue.clear();
  baseTransform = t;
}

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

/**
 * Compares this matrix with the given object for equality, including error terms (if any).
 */
@Override
public boolean equals(final Object obj) {
  if (obj instanceof AffineMatrix) {
    final AffineMatrix other = (AffineMatrix) obj;
    return transform.equals(other.transform) && Arrays.equals(errors, other.errors);
  }
  return false;
}

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

/**
 * Sets the base transform applied to MouseEvent coordinates prior
 * to dispatch.
 * @param t the affine transform
 */
public void setBaseTransform(AffineTransform t) {
  if ((baseTransform != t) &&
    ((baseTransform == null) || (!baseTransform.equals(t))))
    // new Display transform so events are not where user
    // thinks they were.
    eventQueue.clear();
  baseTransform = t;
}

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

/**
 * Sets the base transform applied to MouseEvent coordinates prior
 * to dispatch.
 * @param t the affine transform
 */
public void setBaseTransform(AffineTransform t) {
  if ((baseTransform != t) &&
    ((baseTransform == null) || (!baseTransform.equals(t))))
    // new Display transform so events are not where user
    // thinks they were.
    eventQueue.clear();
  baseTransform = t;
}

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

public boolean equals(LinearGradient that) {
    return x1 == that.x1 &&
        y1 == that.y1 &&
        x2 == that.x2 &&
        y2 == that.y2 &&
        isRelativeToFigureBounds == that.isRelativeToFigureBounds &&
        Arrays.equals(stopOffsets, that.stopOffsets) &&
        Arrays.equals(stopOpacities, that.stopOpacities) &&
        Arrays.equals(stopColors, that.stopColors) &&
        transform.equals(that.transform);
  }
}

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

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

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

/**
 * Computes the initial value of the transform used for rendering.
 * Return true if a repaint is required, otherwise false.
 */
protected boolean computeRenderingTransform() {
  initialTransform = new AffineTransform();
  if (!initialTransform.equals(renderingTransform)) {
    setRenderingTransform(initialTransform, false);
    return true;
  }
  return false;
}

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

/**
 * Computes the initial value of the transform used for rendering.
 * Return true if a repaint is required, otherwise false.
 */
protected boolean computeRenderingTransform() {
  initialTransform = new AffineTransform();
  if (!initialTransform.equals(renderingTransform)) {
    setRenderingTransform(initialTransform, false);
    return true;
  }
  return false;
}

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

/**
 * Computes the initial value of the transform used for rendering.
 * Return true if a repaint is required, otherwise false.
 */
protected boolean computeRenderingTransform() {
  initialTransform = new AffineTransform();
  if (!initialTransform.equals(renderingTransform)) {
    setRenderingTransform(initialTransform, false);
    return true;
  }
  return false;
}

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

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

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

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

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

public FontFile deriveFont(AffineTransform at) {
  OFont font = new OFont(this);
  // clear font metric cache if we change the font's transform
  if (!font.getTransform().equals(this.awtFont.getTransform())) {
    this.echarAdvanceCache.clear();
  }
  font.awtFont = this.awtFont.deriveFont(at);
  font.maxCharBounds = this.maxCharBounds;
  return font;
}

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

/**
 * Check the current transform.
 * The transform for the current state is the combination of all
 * transforms in the current state. The parameter is compared
 * against this current transform.
 *
 * @param tf the transform the check against
 * @return true if the new transform is different then the current transform
 */
public boolean checkTransform(AffineTransform tf) {
  return !tf.equals(getData().getTransform());
}

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

public boolean isIdenticalTo(final Object ob) {
  if (!(ob instanceof LayerSet)) return false;
  final LayerSet layerset = (LayerSet) ob;
  if (layerset.layer_width != this.width || layerset.height != this.height || layerset != this.ls) return false;
  final ArrayList<Displayable> col = ls.getDisplayables();
  col.addAll(ls.getZDisplayables());
  for (final Displayable d : col) {
    final AffineTransform aff = this.affines.get(d);
    if (null == aff) return false;
    if (!aff.equals(d.getAffineTransform())) return false;
  }
  return true;
}

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

/**
 * Computes the transform used for rendering.
 * Returns true if the component needs to be repainted.
 */
protected boolean computeRenderingTransform() {
  if ((svgDocument == null) || (gvtRoot == null))
    return false;
  boolean ret = updateRenderingTransform();
  initialTransform = new AffineTransform();
  if (!initialTransform.equals(getRenderingTransform())) {
    setRenderingTransform(initialTransform, false);
    ret = true;
  }
  return ret;
}

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

@Override
public void setTransform(AffineTransform tx) {
  if (isDisposed() || tx == null || state.getTransform().equals(tx)) {
    return;
  }
  emit(new SetTransformCommand(tx));
  state.setTransform(tx);
}

相关文章