Class Maintenance


  • public class Maintenance
    extends java.lang.Object
    A collection of static utilities to provide cross referencing information among the various PanelPro objects. Most likely, this is incomplete as there still may be references held by objects unknown to the author. It is intended to inform users where and how the various elements are used. In particular to identify useless elements ('orphans'). Currently, called only from the Logix JFrame, which is probably not its ultimate UI.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static java.util.ResourceBundle rbm  
    • Constructor Summary

      Constructors 
      Constructor Description
      Maintenance()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void deviceReportPressed​(java.lang.String devName, java.awt.Frame parent)
      Find references of a System or User name in the various Manager Objects.
      static void findEmptyPressed​(java.awt.Frame parent)
      Find useless Conditionals in the various Manager Objects.
      static void findOrphansPressed​(java.awt.Frame parent)
      Find orphaned elements in the various Manager Objects.
      (package private) static java.lang.String[] getTypeAndNames​(java.lang.String name)
      Find type of element and its names from a name that may be a user name or a system name.
      (package private) static void makeDialog​(java.awt.Component component, java.awt.Component button, java.awt.Frame parent, java.lang.String title)
      Build and display a dialog box with an OK button and optional 2nd button.
      (package private) static boolean search​(java.lang.String name, javax.swing.JTextArea text)
      Search if a given string is used as the name of a NamedBean.
      (package private) static boolean testName​(java.lang.String name, boolean found, java.lang.String[] names, java.lang.String line1, java.lang.String line2, java.lang.String line, java.lang.StringBuilder tempText)
      Check if a given string is either a user or a system name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • rbm

        static final java.util.ResourceBundle rbm
    • Method Detail

      • deviceReportPressed

        public static void deviceReportPressed​(java.lang.String devName,
                                               java.awt.Frame parent)
        Find references of a System or User name in the various Manager Objects.
        Parameters:
        devName - name to look for
        parent - Frame calling this method
      • findOrphansPressed

        public static void findOrphansPressed​(java.awt.Frame parent)
        Find orphaned elements in the various Manager Objects.
        Parameters:
        parent - Frame to check
      • findEmptyPressed

        public static void findEmptyPressed​(java.awt.Frame parent)
        Find useless Conditionals in the various Manager Objects.
        Parameters:
        parent - Frame to check
      • getTypeAndNames

        @Nonnull
        static java.lang.String[] getTypeAndNames​(@Nonnull
                                                  java.lang.String name)
        Find type of element and its names from a name that may be a user name or a system name.

        Searches each Manager for a reference to the "name".

        Parameters:
        name - string (name base) to look for
        Returns:
        4 element String array: {Type, userName, sysName, numListeners} - This should probably return an instance of a custom type rather than a bunch of string names
      • testName

        static boolean testName​(java.lang.String name,
                                boolean found,
                                java.lang.String[] names,
                                java.lang.String line1,
                                java.lang.String line2,
                                java.lang.String line,
                                java.lang.StringBuilder tempText)
        Check if a given string is either a user or a system name.
        Parameters:
        name - the string to compare
        found - whether the item has already been found somewhere
        names - array containing system and user name as items 0 and 1
        line1 - message line 1 to use if string is not matched
        line2 - message line 2 to use if string is not matched
        line - message line to use if string is matched
        tempText - body of text to add to, a global variable
        Returns:
        false if name is null or cannot be matched to the names array
      • search

        static boolean search​(java.lang.String name,
                              javax.swing.JTextArea text)
        Search if a given string is used as the name of a NamedBean.
        Parameters:
        name - the string to look for
        text - body of the message to be displayed reporting the result
        Returns:
        true if name is found at least once as a bean name
      • makeDialog

        static void makeDialog​(java.awt.Component component,
                               java.awt.Component button,
                               java.awt.Frame parent,
                               java.lang.String title)
        Build and display a dialog box with an OK button and optional 2nd button.
        Parameters:
        component - Body of message to put in dialog box
        button - optional second button to add to pane
        parent - Frame that asked for this dialog
        title - text do use as title of the dialog box