public class KeyTemplate
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
KeyTemplate.Mode
|
| Constructor and Description |
|---|
KeyTemplate()
Initializes a new instance of the
KeyTemplate class. |
| Modifier and Type | Method and Description |
|---|---|
void |
draw(java.awt.Graphics2D graphics,
Key objKey,
KeyTemplate.Mode mode,
java.awt.Font font)
Draws the specified key using this template.
|
protected void |
drawBackground(java.awt.Graphics2D graphics,
Key objKey,
KeyTemplate.Mode mode)
Override this method to render custom key background.
|
protected void |
drawFrame(java.awt.Graphics2D graphics,
Key objKey,
KeyTemplate.Mode mode)
Override this method to render custom key border.
|
java.awt.Color |
getAlterCaseForeground()
Gets the color of alter-case characters.
|
GradientBrush |
getBackground()
Gets the background brush.
|
Pen |
getBorder()
Gets the Pen used to draw key borders.
|
int |
getCornerRadius()
Gets the radius of keys' rounded corners.
|
GradientBrush |
getHoverBackground()
Gets the background of hovered keys.
|
java.util.EnumSet<ImageAlignment> |
getImageAlign()
Gets how images are aligned inside keys.
|
java.awt.Color |
getLowerCaseForeground()
Gets the color of lower-case characters.
|
GradientBrush |
getPressedBackground()
Gets the background of pressed keys.
|
java.awt.Color |
getUpperCaseForeground()
Gets the color of upper-case characters.
|
void |
setAlterCaseForeground(java.awt.Color value)
Sets the color of alter-case characters.
|
void |
setBackground(GradientBrush value)
Sets the background brush.
|
void |
setBorder(Pen value)
Sets the Pen used to draw key borders.
|
void |
setCornerRadius(int value)
Sets the radius of keys' rounded corners.
|
void |
setHoverBackground(GradientBrush value)
Sets the background of hovered keys.
|
void |
setImageAlign(java.util.EnumSet<ImageAlignment> value)
Sets how images are aligned inside keys.
|
void |
setLowerCaseForeground(java.awt.Color value)
Sets the color of lower-case characters.
|
void |
setPressedBackground(GradientBrush value)
Sets the background of pressed keys.
|
void |
setUpperCaseForeground(java.awt.Color value)
Sets the color of upper-case characters.
|
public KeyTemplate()
KeyTemplate class.public void setBackground(GradientBrush value)
value - A GradientBrush instance.public GradientBrush getBackground()
public void setHoverBackground(GradientBrush value)
value - A GradientBrush instance.public GradientBrush getHoverBackground()
public void setPressedBackground(GradientBrush value)
value - A GradientBrush instance.public GradientBrush getPressedBackground()
public void setBorder(Pen value)
value - A Pen instance.public Pen getBorder()
public void setLowerCaseForeground(java.awt.Color value)
value - A java.awt.Color instance.public java.awt.Color getLowerCaseForeground()
public void setUpperCaseForeground(java.awt.Color value)
value - A java.awt.Color instance.public java.awt.Color getUpperCaseForeground()
public void setAlterCaseForeground(java.awt.Color value)
value - A java.awt.Color instance.public java.awt.Color getAlterCaseForeground()
public int getCornerRadius()
public void setCornerRadius(int value)
value - An integer value specifying the radius.public java.util.EnumSet<ImageAlignment> getImageAlign()
ImageAlignment flags.public void setImageAlign(java.util.EnumSet<ImageAlignment> value)
value - A set of ImageAlignment flags.protected void drawBackground(java.awt.Graphics2D graphics,
Key objKey,
KeyTemplate.Mode mode)
graphics - A target Graphics2D where the key should be drawn.objKey - A Key instance.mode - A Mode member specifying the key state.protected void drawFrame(java.awt.Graphics2D graphics,
Key objKey,
KeyTemplate.Mode mode)
graphics - A target Graphics2D where the key should be drawn.objKey - A Key instance.mode - A Mode member specifying the key state.public void draw(java.awt.Graphics2D graphics,
Key objKey,
KeyTemplate.Mode mode,
java.awt.Font font)
graphics - A target Graphics2D where the key should be drawn.objKey - A Key instance.mode - A Mode member specifying the key state.font - A java.awt.Font instance.