public class Style
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Style |
defaultStyle |
java.util.Optional<java.awt.Color> |
fillColor
Fill Color (if set).
|
java.awt.Color |
penColor
Pen color to use (defaults to black).
|
java.util.Optional<java.awt.Stroke> |
stroke
Pen width to use (only available within Graphics2D).
|
Constructor and Description |
---|
Style(java.util.Optional<java.awt.Color> fillColor,
java.awt.Color penColor,
java.util.Optional<java.awt.Stroke> stroke)
Construct new Style object with desired criteria
|
Modifier and Type | Method and Description |
---|---|
Style |
clearFillColor()
Clear fill color.
|
Style |
copy()
Return a copy of current style.
|
boolean |
equals(java.lang.Object o)
Reasonable equals method for Style objects.
|
int |
hashCode()
Reasonable hashCode method.
|
Style |
setFillColor(java.awt.Color c)
Set the fill color.
|
Style |
setPenColor(java.awt.Color c)
Set the pen color.
|
Style |
setStroke(java.awt.Stroke s)
Set the pen stroke.
|
public static Style defaultStyle
public final java.util.Optional<java.awt.Color> fillColor
public final java.awt.Color penColor
public final java.util.Optional<java.awt.Stroke> stroke
public Style(java.util.Optional<java.awt.Color> fillColor, java.awt.Color penColor, java.util.Optional<java.awt.Stroke> stroke)
fillColor
- Fill color, or Optional.empty() if nonepenColor
- Pen color to usestroke
- Stroke to usepublic Style setFillColor(java.awt.Color c)
c
- new Fill colorpublic Style clearFillColor()
public Style setPenColor(java.awt.Color c)
c
- desired pen colorpublic Style setStroke(java.awt.Stroke s)
s
- desired strokepublic Style copy()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object