java.lang.Object
com.inductiveautomation.factorypmi.application.components.overlay.OverlayUtility

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

    • QUALITY_SUFFIX

      public static final 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:
    • FORCE_QUALITY_CHANGE

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

    • OverlayUtility

      public OverlayUtility()
  • Method Details

    • 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, Graphics graphics)
    • paintOverlay

      public static void paintOverlay(JComponent comp, Graphics graphics, QualityCode quality)
    • getQuality

      public static QualityCode getQuality(JComponent comp, 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 Map<String,QualityCode> getQualities(JComponent comp)
      Return all qualities registered for the component
    • updateQuality

      public static void updateQuality(QualityMonitor qm, 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(String[] args)