- java.lang.Object
-
- eu.ess.xaos.ui.control.Icons
-
public class Icons extends Object
Provides methods to obtain specific icons.- Author:
- claudio.rosati@esss.se
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_SIZEThe default icon size to used in menus and toolbars
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NodeiconFor(File file, int size)CallsiconForFileExtension(String, int)for the providedPath.static NodeiconFor(File file, int size, Node defaultIcon)static NodeiconFor(Class<?> clazz, int size)CallsiconForClass(String, int)for the providedClass.static NodeiconFor(Class<?> clazz, int size, Node defaultIcon)static NodeiconFor(Object object, int size)static NodeiconFor(Object object, int size, Node defaultIcon)static NodeiconFor(Path path, int size)CallsiconForFileExtension(String, int)for the providedPath.static NodeiconFor(Path path, int size, Node defaultIcon)static NodeiconForClass(String clazz, int size)static NodeiconForClass(String clazz, int size, Node defaultIcon)static NodeiconForFileExtension(String extension, int size)static NodeiconForFileExtension(String extension, int size, Node defaultIcon)static NodeiconForMIMEType(String mime)static NodeiconForMIMEType(String mime, Node defaultIcon)
-
-
-
Field Detail
-
DEFAULT_SIZE
public static final int DEFAULT_SIZE
The default icon size to used in menus and toolbars- See Also:
- Constant Field Values
-
-
Method Detail
-
iconFor
public static Node iconFor(Class<?> clazz, int size)
CallsiconForClass(String, int)for the providedClass.
-
iconFor
public static Node iconFor(File file, int size)
CallsiconForFileExtension(String, int)for the providedPath.
-
iconFor
public static Node iconFor(Object object, int size)
- Parameters:
object- The object for which a graphical representation is needed.size- The size of the squareNodeto be returned.- Returns:
- An iconic
Noderepresenting the givenobjectat the givensize, ornull.nullis also returned ifobjectisnull, orsize <= 0.
-
iconFor
public static Node iconFor(Object object, int size, Node defaultIcon)
- Parameters:
object- The object for which a graphical representation is needed.size- The size of the squareNodeto be returned.defaultIcon- The value to be returned if no provider was able to return a valid alternative.- Returns:
- An iconic
Noderepresenting the givenobjectat the givensize.
-
iconFor
public static Node iconFor(Path path, int size)
CallsiconForFileExtension(String, int)for the providedPath.
-
iconForClass
public static Node iconForClass(String clazz, int size)
- Parameters:
clazz- The full class name (the one returned byClass.getName()) for which a graphical representation is needed.size- The size of the squareNodeto be returned.- Returns:
- An iconic
NoderepresentingClasswith the givenname, ornull.nullis also returned ifclazzisnull, orsize <= 0.
-
iconForClass
public static Node iconForClass(String clazz, int size, Node defaultIcon)
- Parameters:
clazz- The full class name (the one returned byClass.getName()) for which a graphical representation is needed.size- The size of the squareNodeto be returned.defaultIcon- The value to be returned if no provider was able to return a valid alternative.- Returns:
- An iconic
NoderepresentingClasswith the givenname, ornull.
-
iconForFileExtension
public static Node iconForFileExtension(String extension, int size)
- Parameters:
extension- The file extension (without the preceding '.').size- The size of the squareNodeto be returned.- Returns:
- An iconic
Noderepresenting a file with the givenextensionat the givensize, ornull.nullis also returned ifextensionisnullor empty, orsize <= 0.
-
iconForFileExtension
public static Node iconForFileExtension(String extension, int size, Node defaultIcon)
- Parameters:
extension- The file extension (without the preceding '.').size- The size of the squareNodeto be returned.defaultIcon- The value to be returned if no provider was able to return a valid alternative.- Returns:
- An iconic
Noderepresenting a file with the givenextension, ornull.
-
iconForMIMEType
public static Node iconForMIMEType(String mime)
- Parameters:
mime- The MIME type for which a graphical representation is needed.- Returns:
- An iconic
Noderepresenting the givenmimetype, ornull.
-
iconForMIMEType
public static Node iconForMIMEType(String mime, Node defaultIcon)
- Parameters:
mime- The MIME type for which a graphical representation is needed.defaultIcon- The value to be returned if no provider was able to return a valid alternative.- Returns:
- An iconic
Noderepresenting the givenmimetype, ornull.
-
-