Class XTCEViewerFunctions


  • public class XTCEViewerFunctions
    extends Object
    This class is a container to capture some common static functions that are applicable throughout the XTCEViewer application. This class is not meant to be constructed, since the functions are static.
    Author:
    David Overeem
    • Method Detail

      • expandAllTreeNodes

        public static void expandAllTreeNodes​(JTree tree)
        Helper function to expand all the nodes of a JTree object.
        Parameters:
        tree - JTree to expand all nodes.
      • showRightClickTableMenu

        public static void showRightClickTableMenu​(MouseEvent evt,
                                                   JTable table,
                                                   JPopupMenu menu)
        Show the right click menu associated with a table in the viewer.
        Parameters:
        evt - MouseEvent associated with the click.
        table - JTable that the click event occurred on.
        menu - JPopupMenu from the viewer that is associated with this particular table.
      • copyCell

        public static void copyCell​(JTable table)
        Helper function to implement copying contents of a table cell to the System Clipboard for pasting in other applications.
        Parameters:
        table - JTable object to query for the cell contents and copy
      • copyRow

        public static void copyRow​(JTable table)
        Helper function to implement copying contents of a table row to the System Clipboard for pasting in other applications.
        Parameters:
        table - JTable object to query for the row contents and copy
      • copyColumn

        public static void copyColumn​(JTable table)
        Helper function to implement copying contents of a table column to the System Clipboard for pasting in other applications.
        Parameters:
        table - JTable object to query for the column contents and copy
      • copyTable

        public static void copyTable​(JTable table)
        Helper function to implement copying contents of a table to the System Clipboard for pasting in other applications.
        Parameters:
        table - JTable object to query for the contents and copy
      • copyPasteTextArea

        public static void copyPasteTextArea​(KeyEvent evt,
                                             JTextComponent textArea)
        Helper function to implement copy and paste from JTextArea to the OS when it is not supported by default.
        Parameters:
        evt - KeyEvent object from the Swing callback.
        textArea - JTextComponent to cut, copy, paste to or from.
      • clearTree

        public static void clearTree​(JTree tree)
        Helper function to clear/erase the contents of a JTree Swing widget. This is apparently complex enough to justify having its own function and is used throughout the GUI code.
        Parameters:
        tree - JTree to clear/erase.
      • buildSpaceSystemTree

        public static void buildSpaceSystemTree​(JTree tree,
                                                List<XTCESpaceSystem> spaceSystems)
        Helper function to add the XTCE SpaceSystem array list to a JTree.
        Parameters:
        tree - JTree to add the XTCEViewerSpaceSystemTreeNode objects to.
        spaceSystems - ArrayList of XTCESpaceSystem objects to add.
      • selectSpaceSystemFromTree

        public static boolean selectSpaceSystemFromTree​(JTree tree,
                                                        String searchString,
                                                        boolean basenameOnly)
        Helper function to determine if a provided SpaceSystem by name is a node in a JTree list of Space Systems.
        Parameters:
        tree - JTree containing the tree for which to search for nodes.
        searchString - String containing the Space System name or path to search for.
        basenameOnly - Boolean indicating of the search string argument is a basename or a full path.
        Returns:
        Boolean indicating of a Space System node was found that matches the search string described in the arguments.