public class CursorFactory extends Object
Modifier and Type | Method and Description |
---|---|
static Cursor |
createDiskCursor(int diameter,
float scale,
Cursor defaultCursor)
Creates a filled circle shaped cursor of given size with hotspot at the
disks center.
|
static Cursor |
createFilledSquareCursor(double diameter,
double scale,
Cursor defaultCursor)
Creates a filled square shaped cursor of given size with hotspot at the
squares center.
|
static Area |
getAreaBrushedByDisk(int x0,
int y0,
int x1,
int y1,
int diam)
Return the area covered by a disk shaped brush moving in a
straight line from
(x0, y0) to (x1, y1) . |
static Area |
getAreaBrushedByRect(int x0,
int y0,
int x1,
int y1,
int width,
int height)
Return the area covered by a rectangular brush moving in a
straight line from
(x0, y0) to (x1, y1) . |
public static Cursor createFilledSquareCursor(double diameter, double scale, Cursor defaultCursor)
diameter
- Size (diameter) of the returned cursor.scale
- scale factor for the cursor circle. GFor values above one,
this not only increases the size of the cursor but also the
black and white "pixel" it is composed of.defaultCursor
- Cursor to be returned if requested cursor size
cannot be created on the underlying platform (at the time being
above 32 on Windows and above 64 on Linux) or is too small
to be visible (scaled diameter below two pixels diameter).public static Cursor createDiskCursor(int diameter, float scale, Cursor defaultCursor)
diameter
- Size (diameter) of the returned cursor.scale
- scale factor for the cursor circle. GFor values above one,
this not only increases the size of the cursor but also the
black and white "pixel" it is composed of.defaultCursor
- Cursor to be returned if requested cursor size
cannot be created on the underlying platform (at the time being
above 32 on Windows and above 64 on Linux) or is too small
to be visible (scaled diameter below three pixels diameter).public static Area getAreaBrushedByRect(int x0, int y0, int x1, int y1, int width, int height)
(x0, y0)
to (x1, y1)
.
Mathemetically speaking, the returned area is the Minkowsky sum
of the line segment ((x0, y0), (x1, y1))
with the
axis parallel rectangle of size (width, height)
and centered around the origin.
x0
- Start coordinate for brushing on x-axis.y0
- Start coordinate for brushing on y-axis.x1
- End coordinate for brushing on x-axis.y1
- End coordinate for brushing on y-axis.width
- Horizontal diameter the cursor rectangle.height
- Vertical diameter the cursor rectangle.public static Area getAreaBrushedByDisk(int x0, int y0, int x1, int y1, int diam)
(x0, y0)
to (x1, y1)
.
Mathemetically speaking, the returned area is the Minkowsky sum
of the line segment ((x0, y0), (x1, y1))
with the
disk of diameter diam
and centered around the origin.
x0
- Start coordinate for brushing on x-axis.y0
- Start coordinate for brushing on y-axis.x1
- End coordinate for brushing on x-axis.y1
- End coordinate for brushing on y-axis.diam
- Diameter the cursor disk.Copyright © 2015–2021 Fiji. All rights reserved.