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


Java Arc2D.getArcType方法代碼示例

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


在下文中一共展示了Arc2D.getArcType方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: equal

import java.awt.geom.Arc2D; //導入方法依賴的package包/類
/**
 * Compares two arcs and returns <code>true</code> if they are equal or
 * both <code>null</code>.
 *
 * @param a1  the first arc (<code>null</code> permitted).
 * @param a2  the second arc (<code>null</code> permitted).
 *
 * @return A boolean.
 */
public static boolean equal(final Arc2D a1, final Arc2D a2) {
    if (a1 == null) {
        return (a2 == null);
    }
    if (a2 == null) {
        return false;
    }
    if (!a1.getFrame().equals(a2.getFrame())) {
        return false;
    }
    if (a1.getAngleStart() != a2.getAngleStart()) {
        return false;
    }
    if (a1.getAngleExtent() != a2.getAngleExtent()) {
        return false;
    }
    if (a1.getArcType() != a2.getArcType()) {
        return false;
    }
    return true;
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:31,代碼來源:ShapeUtilities.java

示例2: equal

import java.awt.geom.Arc2D; //導入方法依賴的package包/類
/**
 * Compares two arcs and returns {@code true} if they are equal or
 * both {@code null}.
 *
 * @param a1  the first arc ({@code null} permitted).
 * @param a2  the second arc ({@code null} permitted).
 *
 * @return A boolean.
 */
public static boolean equal(Arc2D a1, Arc2D a2) {
    if (a1 == null) {
        return (a2 == null);
    }
    if (a2 == null) {
        return false;
    }
    if (!a1.getFrame().equals(a2.getFrame())) {
        return false;
    }
    if (a1.getAngleStart() != a2.getAngleStart()) {
        return false;
    }
    if (a1.getAngleExtent() != a2.getAngleExtent()) {
        return false;
    }
    if (a1.getArcType() != a2.getArcType()) {
        return false;
    }
    return true;
}
 
開發者ID:jfree,項目名稱:jfreechart,代碼行數:31,代碼來源:ShapeUtils.java

示例3: cloneShape

import java.awt.geom.Arc2D; //導入方法依賴的package包/類
/**
 * Clone's the shape provided.
 * 
 * @param aShape shape to be cloned
 * 
 * @return a cloned version of the provided shape
 */
public Shape cloneShape(final Shape aShape) {
    if (aShape instanceof Rectangle2D) {
        return new PBounds((Rectangle2D) aShape);
    }
    else if (aShape instanceof Ellipse2D) {
        final Ellipse2D e2 = (Ellipse2D) aShape;
        return new Ellipse2D.Double(e2.getX(), e2.getY(), e2.getWidth(), e2.getHeight());
    }
    else if (aShape instanceof Arc2D) {
        final Arc2D a2 = (Arc2D) aShape;
        return new Arc2D.Double(a2.getX(), a2.getY(), a2.getWidth(), a2.getHeight(), a2.getAngleStart(), a2
                .getAngleExtent(), a2.getArcType());
    }
    else if (aShape instanceof RoundRectangle2D) {
        final RoundRectangle2D r2 = (RoundRectangle2D) aShape;
        return new RoundRectangle2D.Double(r2.getX(), r2.getY(), r2.getWidth(), r2.getHeight(), r2.getArcWidth(),
                r2.getArcHeight());
    }
    else if (aShape instanceof Line2D) {
        final Line2D l2 = (Line2D) aShape;
        return new Line2D.Double(l2.getP1(), l2.getP2());
    }
    else {
        final GeneralPath aPath = new GeneralPath();
        aPath.append(aShape, false);
        return aPath;
    }
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:36,代碼來源:PSWTPath.java


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