Class APointPainter<T extends IPointPainterConfigurableUI<T>>
- java.lang.Object
-
- info.monitorenter.gui.chart.pointpainters.APointPainter<T>
-
- Type Parameters:
T
- needed for generic comparable.
- All Implemented Interfaces:
IPointPainter<T>
,IPointPainterConfigurableUI<T>
,java.io.Serializable
,java.lang.Comparable<T>
- Direct Known Subclasses:
PointPainterDisc
,PointPainterLine
,PointPainterVerticalBar
public abstract class APointPainter<T extends IPointPainterConfigurableUI<T>> extends java.lang.Object implements IPointPainterConfigurableUI<T>
Adapter class that implements optional methods of
as "no operation".IPointPainter
- Since:
- 3.0.0
- Version:
- $Revision: 1.13 $
- Author:
- Achim Westermann
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description APointPainter()
Default constructor (sets the consumed by paint flag to false).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(T arg0)
void
endPaintIteration(java.awt.Graphics g2d)
Invoked to inform implementations that a paint iteration ends for the correspondingITrace2D
.boolean
equals(java.lang.Object obj)
java.awt.Color
getColor()
Returns the color to paint with ornull if no special color is desired.
java.awt.Color
getColorFill()
Returns the color to paint fillings with ornull if no special color is desired.
java.awt.Stroke
getStroke()
Returns the stroke to paint with.int
getTransparency()
Returns the transparency to use for painting.int
getTransparencyFill()
Returns the transparency to use for fill painting.int
hashCode()
protected java.awt.Color
installColor(java.awt.Graphics g)
Installs the color to the graphics context if and only if a color has been set.protected java.awt.Color
installColorFill(java.awt.Graphics g)
Installs the fill color to the graphics context if and only if a fill color has been set.protected java.awt.Stroke
installStroke(java.awt.Graphics g)
Installs the stroke to the graphics context if and only if a stroke has been set.java.awt.Color
setColor(java.awt.Color color)
Sets the color to paint with ornull
if no special color is desired.java.awt.Color
setColorFill(java.awt.Color fillColor)
Sets the color to paint fillings with ornull
if no special fill color is desired.java.awt.Stroke
setStroke(java.awt.Stroke stroke)
Sets the stroke to paint with ornull
if no special color is desired.int
setTransparency(int transparency0to255)
Sets the transparency to use for painting.int
setTransparencyFill(int transparency0to255)
Sets the transparency to use for fill painting.void
startPaintIteration(java.awt.Graphics g2d)
Invoked to inform implementations that a paint iteration starts for the correspondingITrace2D
.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface info.monitorenter.gui.chart.IPointPainter
paintPoint
-
-
-
-
Method Detail
-
compareTo
public final int compareTo(T arg0)
- Specified by:
compareTo
in interfacejava.lang.Comparable<T extends IPointPainterConfigurableUI<T>>
- See Also:
Comparable.compareTo(java.lang.Object)
-
endPaintIteration
public void endPaintIteration(java.awt.Graphics g2d)
Description copied from interface:IPointPainter
Invoked to inform implementations that a paint iteration ends for the correspondingITrace2D
.- Specified by:
endPaintIteration
in interfaceIPointPainter<T extends IPointPainterConfigurableUI<T>>
- Parameters:
g2d
- provided in case pending paint operations have to be performed.- See Also:
IPointPainter.endPaintIteration(java.awt.Graphics)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
getColor
public java.awt.Color getColor()
Description copied from interface:IPointPainterConfigurableUI
Returns the color to paint with ornull if no special color is desired.
- Specified by:
getColor
in interfaceIPointPainterConfigurableUI<T extends IPointPainterConfigurableUI<T>>
- Returns:
- the color to paint with
null if no special color is desired.
- See Also:
IPointPainterConfigurableUI.getColor()
-
getColorFill
public java.awt.Color getColorFill()
Description copied from interface:IPointPainterConfigurableUI
Returns the color to paint fillings with ornull if no special color is desired.
- Specified by:
getColorFill
in interfaceIPointPainterConfigurableUI<T extends IPointPainterConfigurableUI<T>>
- Returns:
- the color to paint fillings with
null if no special color is desired.
- See Also:
IPointPainterConfigurableUI.getColorFill()
-
getStroke
public java.awt.Stroke getStroke()
Description copied from interface:IPointPainterConfigurableUI
Returns the stroke to paint with.- Specified by:
getStroke
in interfaceIPointPainterConfigurableUI<T extends IPointPainterConfigurableUI<T>>
- Returns:
- the stroke to paint with.
- See Also:
IPointPainterConfigurableUI.getStroke()
-
getTransparency
public int getTransparency()
Description copied from interface:IPointPainterConfigurableUI
Returns the transparency to use for painting.This value will be computed from the color used. If that color is not configured (null) a value of 0.0 is returned even if the color from the
used for painting has a different setting!Graphics
- Specified by:
getTransparency
in interfaceIPointPainterConfigurableUI<T extends IPointPainterConfigurableUI<T>>
- Returns:
- the transparency used between 0 and 255.
- See Also:
IPointPainterConfigurableUI.getTransparency()
-
getTransparencyFill
public int getTransparencyFill()
Description copied from interface:IPointPainterConfigurableUI
Returns the transparency to use for fill painting.This value will be computed from the color used. If that color is not configured (null) a value of 0.0 is returned even if the color from the
used for painting has a different setting!Graphics
- Specified by:
getTransparencyFill
in interfaceIPointPainterConfigurableUI<T extends IPointPainterConfigurableUI<T>>
- Returns:
- the fill transparency used between 0 and 255.
- See Also:
IPointPainterConfigurableUI.getTransparencyFill()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
installColor
protected java.awt.Color installColor(java.awt.Graphics g)
Installs the color to the graphics context if and only if a color has been set.- Parameters:
g
- the graphics context to use.- Returns:
- the previous color of the graphics context or
null
if no action was taken. - See Also:
setColor(Color)
-
installColorFill
protected java.awt.Color installColorFill(java.awt.Graphics g)
Installs the fill color to the graphics context if and only if a fill color has been set.- Parameters:
g
- the graphics context to use.- Returns:
- the previous color of the graphics context or
null
if no action was taken. - See Also:
setColorFill(Color)
-
installStroke
protected java.awt.Stroke installStroke(java.awt.Graphics g)
Installs the stroke to the graphics context if and only if a stroke has been set.- Parameters:
g
- the graphics context to use.- Returns:
- the previous stroke of the graphics context or
null
if no action was taken. - See Also:
setStroke(Stroke)
-
setColor
public java.awt.Color setColor(java.awt.Color color)
Description copied from interface:IPointPainterConfigurableUI
Sets the color to paint with ornull
if no special color is desired.In the latter case the color of the
provided for paint operations will be used.Graphics
- Specified by:
setColor
in interfaceIPointPainterConfigurableUI<T extends IPointPainterConfigurableUI<T>>
- Parameters:
color
- the color to paint with ornull
if no special color is desired.- Returns:
- the previous color to paint with
null if no special color is desired.
- See Also:
IPointPainterConfigurableUI.setColor(java.awt.Color)
-
setColorFill
public java.awt.Color setColorFill(java.awt.Color fillColor)
Description copied from interface:IPointPainterConfigurableUI
Sets the color to paint fillings with ornull
if no special fill color is desired.In the latter case the color of the
provided for paint fill operations will be used.Graphics
- Specified by:
setColorFill
in interfaceIPointPainterConfigurableUI<T extends IPointPainterConfigurableUI<T>>
- Parameters:
fillColor
- the color to paint fillings with ornull
if no special color is desired.- Returns:
- the previous color to paint fillings with
null if no special color is desired.
- See Also:
IPointPainterConfigurableUI.setColorFill(java.awt.Color)
-
setStroke
public java.awt.Stroke setStroke(java.awt.Stroke stroke)
Description copied from interface:IPointPainterConfigurableUI
Sets the stroke to paint with ornull
if no special color is desired.In the latter case the stroke of the
provided for paint operations will be used.Graphics
- Specified by:
setStroke
in interfaceIPointPainterConfigurableUI<T extends IPointPainterConfigurableUI<T>>
- Parameters:
stroke
- the stroke to paint with.- Returns:
- the previous color being used or
null
if none was used before. - See Also:
IPointPainterConfigurableUI.setStroke(java.awt.Stroke)
-
setTransparency
public int setTransparency(int transparency0to255)
Description copied from interface:IPointPainterConfigurableUI
Sets the transparency to use for painting.This value will be fold into color. If color has not been configured before it will not have any effect.
Caution: When using a value greater 0 may cost a multiple cpu load!
- Specified by:
setTransparency
in interfaceIPointPainterConfigurableUI<T extends IPointPainterConfigurableUI<T>>
- Parameters:
transparency0to255
- a transparency value between 0 and 255.- Returns:
- the previous transparency used.
- See Also:
IPointPainterConfigurableUI.setTransparency(int)
-
setTransparencyFill
public int setTransparencyFill(int transparency0to255)
Description copied from interface:IPointPainterConfigurableUI
Sets the transparency to use for fill painting.This value will be fold into fill color. If fill color has not been configured before it will not have any effect.
Caution: When using a value greater 0 may cost a multiple cpu load!
- Specified by:
setTransparencyFill
in interfaceIPointPainterConfigurableUI<T extends IPointPainterConfigurableUI<T>>
- Parameters:
transparency0to255
- a transparency value between 0 and 255.- Returns:
- the previous fill transparency used.
- See Also:
IPointPainterConfigurableUI.setTransparencyFill(int)
-
startPaintIteration
public void startPaintIteration(java.awt.Graphics g2d)
Description copied from interface:IPointPainter
Invoked to inform implementations that a paint iteration starts for the correspondingITrace2D
.- Specified by:
startPaintIteration
in interfaceIPointPainter<T extends IPointPainterConfigurableUI<T>>
- Parameters:
g2d
- provided in case pending paint operations have to be performed.- See Also:
IPointPainter.startPaintIteration(java.awt.Graphics)
-
-