public class TLcdGXYPainterColorStyle extends Object implements ILcdGXYPainterStyle, ILcdCloneable
ILcdGXYPainterStyle
interface. It sets a selectionColor before painting an Object
in
ILcdGXYPainter.SELECTED
mode, a defaultColor otherwise.TLcdG2DLineStyle
,
Serialized FormConstructor and Description |
---|
TLcdGXYPainterColorStyle() |
TLcdGXYPainterColorStyle(Color aDefaultColor) |
TLcdGXYPainterColorStyle(Color aDefaultColor,
Color aSelectionColor) |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Makes
Object.clone() public. |
Color |
getDefaultColor() |
Color |
getSelectionColor() |
void |
setDefaultColor(Color newDefaultColor) |
void |
setSelectionColor(Color newSelectionColor) |
void |
setupGraphics(Graphics aGraphics,
Object aObject,
int aMode,
ILcdGXYContext aGXYContext)
Calls
aGraphics.setColor(getSelectionColor) if
( ( aMode & ILcdGXYPainter.SELECTED ) != 0 ) and getSelectionColor returns a
non null value, aGraphics.setColor(getDefaultColor) otherwise. |
public TLcdGXYPainterColorStyle()
public TLcdGXYPainterColorStyle(Color aDefaultColor)
public void setupGraphics(Graphics aGraphics, Object aObject, int aMode, ILcdGXYContext aGXYContext)
aGraphics.setColor(getSelectionColor)
if
( ( aMode & ILcdGXYPainter.SELECTED
) != 0 ) and getSelectionColor returns a
non null
value, aGraphics.setColor(getDefaultColor)
otherwise.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 void setDefaultColor(Color newDefaultColor)
public Color getDefaultColor()
public void setSelectionColor(Color newSelectionColor)
public Color getSelectionColor()
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()