Java Graphics Draw drawSelectionPoint(Graphics g, Point p)

Here you can find the source of drawSelectionPoint(Graphics g, Point p)

Description

draw Selection Point

License

Apache License

Declaration

public static void drawSelectionPoint(Graphics g, Point p) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.awt.BasicStroke;
import java.awt.Color;

import java.awt.Graphics;
import java.awt.Graphics2D;

import java.awt.Point;

import java.awt.RenderingHints;
import java.awt.Shape;

import java.awt.geom.Ellipse2D;

public class Main {
    public final static BasicStroke boldStroke = new BasicStroke(1.5f, BasicStroke.CAP_ROUND,
            BasicStroke.JOIN_ROUND, 10.0f, null, 0.0f);
    /** The selection color */
    public static Color selectionColor = Color.RED;

    public static void drawSelectionPoint(Graphics g, Point p) {
        Graphics2D g2 = (Graphics2D) g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

        g2.setStroke(boldStroke);//w w w.  ja  va  2s .  c  o m
        g2.setPaint(selectionColor);
        Shape s = new Ellipse2D.Double(p.x - 5, p.y - 5, 10, 10);
        g2.draw(s);
    }
}

Related

  1. drawRequiredMarker(Graphics2D g2, int x, int y, int iconSize)
  2. drawRTriangle(Graphics g, Color color, int x, int y, int r)
  3. drawScaleTick(Graphics g, int x, int y, boolean yAxisP, int length)
  4. drawScrollBar(Graphics g, int which, int direction, int x, int y, int fmWidth, int fmHeight, Color fg, Color bg)
  5. drawSelectionBox(Graphics g)
  6. drawSpline(Graphics graphics, int x1, int y1, int x2, int y2, int x3, int y3)
  7. drawSquarePoint(Graphics2D g2, Point2D.Double pt, int ptSize, Color color)
  8. drawStackTrace(Graphics gr, int x, int y, Throwable ex)
  9. drawStage(Graphics g, int x, int y)