- 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 int
DEFAULT_SIZE
The default icon size to used in menus and toolbars
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Node
iconFor(File file, int size)
CallsiconForFileExtension(String, int)
for the providedPath
.static Node
iconFor(File file, int size, Node defaultIcon)
static Node
iconFor(Class<?> clazz, int size)
CallsiconForClass(String, int)
for the providedClass
.static Node
iconFor(Class<?> clazz, int size, Node defaultIcon)
static Node
iconFor(Object object, int size)
static Node
iconFor(Object object, int size, Node defaultIcon)
static Node
iconFor(Path path, int size)
CallsiconForFileExtension(String, int)
for the providedPath
.static Node
iconFor(Path path, int size, Node defaultIcon)
static Node
iconForClass(String clazz, int size)
static Node
iconForClass(String clazz, int size, Node defaultIcon)
static Node
iconForFileExtension(String extension, int size)
static Node
iconForFileExtension(String extension, int size, Node defaultIcon)
static Node
iconForMIMEType(String mime)
static Node
iconForMIMEType(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 squareNode
to be returned.- Returns:
- An iconic
Node
representing the givenobject
at the givensize
, ornull
.null
is also returned ifobject
isnull
, 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 squareNode
to be returned.defaultIcon
- The value to be returned if no provider was able to return a valid alternative.- Returns:
- An iconic
Node
representing the givenobject
at 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 squareNode
to be returned.- Returns:
- An iconic
Node
representingClass
with the givenname
, ornull
.null
is also returned ifclazz
isnull
, 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 squareNode
to be returned.defaultIcon
- The value to be returned if no provider was able to return a valid alternative.- Returns:
- An iconic
Node
representingClass
with 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 squareNode
to be returned.- Returns:
- An iconic
Node
representing a file with the givenextension
at the givensize
, ornull
.null
is also returned ifextension
isnull
or 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 squareNode
to be returned.defaultIcon
- The value to be returned if no provider was able to return a valid alternative.- Returns:
- An iconic
Node
representing 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
Node
representing the givenmime
type, 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
Node
representing the givenmime
type, ornull
.
-
-