public class Ilt2DPalette extends Object implements IltPalette
It consists of:
IlvPattern
.
0
means that the gradient
goes from left to right (that is, the first color is on the left, and the
second color on the right); an angle of 45
means that the
gradient goes from the bottom to the top, and so on. For a radial gradient,
the angle specifies the position of the center of the gradient relative
to the center of the shape. Any angle between 0
and 360
can be used.
IltGraphicUtil
Constructor and Description |
---|
Ilt2DPalette()
Creates an empty palette.
|
Ilt2DPalette(Color colour)
Creates a new mono-color 2D palette.
|
Ilt2DPalette(Color foreground,
Color background,
IltPattern pattern)
Creates a new 2D palette.
|
Ilt2DPalette(Color foreground,
Color background,
Image fillTexture)
Creates a new 2D palette using a texture.
|
Ilt2DPalette(int fillStyle,
Color fillColor1,
Color fillColor2,
float fillStart,
float fillEnd,
float fillAngle)
Creates a new 2D palette.
|
Ilt2DPalette(int fillStyle,
Color fillColor1,
Color fillColor2,
float fillStart,
float fillEnd,
float fillAngle,
IltPattern pattern,
Image fillTexture)
Creates a new 2D palette.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Compares two objects.
|
Color |
getBackground()
Returns the background color.
|
Ilt2DPalette |
getCurrentPalette() |
Color |
getForeground()
Returns the foreground color.
|
Paint |
getPaint()
Returns the paint object that should be used to
fill an object shape.
|
int |
getStyle()
Returns the style used to fill the shape.
|
int |
hashCode()
Returns a hash code value for the object.
|
static Ilt2DPalette |
New2DPalette(Color foreground,
Color background,
Image fillTexture)
Creates a new 2D palette using a texture.
|
static Ilt2DPalette |
New2DPalette(IlPattern pattern,
Color foreground,
Color background)
Deprecated.
Please use a constructor that accepts
IltPattern
instead of IlPattern . |
static Ilt2DPalette |
New2DPalette(IltPattern pattern,
Color foreground,
Color background)
Creates a new 2D palette.
|
static Ilt2DPalette |
New2DPalette(int fillStyle,
Color fillColor1,
Color fillColor2,
float fillStart,
float fillEnd,
float fillAngle)
Creates a new 2D palette.
|
static Ilt2DPalette |
NewSimple2DPalette(Color colour)
Creates a new mono-color 2D palette.
|
void |
setForeground(Color foreground)
Sets the foreground color.
|
String |
toString()
Converts the object into a human-readable format.
|
public Ilt2DPalette()
public Ilt2DPalette(Color colour)
colour
- Foreground color used to fill an object using
a solid fill style.public Ilt2DPalette(Color foreground, Color background, Image fillTexture)
foreground
- Foreground colorbackground
- Background colorfillTexture
- Texture that will be used to fill
an object shape.public Ilt2DPalette(Color foreground, Color background, IltPattern pattern)
pattern
- A fill pattern. For filling an entire area with a single
color, use IltPattern.Solid
.foreground
- A foreground color.background
- A background color. This may be null
;
in this case the pattern will be transparent.public Ilt2DPalette(int fillStyle, Color fillColor1, Color fillColor2, float fillStart, float fillEnd, float fillAngle)
fillStyle
- A fill style, either no fill, solid color, linear gradient
or radial gradientfillColor1
- A foreground colorfillColor2
- A background colorfillStart
- Position where the gradient startsfillEnd
- Position where the gradient endsfillAngle
- Angle (in degrees) of the gradientpublic Ilt2DPalette(int fillStyle, Color fillColor1, Color fillColor2, float fillStart, float fillEnd, float fillAngle, IltPattern pattern, Image fillTexture)
fillStyle
- A fill style, either no fill, solid color, linear gradient
or radial gradientfillColor1
- A foreground colorfillColor2
- A background colorfillStart
- Position where the gradient startsfillEnd
- Position where the gradient endsfillAngle
- Angle (in degrees) of the gradientpattern
- Fill patternfillTexture
- Fill texturepublic int getStyle()
public void setForeground(Color foreground)
public Color getForeground()
public Color getBackground()
public Paint getPaint()
public Ilt2DPalette getCurrentPalette()
public String toString()
public boolean equals(Object o)
public int hashCode()
public static Ilt2DPalette NewSimple2DPalette(Color colour)
@Deprecated public static Ilt2DPalette New2DPalette(IlPattern pattern, Color foreground, Color background)
IltPattern
instead of IlPattern
.pattern
- A fill pattern. For filling an entire area with a single
color, use IltPattern.Solid
.foreground
- A foreground color.background
- A background color. This may be null
;
in this case the pattern will be transparent.public static Ilt2DPalette New2DPalette(IltPattern pattern, Color foreground, Color background)
pattern
- A fill pattern. For filling an entire area with a
single color, use IltPattern.Solid
.foreground
- A foreground color.background
- A background color. This may be null
;
in this case the pattern will be transparent.public static Ilt2DPalette New2DPalette(Color foreground, Color background, Image fillTexture)
foreground
- foreground colorbackground
- background colorfillTexture
- texture that will be used to fill
an object shape.public static Ilt2DPalette New2DPalette(int fillStyle, Color fillColor1, Color fillColor2, float fillStart, float fillEnd, float fillAngle)
fillStyle
- A fill style, either no fill, solid color, linear gradient
or radial gradientfillColor1
- A first fill colorfillColor2
- A second fill color, to be used in case of gradient stylesfillStart
- Position where the gradient startsfillEnd
- Position where the gradient endsfillAngle
- Angle (in degrees) of the gradient© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.