Class AbstractStrokeSelectionShapePainter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.image.selectionshape.AbstractSelectionShapePainter
-
- adams.gui.visualization.image.selectionshape.AbstractStrokeSelectionShapePainter
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,SelectionShapePainter,StrokeSelectionShapePainter,Serializable
- Direct Known Subclasses:
PolygonPainter,RectanglePainter
public abstract class AbstractStrokeSelectionShapePainter extends AbstractSelectionShapePainter implements StrokeSelectionShapePainter
For selection shape painters that use a stroke.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected floatm_StrokeThicknessthe thickness of the stroke.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractStrokeSelectionShapePainter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidapplyStroke(Graphics g, float stroke)Applies the stroke thickness.voiddefineOptions()Adds options to the internal list of options.protected voiddoPaintSelectionShape(ImagePanel.PaintPanel owner, Graphics g, Point topLeft, Point bottomRight, List<Point> trace)Paints the selection shape.protected abstract voiddoPaintSelectionShapeWithStroke(ImagePanel.PaintPanel owner, Graphics g, Point topLeft, Point bottomRight, List<Point> trace)Paints the selection shape.floatgetStrokeThickness()Returns the current stroke thickness.protected floatgetStrokeWidth(Graphics g, float defValue)Returns the thickness of the stroke.voidsetStrokeThickness(float value)Sets the stroke thickness to use.StringstrokeThicknessTipText()Returns the tip text for this property.-
Methods inherited from class adams.gui.visualization.image.selectionshape.AbstractSelectionShapePainter
canPaint, paintSelectionShape
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
Methods inherited from interface adams.gui.visualization.image.selectionshape.SelectionShapePainter
canAddTracePoint, paintSelectionShape
-
-
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setStrokeThickness
public void setStrokeThickness(float value)
Sets the stroke thickness to use.- Specified by:
setStrokeThicknessin interfaceStrokeSelectionShapePainter- Parameters:
value- the thickness
-
getStrokeThickness
public float getStrokeThickness()
Returns the current stroke thickness.- Specified by:
getStrokeThicknessin interfaceStrokeSelectionShapePainter- Returns:
- the thickness
-
strokeThicknessTipText
public String strokeThicknessTipText()
Returns the tip text for this property.- Specified by:
strokeThicknessTipTextin interfaceStrokeSelectionShapePainter- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getStrokeWidth
protected float getStrokeWidth(Graphics g, float defValue)
Returns the thickness of the stroke.- Parameters:
g- graphics context to get the thickness fromdefValue- the default value to return in case of failure- Returns:
- the stroke, default value if failed to extract
-
applyStroke
protected void applyStroke(Graphics g, float stroke)
Applies the stroke thickness.- Parameters:
stroke- the thickness to apply
-
doPaintSelectionShape
protected void doPaintSelectionShape(ImagePanel.PaintPanel owner, Graphics g, Point topLeft, Point bottomRight, List<Point> trace)
Paints the selection shape.- Specified by:
doPaintSelectionShapein classAbstractSelectionShapePainter- Parameters:
owner- the panel this shape is used withg- the graphics contexttopLeft- the top-left cornerbottomRight- the bottom-right cornertrace- the mouse movement trace
-
doPaintSelectionShapeWithStroke
protected abstract void doPaintSelectionShapeWithStroke(ImagePanel.PaintPanel owner, Graphics g, Point topLeft, Point bottomRight, List<Point> trace)
Paints the selection shape.- Parameters:
owner- the panel this shape is used withg- the graphics contexttopLeft- the top-left cornerbottomRight- the bottom-right cornertrace- the mouse movement trace
-
-