Class AbstractReportBasedOverlayHelper

    • Field Detail

      • m_Prefix

        protected String m_Prefix
        the prefix for the objects in the report.
      • 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 rectangles.
      • 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_AllObjects

        protected LocatedObjects m_AllObjects
        all located objects.
      • m_FilteredObjects

        protected LocatedObjects m_FilteredObjects
        the filtered located objects.
      • m_ObjectLocationMappings

        protected Map<LocatedObject,​Polygon> m_ObjectLocationMappings
        the cached object/location relation.
      • m_Locations

        protected List<Polygon> m_Locations
        the cached locations.
      • m_PredefinedLabels

        protected BaseString[] m_PredefinedLabels
        predefined labels.
    • Constructor Detail

      • AbstractReportBasedOverlayHelper

        public AbstractReportBasedOverlayHelper()
    • Method Detail

      • getDefaultPrefix

        protected abstract String getDefaultPrefix()
        Returns the default prefix for the objects in the report.
        Returns:
        the default
      • 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.
      • determineTypeSuffix

        protected String determineTypeSuffix()
        Returns the type suffix without the leading dot.
        Returns:
        the sufix
      • applyFormatOptions

        protected String applyFormatOptions​(String value,
                                            String format)
        Applies further format options. Does nothing if format or value are empty.
        Parameters:
        value - the value to format
        format - the format to apply
        Returns:
        the processed value
      • applyLabelFormat

        protected String applyLabelFormat​(LocatedObject object,
                                          String type)
        Applies the label format to the object to generate a display string.
        Parameters:
        object - the object to use as basis
        type - the meta-data key for the type
        Returns:
        the generated label
      • determineLocations

        public boolean determineLocations​(Report report)
        Determines the locations of the objects.
        Parameters:
        report - the report to inspect
        Returns:
        true if updated
      • determineLocations

        public abstract boolean determineLocations​(Report report,
                                                   LocatedObjectFilter filter)
        Determines the locations of the objects.
        Parameters:
        report - the report to inspect
        Returns:
        true if updated
      • hasColor

        public boolean hasColor​(Polygon poly)
        Checks whether a color has been stored for the given object.
        Parameters:
        poly - the object to check
        Returns:
        true if custom color available
      • getColor

        public Color getColor​(Polygon poly)
        Returns the color for the object.
        Parameters:
        poly - the object to get the color for
        Returns:
        the color, null if none available
      • 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
      • hasLabel

        public boolean hasLabel​(Polygon poly)
        Checks whether a label has been stored for the given object.
        Parameters:
        poly - the object to check
        Returns:
        true if custom label available
      • getLabel

        public String getLabel​(Polygon poly)
        Returns the label for the object.
        Parameters:
        poly - the object to get the label for
        Returns:
        the label, null if none available
      • hasObjectLocationMappings

        public boolean hasObjectLocationMappings()
        Checks whether any object/location mappings are available.
        Returns:
        true if mappings available
      • hasLocations

        public boolean hasLocations()
        Checks whether any locations are available.
        Returns:
        true if locations available
      • hasAllObjects

        public boolean hasAllObjects()
        Returns whether the objects have been initialized.
        Returns:
        true if initialized
      • getAllObjects

        public LocatedObjects getAllObjects()
        Returns all the objects.
        Returns:
        the objects, null if not initialized yet
      • hasFilteredObjects

        public boolean hasFilteredObjects()
        Returns whether the objects have been initialized.
        Returns:
        true if initialized
      • getFilteredObjects

        public LocatedObjects getFilteredObjects()
        Returns the filtered objects.
        Returns:
        the objects, null if not initialized yet
      • calcStringDimenions

        public Dimension calcStringDimenions​(Graphics g,
                                             Font f,
                                             String s)
        Calculates the string dimensions in pixels.
        Parameters:
        g - the graphics context
        f - the font to use
        s - the string to measure
        Returns:
        the dimensions in pixels
      • drawString

        public void drawString​(Graphics g,
                               Rectangle rect,
                               String label)
        Draws the string at the specified position.
        Parameters:
        g - the graphics context
        rect - the bounding box
        label - the label to draw