Package com.luciad.view.gxy
Class TLcdG2DLineStyle
java.lang.Object
com.luciad.view.gxy.TLcdG2DLineStyle
- All Implemented Interfaces:
ILcdCloneable,ILcdGXYPainterStyle,Serializable,Cloneable
Implementation of
ILcdGXYPainterStyle that represents a line style, with a color
and line width that can be different in regular and selected mode.
This implementation requires Graphics2D instances.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a default line style.TLcdG2DLineStyle(TLcdG2DLineStyle aLineStyle) Creates a new line style based on the given style.TLcdG2DLineStyle(Color aColor, double aWidth, Color aSelectionColor, double aSelectionWidth) Creates a new line style based on the given colors and widths.TLcdG2DLineStyle(Color aColor, Color aSelectionColor) Creates a new line style with a width of 1 pixel, based on the given colors. -
Method Summary
Modifier and TypeMethodDescriptionclone()MakesObject.clone()public.getColor()Returns the color used in default mode.doubleReturns the line width used in default mode.Returns the color used in selection mode.doubleReturns the line width used in selection mode.booleanReturns whether to use anti-aliasing when painting.voidsetAntiAliasing(boolean aAntiAliasing) Sets whether to use anti-aliasing when painting.voidSets the color used in default mode.voidsetLineWidth(double aLineWidth) Sets the line width used in default mode.voidsetSelectionColor(Color aSelectionColor) Sets the color used in selection mode.voidsetSelectionLineWidth(double aSelectionLineWidth) Sets the line width used in selection mode.voidsetupGraphics(Graphics aGraphics, Object aObject, int aMode, ILcdGXYContext aGXYContext) ConfiguresaGraphicsfor painting the given object.
-
Constructor Details
-
TLcdG2DLineStyle
public TLcdG2DLineStyle()Creates a default line style. -
TLcdG2DLineStyle
Creates a new line style with a width of 1 pixel, based on the given colors.- Parameters:
aColor- the line color used in default modeaSelectionColor- the line color used in selection mode
-
TLcdG2DLineStyle
Creates a new line style based on the given colors and widths.- Parameters:
aColor- the line color used in default modeaWidth- the line width used in default modeaSelectionColor- the line color used in selection modeaSelectionWidth- the line width used in selection mode
-
TLcdG2DLineStyle
Creates a new line style based on the given style.- Parameters:
aLineStyle- a style whose settings will be copied
-
-
Method Details
-
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:
-
getLineWidth
public double getLineWidth()Returns the line width used in default mode.- Returns:
- the line width used in default mode
- See Also:
-
setLineWidth
public void setLineWidth(double aLineWidth) Sets the line width used in default mode.- Parameters:
aLineWidth- the new line width to be used in default mode- See Also:
-
getSelectionLineWidth
public double getSelectionLineWidth()Returns the line width used in selection mode.- Returns:
- the line width used in selection mode
- See Also:
-
setSelectionLineWidth
public void setSelectionLineWidth(double aSelectionLineWidth) Sets the line width used in selection mode.- Parameters:
aSelectionLineWidth- the new line width 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- if true, uses anti-aliasing when painting- 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 line width, 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:
-