public class TextAttributes
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static TextAttributes |
ERASE_MARKER |
Constructor and Description |
---|
TextAttributes() |
TextAttributes(java.awt.Color foregroundColor,
java.awt.Color backgroundColor,
java.awt.Color effectColor,
EffectType effectType,
int fontType) |
TextAttributes(Element element) |
Modifier and Type | Method and Description |
---|---|
TextAttributes |
clone() |
void |
copyFrom(TextAttributes other) |
boolean |
equals(java.lang.Object obj) |
void |
forEachAdditionalEffect(java.util.function.BiConsumer<? super EffectType,? super java.awt.Color> consumer) |
void |
forEachEffect(java.util.function.BiConsumer<? super EffectType,? super java.awt.Color> consumer) |
static TextAttributes |
fromFlyweight(AttributesFlyweight flyweight) |
java.awt.Color |
getBackgroundColor() |
java.awt.Color |
getEffectColor() |
EffectType |
getEffectType() |
java.awt.Color |
getErrorStripeColor() |
AttributesFlyweight |
getFlyweight() |
int |
getFontType() |
java.awt.Color |
getForegroundColor() |
boolean |
hasEffects() |
int |
hashCode() |
boolean |
isEmpty() |
static TextAttributes |
merge(TextAttributes under,
TextAttributes above)
Merges (layers) the two given text attributes.
|
void |
readExternal(Element element) |
void |
setAdditionalEffects(java.util.Map<EffectType,java.awt.Color> effectsMap)
Sets additional effects to paint
|
void |
setAttributes(java.awt.Color foregroundColor,
java.awt.Color backgroundColor,
java.awt.Color effectColor,
java.awt.Color errorStripeColor,
EffectType effectType,
int fontType) |
void |
setAttributes(java.awt.Color foregroundColor,
java.awt.Color backgroundColor,
java.awt.Color effectColor,
java.awt.Color errorStripeColor,
EffectType effectType,
java.util.Map<EffectType,java.awt.Color> additionalEffects,
int fontType) |
void |
setBackgroundColor(java.awt.Color color) |
void |
setEffectColor(java.awt.Color color) |
void |
setEffectType(EffectType effectType) |
void |
setErrorStripeColor(java.awt.Color color) |
void |
setFontType(int type) |
void |
setForegroundColor(java.awt.Color color) |
java.lang.String |
toString() |
void |
withAdditionalEffect(EffectType effectType,
java.awt.Color color)
Appends additional effect to paint with specific color
|
void |
withAdditionalEffects(java.util.Map<EffectType,java.awt.Color> effectsMap)
Appends additional effects to paint with specific colors.
|
void |
writeExternal(Element element) |
public static final TextAttributes ERASE_MARKER
public TextAttributes()
public TextAttributes(Element element)
public TextAttributes(java.awt.Color foregroundColor, java.awt.Color backgroundColor, java.awt.Color effectColor, EffectType effectType, int fontType)
public static TextAttributes merge(TextAttributes under, TextAttributes above)
under
- Text attributes to merge "under".above
- Text attributes to merge "above", overriding settings from "under".public void copyFrom(TextAttributes other)
public void setAttributes(java.awt.Color foregroundColor, java.awt.Color backgroundColor, java.awt.Color effectColor, java.awt.Color errorStripeColor, EffectType effectType, int fontType)
public void setAttributes(java.awt.Color foregroundColor, java.awt.Color backgroundColor, java.awt.Color effectColor, java.awt.Color errorStripeColor, EffectType effectType, java.util.Map<EffectType,java.awt.Color> additionalEffects, int fontType)
public boolean isEmpty()
public AttributesFlyweight getFlyweight()
public static TextAttributes fromFlyweight(AttributesFlyweight flyweight)
public java.awt.Color getForegroundColor()
public void setForegroundColor(java.awt.Color color)
public java.awt.Color getBackgroundColor()
public void setBackgroundColor(java.awt.Color color)
public java.awt.Color getEffectColor()
public void setEffectColor(java.awt.Color color)
public java.awt.Color getErrorStripeColor()
public void setErrorStripeColor(java.awt.Color color)
public boolean hasEffects()
public void setAdditionalEffects(java.util.Map<EffectType,java.awt.Color> effectsMap)
effectsMap
- map of effect types and colors to use.public void withAdditionalEffect(EffectType effectType, java.awt.Color color)
setAdditionalEffects(Map)
public void withAdditionalEffects(java.util.Map<EffectType,java.awt.Color> effectsMap)
public EffectType getEffectType()
public void forEachAdditionalEffect(java.util.function.BiConsumer<? super EffectType,? super java.awt.Color> consumer)
public void forEachEffect(java.util.function.BiConsumer<? super EffectType,? super java.awt.Color> consumer)
public void setEffectType(EffectType effectType)
public int getFontType()
public void setFontType(int type)
public TextAttributes clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void readExternal(Element element)
public void writeExternal(Element element)
public java.lang.String toString()
toString
in class java.lang.Object