Class OverlayUtility


  • public class OverlayUtility
    extends java.lang.Object
    Class that manages painting data quality overlays for JComponents that are QualityMonitors.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean FORCE_QUALITY_CHANGE
      Set this tag before calling updateQuality to force a quality change to be fired.
      static java.lang.String QUALITY_SUFFIX
      If you have a property named "foo", then when its quality changes, you'll get a property change event fired for "foo"+QUALITY_SUFFIX
    • Constructor Summary

      Constructors 
      Constructor Description
      OverlayUtility()  
    • Field Detail

      • QUALITY_SUFFIX

        public static final java.lang.String QUALITY_SUFFIX
        If you have a property named "foo", then when its quality changes, you'll get a property change event fired for "foo"+QUALITY_SUFFIX
        See Also:
        Constant Field Values
      • FORCE_QUALITY_CHANGE

        public static boolean FORCE_QUALITY_CHANGE
        Set this tag before calling updateQuality to force a quality change to be fired.
    • Constructor Detail

      • OverlayUtility

        public OverlayUtility()
    • Method Detail

      • setOverlay

        public static void setOverlay​(QualityCode quality,
                                      Overlay overlay)
        Sets the overlay for the given quality. Make sure you repaint any open windows to ensure that the new overlay takes effect immediately.
      • setOverlaysEnabled

        public static void setOverlaysEnabled​(boolean overlaysEnabled)
      • isOverlaysEnabled

        public static boolean isOverlaysEnabled()
      • setTemplateEditingActive

        public static void setTemplateEditingActive​(boolean templateEditingActive)
      • isTemplateEditingActive

        public static boolean isTemplateEditingActive()
      • paintOverlay

        public static void paintOverlay​(QualityMonitor qm,
                                        java.awt.Graphics graphics)
      • paintOverlay

        public static void paintOverlay​(javax.swing.JComponent comp,
                                        java.awt.Graphics graphics,
                                        QualityCode quality)
      • getQuality

        public static QualityCode getQuality​(javax.swing.JComponent comp,
                                             java.lang.String propertyName)
        Attempts to look up the quality for an individual property. If no quality is found then good quality is assumed.
      • getQualities

        public static java.util.Map<java.lang.String,​QualityCode> getQualities​(javax.swing.JComponent comp)
        Return all qualities registered for the component
      • updateQuality

        public static void updateQuality​(QualityMonitor qm,
                                         java.lang.String propName,
                                         QualityCode qualityCode)

        Iterates through a list of property qualities stored in the JComponent's client property map. Uses a list rather than a map b/c we'd have to iterate through the map anyhow, so its not efficient

        If you call this from a non-EDT thread, it will be wrapped in an invokeLater for you automatically.

      • main

        public static void main​(java.lang.String[] args)