public class TLcdDWGGXYLineStyle extends Object implements ILcdGXYPainterStyle, ILcdCloneable
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.Constructor and Description |
---|
TLcdDWGGXYLineStyle()
Creates 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.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Makes
Object.clone() public. |
Color[] |
getColorTable()
Returns the color table.
|
Color |
getSelectionColor()
Returns the selection color.
|
Color |
retrieveColor(ILcdDWGShape aDWGShape)
Finds the correct DWG color index and returns the corresponding color from
the DWG color table.
|
int |
retrieveColorIndex(ILcdDWGShape aDWGShape)
Returns the DWG color index to be used for drawing the given DWG element.
|
TLcdDWGLineType |
retrieveLineType(ILcdDWGShape aDWGShape)
Returns the line type to be used for drawing the given DWG element.
|
int |
retrieveWeight(ILcdDWGShape aDWGShape)
Returns the weight to be used for drawing the given DWG element.
|
void |
setColorTable(Color[] aColorTable)
Sets the color table.
|
void |
setSelectionColor(Color aSelectionColor)
Sets the selection color.
|
void |
setupGraphics(Graphics aGraphics,
Object aObject,
int aMode,
ILcdGXYContext aGXYContext)
Set up
aGraphics before painting aObject. |
public TLcdDWGGXYLineStyle()
public TLcdDWGGXYLineStyle(Color[] aColorTable)
public void setColorTable(Color[] aColorTable)
public Color[] getColorTable()
public void setSelectionColor(Color aSelectionColor)
public Color getSelectionColor()
public void setupGraphics(Graphics aGraphics, Object aObject, int aMode, ILcdGXYContext aGXYContext)
ILcdGXYPainterStyle
aGraphics
before painting aObject.
For example, if (aMode & ILcdGXYPainter.SELECTED) != 0
, you may want to
call aGraphics.setColor(Color.red)
for instance, to see the selected
representation of a aObject in red.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 TLcdDWGLineType retrieveLineType(ILcdDWGShape aDWGShape)
public int retrieveWeight(ILcdDWGShape aDWGShape)
public Color retrieveColor(ILcdDWGShape aDWGShape)
retrieveColorIndex(ILcdDWGShape)
public int retrieveColorIndex(ILcdDWGShape aDWGShape)
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()