Package com.luciad.format.dwg.gxy
Class TLcdDWGGXYFontStyle
java.lang.Object
com.luciad.format.dwg.gxy.TLcdDWGGXYFontStyle
- All Implemented Interfaces:
ILcdCloneable
,ILcdGXYPainterStyle
,Serializable
,Cloneable
This class implements an
ILcdGXYPainterStyle
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
ConstructorDescriptionTLcdDWGGXYFontStyle
(Color[] aColorTable) TLcdDWGGXYFontStyle
(Color[] aColorTable, Color aSelectionColor) -
Method Summary
Modifier and TypeMethodDescriptionclone()
MakesObject.clone()
public.Color[]
protected Color
retrieveColor
(ILcdDWGShape aDWGShape) Finds the correct DWG color index and returns the corresponding color from the DWG color table.protected int
retrieveColorIndex
(ILcdDWGShape aDWGShape) void
setColorTable
(Color[] aColorTable) void
setSelectionColor
(Color aSelectionColor) void
setupGraphics
(Graphics aGraphics, Object aObject, int aMode, ILcdGXYContext aGXYContext) Set upaGraphics
before painting aObject.
-
Constructor Details
-
TLcdDWGGXYFontStyle
-
TLcdDWGGXYFontStyle
-
-
Method Details
-
setColorTable
-
getColorTable
-
setSelectionColor
-
getSelectionColor
-
setupGraphics
public void setupGraphics(Graphics aGraphics, Object aObject, int aMode, ILcdGXYContext aGXYContext) Description copied from interface:ILcdGXYPainterStyle
Set upaGraphics
before 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:
setupGraphics
in interfaceILcdGXYPainterStyle
- Parameters:
aGraphics
- theGraphics
to set up.aObject
- theObject
to paint.aMode
- the painting mode to consider (defined inILcdGXYPainter
).aGXYContext
- theILcdGXYContext
to consider.- See Also:
-
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. Implementations 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 painting the given DWG element.
-
clone
Description copied from interface:ILcdCloneable
Makes
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:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classObject
- See Also:
-