Package org.apache.sis.gui.map
Class MapCanvas.Renderer
Object
Renderer
- Direct Known Subclasses:
- MapCanvasAWT.Renderer
- Enclosing class:
- MapCanvas
A snapshot of 
MapCanvas state to render as a map, together with rendering code.
 This class is instantiated and used as below:
 - MapCanvasinvokes- MapCanvas.createRenderer()in the JavaFX thread. That method shall take a snapshot of every information needed for performing the rendering in a background thread.
- MapCanvasinvokes- render()in a background thread. That method creates or updates the nodes to show in the canvas but without reading or writing any canvas property; that method should use only the snapshot taken in step 1.
- MapCanvasinvokes- commit(MapCanvas)in the JavaFX thread. The nodes prepared at step 2 can be transferred to- MapCanvas.floatingPanein that method.
- Since:
- 1.1
Defined in the sis-javafx module
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract booleancommit(MapCanvas canvas) Invoked in JavaFX thread afterrender()completion.intReturns the height (number of rows) of the view, in pixels.intReturns the width (number of columns) of the view, in pixels.protected abstract voidrender()Invoked in a background thread for rendering the map.
- 
Constructor Details- 
Rendererprotected Renderer()
 
- 
- 
Method Details- 
getWidthpublic int getWidth()Returns the width (number of columns) of the view, in pixels.- Returns:
- number of pixels to render horizontally.
 
- 
getHeightpublic int getHeight()Returns the height (number of rows) of the view, in pixels.- Returns:
- number of pixels to render vertically.
 
- 
renderInvoked in a background thread for rendering the map. This method should not access anyMapCanvasproperty; if some canvas properties are needed, they should have been copied at construction time.- Throws:
- Exception- if an error occurred while preparing data or rendering them.
 
- 
commitInvoked in JavaFX thread afterrender()completion. This method can update theMapCanvas.floatingPanechildren with the nodes (images, shaped, etc.) created byrender().- Parameters:
- canvas- the canvas where drawing has been done.
- Returns:
- trueon success, or- falseif the rendering should be redone (for example because a change has been detected in the data).
 
 
-