Class TLcdDWGGXYLineStyle

All Implemented Interfaces:
ILcdCloneable, ILcdGXYPainterStyle, Serializable, Cloneable

public class TLcdDWGGXYLineStyle extends Object implements ILcdGXYPainterStyle, ILcdCloneable
This class implements an ILcdGXYPainterLineType for DWG objects. It sets a selectionColor before painting an Object in ILcdGXYPainter.SELECTED mode, or the color specified by the DWG object otherwise.
See Also:
  • Constructor Details

    • TLcdDWGGXYLineStyle

      public TLcdDWGGXYLineStyle()
      Creates a new TLcdDWGGXYLineStyle.
    • TLcdDWGGXYLineStyle

      public TLcdDWGGXYLineStyle(Color[] aColorTable)
      Creates a new TLcdDWGGXYLineStyle with the given DWG color table.
    • TLcdDWGGXYLineStyle

      public TLcdDWGGXYLineStyle(Color[] aColorTable, Color aSelectionColor)
      Creates a new TLcdDWGGXYLineStyle with the given color table and selection color.
  • Method Details

    • setColorTable

      public void setColorTable(Color[] aColorTable)
      Sets the color table. A color table always contains 256 entries.
    • getColorTable

      public Color[] getColorTable()
      Returns the color table.
    • setSelectionColor

      public void setSelectionColor(Color aSelectionColor)
      Sets the selection color.
    • getSelectionColor

      public Color getSelectionColor()
      Returns the selection color.
    • setupGraphics

      public void setupGraphics(Graphics aGraphics, Object aObject, int aMode, ILcdGXYContext aGXYContext)
      Description copied from interface: ILcdGXYPainterStyle
      Set up aGraphics before painting aObject. For example, if (aMode & ILcdGXYPainter.SELECTED) != 0, you may want to call aGraphics.setColor( for instance, to see the selected representation of a aObject in red.
      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:
    • retrieveLineType

      public TLcdDWGLineType retrieveLineType(ILcdDWGShape aDWGShape)
      Returns the line type to be used for drawing the given DWG element.
    • retrieveWeight

      public int retrieveWeight(ILcdDWGShape aDWGShape)
      Returns the weight to be used for drawing the given DWG element. Typically, only polylines have weights. Extensions may override this method to get a different behavior.
    • retrieveColor

      public Color retrieveColor(ILcdDWGShape aDWGShape)
      Finds the correct DWG color index and returns the corresponding color from the DWG color table. If the color index is invalid, the color value from the display info is returned. Extensions may override this method to get a different behavior.
      the Color to be used for filling the given DWG element.
      See Also:
    • retrieveColorIndex

      public int retrieveColorIndex(ILcdDWGShape aDWGShape)
      Returns the DWG color index to be used for drawing the given DWG element. Extensions may override this method to get different colors.
    • 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: