public class View extends javax.swing.JComponent implements JMapEventDispatcher
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected Tool |
currentTool |
protected ViewEventDispatcher |
eventDispatcher |
protected GraphicsRef |
graphicsRef |
protected LayerAdapter |
layerAdapter |
protected MouseOverManager |
mouseOverManager |
protected java.awt.image.BufferedImage |
offImage |
protected OrientedRectangle |
panSmoothToRedrawRect |
static java.lang.String |
PROPERTY_DISPLAY_UNIT |
static java.lang.String |
PROPERTY_DISTANCE_UNIT |
static java.lang.String |
PROPERTY_MAP_ROTATION |
static java.lang.String |
PROPERTY_MAP_UNIT |
static java.lang.String |
PROPERTY_MOUSEOVER_DISABLED |
static java.lang.String |
PROPERTY_VIEW_NAME |
protected ViewRenderer |
renderer |
protected java.lang.String |
viewName |
protected ViewOverlay |
viewOverlay |
protected javax.swing.JPopupMenu |
viewPopupMenu |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
View(LayerManager layerMgr,
ViewSettings settings)
Constructs a new View object associated with the specified LayerManager.
|
Modifier and Type | Method and Description |
---|---|
long |
addMarker(Point coord,
java.lang.String text,
Style markerStyle)
Adds a new marker to the view.
|
javax.swing.JMenuItem |
addPopupMenuAction(javax.swing.Action menuItemAction)
Adds an action to the view contextual menu.
|
void |
addPopupMenuItem(javax.swing.JMenuItem menuItem)
Adds a menu item to the view contextual menu.
|
void |
addPopupMenuSeparator()
Adds separator to the view contextual menu.
|
void |
addStaticElement(ViewStaticElement staticElem)
Adds the specified static element to the list of elements that will be
drawn in this view on top of geographic data.
|
void |
addStaticImage(java.awt.Image im,
java.awt.Point pt,
int relativeTo)
Deprecated.
Use addStaticElement instead
|
void |
addViewEventListener(ViewEventListener listener)
Adds a listener to the list of view event listeners.
|
void |
applySettings(ViewSettings settings)
Sets the settings for the view
|
void |
clearMarkers()
Removes all the markers from this view
|
void |
close()
Frees resources used by the view.
|
protected boolean |
createOffImage() |
void |
dispatchEvent(JMapEvent event)
The
dispatchEvent method is used to dispatch synchronously
JMap events to all registered listeners. |
protected void |
draw(K2DTransform t,
OrientedRectangle wcRegion,
int drawOptions) |
protected void |
draw(K2DTransform t,
OrientedRectangle wcRegion,
Rectangle dcRegion,
int drawOptions,
boolean updateViewGraphics) |
void |
drawStaticElements(GraphicsRef gr,
K2DTransform t,
Rectangle viewBounds)
Draws view static elements.
|
void |
drawVolatileElement(K2DElement element,
VectorLayer vectorLayer,
java.awt.Graphics g)
Deprecated.
use viewOverlay.drawVolatileElement(element, layer);
|
void |
drawVolatileElements(K2DElement[] elements,
VectorLayer vectorLayer,
java.awt.Graphics g)
Deprecated.
use viewOverlay.drawVolatileElement(element, layer);
|
void |
drawVolatileElements(K2DElement[] elements,
VectorLayer vectorLayer,
Rectangle userBoundingBoxDc,
java.awt.Graphics g)
Deprecated.
use viewOverlay.drawVolatileElement(element, layer);
|
protected void |
firePopupMenuShowingEvent(java.awt.event.MouseEvent mouseEvent) |
protected void |
fireToolChangedEvent(Tool oldTool,
Tool newTool) |
void |
fireViewChanged() |
protected void |
fireViewRedrawOccurredEvent(ViewState viewState)
Fires a ViewRedrawEvent.
|
protected void |
fireViewRepaintOccurredEvent(java.awt.Graphics g)
Fires a ViewRedrawEvent.
|
Point |
getCenterOfView()
Returns the coordinate of the center of the view in DC coordinates.
|
Tool |
getCurrentTool()
Returns the current active tool of the view.
|
Rectangle |
getDCViewBounds()
Returns the coordinate of the center of the view in DC coordinates.
|
JMapUnit |
getDisplayUnit()
This method returns the Display unit.
|
JMapUnit |
getDistanceUnit() |
GraphicsManager |
getGraphicsManager()
Returns the graphics manager of the current view.
|
OrientedRectangle |
getInitialViewBounds()
Gets the intial view bounds
|
LayerManager |
getLayerManager()
Returns the LayerManager object associated with this view.
|
Projection |
getMapProjection()
Returns the current map data projection.
|
JMapUnit |
getMapUnit()
Returns the current map data unit.
|
OrientedRectangle |
getMaxViewBounds()
Returns the maximum bounds of this view
|
Projection |
getMeasurementProjection() |
MouseOverManager |
getMouseOverManager()
Return the
MouseOverManager for this view. |
ViewRenderer |
getRenderer()
Returns the ViewRenderer instance which is used to render
the map on the view.
|
double |
getRotation()
Returns the view rotation angle in degrees.
|
double |
getScaleFactor()
Computes the view current scale factor denominator.
|
double |
getScaleFactor(double dcScale)
Computes a scale factor denominator.
|
ScaleValidator |
getScaleValidator() |
ViewStaticElement[] |
getStaticElements()
Returns view static elements added to this view.
|
K2DTransform |
getTransform()
Returns the K2DTransform object associated with this view.
|
boolean |
getVerbose()
Returns the verbose mode for this view.
|
GraphicsRef |
getViewGraphicsRef()
Returns the GraphicsRef instance of the view.
|
java.lang.String |
getViewName()
Gets the view name.
|
ViewOverlay |
getViewOverlay()
Returns the ViewOverlay associated with this view
|
ViewSettings |
getViewSettings()
Returns the current view settings.
|
ViewState |
getViewState()
Returns the current state of the view, including all parameters
needed to restore the current state.
|
OrientedRectangle |
getWCViewBounds()
Returns a Rectangle object representing the area of the view in WC.
|
double |
getZoomLevel()
Gets the zoom level expressed in the current map units
|
protected ViewEventDispatcher |
initEventDispatcher() |
boolean |
isBusy()
Indicates if the View is currently busy repainting.
|
boolean |
isMouseInside()
Determines if the mouse cursor is inside the view.
|
boolean |
isRefreshable()
Returns whether or not the view is refreshable.
|
boolean |
moveBackward()
Adjust the view in order to display the region that was displayed prior to
the previous change in the view (similar to undo).
|
boolean |
moveForward()
If moveBackward() was called, adjust the view in order to display the region that
was displayed before the call to moveBackward() (similar to redo).
|
void |
moveTo(double x,
double y)
Makes the specified WC coordinate the new center of the view.
|
void |
moveTo(Point coord)
Makes the specified WC coordinate the new center of the view
|
void |
paint(java.awt.Graphics g)
Paint on the graphic
|
void |
pan(int xdc,
int ydc)
Adjusts the view in order to display a region that corresponds to the
current region translated by xDC in x and yDC in y (in DC).
|
void |
panSmooth(int xDC,
int yDC)
This method will pan the view and dynamically update the view to reflect
the translation.
|
void |
panSmooth(int xDC,
int yDC,
boolean redrawLabels)
This method will pan the view and dynamically update the view to reflect
the translation.
|
void |
redraw(OrientedRectangle wcRegion)
Redraws the current view using all layers.
|
void |
redraw(OrientedRectangle WCRegion,
int drawOptions)
Redraws the current view using the specified draw options.
|
void |
redraw(OrientedRectangle WCRegion,
int drawOptions,
boolean stopDrawing)
Redraws the current view using the specified draw options.
|
void |
redraw(OrientedRectangle wcRegion,
int drawOptions,
boolean stopDrawing,
boolean updateViewGraphics)
Redraws the current view using the specified draw options.
|
void |
refresh()
Redraws the complete view.
|
void |
removeMarker(long markerId)
Removes the specified marker from this view
|
void |
removePopupMenuAction(javax.swing.Action menuItemAction)
Removes an action from the view contextual menu.
|
void |
removePopupMenuItem(javax.swing.JMenuItem menuItem)
Removes a menu item from the view contextual menu.
|
void |
removeStaticElement(ViewStaticElement staticElem)
Removes the specified static element from the list.
|
void |
removeViewEventListener(ViewEventListener listener)
Removes a listener from the list of view event listeners.
|
void |
resetVolatileImageLastBounds()
Deprecated.
Is of no use anymore.
|
void |
setBounds(int x,
int y,
int width,
int height)
Sets the view bounds.
|
void |
setCurrentTool(Tool tool)
Sets the active Tool object for this view.
|
void |
setDisplayUnit(JMapUnit unit)
Sets the unit to use when displaying coordinates.
|
void |
setDistanceUnit(JMapUnit unit)
Sets the unit to use when displaying distances.
|
void |
setInitialViewBounds(OrientedRectangle initialViewBounds)
Sets the initial view bounds
|
void |
setLayerManager(LayerManager layerMgr)
Sets the layer manager
|
void |
setLayerRefreshManagerView(LayerViewRefreshManager dynamicLayerManager) |
void |
setMapUnit(JMapUnit unit)
Sets the unit for this map.
|
void |
setMaximumScale(double scale)
Sets the View object maximum scale.
|
void |
setMaxViewBounds(OrientedRectangle maxBounds)
Sets the maximum view bounds where the user will be able to zoom/pan
|
void |
setRefreshable(boolean refreshable)
Sets whether or not the view is refreshable.
|
void |
setRotation(double angle)
Rotates the map to the specified angle in degrees.
|
void |
setScale(double scaleFactor)
Sets the new scale of the view.
|
void |
setScaleValidator(ScaleValidator scaleValidator) |
void |
setVerbose(boolean verbose)
Sets the verbose mode for this view.
|
void |
setViewName(java.lang.String viewName)
Sets the view name.
|
protected void |
this_layerAddedEventOccurred(LayerAddedEvent e) |
protected void |
this_layerPosChangedEventOccurred(LayerPosChangedEvent e)
Handles layer position change events.
|
protected void |
this_layerPropertyChangedEvent(LayerPropertyChangedEvent e)
Handler for LayerPropertyChangedEvent events.
|
protected void |
this_layerReceivedDataEventOccurred(LayerReceivedDataEvent e)
Handles new data events.
|
protected void |
this_layerRefreshRequestEvent()
Handles layerRefreshrequestEvent Refreshes the layer
|
protected void |
this_layerRemovedEventOccurred(LayerRemovedEvent e) |
protected void |
this_layerStyleChangedEventOccurred(LayerStyleChangedEvent e)
Handles layer style change events.
|
protected void |
this_mouseClicked(java.awt.event.MouseEvent e)
Event handler for mouse click events.
|
protected void |
this_mouseDragged(java.awt.event.MouseEvent e)
Event handler for mouse drag events.
|
protected void |
this_mouseEntered(java.awt.event.MouseEvent e) |
protected void |
this_mouseExited(java.awt.event.MouseEvent e) |
protected void |
this_mouseMoved(java.awt.event.MouseEvent e)
Event handler for mouse move events.
|
protected void |
this_mousePressed(java.awt.event.MouseEvent e)
Event handler for mouse down events.
|
protected void |
this_mouseReleased(java.awt.event.MouseEvent e)
Event handler for mouse up events.
|
void |
zoom(double factor)
Zooms by the specified factor and around the center of the view.
|
void |
zoom(double factor,
Point WCPt)
Zooms by the specified factor and around specified point.
|
void |
zoom(OrientedRectangle rect)
Zooms to the specified WC region (rect).
|
void |
zoom(Rectangle rect)
Zooms to the specified WC region (rect).
|
void |
zoomExtent()
Adjusts the view in order to display every element of every visible layer
managed by the associated LayerManager object.
|
void |
zoomToRect(OrientedRectangle rect)
Deprecated.
use zoom(OrientedRectangle) instead
|
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, paintBorder, paintChildren, paintComponent, 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, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String PROPERTY_VIEW_NAME
public static final java.lang.String PROPERTY_MAP_UNIT
public static final java.lang.String PROPERTY_DISTANCE_UNIT
public static final java.lang.String PROPERTY_DISPLAY_UNIT
public static final java.lang.String PROPERTY_MAP_ROTATION
public static final java.lang.String PROPERTY_MOUSEOVER_DISABLED
protected ViewRenderer renderer
protected GraphicsRef graphicsRef
protected java.awt.image.BufferedImage offImage
protected ViewOverlay viewOverlay
protected MouseOverManager mouseOverManager
protected javax.swing.JPopupMenu viewPopupMenu
protected Tool currentTool
protected OrientedRectangle panSmoothToRedrawRect
protected LayerAdapter layerAdapter
protected java.lang.String viewName
protected final ViewEventDispatcher eventDispatcher
public View(LayerManager layerMgr, ViewSettings settings)
layerMgr
- the associated LayerManagersettings
- the settings to be applied to the viewLayerManager
protected ViewEventDispatcher initEventDispatcher()
public void close()
protected boolean createOffImage()
public void paint(java.awt.Graphics g)
paint
in class javax.swing.JComponent
g
- the corresponding Graphic instancepublic void addPopupMenuItem(javax.swing.JMenuItem menuItem)
menuItem
- the JMenuItem to addpublic void addPopupMenuSeparator()
public Tool getCurrentTool()
public javax.swing.JMenuItem addPopupMenuAction(javax.swing.Action menuItemAction)
menuItemAction
- the action to addpublic void removePopupMenuItem(javax.swing.JMenuItem menuItem)
menuItem
- the menu item to removepublic void removePopupMenuAction(javax.swing.Action menuItemAction)
menuItemAction
- the action to removepublic MouseOverManager getMouseOverManager()
MouseOverManager
for this view.public void setBounds(int x, int y, int width, int height)
setBounds
in class java.awt.Component
x
- the new x-coordinate of this view.y
- the new y-coordinate of this view.width
- the new width
of this view.height
- the new height
of this view.Component.setBounds(int, int, int, int)
public ViewOverlay getViewOverlay()
protected void draw(K2DTransform t, OrientedRectangle wcRegion, int drawOptions)
protected void draw(K2DTransform t, OrientedRectangle wcRegion, Rectangle dcRegion, int drawOptions, boolean updateViewGraphics)
@Deprecated public void drawVolatileElement(K2DElement element, VectorLayer vectorLayer, java.awt.Graphics g)
element
- element that need to be drawn on the screenlayer
- the layer that contains the element.g
- graphics instance. Not used anymore.@Deprecated public void drawVolatileElements(K2DElement[] elements, VectorLayer vectorLayer, Rectangle userBoundingBoxDc, java.awt.Graphics g)
elements
- array of K2DElements elements that need to be drawn on the screenvectorLayer
- the layer that contains the array of elements.userBoundingBoxDc
- Additional region in DC which needs to be restored. Not used anymore.g
- graphics instance. Not used anymore.@Deprecated public void resetVolatileImageLastBounds()
@Deprecated public void drawVolatileElements(K2DElement[] elements, VectorLayer vectorLayer, java.awt.Graphics g)
elements
- array of K2DStyledElements elements that need to be drawn on the
screenvectorLayer
- the layer that contains the array of elements.g
- the graphics instance. Not used anymore.public void setCurrentTool(Tool tool)
tool
- the new current active tool of the viewpublic void dispatchEvent(JMapEvent event)
dispatchEvent
method is used to dispatch synchronously
JMap events to all registered listeners. The main use of the JMapEventDispatcher
interface is to dispatch events that were previously added to the JMap event queue.
ViewEvent
will be accepted by this method. Any other
JMap event types will cause the view to throw an exception.dispatchEvent
in interface JMapEventDispatcher
event
- the event to be dispatched.java.lang.IllegalArgumentException
- will be thrown if the JMapEvent
instance
is no an instance of the ViewEvent
class.JMapEventQueue.push(JMapEvent, JMapEventDispatcher)
protected void firePopupMenuShowingEvent(java.awt.event.MouseEvent mouseEvent)
protected void this_mousePressed(java.awt.event.MouseEvent e)
e
- the mouse event.protected void this_mouseReleased(java.awt.event.MouseEvent e)
e
- the mouse event.protected void this_mouseMoved(java.awt.event.MouseEvent e)
e
- the mouse event.protected void this_mouseClicked(java.awt.event.MouseEvent e)
e
- the mouse event.protected void this_mouseDragged(java.awt.event.MouseEvent e)
e
- the mouse event.public boolean isBusy()
protected void this_mouseEntered(java.awt.event.MouseEvent e)
protected void this_mouseExited(java.awt.event.MouseEvent e)
public boolean isMouseInside()
public void panSmooth(int xDC, int yDC)
xDC
- the translation in x expressed in DC coordinatesyDC
- the translation in y expressed in DC coordinatespan(int xDC, int yDC)
public void panSmooth(int xDC, int yDC, boolean redrawLabels)
xDC
- the translation in x expressed in DC coordinatesyDC
- the translation in y expressed in DC coordinatesredrawLabels
- if this should also redraw the labelspan(int xDC, int yDC)
public void redraw(OrientedRectangle wcRegion)
wcRegion
- the region to redraw.public void redraw(OrientedRectangle WCRegion, int drawOptions)
WCRegion
- the region to redraw.drawOptions
- a bit field value that specifies what to draw.for available draw options constants.
public void redraw(OrientedRectangle WCRegion, int drawOptions, boolean stopDrawing)
WCRegion
- the region to redraw.drawOptions
- a bit field value that specifies what to draw.stopDrawing
- defines whether or not the drawing thread should be stopped
drawing before redrawing the view. However, this flag has not
effect on a synchronized redraw.for available draw options constants.
public void redraw(OrientedRectangle wcRegion, int drawOptions, boolean stopDrawing, boolean updateViewGraphics)
wcRegion
- the region to redraw.drawOptions
- a bit field value that specifies what to draw.stopDrawing
- defines whether or not the drawing thread should be stopped
drawing before redrawing the view. However, this flag has not
effect on a synchronized redraw.updateViewGraphics
- defines whether or not the redraw should update the view graphics
(false will only affect the offImage)public void refresh()
public void setLayerManager(LayerManager layerMgr)
layerMgr
- public void setViewName(java.lang.String viewName)
null
.
A PropertyChangeEvent event is fired (propertyName : PROPERTY_VIEW_NAME).viewName
- the new name for this viewPropertyChangeEvent
public java.lang.String getViewName()
public void setRefreshable(boolean refreshable)
refreshable
- a boolean value that specifies whether or not the view is
refreshable.protected void this_layerRefreshRequestEvent()
protected void this_layerAddedEventOccurred(LayerAddedEvent e)
protected void this_layerRemovedEventOccurred(LayerRemovedEvent e)
protected void this_layerStyleChangedEventOccurred(LayerStyleChangedEvent e)
e
- the corresponding LayerStyleChangedEventprotected void this_layerPosChangedEventOccurred(LayerPosChangedEvent e)
e
- protected void this_layerReceivedDataEventOccurred(LayerReceivedDataEvent e)
e
- the corresponding new data eventprotected void this_layerPropertyChangedEvent(LayerPropertyChangedEvent e)
e
- the received event.public GraphicsRef getViewGraphicsRef()
public ViewRenderer getRenderer()
protected void fireViewRedrawOccurredEvent(ViewState viewState)
viewState
- parameters used to redraw the view.protected void fireViewRepaintOccurredEvent(java.awt.Graphics g)
g
- the graphics instance used to paint the view.public void addStaticElement(ViewStaticElement staticElem)
staticElem
- the static element to be addedViewStaticImage
@Deprecated public void addStaticImage(java.awt.Image im, java.awt.Point pt, int relativeTo)
im
- the imagept
- the position of the image relative to the specified cornerrelativeTo
- a constant from KStaticImage class used to specify the corner near
which the image will be drawnViewStaticImage
public void addViewEventListener(ViewEventListener listener)
listener
- the event listener to addpublic void removeViewEventListener(ViewEventListener listener)
listener
- the event listener to removepublic void applySettings(ViewSettings settings)
settings
- the ViewSettings instance containing the settingsViewSettings
public void drawStaticElements(GraphicsRef gr, K2DTransform t, Rectangle viewBounds)
gr
- the graphics instance wrapper to use.t
- the view transformation matrix.viewBounds
- the view bounds to draw.public void fireViewChanged()
public Point getCenterOfView()
public Rectangle getDCViewBounds()
public JMapUnit getDisplayUnit()
public JMapUnit getDistanceUnit()
public GraphicsManager getGraphicsManager()
public OrientedRectangle getInitialViewBounds()
public LayerManager getLayerManager()
public Projection getMapProjection()
public Projection getMeasurementProjection()
public JMapUnit getMapUnit()
public OrientedRectangle getMaxViewBounds()
public double getRotation()
public double getScaleFactor()
public double getScaleFactor(double dcScale)
dcScale
- the ratio between DC and WC coordinates.public ViewStaticElement[] getStaticElements()
public K2DTransform getTransform()
public boolean getVerbose()
public ViewSettings getViewSettings()
public ViewState getViewState()
public OrientedRectangle getWCViewBounds()
public double getZoomLevel()
public boolean isRefreshable()
public void moveTo(Point coord)
coord
- the new center WC coordinate of the viewpublic void moveTo(double x, double y)
x
- the new x valuey
- the new y valuepublic void pan(int xdc, int ydc)
xdc
- the translation in x expressed in DC coordinatesydc
- the translation in y expressed in DC coordinatespublic void removeStaticElement(ViewStaticElement staticElem)
staticElem
- the static element to be removedViewStaticImage
public void setDisplayUnit(JMapUnit unit)
unit
- the main display unit to use on this viewPropertyChangeEvent
public void setDistanceUnit(JMapUnit unit)
unit
- the distance unit to use on this viewPropertyChangeEvent
public void setInitialViewBounds(OrientedRectangle initialViewBounds)
initialViewBounds
- The initial view bounds.public void setMapUnit(JMapUnit unit)
unit
- the corresponding JMapUnit instance.PropertyChangeEvent
public void setMaxViewBounds(OrientedRectangle maxBounds)
maxBounds
- public void setMaximumScale(double scale)
scale
- the maximum scalepublic void setRotation(double angle)
angle
- the absolute angle in degrees (0 means north is straight up)PropertyChangeEvent
public void setVerbose(boolean verbose)
verbose
- The verbose modepublic void zoom(double factor, Point WCPt)
factor
- the zooming factorWCPt
- the center of the zoom operation in WCpublic void zoom(double factor)
factor
- the zooming factorpublic void zoom(Rectangle rect)
rect
- the WC region to zoom to.public void zoom(OrientedRectangle rect)
rect
- the WC region to zoom to.public void zoomExtent()
public void setScale(double scaleFactor)
scaleFactor
- the scale denominator (pass 1000 for a scale of 1 : 1000)public boolean moveBackward()
public boolean moveForward()
@Deprecated public void zoomToRect(OrientedRectangle rect)
rect
- the region to zoom to.public long addMarker(Point coord, java.lang.String text, Style markerStyle)
coord
- The coordinate of the markertext
- (Optional) the text of this marker, null if nonemarkerStyle
- (Optional) the style of this marker, null if nonepublic void removeMarker(long markerId)
markerId
- the id of the marker to removepublic void clearMarkers()
public void setScaleValidator(ScaleValidator scaleValidator)
public ScaleValidator getScaleValidator()
public void setLayerRefreshManagerView(LayerViewRefreshManager dynamicLayerManager)