Class AbstractPointOverlayFromReport
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.object.overlay.AbstractOverlay
-
- adams.gui.visualization.object.overlay.AbstractPointOverlayFromReport
-
- All Implemented Interfaces:
CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,Overlay,OverlayWithCustomAlphaSupport,Serializable
- Direct Known Subclasses:
SimplePointOverlayFromReport
public abstract class AbstractPointOverlayFromReport extends AbstractOverlay implements OverlayWithCustomAlphaSupport
Ancestor for overlays that use point locations from a report.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intm_CustomAlphathe custom alpha value to use.protected Map<Color,Color>m_CustomAlphaColorCachethe color cache.protected booleanm_CustomAlphaEnabledwhether a custom alpha is in use.protected Set<ChangeListener>m_LocationsUpdatedListenersthe listeners for locations updates.protected ReportPointOverlaym_Overlaysthe overlay handler.static StringPREFIX_DEFAULTthe default prefix.-
Fields inherited from class adams.gui.visualization.object.overlay.AbstractOverlay
m_Enabled
-
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 AbstractPointOverlayFromReport()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddLocationsUpdatedListeners(ChangeListener l)Adds the listener for location updates.voidannotationsChanged()Hook method for when annotations change.protected ColorapplyAlpha(Color c)Applies the custom alpha value to the color if necessary.voidcleanUp()Cleans up data structures, frees up memory.StringcolorTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected voiddoPaint(ObjectAnnotationPanel panel, Graphics g)Paints the overlay.protected abstract voiddoPaintObjects(ObjectAnnotationPanel panel, Graphics g, List<Polygon> locations)Performs the actual painting of the objects.ColorgetColor()Returns the color to use for the objects.intgetCustomAlpha()Returns the custom alpha value (0: transparent, 255: opaque).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.ColorgetTypeColor(String type)Returns the color for the object type.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.booleangetUseColorsPerType()Returns whether to use colors per type.booleanhasTypeColor(String type)Checks whether a color has been stored for the given object type.protected voidinitialize()Initializes the members.booleanisCustomAlphaEnabled()Returns whether a custom alpha value is in use for the overlay colors.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 voidnotifyLocationsUpdatedListeners()Notifies all the listeners that the notifications have been updated.StringpredefinedLabelsTipText()Returns the tip text for this property.StringprefixTipText()Returns the tip text for this property.voidremoveLocationsUpdatedListeners(ChangeListener l)Removes the listener for location updates.voidsetColor(Color value)Sets the color to use for the objects.voidsetCustomAlpha(int value)Sets the custom alpha value (0: transparent, 255: opaque).voidsetCustomAlphaEnabled(boolean value)Sets whether to use a custom alpha value for the overlay colors.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.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.voidsetUseColorsPerType(boolean value)Sets whether to use colors per type.StringtypeColorProviderTipText()Returns the tip text for this property.StringtypeRegExpTipText()Returns the tip text for this property.StringtypeSuffixTipText()Returns the tip text for this property.StringuseColorsPerTypeTipText()Returns the tip text for this property.-
Methods inherited from class adams.gui.visualization.object.overlay.AbstractOverlay
enabledTipText, getEnabled, paint, setEnabled
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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.object.overlay.Overlay
enabledTipText, getEnabled, paint, setEnabled
-
-
-
-
Field Detail
-
PREFIX_DEFAULT
public static final String PREFIX_DEFAULT
the default prefix.- See Also:
- Constant Field Values
-
m_Overlays
protected ReportPointOverlay m_Overlays
the overlay handler.
-
m_LocationsUpdatedListeners
protected Set<ChangeListener> m_LocationsUpdatedListeners
the listeners for locations updates.
-
m_CustomAlphaEnabled
protected boolean m_CustomAlphaEnabled
whether a custom alpha is in use.
-
m_CustomAlpha
protected int m_CustomAlpha
the custom alpha value to use.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOverlay
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein 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.
-
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.
-
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.
-
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.
-
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.
-
hasTypeColor
public boolean hasTypeColor(String type)
Checks whether a color has been stored for the given object type.- Parameters:
type- the type to check- Returns:
- true if custom color available
-
getTypeColor
public Color getTypeColor(String type)
Returns the color for the object type.- Parameters:
type- the type to get the color for- Returns:
- the color, null if none available
-
addLocationsUpdatedListeners
public void addLocationsUpdatedListeners(ChangeListener l)
Adds the listener for location updates.- Parameters:
l- the listener to add
-
removeLocationsUpdatedListeners
public void removeLocationsUpdatedListeners(ChangeListener l)
Removes the listener for location updates.- Parameters:
l- the listener to remove
-
notifyLocationsUpdatedListeners
protected void notifyLocationsUpdatedListeners()
Notifies all the listeners that the notifications have been updated.
-
annotationsChanged
public void annotationsChanged()
Hook method for when annotations change.- Specified by:
annotationsChangedin interfaceOverlay- Overrides:
annotationsChangedin classAbstractOverlay
-
setCustomAlphaEnabled
public void setCustomAlphaEnabled(boolean value)
Sets whether to use a custom alpha value for the overlay colors.- Specified by:
setCustomAlphaEnabledin interfaceOverlayWithCustomAlphaSupport- Parameters:
value- true if to use custom alpha
-
isCustomAlphaEnabled
public boolean isCustomAlphaEnabled()
Returns whether a custom alpha value is in use for the overlay colors.- Specified by:
isCustomAlphaEnabledin interfaceOverlayWithCustomAlphaSupport- Returns:
- true if custom alpha in use
-
setCustomAlpha
public void setCustomAlpha(int value)
Sets the custom alpha value (0: transparent, 255: opaque).- Specified by:
setCustomAlphain interfaceOverlayWithCustomAlphaSupport- Parameters:
value- the alpha value
-
getCustomAlpha
public int getCustomAlpha()
Returns the custom alpha value (0: transparent, 255: opaque).- Specified by:
getCustomAlphain interfaceOverlayWithCustomAlphaSupport- Returns:
- the alpha value
-
applyAlpha
protected Color applyAlpha(Color c)
Applies the custom alpha value to the color if necessary.- Parameters:
c- the color to update- Returns:
- the (potentially) updated color
-
doPaintObjects
protected abstract void doPaintObjects(ObjectAnnotationPanel panel, Graphics g, List<Polygon> locations)
Performs the actual painting of the objects.- Parameters:
panel- the panel this overlay is forg- the graphics contextlocations- the locations to paint
-
doPaint
protected void doPaint(ObjectAnnotationPanel panel, Graphics g)
Paints the overlay.- Specified by:
doPaintin classAbstractOverlay- Parameters:
panel- the owning panelg- the graphics context
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUpin interfaceCleanUpHandler- Specified by:
cleanUpin interfaceOverlay- Overrides:
cleanUpin classAbstractOverlay
-
-