Package adams.gui.tools.previewbrowser
Class PointsFromReportHandler
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.tools.previewbrowser.AbstractContentHandler
-
- adams.gui.tools.previewbrowser.PointsFromReportHandler
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,ContentHandler,Serializable
public class PointsFromReportHandler extends AbstractContentHandler
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classPointsFromReportHandler.CombinedPanelThe panel for displaying the image.
-
Field Summary
Fields Modifier and Type Field Description protected PlaceholderDirectorym_AlternativeLocationthe alternative location.protected Colorm_Colorthe color for the objects.protected intm_Diameterthe diameter of the circle.protected ObjectFinderm_Finderthe object finder to use.protected ImageAnchorm_LabelAnchorthe label anchor.protected Fontm_LabelFontthe label font.protected Stringm_LabelFormatthe label for the points.protected intm_LabelOffsetXthe x offset for the label.protected intm_LabelOffsetYthe y offset for the label.protected BaseString[]m_PredefinedLabelsthe predefined labels.protected Stringm_Prefixthe prefix for the objects in the report.protected booleanm_ShowPointPanelwhether to show the located object panel.protected ColorProviderm_TypeColorProviderthe color provider to use.protected BaseRegExpm_TypeRegExpthe regular expression for the types to draw.protected Stringm_TypeSuffixthe suffix for the type.protected booleanm_UseAlternativeLocationwhether to use an alternative location for the reports.protected booleanm_UseColorsPerTypewhether to use colors per type.-
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 PointsFromReportHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringalternativeLocationTipText()Returns the tip text for this property.StringcolorTipText()Returns the tip text for this property.PreviewPanelcreatePreview(File file)Creates the actual view.voiddefineOptions()Adds options to the internal list of options.StringdiameterTipText()Returns the tip text for this property.protected ReportfilterReport(Report report)Filters the objects in the report, if necessary.StringfinderTipText()Returns the tip text for this property.PlaceholderDirectorygetAlternativeLocation()Returns the alternative location to use for the reports.ColorgetColor()Returns the color to use for the objects.protected ImageAnchorgetDefaultLabelAnchor()Returns the default label anchor.protected intgetDefaultLabelOffsetX()Returns the default label offset for X.protected intgetDefaultLabelOffsetY()Returns the default label offset for Y.intgetDiameter()Returns the diameter to use for drawing the circle.String[]getExtensions()Returns the list of extensions (without dot) that this handler can take care of.ObjectFindergetFinder()Returns the finder to use for locating the objects.ImageAnchorgetLabelAnchor()Returns the anchor for the label.FontgetLabelFont()Returns the label font.StringgetLabelFormat()Returns the label format.intgetLabelOffsetX()Returns the X offset for the label.intgetLabelOffsetY()Returns the Y offset for the label.BaseString[]getPredefinedLabels()Returns the predefined labels.StringgetPrefix()Returns the prefix to use for the objects in the report.booleangetShowPointPanel()Returns whether to show the panel with the located points.ColorProvidergetTypeColorProvider()Returns the color provider to use for the types.BaseRegExpgetTypeRegExp()Returns the regular expression that the types must match in order to get drawn.StringgetTypeSuffix()Returns the suffix to use for the types.booleangetUseAlternativeLocation()Returns whether to use an alternative location for the reports.booleangetUseColorsPerType()Returns whether to use colors per type.StringglobalInfo()Returns a string describing the object.StringlabelAnchorTipText()Returns the tip text for this property.StringlabelFontTipText()Returns the tip text for this property.StringlabelFormatTipText()Returns the tip text for this property.StringlabelOffsetXTipText()Returns the tip text for this property.StringlabelOffsetYTipText()Returns the tip text for this property.protected ReportloadReport(PointsFromReportHandler.CombinedPanel panel, File file)Loads the report associated with the image file.StringpredefinedLabelsTipText()Returns the tip text for this property.StringprefixTipText()Returns the tip text for this property.PreviewPanelreusePreview(File file, PreviewPanel previewPanel)Reuses the last preview, if possible.voidsetAlternativeLocation(PlaceholderDirectory value)Sets the alternative location to use for the reports.voidsetColor(Color value)Sets the color to use for the objects.voidsetDiameter(int value)Sets the diameter to use for drawing the circle.voidsetFinder(ObjectFinder value)Sets the finder to use for locating the objects.voidsetLabelAnchor(ImageAnchor value)Sets the anchor for the label.voidsetLabelFont(Font value)Sets the label font.voidsetLabelFormat(String value)Sets the label format.voidsetLabelOffsetX(int value)Sets the X offset for the label.voidsetLabelOffsetY(int value)Sets the Y offset for the label.voidsetPredefinedLabels(BaseString[] value)Sets the predefined labels.voidsetPrefix(String value)Sets the prefix to use for the objects in the report.voidsetShowPointPanel(boolean value)Sets whether to show the panel with the located points.voidsetTypeColorProvider(ColorProvider value)Sets the color provider to use for the types.voidsetTypeRegExp(BaseRegExp value)Sets the regular expression that the types must match in order to get drawn.voidsetTypeSuffix(String value)Sets the suffix to use for the types.voidsetUseAlternativeLocation(boolean value)Sets whether to use an alternative location for the reports.voidsetUseColorsPerType(boolean value)Sets whether to use colors per type.StringshowPointPanelTipText()Returns the tip text for this property.StringtypeColorProviderTipText()Returns the tip text for this property.StringtypeRegExpTipText()Returns the tip text for this property.StringtypeSuffixTipText()Returns the tip text for this property.StringuseAlternativeLocationTipText()Returns the tip text for this property.StringuseColorsPerTypeTipText()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_Prefix
protected String m_Prefix
the prefix for the objects in the report.
-
m_Diameter
protected int m_Diameter
the diameter of the circle.
-
m_Color
protected Color m_Color
the color for the objects.
-
m_UseColorsPerType
protected boolean m_UseColorsPerType
whether to use colors per type.
-
m_TypeColorProvider
protected ColorProvider m_TypeColorProvider
the color provider to use.
-
m_TypeSuffix
protected String m_TypeSuffix
the suffix for the type.
-
m_TypeRegExp
protected BaseRegExp m_TypeRegExp
the regular expression for the types to draw.
-
m_LabelFormat
protected String m_LabelFormat
the label for the points.
-
m_LabelFont
protected Font m_LabelFont
the label font.
-
m_LabelAnchor
protected ImageAnchor m_LabelAnchor
the label anchor.
-
m_LabelOffsetX
protected int m_LabelOffsetX
the x offset for the label.
-
m_LabelOffsetY
protected int m_LabelOffsetY
the y offset for the label.
-
m_PredefinedLabels
protected BaseString[] m_PredefinedLabels
the predefined labels.
-
m_Finder
protected ObjectFinder m_Finder
the object finder to use.
-
m_UseAlternativeLocation
protected boolean m_UseAlternativeLocation
whether to use an alternative location for the reports.
-
m_AlternativeLocation
protected PlaceholderDirectory m_AlternativeLocation
the alternative location.
-
m_ShowPointPanel
protected boolean m_ShowPointPanel
whether to show the located object panel.
-
-
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
-
setPrefix
public void setPrefix(String value)
Sets the prefix to use for the objects in the report.- Parameters:
value- the prefix
-
getPrefix
public String getPrefix()
Returns the prefix to use for the objects in the report.- Returns:
- the prefix
-
prefixTipText
public String prefixTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setDiameter
public void setDiameter(int value)
Sets the diameter to use for drawing the circle.- Parameters:
value- the diameter
-
getDiameter
public int getDiameter()
Returns the diameter to use for drawing the circle.- Returns:
- the diameter
-
diameterTipText
public String diameterTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColor
public void setColor(Color value)
Sets the color to use for the objects.- Parameters:
value- the color
-
getColor
public Color getColor()
Returns the color to use for the objects.- Returns:
- the color
-
colorTipText
public String colorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUseColorsPerType
public void setUseColorsPerType(boolean value)
Sets whether to use colors per type.- Parameters:
value- true if to use colors per type
-
getUseColorsPerType
public boolean getUseColorsPerType()
Returns whether to use colors per type.- Returns:
- true if to use colors per type
-
useColorsPerTypeTipText
public String useColorsPerTypeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setTypeColorProvider
public void setTypeColorProvider(ColorProvider value)
Sets the color provider to use for the types.- Parameters:
value- the provider
-
getTypeColorProvider
public ColorProvider getTypeColorProvider()
Returns the color provider to use for the types.- Returns:
- the provider
-
typeColorProviderTipText
public String typeColorProviderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setTypeSuffix
public void setTypeSuffix(String value)
Sets the suffix to use for the types.- Parameters:
value- the suffix
-
getTypeSuffix
public String getTypeSuffix()
Returns the suffix to use for the types.- Returns:
- the suffix
-
typeSuffixTipText
public String typeSuffixTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setTypeRegExp
public void setTypeRegExp(BaseRegExp value)
Sets the regular expression that the types must match in order to get drawn.- Parameters:
value- the expression
-
getTypeRegExp
public BaseRegExp getTypeRegExp()
Returns the regular expression that the types must match in order to get drawn.- Returns:
- the expression
-
typeRegExpTipText
public String typeRegExpTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLabelFormat
public void setLabelFormat(String value)
Sets the label format.- Parameters:
value- the label format
-
getLabelFormat
public String getLabelFormat()
Returns the label format.- Returns:
- the label format
-
labelFormatTipText
public String labelFormatTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLabelFont
public void setLabelFont(Font value)
Sets the label font.- Parameters:
value- the label font
-
getLabelFont
public Font getLabelFont()
Returns the label font.- Returns:
- the label font
-
labelFontTipText
public String labelFontTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultLabelAnchor
protected ImageAnchor getDefaultLabelAnchor()
Returns the default label anchor.- Returns:
- the default
-
setLabelAnchor
public void setLabelAnchor(ImageAnchor value)
Sets the anchor for the label.- Parameters:
value- the anchor
-
getLabelAnchor
public ImageAnchor getLabelAnchor()
Returns the anchor for the label.- Returns:
- the anchor
-
labelAnchorTipText
public String labelAnchorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultLabelOffsetX
protected int getDefaultLabelOffsetX()
Returns the default label offset for X.- Returns:
- the default
-
setLabelOffsetX
public void setLabelOffsetX(int value)
Sets the X offset for the label.- Parameters:
value- the X offset
-
getLabelOffsetX
public int getLabelOffsetX()
Returns the X offset for the label.- Returns:
- the X offset
-
labelOffsetXTipText
public String labelOffsetXTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultLabelOffsetY
protected int getDefaultLabelOffsetY()
Returns the default label offset for Y.- Returns:
- the default
-
setLabelOffsetY
public void setLabelOffsetY(int value)
Sets the Y offset for the label.- Parameters:
value- the Y offset
-
getLabelOffsetY
public int getLabelOffsetY()
Returns the Y offset for the label.- Returns:
- the Y offset
-
labelOffsetYTipText
public String labelOffsetYTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPredefinedLabels
public void setPredefinedLabels(BaseString[] value)
Sets the predefined labels.- Parameters:
value- the labels
-
getPredefinedLabels
public BaseString[] getPredefinedLabels()
Returns the predefined labels.- Returns:
- the labels
-
predefinedLabelsTipText
public String predefinedLabelsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFinder
public void setFinder(ObjectFinder value)
Sets the finder to use for locating the objects.- Parameters:
value- the finder
-
getFinder
public ObjectFinder getFinder()
Returns the finder to use for locating the objects.- Returns:
- the finder
-
finderTipText
public String finderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUseAlternativeLocation
public void setUseAlternativeLocation(boolean value)
Sets whether to use an alternative location for the reports.- Parameters:
value- true if to use
-
getUseAlternativeLocation
public boolean getUseAlternativeLocation()
Returns whether to use an alternative location for the reports.- Returns:
- true if to use
-
useAlternativeLocationTipText
public String useAlternativeLocationTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAlternativeLocation
public void setAlternativeLocation(PlaceholderDirectory value)
Sets the alternative location to use for the reports.- Parameters:
value- the location
-
getAlternativeLocation
public PlaceholderDirectory getAlternativeLocation()
Returns the alternative location to use for the reports.- Returns:
- the location
-
alternativeLocationTipText
public String alternativeLocationTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setShowPointPanel
public void setShowPointPanel(boolean value)
Sets whether to show the panel with the located points.- Parameters:
value- true if to show
-
getShowPointPanel
public boolean getShowPointPanel()
Returns whether to show the panel with the located points.- Returns:
- true if to show
-
showPointPanelTipText
public String showPointPanelTipText()
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.- Returns:
- the list of extensions (no dot)
-
filterReport
protected Report filterReport(Report report)
Filters the objects in the report, if necessary.- Parameters:
report- the report to filter- Returns:
- the filtered report (copy, in case filtering occurred)
-
loadReport
protected Report loadReport(PointsFromReportHandler.CombinedPanel panel, File file)
Loads the report associated with the image file.- Parameters:
panel- the context panelfile- the image file- Returns:
- the report, null if not present or failed to load
-
createPreview
public PreviewPanel createPreview(File file)
Creates the actual view.- Specified by:
createPreviewin interfaceContentHandler- Specified by:
createPreviewin classAbstractContentHandler- Parameters:
file- the file to create the view for- Returns:
- the view
-
reusePreview
public PreviewPanel reusePreview(File file, PreviewPanel previewPanel)
Reuses the last preview, if possible.- Specified by:
reusePreviewin interfaceContentHandler- Overrides:
reusePreviewin classAbstractContentHandler- Parameters:
file- the file to create the view for- Returns:
- the view
-
-