Package adams.gui.tools.previewbrowser
Class ImageSegmentationAnnotationsHandler
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.tools.previewbrowser.AbstractContentHandler
-
- adams.gui.tools.previewbrowser.ImageSegmentationAnnotationsHandler
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,ContentHandler,ColorProviderHandler,Serializable
public class ImageSegmentationAnnotationsHandler extends AbstractContentHandler implements ColorProviderHandler
Overlays image segmentation annotations obtained from the specified reader over the original JPG image.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected floatm_Alphathe alpha value (0=transparent, 1=opaque).protected booleanm_BestFitwhether to use best fit.protected ColorProviderm_ColorProviderthe color provider to use.protected BaseString[]m_DisplayedLabelsdisplayed labels.protected ImageSegmentationAnnotationReaderm_Readerthe annotation reader to use.protected booleanm_UseSeparateLayerswhether to use separate layers.protected doublem_Zoomthe zoom level.-
Fields inherited from class adams.gui.tools.previewbrowser.AbstractContentHandler
m_Relation
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.gui.tools.previewbrowser.ContentHandler
MATCH_ALL
-
-
Constructor Summary
Constructors Constructor Description ImageSegmentationAnnotationsHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringalphaTipText()Returns the tip text for this property.StringbestFitTipText()Returns the tip text for this property.StringcolorProviderTipText()Returns the tip text for this property.PreviewPanelcreatePreview(File file)Creates the actual preview.voiddefineOptions()Adds options to the internal list of options.StringdisplayedLabelsTipText()Returns the tip text for this property.floatgetAlpha()Returns the alpha value to use for the overlay: 0=transparent, 255=opaque.booleangetBestFit()Returns whether to use best fit for the image or not.ColorProvidergetColorProvider()Returns the color provider to use.BaseString[]getDisplayedLabels()Returns the displayed labels.String[]getExtensions()Returns the list of extensions (without dot) that this handler can take care of.ImageSegmentationAnnotationReadergetReader()Returns the image annotation reader to use.booleangetUseSeparateLayers()Returns whether to use separate layers or just one.doublegetZoom()Returns the zoom level in percent.StringglobalInfo()Returns a string describing the object.protected FilelocateAnnotation(File file)Locates the annotation PNG file.StringreaderTipText()Returns the tip text for this property.PreviewPanelreusePreview(File file, PreviewPanel lastPreview)Reuses the last preview, if possible.voidsetAlpha(float value)Sets the alpha value to use for the overlay: 0=transparent, 255=opaque.voidsetBestFit(boolean value)Sets whether to use best fit for the image or not.voidsetColorProvider(ColorProvider value)Sets the color provider to use.voidsetDisplayedLabels(BaseString[] value)Sets the displayed labels.voidsetReader(ImageSegmentationAnnotationReader value)Sets the image annotation reader to use.voidsetUseSeparateLayers(boolean value)Sets whether to use separate layers or just one.voidsetZoom(double value)Sets the zoom level in percent (1-inf).StringuseSeparateLayersTipText()Returns the tip text for this property.StringzoomTipText()Returns the tip text for this property.-
Methods inherited from class adams.gui.tools.previewbrowser.AbstractContentHandler
checkFile, getHandlers, getHandlersForFile, getHandlersForFile, getPreview, getRelation, hasHandler, hasHandler
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, 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
-
-
-
-
Field Detail
-
m_Reader
protected ImageSegmentationAnnotationReader m_Reader
the annotation reader to use.
-
m_ColorProvider
protected ColorProvider m_ColorProvider
the color provider to use.
-
m_Alpha
protected float m_Alpha
the alpha value (0=transparent, 1=opaque).
-
m_DisplayedLabels
protected BaseString[] m_DisplayedLabels
displayed labels.
-
m_Zoom
protected double m_Zoom
the zoom level.
-
m_BestFit
protected boolean m_BestFit
whether to use best fit.
-
m_UseSeparateLayers
protected boolean m_UseSeparateLayers
whether to use separate layers.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setReader
public void setReader(ImageSegmentationAnnotationReader value)
Sets the image annotation reader to use.- Parameters:
value- the reader
-
getReader
public ImageSegmentationAnnotationReader getReader()
Returns the image annotation reader to use.- Returns:
- the reader
-
readerTipText
public String readerTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setColorProvider
public void setColorProvider(ColorProvider value)
Sets the color provider to use.- Specified by:
setColorProviderin interfaceColorProviderHandler- Parameters:
value- the color provider
-
getColorProvider
public ColorProvider getColorProvider()
Returns the color provider to use.- Specified by:
getColorProviderin interfaceColorProviderHandler- Returns:
- the color provider
-
colorProviderTipText
public String colorProviderTipText()
Returns the tip text for this property.- Specified by:
colorProviderTipTextin interfaceColorProviderHandler- Returns:
- tip text for this property suitable for displaying in the gui
-
setAlpha
public void setAlpha(float value)
Sets the alpha value to use for the overlay: 0=transparent, 255=opaque.- Parameters:
value- the alpha value
-
getAlpha
public float getAlpha()
Returns the alpha value to use for the overlay: 0=transparent, 255=opaque.- Returns:
- the alpha value
-
alphaTipText
public String alphaTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setDisplayedLabels
public void setDisplayedLabels(BaseString[] value)
Sets the displayed labels.- Parameters:
value- the labels
-
getDisplayedLabels
public BaseString[] getDisplayedLabels()
Returns the displayed labels.- Returns:
- the labels
-
displayedLabelsTipText
public String displayedLabelsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setZoom
public void setZoom(double value)
Sets the zoom level in percent (1-inf).- Parameters:
value- the zoom
-
getZoom
public double getZoom()
Returns the zoom level in percent.- Returns:
- the zoom
-
zoomTipText
public String zoomTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setBestFit
public void setBestFit(boolean value)
Sets whether to use best fit for the image or not.- Parameters:
value- true if to use
-
getBestFit
public boolean getBestFit()
Returns whether to use best fit for the image or not.- Returns:
- true if to use
-
bestFitTipText
public String bestFitTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUseSeparateLayers
public void setUseSeparateLayers(boolean value)
Sets whether to use separate layers or just one.- Parameters:
value- true if to use
-
getUseSeparateLayers
public boolean getUseSeparateLayers()
Returns whether to use separate layers or just one.- Returns:
- true if to use
-
useSeparateLayersTipText
public String useSeparateLayersTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getExtensions
public String[] getExtensions()
Returns the list of extensions (without dot) that this handler can take care of.- Specified by:
getExtensionsin interfaceContentHandler- Returns:
- the list of extensions (no dot)
-
locateAnnotation
protected File locateAnnotation(File file)
Locates the annotation PNG file.- Parameters:
file- the JPG file- Returns:
- the annotation file or null if failed to locate
-
createPreview
public PreviewPanel createPreview(File file)
Creates the actual preview.- Specified by:
createPreviewin interfaceContentHandler- Specified by:
createPreviewin classAbstractContentHandler- Parameters:
file- the file to create the view for- Returns:
- the preview
-
reusePreview
public PreviewPanel reusePreview(File file, PreviewPanel lastPreview)
Reuses the last preview, if possible.
Default implementation just creates a new preview.- Specified by:
reusePreviewin interfaceContentHandler- Overrides:
reusePreviewin classAbstractContentHandler- Parameters:
file- the file to create the view for- Returns:
- the preview
-
-