Package org.arakhne.afc.gis.ui.drawers
Class GisElementContainerDrawer<T extends MapElement>
- java.lang.Object
-
- org.arakhne.afc.gis.ui.drawers.GisElementContainerDrawer<T>
-
- Type Parameters:
T- the type of the elements to draw.
- All Implemented Interfaces:
Drawer<GISElementContainer>,DrawerReference<T>
- Direct Known Subclasses:
RoadNetworkDrawer
public class GisElementContainerDrawer<T extends MapElement> extends Object implements Drawer<GISElementContainer>, DrawerReference<T>
Drawer of a map element container.- Since:
- 15.0
- Version:
- 17.0 2020-01-04 14:41:54
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.gis.ui
- Maven Artifact Id:
- giscorefx
-
-
Constructor Summary
Constructors Constructor Description GisElementContainerDrawer()Constructor.GisElementContainerDrawer(Drawer<? super T> drawer)Constructor based on the given drawer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddraw(ZoomableGraphicsContext gc, GISElementContainer primitive)Draw the given document primitives.protected Drawer<? super T>draw(ZoomableGraphicsContext gc, GISElementContainer<T> primitive, Drawer<? super T> drawer)Draw the primitive with the given drawer.protected Drawer<? super T>drawPrimitives(ZoomableGraphicsContext gc, GISElementContainer<T> primitive, Drawer<? super T> drawer)Draw the primitives.Drawer<? super T>getDrawer()Replies the preferred drawer for this drawable object.Class<? extends GISElementContainer>getPrimitiveType()Replies the type of the primitives that could be drawn by this drawer.voidsetDrawer(Drawer<? super T> drawer)Change the preferred drawer for this drawable object.
-
-
-
Method Detail
-
getDrawer
public Drawer<? super T> getDrawer()
Description copied from interface:DrawerReferenceReplies the preferred drawer for this drawable object.- Specified by:
getDrawerin interfaceDrawerReference<T extends MapElement>- Returns:
- the drawer or
nullif none.
-
setDrawer
public void setDrawer(Drawer<? super T> drawer)
Description copied from interface:DrawerReferenceChange the preferred drawer for this drawable object.- Specified by:
setDrawerin interfaceDrawerReference<T extends MapElement>- Parameters:
drawer- the drawer ornullif none.
-
draw
public final void draw(ZoomableGraphicsContext gc, GISElementContainer primitive)
Description copied from interface:DrawerDraw the given document primitives.- Specified by:
drawin interfaceDrawer<T extends MapElement>- Parameters:
gc- the graphics context that must be used for drawing.primitive- the primitive to draw.
-
draw
protected Drawer<? super T> draw(ZoomableGraphicsContext gc, GISElementContainer<T> primitive, Drawer<? super T> drawer)
Draw the primitive with the given drawer.- Parameters:
gc- the graphics context to draw with.primitive- the primitive to draw.drawer- the drawer, ornullto use the default.- Returns:
- the used drawer.
-
drawPrimitives
protected Drawer<? super T> drawPrimitives(ZoomableGraphicsContext gc, GISElementContainer<T> primitive, Drawer<? super T> drawer)
Draw the primitives.This function calls the drawers on each primitive inside the given container. It is not expected to be overridden into the sub-classes.
- Parameters:
gc- the graphics context to draw with.primitive- the primitive to draw.drawer- the drawer, ornullto use the default.- Returns:
- the used drawer.
- Since:
- 16.0
-
getPrimitiveType
@Pure public Class<? extends GISElementContainer> getPrimitiveType()
Description copied from interface:DrawerReplies the type of the primitives that could be drawn by this drawer.- Specified by:
getPrimitiveTypein interfaceDrawer<T extends MapElement>- Returns:
- the type of the primitives.
-
-