Class DeferredDrawer<T>

  • Type Parameters:
    T - the type of the primitives to draw.
    All Implemented Interfaces:
    Drawer<T>

    public final class DeferredDrawer<T>
    extends Object
    implements Drawer<T>
    Drawer that defers to another drawer dynamically. This drawer is implemented in order to be used inside the constructors of a Drawer when it needs another drawer.
    Since:
    16.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 Detail

      • of

        public static <T> Drawer<T> of​(Class<? extends T> type)
        Constructor.
        Type Parameters:
        T - the type of elements to be drawn.
        Parameters:
        type - the type of elements to be drawn.
        Returns:
        the drawer.
      • draw

        public void draw​(ZoomableGraphicsContext gc,
                         T primitive)
        Description copied from interface: Drawer
        Draw the given document primitives.
        Specified by:
        draw in interface Drawer<T>
        Parameters:
        gc - the graphics context that must be used for drawing.
        primitive - the primitive to draw.
      • getPrimitiveType

        @Pure
        public Class<? extends T> getPrimitiveType()
        Description copied from interface: Drawer
        Replies the type of the primitives that could be drawn by this drawer.
        Specified by:
        getPrimitiveType in interface Drawer<T>
        Returns:
        the type of the primitives.