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 ofas "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 intcompareTo(T arg0)voidendPaintIteration(java.awt.Graphics g2d)Invoked to inform implementations that a paint iteration ends for the correspondingITrace2D.booleanequals(java.lang.Object obj)java.awt.ColorgetColor()Returns the color to paint with ornull if no special color is desired.java.awt.ColorgetColorFill()Returns the color to paint fillings with ornull if no special color is desired.java.awt.StrokegetStroke()Returns the stroke to paint with.intgetTransparency()Returns the transparency to use for painting.intgetTransparencyFill()Returns the transparency to use for fill painting.inthashCode()protected java.awt.ColorinstallColor(java.awt.Graphics g)Installs the color to the graphics context if and only if a color has been set.protected java.awt.ColorinstallColorFill(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.StrokeinstallStroke(java.awt.Graphics g)Installs the stroke to the graphics context if and only if a stroke has been set.java.awt.ColorsetColor(java.awt.Color color)Sets the color to paint with ornullif no special color is desired.java.awt.ColorsetColorFill(java.awt.Color fillColor)Sets the color to paint fillings with ornullif no special fill color is desired.java.awt.StrokesetStroke(java.awt.Stroke stroke)Sets the stroke to paint with ornullif no special color is desired.intsetTransparency(int transparency0to255)Sets the transparency to use for painting.intsetTransparencyFill(int transparency0to255)Sets the transparency to use for fill painting.voidstartPaintIteration(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:
compareToin 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:IPointPainterInvoked to inform implementations that a paint iteration ends for the correspondingITrace2D.- Specified by:
endPaintIterationin 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:
equalsin classjava.lang.Object- See Also:
Object.equals(java.lang.Object)
-
getColor
public java.awt.Color getColor()
Description copied from interface:IPointPainterConfigurableUIReturns the color to paint with ornull if no special color is desired.- Specified by:
getColorin 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:IPointPainterConfigurableUIReturns the color to paint fillings with ornull if no special color is desired.- Specified by:
getColorFillin 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:IPointPainterConfigurableUIReturns the stroke to paint with.- Specified by:
getStrokein interfaceIPointPainterConfigurableUI<T extends IPointPainterConfigurableUI<T>>- Returns:
- the stroke to paint with.
- See Also:
IPointPainterConfigurableUI.getStroke()
-
getTransparency
public int getTransparency()
Description copied from interface:IPointPainterConfigurableUIReturns 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:
getTransparencyin 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:IPointPainterConfigurableUIReturns 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:
getTransparencyFillin interfaceIPointPainterConfigurableUI<T extends IPointPainterConfigurableUI<T>>- Returns:
- the fill transparency used between 0 and 255.
- See Also:
IPointPainterConfigurableUI.getTransparencyFill()
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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
nullif 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
nullif 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
nullif no action was taken. - See Also:
setStroke(Stroke)
-
setColor
public java.awt.Color setColor(java.awt.Color color)
Description copied from interface:IPointPainterConfigurableUISets the color to paint with ornullif no special color is desired.In the latter case the color of the
provided for paint operations will be used.Graphics- Specified by:
setColorin interfaceIPointPainterConfigurableUI<T extends IPointPainterConfigurableUI<T>>- Parameters:
color- the color to paint with ornullif 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:IPointPainterConfigurableUISets the color to paint fillings with ornullif 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:
setColorFillin interfaceIPointPainterConfigurableUI<T extends IPointPainterConfigurableUI<T>>- Parameters:
fillColor- the color to paint fillings with ornullif 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:IPointPainterConfigurableUISets the stroke to paint with ornullif no special color is desired.In the latter case the stroke of the
provided for paint operations will be used.Graphics- Specified by:
setStrokein interfaceIPointPainterConfigurableUI<T extends IPointPainterConfigurableUI<T>>- Parameters:
stroke- the stroke to paint with.- Returns:
- the previous color being used or
nullif none was used before. - See Also:
IPointPainterConfigurableUI.setStroke(java.awt.Stroke)
-
setTransparency
public int setTransparency(int transparency0to255)
Description copied from interface:IPointPainterConfigurableUISets 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:
setTransparencyin 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:IPointPainterConfigurableUISets 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:
setTransparencyFillin 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:IPointPainterInvoked to inform implementations that a paint iteration starts for the correspondingITrace2D.- Specified by:
startPaintIterationin interfaceIPointPainter<T extends IPointPainterConfigurableUI<T>>- Parameters:
g2d- provided in case pending paint operations have to be performed.- See Also:
IPointPainter.startPaintIteration(java.awt.Graphics)
-
-