Package com.luciad.format.dwg.gxy
Class TLcdDWGGXYLineStyle
java.lang.Object
com.luciad.format.dwg.gxy.TLcdDWGGXYLineStyle
- All Implemented Interfaces:
ILcdCloneable,ILcdGXYPainterStyle,Serializable,Cloneable
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 Summary
ConstructorsConstructorDescriptionCreates a new TLcdDWGGXYLineStyle.TLcdDWGGXYLineStyle(Color[] aColorTable) Creates a new TLcdDWGGXYLineStyle with the given DWG color table.TLcdDWGGXYLineStyle(Color[] aColorTable, Color aSelectionColor) Creates a new TLcdDWGGXYLineStyle with the given color table and selection color. -
Method Summary
Modifier and TypeMethodDescriptionclone()MakesObject.clone()public.Color[]Returns the color table.Returns the selection color.retrieveColor(ILcdDWGShape aDWGShape) Finds the correct DWG color index and returns the corresponding color from the DWG color table.intretrieveColorIndex(ILcdDWGShape aDWGShape) Returns the DWG color index to be used for drawing the given DWG element.retrieveLineType(ILcdDWGShape aDWGShape) Returns the line type to be used for drawing the given DWG element.intretrieveWeight(ILcdDWGShape aDWGShape) Returns the weight to be used for drawing the given DWG element.voidsetColorTable(Color[] aColorTable) Sets the color table.voidsetSelectionColor(Color aSelectionColor) Sets the selection color.voidsetupGraphics(Graphics aGraphics, Object aObject, int aMode, ILcdGXYContext aGXYContext) Set upaGraphicsbefore painting aObject.
-
Constructor Details
-
TLcdDWGGXYLineStyle
public TLcdDWGGXYLineStyle()Creates a new TLcdDWGGXYLineStyle. -
TLcdDWGGXYLineStyle
Creates a new TLcdDWGGXYLineStyle with the given DWG color table. -
TLcdDWGGXYLineStyle
Creates a new TLcdDWGGXYLineStyle with the given color table and selection color.
-
-
Method Details
-
setColorTable
Sets the color table. A color table always contains 256 entries. -
getColorTable
Returns the color table. -
setSelectionColor
Sets the selection color. -
getSelectionColor
Returns the selection color. -
setupGraphics
public void setupGraphics(Graphics aGraphics, Object aObject, int aMode, ILcdGXYContext aGXYContext) Description copied from interface:ILcdGXYPainterStyleSet upaGraphicsbefore painting aObject. For example, if(aMode & ILcdGXYPainter.SELECTED) != 0, you may want to callaGraphics.setColor(Color.red)for instance, to see the selected representation of a aObject in red.- Specified by:
setupGraphicsin interfaceILcdGXYPainterStyle- Parameters:
aGraphics- theGraphicsto set up.aObject- theObjectto paint.aMode- the painting mode to consider (defined inILcdGXYPainter).aGXYContext- theILcdGXYContextto consider.- See Also:
-
retrieveLineType
Returns the line type to be used for drawing the given DWG element. -
retrieveWeight
Returns the weight to be used for drawing the given DWG element. In DWG, this value is a discrete step of "1/100th of a millimeter". Negative values having a special meaning, we use the layer's weight in that case. -
retrieveColor
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.- Returns:
- the Color to be used for filling the given DWG element.
- See Also:
-
retrieveColorIndex
Returns the DWG color index to be used for drawing the given DWG element. Extensions may override this method to get different colors. -
clone
Description copied from interface:ILcdCloneableMakes
When for example extending fromObject.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 ); } }- Specified by:
clonein interfaceILcdCloneable- Overrides:
clonein classObject- See Also:
-