Package com.luciad.view.gxy
Class TLcdStrokeLineStyle
java.lang.Object
com.luciad.view.gxy.TLcdStrokeLineStyle
- All Implemented Interfaces:
ILcdCloneable,ILcdGXYPainterStyle,Serializable,Cloneable
ILcdGXYPainterStyle based on java.awt.Stroke.
The color can be different in regular and selected mode.
The Builder subclass offers convenience methods for building
various common line strokes.
This implementation requires Graphics2D instances.
For a more advanced custom line style, see TLcdGXYComplexStroke.- Since:
- 11.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a default line style.TLcdStrokeLineStyle(TLcdStrokeLineStyle aLineStyle) Creates a new line style based on the given style. -
Method Summary
Modifier and TypeMethodDescriptionclone()MakesObject.clone()public.getColor()Returns the color used in default mode.Returns the color used in selection mode.Returns the stroke used in selection mode.Returns the stroke used in default mode.booleanReturns whether to use anti-aliasing when painting.static TLcdStrokeLineStyleBuilderCreates a new builder with the default values.voidsetAntiAliasing(boolean aAntiAliasing) Sets whether to use anti-aliasing when painting.voidSets the color used in default mode.voidsetSelectionColor(Color aSelectionColor) Sets the color used in selection mode.voidsetSelectionStroke(Stroke aSelectionStroke) Sets the stroke used in selection mode.voidSets the stroke used in default mode.voidsetupGraphics(Graphics aGraphics, Object aObject, int aMode, ILcdGXYContext aGXYContext) ConfiguresaGraphicsfor painting the given object.
-
Constructor Details
-
TLcdStrokeLineStyle
public TLcdStrokeLineStyle()Creates a default line style. -
TLcdStrokeLineStyle
Creates a new line style based on the given style.- Parameters:
aLineStyle- a style whose settings will be copied
-
-
Method Details
-
newBuilder
Creates a new builder with the default values.- Returns:
- the new builder.
-
getColor
Returns the color used in default mode.- Returns:
- the color used in default mode
- See Also:
-
setColor
Sets the color used in default mode.- Parameters:
aColor- the new color to be used in default mode.- See Also:
-
getSelectionColor
Returns the color used in selection mode.- Returns:
- the color used in selection mode
- See Also:
-
setSelectionColor
Sets the color used in selection mode.- Parameters:
aSelectionColor- the new color to be used in selection mode.- See Also:
-
isAntiAliasing
public boolean isAntiAliasing()Returns whether to use anti-aliasing when painting.- Returns:
- whether to use anti-aliasing when painting
- See Also:
-
setAntiAliasing
public void setAntiAliasing(boolean aAntiAliasing) Sets whether to use anti-aliasing when painting.See also
ILcdGXYView.isAntiAliased().- Parameters:
aAntiAliasing- iftrue, uses anti-aliasing when painting- See Also:
-
getStroke
Returns the stroke used in default mode.- Returns:
- the stroke used in default mode.
- See Also:
-
setStroke
Sets the stroke used in default mode.- Parameters:
aStroke- the new stroke to be used in default mode.- See Also:
-
getSelectionStroke
Returns the stroke used in selection mode.- Returns:
- the stroke used in selection mode.
- See Also:
-
setSelectionStroke
Sets the stroke used in selection mode.- Parameters:
aSelectionStroke- the new stroke to be used in selection mode.- See Also:
-
setupGraphics
public void setupGraphics(Graphics aGraphics, Object aObject, int aMode, ILcdGXYContext aGXYContext) ConfiguresaGraphicsfor painting the given object. In particular, the stroke will be changed to have the configured stroke, color and aliasing, depending on the selection mode.- Specified by:
setupGraphicsin interfaceILcdGXYPainterStyle- Parameters:
aGraphics- theGraphicsto set up. This implementation relies on aGraphics2Dinstance.aObject- theObjectto paint.aMode- the painting mode to consider (defined inILcdGXYPainter).aGXYContext- theILcdGXYContextto consider.- See Also:
-
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:
-