Class ResourceFactory


  • @Service
    public class ResourceFactory
    extends AbstractResourceFactory
    A factory class that builds and/or caches resources (mostly icons and backgrounds).
    Author:
    Johny Andres Ortega Ruiz <johny.ortega@kuwaiba.org>, Orlando Paz <Orlando.paz@kuwaiba.org>, Julian David Camacho Erazo <julian.camacho@kuwaiba.org>
    • Constructor Detail

      • ResourceFactory

        public ResourceFactory()
    • Method Detail

      • getClassIconUri

        public String getClassIconUri​(String className)
        Returns the URI for the large icon of a class with the given name.
        Parameters:
        className - the name of the class
        Returns:
        the URI of the large icon
      • getClassSmallIconUri

        public String getClassSmallIconUri​(String className)
        Returns the URI for the small icon of a class with the given name.
        Parameters:
        className - the name of the class
        Returns:
        the URI of the small icon
      • getRelationshipIconUri

        public String getRelationshipIconUri​(int color,
                                             int width,
                                             int height)
        Returns the URI for a relationship icon with the given color, width, and height.
        Parameters:
        color - the color of the icon (as an RGB value)
        width - the width of the icon
        height - the height of the icon
        Returns:
        the URI of the relationship icon
      • getClassIcon

        public String getClassIcon​(String className)
        Returns the URI for the large icon of a class with the given name.
        Specified by:
        getClassIcon in class AbstractResourceFactory
        Parameters:
        className - the name of the class
        Returns:
        the URI of the large icon
      • getClassSmallIcon

        public String getClassSmallIcon​(String className)
        Returns the URI for the small icon of a class with the given name.
        Specified by:
        getClassSmallIcon in class AbstractResourceFactory
        Parameters:
        className - the name of the class
        Returns:
        the URI of the small icon
      • getRelationshipIcon

        public String getRelationshipIcon​(Color color,
                                          int width,
                                          int height)
        Returns the URI for a relationship icon with the given color, width, and height.
        Parameters:
        color - the color of the icon (as a Color object)
        width - the width of the icon
        height - the height of the icon
        Returns:
        the URI of the relationship icon