Java Color Distance drawArc(Point2D start, double distance, double startAngle, double arcAngle, boolean fill, Graphics2D g2, Color color)

Here you can find the source of drawArc(Point2D start, double distance, double startAngle, double arcAngle, boolean fill, Graphics2D g2, Color color)

Description

draw Arc

License

Open Source License

Declaration

public static void drawArc(Point2D start, double distance, double startAngle, double arcAngle, boolean fill,
            Graphics2D g2, Color color) 

Method Source Code


//package com.java2s;

import java.awt.Color;

import java.awt.Graphics2D;

import java.awt.geom.Point2D;

public class Main {
    public static void drawArc(Point2D start, double distance, double startAngle, double arcAngle, boolean fill,
            Graphics2D g2, Color color) {
        int r2 = (int) (distance * 2);
        int x = (int) (start.getX() - distance);
        int y = (int) (start.getY() - distance);

        g2.setColor(color);//from w  w  w .j  a v a 2 s.c  o m
        if (fill)
            g2.fillArc(x, y, r2, r2, (int) Math.toDegrees(startAngle), (int) Math.toDegrees(arcAngle));
        else
            g2.drawArc(x, y, r2, r2, (int) Math.toDegrees(startAngle), (int) Math.toDegrees(arcAngle));
    }
}

Related

  1. colorDistance(final float[] lab1, final float[] lab2)
  2. colorDistance(int r1, int g1, int b1, int r2, int g2, int b2)
  3. distance(Color a, Color b)
  4. distance(Color c1, Color c2)
  5. distanceToColor(final int distance)
  6. getDistance(int c1, Color c2)
  7. getMaxDistance(final Color first, final Color second)
  8. pixelDistance(final Color col1, final Color col2)