- java.lang.Object
-
- org.arakhne.afc.nodefx.Drawers
-
public final class Drawers extends Object
Utility class forZoomableDrawer
.- Since:
- 15.0
- Version:
- 17.0 2020-01-04 14:41:52
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.advanced
- Maven Artifact Id:
- nodefx
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Iterator<Drawer<?>>
getAllDrawers()
Replies all the registered document drawers.static <T> Drawer<T>
getDrawerFor(Class<? extends T> type)
Replies the first registered document drawer that is supporting the given type.static <T> Drawer<? super T>
getDrawerFor(T instance)
Replies the first registered document drawer that is supporting the given instance.static ServiceLoader<Drawer<?>>
getDrawerProvidingService()
Replies the service that provides the drawers.static void
reload()
Reload the drawers' definition.static void
setBackedDrawers(Iterable<Drawer<?>> drawers)
Change the collection of drawers.
-
-
-
Method Detail
-
reload
public static void reload()
Reload the drawers' definition.
-
getAllDrawers
@Pure public static Iterator<Drawer<?>> getAllDrawers()
Replies all the registered document drawers.- Returns:
- the drawers.
-
setBackedDrawers
public static void setBackedDrawers(Iterable<Drawer<?>> drawers)
Change the collection of drawers.- Parameters:
drawers
- the collection of the drawers.- Since:
- 17.0
-
getDrawerProvidingService
@Pure public static ServiceLoader<Drawer<?>> getDrawerProvidingService()
Replies the service that provides the drawers.- Returns:
- the drawers' providing service.
- Since:
- 17.0
-
getDrawerFor
@Pure public static <T> Drawer<T> getDrawerFor(Class<? extends T> type)
Replies the first registered document drawer that is supporting the given type.If multiple drawers handles the given type, the ones handling the bottom most type within the type hierarchy are selected. In the case there is multiple drawers exactly handling the type, there is no warranty about the order of the drawers; and the replied drawer may be any of the selected drawers. The only assumption that could be done on the order of the drawers is: if only one Jar library provides drawers' implementation, then the order of the drawers is the same as the order of the types declared within the service's file.
- Type Parameters:
T
- the type of the elements to drawer.- Parameters:
type
- the type of the elements to drawer.- Returns:
- the drawer, or
null
if none.
-
getDrawerFor
@Pure public static <T> Drawer<? super T> getDrawerFor(T instance)
Replies the first registered document drawer that is supporting the given instance.- Type Parameters:
T
- the type of the element.- Parameters:
instance
- the element to drawer.- Returns:
- the drawer, or
null
if none. - Since:
- 16.0
-
-