public final class Coloring extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static int |
FONT_MODE_APPLY_NAME
Apply only the name from the font.
|
static int |
FONT_MODE_APPLY_SIZE
Apply only the size from the font.
|
static int |
FONT_MODE_APPLY_STYLE
Apply only the style from the font.
|
static int |
FONT_MODE_DEFAULT
Replace the underlying font by the coloring's font.
|
Constructor and Description |
---|
Coloring()
Construct empty coloring
|
Coloring(Font font,
Color foreColor,
Color backColor)
Construct new coloring
|
Coloring(Font font,
int fontMode,
Color foreColor,
Color backColor)
Construct new coloring
|
Coloring(Font font,
int fontMode,
Color foreColor,
Color backColor,
Color underlineColor,
Color strikeThroughColor)
Construct new coloring
|
Coloring(Font font,
int fontMode,
Color foreColor,
Color backColor,
Color underlineColor,
Color strikeThroughColor,
Color waveUnderlineColor)
Construct new coloring
|
Coloring(Font font,
int fontMode,
Color foreColor,
Color backColor,
Color underlineColor,
Color strikeThroughColor,
Color waveUnderlineColor,
Color topBorderLineColor,
Color rightBorderLineColor,
Color bottomBorderLineColor,
Color leftBorderLineColor) |
Modifier and Type | Method and Description |
---|---|
Coloring |
apply(Coloring c)
Apply this coloring to some other coloring c and return
the resulting coloring.
|
void |
apply(JComponent c)
Apply this coloring to component colors/font.
|
static Coloring |
changeBackColor(Coloring c,
Color newBackColor)
Derive a new coloring by changing
the background-color and its color-mode
and leaving the rest of the coloring unchanged.
|
static Coloring |
changeFont(Coloring c,
Font newFont)
Derive a new coloring by changing the font and leaving
the rest of the coloring (including the font-mode) unchanged.
|
static Coloring |
changeFont(Coloring c,
Font newFont,
int newFontMode)
Derive a new coloring by changing the font and font-mode and leaving
the rest of the coloring unchanged.
|
static Coloring |
changeForeColor(Coloring c,
Color newForeColor)
Derive a new coloring by changing
the foreground-color and its color-mode
and leaving the rest of the coloring unchanged.
|
boolean |
equals(Object o)
All font, foreColor and backColor are the same.
|
static Coloring |
fromAttributeSet(AttributeSet as)
Converts
AttributeSet to a Coloring . |
Color |
getBackColor()
Getter for background color
|
Color |
getBottomBorderLineColor()
Getter for bottom border line color
|
Font |
getFont()
Getter for font
|
int |
getFontMode()
Getter for font-mode
|
Color |
getForeColor()
Getter for foreground color
|
Color |
getLeftBorderLineColor()
Getter for left border line color
|
Color |
getRightBorderLineColor()
Getter for right border line color
|
Color |
getStrikeThroughColor()
Getter for strikethrough line color
|
Color |
getTopBorderLineColor()
Getter for top border line color
|
Color |
getUnderlineColor()
Getter for underline line color
|
Color |
getWaveUnderlineColor()
Getter for wave underline line color
|
int |
hashCode() |
String |
toString() |
public static final int FONT_MODE_APPLY_NAME
public static final int FONT_MODE_APPLY_STYLE
public static final int FONT_MODE_APPLY_SIZE
public static final int FONT_MODE_DEFAULT
public Coloring()
public Coloring(Font font, int fontMode, Color foreColor, Color backColor)
public Coloring(Font font, int fontMode, Color foreColor, Color backColor, Color underlineColor, Color strikeThroughColor)
public Coloring(Font font, int fontMode, Color foreColor, Color backColor, Color underlineColor, Color strikeThroughColor, Color waveUnderlineColor)
public Font getFont()
public int getFontMode()
public Color getForeColor()
public Color getBackColor()
public Color getUnderlineColor()
public Color getWaveUnderlineColor()
public Color getStrikeThroughColor()
public Color getTopBorderLineColor()
public Color getRightBorderLineColor()
public Color getBottomBorderLineColor()
public Color getLeftBorderLineColor()
public void apply(JComponent c)
public Coloring apply(Coloring c)
c
- coloring to which this coloring will be applied.
If it's null then this coloring will be returned as result.public boolean equals(Object o)
public static Coloring changeFont(Coloring c, Font newFont)
public static Coloring changeFont(Coloring c, Font newFont, int newFontMode)
public static Coloring changeForeColor(Coloring c, Color newForeColor)
public static Coloring changeBackColor(Coloring c, Color newBackColor)
public static Coloring fromAttributeSet(AttributeSet as)
AttributeSet
to a Coloring
. This method
will extract any font related information as well as the 'well-known' colors
from the AttributeSet
passed in and will use them for creating
a Coloring
instance that will be returned.
The list of supported colors:
StyleConstants.Foreground
StyleConstants.Background
StyleConstants.Underline
StyleConstants.StrikeThrough
EditorStyleConstants.WaveUnderlineColor
as
- The AttributeSet
to convert.Coloring
that will contain font and color information
from the supplied AttributeSet
.Built on June 4 2024. | Copyright © 2017-2024 Apache Software Foundation. All Rights Reserved.