public class TLcdMIFTextGXYFontStyle extends Object implements ILcdGXYPainterStyle, ILcdCloneable
ILcdGXYPainterStyle
for MIF text objects.
It sets a selectionColor before painting an Object
in
ILcdGXYPainter.SELECTED
mode, or the color and stroke specified
by the MIF pen otherwise.Constructor and Description |
---|
TLcdMIFTextGXYFontStyle()
Constructs a
TLcdMIFTextGXYFontStyle with the default selection color (red). |
TLcdMIFTextGXYFontStyle(Color aSelectionColor)
Constructs a
TLcdMIFTextGXYFontStyle with the given selection color. |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Makes
Object.clone() public. |
Color |
getColor()
Returns the color used to display non selected objects.
|
Font |
getFont()
Returns the font used to display the text objects.
|
Color |
getSelectionColor()
Returns the color in which selected objects are displayed.
|
void |
setColor(Color aColor)
Sets the color to display non selected objects.
|
void |
setFont(Font aFont)
Sets the font to use to display the text objects.
|
void |
setSelectionColor(Color aSelectionColor)
Sets the color in which selected objects are displayed.
|
void |
setupGraphics(Graphics aGraphics,
Object aObject,
int aMode,
ILcdGXYContext aGXYContext)
Set up
aGraphics before painting aObject. |
public TLcdMIFTextGXYFontStyle()
TLcdMIFTextGXYFontStyle
with the default selection color (red).public TLcdMIFTextGXYFontStyle(Color aSelectionColor)
TLcdMIFTextGXYFontStyle
with the given selection color.aSelectionColor
- the color to paint selected text in.public void setSelectionColor(Color aSelectionColor)
aSelectionColor
- the color in which selected objects are displayed.getSelectionColor()
public Color getSelectionColor()
setSelectionColor(java.awt.Color)
public void setFont(Font aFont)
aFont
- the font to use to display the text objects.getFont()
public Font getFont()
setFont(java.awt.Font)
public void setColor(Color aColor)
aColor
- the color to display non selected objects.getColor()
public Color getColor()
setColor(java.awt.Color)
public void setupGraphics(Graphics aGraphics, Object aObject, int aMode, ILcdGXYContext aGXYContext)
ILcdGXYPainterStyle
aGraphics
before painting aObject.
For example, if ( ( aMode & ILcdGXYPainter.SELECTED ) != 0 ), you may want to
call aGraphics.setColor(Color.red)
for instance, to see the selected
representation of a aObject in red.setupGraphics
in interface ILcdGXYPainterStyle
aGraphics
- the Graphics
to set up.aObject
- the Object
to paint.aMode
- the painting mode to consider (defined in
ILcdGXYPainter
).aGXYContext
- the ILcdGXYContext
to consider.ILcdGXYPainter
public Object clone()
ILcdCloneable
Makes Object.clone()
public.
java.lang.Object
, it can be implemented like this:
public Object clone() {
try {
return super.clone();
} catch ( CloneNotSupportedException e ) {
// Cannot happen: extends from Object and implements Cloneable (see also Object.clone)
throw new RuntimeException( e );
}
}
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()