Class PolygonFill
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.gui.visualization.segmentation.tool.AbstractTool
-
- adams.gui.visualization.segmentation.tool.AbstractToolWithParameterPanel
-
- adams.gui.visualization.segmentation.tool.PolygonFill
-
- All Implemented Interfaces:
CleanUpHandler
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,SizeOfHandler
,CustomizableTool
,Tool
,Serializable
public class PolygonFill extends AbstractToolWithParameterPanel
Polygon fill.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_SIZE
the default size.protected boolean
m_Foreground
whether to fill in foreground.protected List<Point>
m_Points
the polygon points.protected Color
m_PolygonColor
the polygon color.protected float
m_PolygonStroke
the polygon stroke thickness.protected JRadioButton
m_RadioBackground
the radio button for background.protected JRadioButton
m_RadioForeground
the radio button for foreground.protected int
m_Size
the current size.protected BaseColorTextField
m_TextPolygonColor
the text field for the polygon color.protected NumberTextField
m_TextPolygonStroke
the text field for the polygon stroke thickness.protected NumberTextField
m_TextZoom
the text field for the size.protected double
m_Zoom
the current zoom.-
Fields inherited from class adams.gui.visualization.segmentation.tool.AbstractToolWithParameterPanel
m_ButtonApply
-
Fields inherited from class adams.gui.visualization.segmentation.tool.AbstractTool
m_KeyListener, m_Listener, m_MotionListener, m_PaintOperation, m_PanelCanvas, m_PanelFullOptions, m_PanelOptions
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description PolygonFill()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addOptions(ParameterPanel paramPanel)
Fills the parameter panel with the options.protected Cursor
createCursor()
Returns the mouse cursor to use.protected ToolKeyAdapter
createKeyListener()
Creates the key listener to use.protected ToolMouseAdapter
createMouseListener()
Creates the mouse listener to use.protected ToolMouseMotionAdapter
createMouseMotionListener()
Creates the mouse motion listener to use.protected PaintOperation
createPaintOperation()
Creates the paint operation to use.protected void
doApply()
Applies the settings.protected void
fill()
Fills in the polygon.Icon
getIcon()
The icon of the tool.String
getName()
The name of the tool.Polygon
getPolygon()
Returns the polygon to paint.Color
getPolygonColor()
Returns the color for the overlay.float
getPolygonStroke()
Returns the thickness for the overlay.String
globalInfo()
Returns a string describing the object.protected void
initialize()
Initializes the members.-
Methods inherited from class adams.gui.visualization.segmentation.tool.AbstractToolWithParameterPanel
applyOptions, createOptionPanel
-
Methods inherited from class adams.gui.visualization.segmentation.tool.AbstractTool
activate, annotationsChanged, apply, checkBeforeApply, cleanUp, createApplyButton, deactivate, getActiveColor, getActiveCombinedSubLayer, getActiveImage, getActiveOverlay, getCanvas, getCursor, getKeyListener, getLayerManager, getMouseListener, getMouseMotionListener, getOptionPanel, getPaintOperation, getZoom, hasActiveCombinedSubLayer, hasActiveOverlay, hasAnyActive, isAutomaticUndoEnabled, setApplyButtonState, setCanvas
-
Methods inherited from class adams.core.logging.CustomLoggingLevelObject
setLoggingLevel
-
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, toString, wait, wait, wait
-
Methods inherited from interface adams.core.CleanUpHandler
cleanUp
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
Methods inherited from interface adams.gui.visualization.segmentation.tool.Tool
activate, annotationsChanged, deactivate, getActiveColor, getActiveCombinedSubLayer, getActiveImage, getActiveOverlay, getCanvas, getCursor, getKeyListener, getLayerManager, getMouseListener, getMouseMotionListener, getOptionPanel, getPaintOperation, getZoom, hasActiveCombinedSubLayer, hasActiveOverlay, hasAnyActive, isAutomaticUndoEnabled, setCanvas
-
-
-
-
Field Detail
-
DEFAULT_SIZE
public static final int DEFAULT_SIZE
the default size.- See Also:
- Constant Field Values
-
m_TextPolygonColor
protected BaseColorTextField m_TextPolygonColor
the text field for the polygon color.
-
m_TextPolygonStroke
protected NumberTextField m_TextPolygonStroke
the text field for the polygon stroke thickness.
-
m_RadioBackground
protected JRadioButton m_RadioBackground
the radio button for background.
-
m_RadioForeground
protected JRadioButton m_RadioForeground
the radio button for foreground.
-
m_TextZoom
protected NumberTextField m_TextZoom
the text field for the size.
-
m_PolygonColor
protected Color m_PolygonColor
the polygon color.
-
m_PolygonStroke
protected float m_PolygonStroke
the polygon stroke thickness.
-
m_Foreground
protected boolean m_Foreground
whether to fill in foreground.
-
m_Size
protected int m_Size
the current size.
-
m_Zoom
protected double m_Zoom
the current zoom.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Returns:
- a description suitable for displaying in the gui
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractTool
-
getName
public String getName()
The name of the tool.- Returns:
- the name
-
getIcon
public Icon getIcon()
The icon of the tool.- Returns:
- the icon
-
createCursor
protected Cursor createCursor()
Returns the mouse cursor to use.- Specified by:
createCursor
in classAbstractTool
- Returns:
- the cursor
-
createPaintOperation
protected PaintOperation createPaintOperation()
Creates the paint operation to use.- Overrides:
createPaintOperation
in classAbstractTool
- Returns:
- the operation
-
getPolygonColor
public Color getPolygonColor()
Returns the color for the overlay.- Returns:
- the color
-
getPolygonStroke
public float getPolygonStroke()
Returns the thickness for the overlay.- Returns:
- the thickness
-
getPolygon
public Polygon getPolygon()
Returns the polygon to paint.- Returns:
- the polygon, null if not enough points
-
fill
protected void fill()
Fills in the polygon.
-
createMouseListener
protected ToolMouseAdapter createMouseListener()
Creates the mouse listener to use.- Specified by:
createMouseListener
in classAbstractTool
- Returns:
- the listener, null if not applicable
-
createMouseMotionListener
protected ToolMouseMotionAdapter createMouseMotionListener()
Creates the mouse motion listener to use.- Specified by:
createMouseMotionListener
in classAbstractTool
- Returns:
- the listener, null if not applicable
-
createKeyListener
protected ToolKeyAdapter createKeyListener()
Creates the key listener to use.- Overrides:
createKeyListener
in classAbstractTool
- Returns:
- the listener, null if not applicable
-
doApply
protected void doApply()
Applies the settings.- Specified by:
doApply
in classAbstractTool
-
addOptions
protected void addOptions(ParameterPanel paramPanel)
Fills the parameter panel with the options.- Specified by:
addOptions
in classAbstractToolWithParameterPanel
- Parameters:
paramPanel
- for adding the options to
-
-