Class ResourceFactory
- java.lang.Object
-
- org.neotropic.util.visual.resources.AbstractResourceFactory
-
- org.neotropic.kuwaiba.visualization.api.resources.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>
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_ICON_HEIGHT
Default icon height (used in views)static int
DEFAULT_ICON_WIDTH
Default icon width (used in views)static int
DEFAULT_SMALL_ICON_HEIGHT
Default icon height (used in navigation trees)static int
DEFAULT_SMALL_ICON_WIDTH
Default icon width (used in navigation trees)static int
DEFAULT_SMALL_NO_ICON_HEIGHT
Default no icon height (used in navigation trees)static int
DEFAULT_SMALL_NO_ICON_WIDTH
Default no icon width (used in navigation trees)
-
Constructor Summary
Constructors Constructor Description ResourceFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.vaadin.flow.server.StreamResource
getClassIcon(String className)
Builds and caches an icon of a given class.com.vaadin.flow.server.StreamResource
getClassSmallIcon(String className)
Gets or builds (but doesn't caches) the small icon of the given class namecom.vaadin.flow.server.StreamResource
getRelationshipIcon(Color color, int width, int height)
Builds an icon resource
-
-
-
Field Detail
-
DEFAULT_ICON_WIDTH
public static final int DEFAULT_ICON_WIDTH
Default icon width (used in views)- See Also:
- Constant Field Values
-
DEFAULT_ICON_HEIGHT
public static final int DEFAULT_ICON_HEIGHT
Default icon height (used in views)- See Also:
- Constant Field Values
-
DEFAULT_SMALL_ICON_WIDTH
public static final int DEFAULT_SMALL_ICON_WIDTH
Default icon width (used in navigation trees)- See Also:
- Constant Field Values
-
DEFAULT_SMALL_ICON_HEIGHT
public static final int DEFAULT_SMALL_ICON_HEIGHT
Default icon height (used in navigation trees)- See Also:
- Constant Field Values
-
DEFAULT_SMALL_NO_ICON_WIDTH
public static final int DEFAULT_SMALL_NO_ICON_WIDTH
Default no icon width (used in navigation trees)- See Also:
- Constant Field Values
-
DEFAULT_SMALL_NO_ICON_HEIGHT
public static final int DEFAULT_SMALL_NO_ICON_HEIGHT
Default no icon height (used in navigation trees)- See Also:
- Constant Field Values
-
-
Method Detail
-
getClassIcon
public com.vaadin.flow.server.StreamResource getClassIcon(String className)
Description copied from class:AbstractResourceFactory
Builds and caches an icon of a given class.- Specified by:
getClassIcon
in classAbstractResourceFactory
- Parameters:
className
- the class name of the icon will be built for- Returns:
- The cached resource
-
getClassSmallIcon
public com.vaadin.flow.server.StreamResource getClassSmallIcon(String className)
Description copied from class:AbstractResourceFactory
Gets or builds (but doesn't caches) the small icon of the given class name- Specified by:
getClassSmallIcon
in classAbstractResourceFactory
- Parameters:
className
- The class name- Returns:
- The cached resource if it has been previously cached, or a generic black icon otherwise
-
getRelationshipIcon
public com.vaadin.flow.server.StreamResource getRelationshipIcon(Color color, int width, int height)
Builds an icon resource- Parameters:
color
- The color of the iconwidth
- The width of the iconheight
- The height of the icon- Returns:
- The icon
-
-