public class MapOverview extends MapControl implements ViewPortListener
Lightweight MapControl
that uses another MapControl
's MapContext
, and updates
any rectangular extent selected, to the associated MapControl
.
Both MapControl
instances work in the same projection. And, always, the not undefined adjusted extent
of the associated one, will be enhanced as a red-bordered grey-filled rectangle in this one. Furthermore, draws a horizontal and vertical
this component's width or height, black lines centered in that rectangle.
MapControl.CancelDraw, MapControl.Drawer, MapControl.MapContextListener, MapControl.MapToolListener
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
ACTUALIZADO, adjustedPoint, currentMapTool, currentTool, DESACTUALIZADO, geomManager, mapAdjustedPoint, mapControlManager, mapToolListener, namesMapTools, prevTool, vp
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
MapOverview(MapControl mapAssoc)
Creates a
MapOverview instance associated to mapAssoc . |
Modifier and Type | Method and Description |
---|---|
void |
backColorChanged(ColorEvent e)
Removes this component as listener of the the associated
MapControl and this one's view port. |
void |
calculateSnapPoint(Point point)
Tries to find the nearest geometry or grid control point by the position
of the current snap tool.
|
void |
extentChanged(ExtentEvent evExtent)
Called when the extent of the view port has changed.
|
MapContext |
getAssociatedMapContext() |
MapControl |
getAssociatedMapControl()
Gets the
MapControl instance that wrappers. |
protected void |
paintComponent(Graphics g)
Paints this component's graphical information using a 8-bit RGBA color double buffer, drawing a red-bordered
grey-filled rectangle enhancing the extent selected, and a horizontal and vertical this component's width or
height, black lines centered in that rectangle.
|
void |
projectionChanged(ProjectionEvent e)
Called when the projection of the view port has changed.
|
void |
refreshExtent()
If this had no extent, calls
#delModel() , otherwise recalculates this
component's view port extent as the union of all extents of all layers of this map. |
void |
refreshOverView(Envelope r)
Repaints this component updating its extent.
|
void |
setModel(MapContext model)
Sets a
MapContext to this component, configuring it to manage view port events produced
in the associated MapControl and this one's view port. |
void |
setProjection(IProjection proj)
Unimplemented.
|
addBehavior, addBehavior, addCombinedBehavior, addExceptionListener, applyFrameRate, cancelDrawing, commandRefresh, commandRepaint, componentHidden, componentMoved, componentResized, componentShown, dispose, drawGraphics, drawMap, getAdjustedPoint, getCanceldraw, getCombinedTool, getCurrentMapTool, getCurrentTool, getGrid, getImage, getMapAdjustedPoint, getMapContext, getMapControlDrawer, getMapTool, getMapToolListener, getMapToolsKeySet, getNamesMapTools, getPoint, getProjection, getViewPort, hasTool, initializeGrid, isDefaultMouseWheelEnabled, isDrawAnimationEnabled, isRefentEnabled, removeCombinedTool, removeExceptionListener, rePaintDirtyLayers, setAdjustGrid, setCombinedTool, setCurrentMapTool, setDefaultMouseWheelEnabled, setDrawAnimationEnabled, setGridVisibility, setMapContext, setMapControlDrawer, setPrevTool, setRefentEnabled, setTool, throwException, update, zoomIn, zoomOut
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public MapOverview(MapControl mapAssoc)
Creates a MapOverview
instance associated to mapAssoc
.
mapAssoc
- MapControl
this component will be the overviewpublic MapContext getAssociatedMapContext()
MapControl.getMapContext()
public MapControl getAssociatedMapControl()
Gets the MapControl
instance that wrappers.
MapControl
instance that wrapperspublic void extentChanged(ExtentEvent evExtent)
ViewPortListener
Called when the extent of the view port has changed.
extentChanged
in interface ViewPortListener
evExtent
- an extend event objectpublic void refreshExtent()
If this had no extent, calls #delModel()
, otherwise recalculates this
component's view port extent as the union of all extents of all layers of this map.
public void refreshOverView(Envelope r)
Repaints this component updating its extent.
r
- the new extentprotected void paintComponent(Graphics g)
Paints this component's graphical information using a 8-bit RGBA color double buffer, drawing a red-bordered grey-filled rectangle enhancing the extent selected, and a horizontal and vertical this component's width or height, black lines centered in that rectangle.
paintComponent
in class MapControl
JComponent.paintComponent(java.awt.Graphics)
,
Drawer2
public void setModel(MapContext model)
Sets a MapContext
to this component, configuring it to manage view port events produced
in the associated MapControl
and this one's view port.
This MapContext
's projection will be the same as the associated MapControl
's one.
Setting the model includes the following steps:
model
as the MapContext
of this
.model
projection, the associated MapControl's projection.
this
as view port listener of the associated MapControl
's view port.this
as view port listener of this MapContext
's view portmodel
- data to setpublic void backColorChanged(ColorEvent e)
Removes this component as listener of the the associated MapControl
and this one's view port. Besides,
removes the extent.
backColorChanged
in interface ViewPortListener
e
- a color event objectpublic void projectionChanged(ProjectionEvent e)
ViewPortListener
Called when the projection of the view port has changed.
projectionChanged
in interface ViewPortListener
e
- a projection event objectViewPortListener.projectionChanged(ProjectionEvent)
,
MapControl.setProjection(IProjection)
public void setProjection(IProjection proj)
Unimplemented.
Can't change the projection, because must be the same as the one of the
associated MapControl
instance.
setProjection
in class MapControl
proj
- the kind of projection to this component's MapContext
MapContext.setProjection(IProjection)
,
MapControl.getProjection()
public void calculateSnapPoint(Point point)
MapControl
Tries to find the nearest geometry or grid control point by the position of the current snap tool.
Prioritizes the grid control points than the geometries ones.
If finds any near, stores the map and pixel coordinates for
the snap, and enables the bForceCoord
attribute for the next
draw of the mouse's cursor.
calculateSnapPoint
in class MapControl
point
- current mouse 2D position