Class TLcdGXYPainterColorStyle

All Implemented Interfaces:
ILcdCloneable, ILcdGXYPainterStyle, Serializable, Cloneable
Direct Known Subclasses:

public class TLcdGXYPainterColorStyle extends Object implements ILcdGXYPainterStyle, ILcdCloneable
This is an implementation of the ILcdGXYPainterStyle interface. It sets a selectionColor before painting an Object in ILcdGXYPainter.SELECTED mode, a defaultColor otherwise.
See Also:
  • Constructor Details

    • TLcdGXYPainterColorStyle

      public TLcdGXYPainterColorStyle()
    • TLcdGXYPainterColorStyle

      public TLcdGXYPainterColorStyle(Color aDefaultColor)
    • TLcdGXYPainterColorStyle

      public TLcdGXYPainterColorStyle(Color aDefaultColor, Color aSelectionColor)
  • Method Details

    • setupGraphics

      public void setupGraphics(Graphics aGraphics, Object aObject, int aMode, ILcdGXYContext aGXYContext)
      Calls aGraphics.setColor(getSelectionColor) if (aMode & <code>ILcdGXYPainter.SELECTED</code>) != 0 and getSelectionColor returns a non null value, aGraphics.setColor(getDefaultColor) otherwise.
      Specified by:
      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.
      See Also:
    • setDefaultColor

      public void setDefaultColor(Color newDefaultColor)
    • getDefaultColor

      public Color getDefaultColor()
    • setSelectionColor

      public void setSelectionColor(Color newSelectionColor)
    • getSelectionColor

      public Color getSelectionColor()
    • clone

      public Object clone()
      Description copied from interface: ILcdCloneable

      Makes Object.clone() public.

      When for example extending from 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 );
      Specified by:
      clone in interface ILcdCloneable
      clone in class Object
      See Also: