Class MapViewDrawing
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- org.mapsforge.map.awt.view.MapView
-
- org.insa.graphs.gui.drawing.components.MapViewDrawing
-
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,Drawing
,org.mapsforge.map.view.MapView
public class MapViewDrawing extends org.mapsforge.map.awt.view.MapView implements Drawing
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
-
Nested classes/interfaces inherited from interface org.insa.graphs.gui.drawing.Drawing
Drawing.AlphaMode
-
-
Field Summary
Fields Modifier and Type Field Description static java.awt.Color
DEFAULT_PATH_COLOR
-
Constructor Summary
Constructors Constructor Description MapViewDrawing()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDrawingClickListener(DrawingClickListener listener)
Add a listener to click to this drawing.void
clear()
Clear the drawing (overlays and underlying graph/map).void
clearOverlays()
Remove overlays from the drawing (do not remove the underlying graph/map).protected org.mapsforge.core.model.LatLong
convertPoint(Point point)
protected MarkerAutoScaling
createMarker(Point point, java.awt.Color outer, java.awt.Color inner, Drawing.AlphaMode mode)
PointSetOverlay
createPointSetOverlay()
Create a new PointSetOverlay that can be used to add overlay points to this drawing.PointSetOverlay
createPointSetOverlay(int width, java.awt.Color color)
Create a new PointSetOverlay with the given initial width and color that can be used to add overlay points to this drawing.void
drawGraph(java.io.File file)
void
drawGraph(Graph graph)
Draw the given graph using a default palette specific to the implementation.void
drawGraph(Graph graph, GraphPalette palette)
Draw the given graph using the given palette.MarkerOverlay
drawMarker(Point point, java.awt.Color outer, java.awt.Color inner, Drawing.AlphaMode mode)
Draw a marker at the given position using the given colors and according to the given mode.PathOverlay
drawPath(Path path)
Draw a path with both origin and destination markers using a default color specific to the implementationPathOverlay
drawPath(Path path, boolean markers)
Draw a path using a default color specific to the implementationPathOverlay
drawPath(Path path, java.awt.Color color)
Draw a path with both origin and destination markers using the given color.PathOverlay
drawPath(Path path, java.awt.Color color, boolean markers)
Draw a path using the given color.void
paint(java.awt.Graphics graphics)
void
removeDrawingClickListener(DrawingClickListener listener)
Remove the given listener from the drawing.-
Methods inherited from class org.mapsforge.map.awt.view.MapView
addInputListener, addLayer, addListeners, destroy, destroyAll, getBoundingBox, getDimension, getFpsCounter, getFrameBuffer, getLayerManager, getMapScaleBar, getMapViewProjection, getModel, onMoveEvent, onZoomEvent, removeInputListener, setCenter, setMapScaleBar, setZoomLevel, setZoomLevelMax, setZoomLevelMin
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Method Detail
-
paint
public void paint(java.awt.Graphics graphics)
- Overrides:
paint
in classorg.mapsforge.map.awt.view.MapView
-
clear
public void clear()
Description copied from interface:Drawing
Clear the drawing (overlays and underlying graph/map).
-
clearOverlays
public void clearOverlays()
Description copied from interface:Drawing
Remove overlays from the drawing (do not remove the underlying graph/map).- Specified by:
clearOverlays
in interfaceDrawing
-
convertPoint
protected org.mapsforge.core.model.LatLong convertPoint(Point point)
-
addDrawingClickListener
public void addDrawingClickListener(DrawingClickListener listener)
Description copied from interface:Drawing
Add a listener to click to this drawing.- Specified by:
addDrawingClickListener
in interfaceDrawing
- Parameters:
listener
- DrawingClickListener to add to this Drawing.
-
removeDrawingClickListener
public void removeDrawingClickListener(DrawingClickListener listener)
Description copied from interface:Drawing
Remove the given listener from the drawing.- Specified by:
removeDrawingClickListener
in interfaceDrawing
- Parameters:
listener
- DrawingClickListener to remove from this Drawing.
-
createMarker
protected MarkerAutoScaling createMarker(Point point, java.awt.Color outer, java.awt.Color inner, Drawing.AlphaMode mode)
-
drawMarker
public MarkerOverlay drawMarker(Point point, java.awt.Color outer, java.awt.Color inner, Drawing.AlphaMode mode)
Description copied from interface:Drawing
Draw a marker at the given position using the given colors and according to the given mode.- Specified by:
drawMarker
in interfaceDrawing
- Parameters:
point
- Position of the marker to draw.outer
- Color for the outer part of the marker to draw.inner
- Color for the inner part of the marker to draw.mode
- Mode for filling the inner par of the marker.- Returns:
- A MarkerOverlay instance representing the newly drawn marker.
-
createPointSetOverlay
public PointSetOverlay createPointSetOverlay()
Description copied from interface:Drawing
Create a new PointSetOverlay that can be used to add overlay points to this drawing. PointSetOverlay are heavy memory resources, do not use one for each point!- Specified by:
createPointSetOverlay
in interfaceDrawing
- Returns:
- A new PointSetOverlay for this drawing.
-
createPointSetOverlay
public PointSetOverlay createPointSetOverlay(int width, java.awt.Color color)
Description copied from interface:Drawing
Create a new PointSetOverlay with the given initial width and color that can be used to add overlay points to this drawing. PointSetOverlay are heavy memory resources, do not use one for each point!- Specified by:
createPointSetOverlay
in interfaceDrawing
- Parameters:
width
- Initial width of points in the overlay.color
- Initial width of points in the overlay.- Returns:
- A new PointSetOverlay for this drawing.
-
drawGraph
public void drawGraph(java.io.File file)
-
drawGraph
public void drawGraph(Graph graph, GraphPalette palette)
Description copied from interface:Drawing
Draw the given graph using the given palette.- Specified by:
drawGraph
in interfaceDrawing
- Parameters:
graph
- Graph to draw.palette
- Palette to use to draw the graph.- See Also:
BasicGraphPalette
,BlackAndWhiteGraphPalette
-
drawGraph
public void drawGraph(Graph graph)
Description copied from interface:Drawing
Draw the given graph using a default palette specific to the implementation.
-
drawPath
public PathOverlay drawPath(Path path, java.awt.Color color, boolean markers)
Description copied from interface:Drawing
Draw a path using the given color.
-
drawPath
public PathOverlay drawPath(Path path, java.awt.Color color)
Description copied from interface:Drawing
Draw a path with both origin and destination markers using the given color.- Specified by:
drawPath
in interfaceDrawing
- Parameters:
path
- Path to draw.color
- Color of the path to draw.- Returns:
- A PathOverlay instance representing the newly drawn path.
- See Also:
Drawing.drawPath(Path, Color, boolean)
-
drawPath
public PathOverlay drawPath(Path path)
Description copied from interface:Drawing
Draw a path with both origin and destination markers using a default color specific to the implementation- Specified by:
drawPath
in interfaceDrawing
- Parameters:
path
- Path to draw.- Returns:
- A PathOverlay instance representing the newly drawn path.
- See Also:
Drawing.drawPath(Path, Color, boolean)
-
drawPath
public PathOverlay drawPath(Path path, boolean markers)
Description copied from interface:Drawing
Draw a path using a default color specific to the implementation- Specified by:
drawPath
in interfaceDrawing
- Parameters:
path
- Path to draw.markers
- true to show origin and destination markers.- Returns:
- A PathOverlay instance representing the newly drawn path.
- See Also:
Drawing.drawPath(Path, Color, boolean)
-
-