Class IconFactory


  • public class IconFactory
    extends java.lang.Object
    A factory for standard JT Harness icons. Note: some of this code is based upon the Swing icon factory for the "metal" look and feel.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ERROR
      A convenience redefinition of Status.ERROR.
      static int FAILED
      A convenience redefinition of Status.FAILED.
      static int FILTERED_OUT
      A constant indicating that as icon should be represented as "filtered out".
      static int NOT_RUN
      A convenience redefinition of Status.NOT_RUN.
      static int NUM_STATES
      A constant indicating the number of different value "state" values.
      static int PASSED
      A convenience redefinition of Status.PASSED.
    • Constructor Summary

      Constructors 
      Constructor Description
      IconFactory()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.swing.Icon getFileIcon()
      Get an icon for a file.
      static javax.swing.Icon getFolderIcon()
      Get an icon for a folder.
      static javax.swing.Icon getOpenableFolderIcon()
      Get an icon for an openable (traversable) folder.
      static javax.swing.Icon getReportIcon()
      Get an icon for a file.
      static javax.swing.Icon getSelectableFolderIcon()
      Get an icon for an selectable (non-traversable) folder.
      static javax.swing.Icon getTestFolderIcon​(int state, boolean active, boolean glyph)
      Get a test folder icon.
      static javax.swing.Icon getTestIcon​(int state, boolean active, boolean glyph)
      Get a test icon.
      static javax.swing.Icon getTestSectionIcon​(int state)
      Get a test section icon.
      static javax.swing.Icon getUpFolderIcon()
      Get an icon for a parent folder.
      • Methods inherited from class java.lang.Object

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

      • IconFactory

        public IconFactory()
    • Method Detail

      • getFileIcon

        public static javax.swing.Icon getFileIcon()
        Get an icon for a file.
        Returns:
        an icon for afile
      • getReportIcon

        public static javax.swing.Icon getReportIcon()
        Get an icon for a file.
        Returns:
        an icon for a report
      • getFolderIcon

        public static javax.swing.Icon getFolderIcon()
        Get an icon for a folder.
        Returns:
        an icon for a folder
      • getUpFolderIcon

        public static javax.swing.Icon getUpFolderIcon()
        Get an icon for a parent folder.
        Returns:
        an icon for a parent folder
      • getOpenableFolderIcon

        public static javax.swing.Icon getOpenableFolderIcon()
        Get an icon for an openable (traversable) folder.
        Returns:
        an icon for an openable (traversable) folder
      • getSelectableFolderIcon

        public static javax.swing.Icon getSelectableFolderIcon()
        Get an icon for an selectable (non-traversable) folder.
        Returns:
        an icon for an selectable (non-traversable) folder
      • getTestIcon

        public static javax.swing.Icon getTestIcon​(int state,
                                                   boolean active,
                                                   boolean glyph)
        Get a test icon.
        Parameters:
        state - the state for this test: one of PASSED, FAILED, ERROR, NOT_RUN, FILTERED_OUT
        active - whether the icon should indicate current activity or not
        glyph - whether the icon should contain an accessibility glyph or not
        Returns:
        a test icon appropriate to the arguments
      • getTestFolderIcon

        public static javax.swing.Icon getTestFolderIcon​(int state,
                                                         boolean active,
                                                         boolean glyph)
        Get a test folder icon.
        Parameters:
        state - the state for this test: one of PASSED, FAILED, ERROR, NOT_RUN, FILTERED_OUT
        active - whether the icon should indicate current activity or not
        glyph - whether the icon should contain an accessibility glyph or not
        Returns:
        a test folder icon appropriate to the arguments
      • getTestSectionIcon

        public static javax.swing.Icon getTestSectionIcon​(int state)
        Get a test section icon.
        Parameters:
        state - the state for this test: one of PASSED, FAILED, ERROR, NOT_RUN, FILTERED_OUT
        Returns:
        a test section icon appropriate to the arguments