Package adams.gui.tools.previewbrowser
Class AbstractContentHandler
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.tools.previewbrowser.AbstractContentHandler
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,ContentHandler
,Serializable
- Direct Known Subclasses:
AbstractObjectContentHandler
,AbstractReportHandler
,AbstractSpreadSheetHandler
,ActualVsPredictedHandler
,AnnotateImage
,AnnotationsAndPredictionsFromReport
,ApacheCommonsImageHandler
,ApacheCommonsImageMetaDataHandler
,BlueChannelImageHandler
,BoofCVImageHandler
,CocoAnnotationsHandler
,ColorDistributionHandler
,ConfusionMatrixHandler
,ConsoleOutputHandler
,DeepLabCutCSVHandler
,DetectronAnnotationsHandler
,FileInfoHandler
,FlowHandler
,FromFileHandler
,GrayOrIndexedImageHandler
,GroovyHandler
,HexaDecimalHandler
,ImageClassificationHandler
,ImageHandler
,ImageMetaDataExtractorHandler
,ImageSegmentationAnnotationsHandler
,IndexedPNGImageHandler
,InstanceExplorerHandler
,JsonPrettyPrintHandler
,JsonTreeViewHandler
,ObjectAnnotationsHandler
,ObjectCentersFromReport
,ObjectLocationsFromReport
,ObjectLocationsFromSpreadSheet
,PDFHandler
,PDFTextHandler
,PointsFromReportHandler
,PropertiesHandler
,ScriptHandler
,SerializedFileHandler
,SimpleImageSegmentationAnnotationsHandler
,TrimapImageHandler
,VggXmlAnnotationHandler
,ViaAnnotationsHandler
,WekaDatasetHandler
,XMLHandler
,YamlHandler
,YoloAnnotationsHandler
public abstract class AbstractContentHandler extends AbstractOptionHandler implements ContentHandler
Ancestor for all content handlers.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static Hashtable<String,List<Class>>
m_Relation
the extenstion archive handlers 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 AbstractContentHandler()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
checkFile(File file)
Performs some checks on the file.abstract PreviewPanel
createPreview(File file)
Creates the actual preview.static String[]
getHandlers()
Returns a list with classnames of handlers.static List<Class>
getHandlersForFile(File file)
Returns the handlers registered for the extension of the specified file.static List<Class>
getHandlersForFile(String filename)
Returns the handlers registered for the extension of the specified file.PreviewPanel
getPreview(File file)
Returns the preview for the specified file.protected static Hashtable<String,List<Class>>
getRelation()
Returns the extension/handlers relation.static boolean
hasHandler(File file)
Checks whether the specified file is an archive that can be managed.static boolean
hasHandler(String filename)
Checks whether the specified file is an archive that can be managed.PreviewPanel
reusePreview(File file, PreviewPanel lastPreview)
Reuses the last preview, if possible.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, 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.gui.tools.previewbrowser.ContentHandler
getExtensions
-
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, defineOptions, getOptionManager, toCommandLine
-
-
-
-
Method Detail
-
checkFile
protected String checkFile(File file)
Performs some checks on the file.- Parameters:
file
- the file to check- Returns:
- null if check passed, otherwise error message
-
reusePreview
public PreviewPanel reusePreview(File file, PreviewPanel lastPreview)
Reuses the last preview, if possible.
Default implementation just creates a new preview.- Specified by:
reusePreview
in interfaceContentHandler
- Parameters:
file
- the file to create the view for- Returns:
- the preview
-
createPreview
public abstract PreviewPanel createPreview(File file)
Creates the actual preview.- Specified by:
createPreview
in interfaceContentHandler
- Parameters:
file
- the file to create the view for- Returns:
- the preview
-
getPreview
public PreviewPanel getPreview(File file)
Returns the preview for the specified file.- Specified by:
getPreview
in interfaceContentHandler
- Parameters:
file
- the file to create the view for- Returns:
- the preview, NoPreviewAvailablePanel in case of an error
- See Also:
NoPreviewAvailablePanel
-
getHandlers
public static String[] getHandlers()
Returns a list with classnames of handlers.- Returns:
- the handler classnames
-
getRelation
protected static Hashtable<String,List<Class>> getRelation()
Returns the extension/handlers relation.- Returns:
- the relation
-
hasHandler
public static boolean hasHandler(File file)
Checks whether the specified file is an archive that can be managed.- Parameters:
file
- the file to check- Returns:
- true if the file represents a managed archive
-
hasHandler
public static boolean hasHandler(String filename)
Checks whether the specified file is an archive that can be managed.- Parameters:
filename
- the file to check- Returns:
- true if the file represents a managed archive
-
getHandlersForFile
public static List<Class> getHandlersForFile(File file)
Returns the handlers registered for the extension of the specified file.- Parameters:
file
- the file to get the handlers for- Returns:
- the handlers, null if none available
-
-