Class OverlayIcons


  • public class OverlayIcons
    extends Icons
    An Icons wrapper that overlays one or more sets of Icons on top of a base set of Icons. Icons are overlayed by rendering the overlay Icons with transparency on top of the base Icons.
    • Constructor Detail

      • OverlayIcons

        public OverlayIcons​(Icons baseIcons,
                            Icons... overlayIcons)
        Create a new Icons that overlays one or more Icons on top of a base Icons. The specified overlayIcons are overlied in the order specified, i.e. the last one is drawn on the very top.
        Consider using get(Icons, Icons...) to allow caching of overlay icons
        Parameters:
        baseIcons - the base Icons on which to overlay the other Icons
        overlayIcons - 0 or more icons to overlay on the base Icons.
        See Also:
        get(Icons, Icons...)
      • OverlayIcons

        public OverlayIcons​(Icons baseIcons,
                            double overallWidthFraction,
                            double overallHeightFraction,
                            double baseIconSizeFraction,
                            double baseIconCenterX,
                            double baseIconCenterY,
                            double overlaySizeFraction,
                            double overlayCenterX,
                            double overlayCenterY,
                            Icons... overlayIcons)
        Create a new Icons that overlays one or more Icons on top of a base Icons. The specified overlayIcons are overlied in the order specified, i.e. the last one is drawn on the very top.
        Parameters:
        baseIcons - the base Icons on which to overlay the other Icons
        overallWidthFraction - a fraction (between 0 and 1) of the base icon width to use as the overall width of the result icon
        overallHeightFraction - a fraction (between 0 and 1) of the base icon height to use as the overall height of the result icon
        baseIconSizeFraction - a value between 0 and 1 to indicate a fraction of the result icon size to cover with the base icon. The base icon will be scaled down if this is less than 1
        baseIconCenterX - a value between 0 and 1 to indicate where on the result icon to horizontally center the base icon. Use 0.5 to center the base icon over the center of the result icon
        baseIconCenterY - a value between 0 and 1 to indicate where on the result icon to vertically center the base icon. Use 0.5 to center the base icon over the center of the result icon
        overlaySizeFraction - a value between 0 and 1 to indicate a fraction of the result icon size to cover with the overlay icons. The overlay icons will be scaled down if his is less than 1
        overlayCenterX - a value between 0 and 1 to indicate where on the result icon to horizontally center the overlay icons. Use 0.5 to center the overlay icons over the center of the result icon
        overlayCenterY - a value between 0 and 1 to indicate where on the result icon to vertically center the overlay icons. Use 0.5 to center the overlay icons over the center of the result icon
        overlayIcons - 0 or more icons to overlay on the base Icons.
        Since:
        API 4.202020 (Geneious 2020.2.0)
    • Method Detail

      • get

        public static OverlayIcons get​(Icons baseIcons,
                                       Icons... overlayIcons)
        Return an Icons that overlays one or more Icons on top of a base Icons. The specified overlayIcons are overlied in the order specified, i.e. the last one is drawn on the very top.
        Parameters:
        baseIcons - the base Icons on which to overlay the other Icons
        overlayIcons - 0 or more icons to overlay on the base Icons.
        Returns:
        overlay icons, creating if necessary via OverlayIcons(Icons, Icons...) or fetching from a cache.
        Since:
        API 4.1000 (Geneious 10.0.0)
      • getId

        public java.lang.String getId()
        Description copied from class: Icons
        Used internally by Geneious for caching.
        Overrides:
        getId in class Icons
        Returns:
        A UUID string that is based on the pixel data of the icon images used to construct this Icons. Therefore identical Icons should have identical id's. Note that the id is dependent on the order of the images passed in to the constructor, so Icons created with images specified in different orders will have different id's
      • getIcon16

        public javax.swing.Icon getIcon16()
        Description copied from class: Icons
        Return a 16 * 16 point icon. Appropriate for use in JTree, JTable rows and small JButtons.
        Overrides:
        getIcon16 in class Icons
      • getIcon24

        public javax.swing.Icon getIcon24()
        Description copied from class: Icons
        Return a 24 * 24 point icon. Appropriate for use in large toolbar buttons.
        Overrides:
        getIcon24 in class Icons
      • getIcon32

        public javax.swing.Icon getIcon32()
        Description copied from class: Icons
        Return a 32 * 32 point icon. Appropriate for use in large table rows.
        Overrides:
        getIcon32 in class Icons
      • getIcon

        public javax.swing.Icon getIcon​(int size)
        Description copied from class: Icons
        Return a size * size point icon
        Overrides:
        getIcon in class Icons
        Parameters:
        size - size in pixels of the icon to get
      • getIcon

        public javax.swing.Icon getIcon​(int size,
                                        java.awt.Color overrideColor)
        Description copied from class: Icons
        Moves the colors in this Icons towards the given color. For example, this is how folder images are assigned the color the user chooses in the service tree.
        Overrides:
        getIcon in class Icons
        Parameters:
        size - The size of icon to generate
        overrideColor - The color used to color the icon
        Returns:
        The colored icon at the specified size