public class StateRenderer2D extends javax.swing.JPanel implements PropertiesProvider, Renderer, MapChangeListener, java.awt.event.MouseWheelListener, java.awt.event.MouseMotionListener, java.awt.event.MouseListener, java.awt.event.KeyListener, PreferencesListener, ILayerPainter, CustomInteractionSupport, IMapPopup, java.awt.event.FocusListener
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected StateRendererInteraction |
activeInteraction |
protected boolean |
antialiasing |
protected static java.awt.geom.GeneralPath |
arrow |
protected java.awt.image.BufferedImage |
cache |
protected java.util.Vector<javax.swing.event.ChangeListener> |
changeListeners |
protected java.util.LinkedList<MapClickListener> |
clickListeners |
protected int |
countCache |
static java.awt.Cursor |
crosshairCursor |
protected CursorLocationPainter |
cursorPainter |
static float |
DEFAULT_ZOOM |
protected java.text.NumberFormat |
df |
static java.awt.Cursor |
drawCursor |
protected java.lang.String |
editingMap |
protected double |
fixedVehicleWidth |
protected boolean |
forceRepaint |
static java.awt.Cursor |
grab2Cursor |
static java.awt.Cursor |
grabCursor |
protected java.awt.Color |
gridColor |
protected boolean |
gridShown |
protected double |
gridSize |
protected MarkElement |
homeRef |
protected java.awt.geom.AffineTransform |
identity |
protected boolean |
ignoreRightClicks |
protected java.util.Vector<StateRendererInteraction> |
interactions |
protected boolean |
isAllTailOn |
protected double |
lastAngle |
protected int |
lastClickedButton |
protected java.awt.geom.Point2D |
lastDragPoint |
protected MapChangeEvent |
lastMapChangeEvent |
protected long |
lastPaintTime |
protected MapLegend |
legend |
protected boolean |
legendShown |
protected java.lang.String |
lockedVehicle |
static int |
MAP_MOVES |
protected boolean |
mapCenterShown |
protected boolean |
mapDragEnable |
protected MapGroup |
mapGroup |
protected int |
minDelay |
protected int |
numberOfShownPoints |
protected PaintersBag |
painters |
protected java.util.Vector<RightMouseClickListener> |
rightClickListeners |
static java.awt.Cursor |
rotateCursor |
protected double |
rotationRads |
protected java.awt.geom.Point2D |
rulerFirstPoint |
protected java.awt.geom.Point2D |
rulerLastPoint |
protected TransponderSecurityArea |
securityArea |
protected int |
show_mode |
protected boolean |
showDots |
protected boolean |
showProperties |
protected boolean |
shuttingDown |
protected boolean |
smoothResizing |
static java.awt.Cursor |
translateCursor |
protected java.awt.geom.GeneralPath |
triangle |
static int |
VEHICLE_MOVES |
protected java.util.Hashtable<java.lang.String,java.awt.Image> |
vehicleImages |
protected boolean |
vehicleImageShown |
protected java.lang.String[] |
vehicles |
protected java.util.HashSet<java.lang.String> |
vehiclesTailOn |
protected java.util.Hashtable<java.lang.String,SystemPositionAndAttitude> |
vehicleStates |
protected java.util.Hashtable<java.lang.String,VehicleTailElement> |
vehicleTails |
protected boolean |
worldBondariesShown |
protected WorldRenderPainter |
worldMapPainter |
protected boolean |
worldMapShown |
protected java.lang.String |
worldMapStyle |
java.awt.geom.Point2D |
worldPixelXY |
static java.awt.Cursor |
zoomCursor |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
GRAB, NONE, ROTATION, RULER, TRANSLATION, vehicleColors, ZOOM
Constructor and Description |
---|
StateRenderer2D()
Empty class constructor - creates a new renderer panel with empty map.
|
StateRenderer2D(LocationType center)
Similar to the empty constructor but creates a map centered at the given position.
|
StateRenderer2D(MapGroup mapGroup)
Creates a new instance with the given map loaded
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(javax.swing.event.ChangeListener cl)
Add a listener to this renderer.
|
void |
addInteraction(StateRendererInteraction interaction)
Add a new form of interaction with the renderer
|
void |
addMapClickListener(MapClickListener newListener)
Adds a new MapClickListener to the current list of listeners MapClickListeners will receive all the map click
events
|
boolean |
addMenuExtension(IEditorMenuExtension extension) |
void |
addMouseListener(java.awt.event.MouseListener l)
Adds the given mouse listener as listener for this component
|
boolean |
addPostRenderPainter(Renderer2DPainter painter,
java.lang.String name)
Add a new overlay to this renderer
|
void |
addPreRenderPainter(Renderer2DPainter painter)
Add an overlay that will be painted before the map
|
void |
addRightMouseClickListener(RightMouseClickListener listener)
Add a listener to the set of objects that will be warned whenever there is a right click in the renderer
|
void |
cleanup()
Perform cleanup tasks
|
void |
clearVehicleTail(java.lang.String[] vehicles)
Clear the tail of the given vehicles
|
void |
drawGrid(java.awt.Graphics2D g,
double cellSize) |
void |
focusGained(java.awt.event.FocusEvent e) |
void |
focusLocation(LocationType location)
Recenters the map, presenting the given location at the exact center of the Renderer
|
void |
focusLost(java.awt.event.FocusEvent e) |
void |
focusObject(AbstractElement mo)
Recenters the map to the central point of the given MapObject
|
void |
followVehicle(java.lang.String systemId)
Sets the currently locked vehicle
|
void |
forceRepaint() |
StateRendererInteraction |
getActiveInteraction()
Retrieve the currently active interaction for this renderer
|
LocationType |
getBottomRightLocationType()
Retrieve real-world location that matches the bottom-right pixel of this Renderer
|
LocationType |
getCenter()
Retrieve a real-world location that is the center of the currently visible view
|
java.lang.String |
getEditingMap() |
AbstractElement |
getFirstInterceptedObject(java.awt.geom.Point2D screenPoint)
This method verifies if any object is intercepted by the given xy coordinates It is very useful for verifying if
a click on the map was over an object.
|
java.awt.Color |
getGridColor()
Retrieve the color of the grid
|
double |
getGridSize()
Retrieve the current grid cell width
|
java.util.Collection<StateRendererInteraction> |
getInteractionModes()
Retrieve a list of all available interactions
|
java.awt.geom.Point2D |
getLastDragPoint() |
int |
getLevelOfDetail() |
java.lang.String |
getLockedVehicle()
Retrieve the currently locked vehicle
|
MapGroup |
getMapGroup()
Gets the currently loaded maps
|
double |
getMapScale()
Gets Map Scale at screen resolution of screen DPIs using
#getScreenResolution() |
java.util.Collection<IEditorMenuExtension> |
getMenuExtensions() |
int |
getMinDelay() |
java.awt.Dimension |
getPreferredSize()
Return the preferred size for this component
|
com.l2fprod.common.propertysheet.DefaultProperty[] |
getProperties()
PropertiesProvider implementation. |
java.lang.String |
getPropertiesDialogTitle()
PropertiesProvider implementation. |
java.lang.String[] |
getPropertiesErrors(com.l2fprod.common.propertysheet.Property[] properties)
PropertiesProvider implementation. |
LocationType |
getRandomVisibleLocationType()
Retrieve a random location that is visible in this Renderer
|
LocationType |
getRealWorldLocation(java.awt.geom.Point2D screenCoordinates)
Given a point on the screen, returns its real world coordinates
|
double |
getRealXCoord(int screenX)
Translates a screen coordinate into ned from Guinea (0,0)
|
double |
getRealYCoord(int screenY)
Translates a screen coordinate into ned from Guinea (0,0)
|
StateRenderer2D |
getRenderer() |
protected java.lang.Thread |
getRenderer2dUpdaterThread(int millisBetweenUpdates)
Creates a retrieves a Thread that updates the Renderer periodically.
|
double |
getRotation() |
java.awt.geom.Point2D |
getScreenPosition(LocationType lt)
Similar to
#getLocationOnScreen(LocationType) but always returns a value, even if it is not currently
visible |
int |
getShowMode()
Retrieve the currently active show mode (vehicle lock).
|
LocationType |
getTopLeftLocationType()
Retrieve real-world location that matches the top-left pixel of this Renderer
|
LocationType |
getVehicleLocation(java.lang.String vehicle) |
java.lang.String[] |
getVehiclesInRender() |
SystemPositionAndAttitude |
getVehicleState(java.lang.String vehicle) |
int |
getViewMode()
Returns the current view mode
|
WorldRenderPainter |
getWorldMapPainter() |
java.lang.String |
getWorldMapStyle() |
float |
getZoom()
Retrieve current zoom
|
protected void |
init()
Default initializations and adding default layers
|
boolean |
isAntialiasing() |
boolean |
isGridShown()
Verifies if the grid is currently being drawn on screen
|
boolean |
isLegendShown()
Verifies if the legent is currently being shown
|
boolean |
isMapCenterShown() |
boolean |
isMapDragEnable() |
boolean |
isShowWorldMapOnScreen() |
boolean |
isShowWorldMapOnScreenControls() |
boolean |
isSmoothResizing() |
boolean |
isVehicleImageShown() |
boolean |
isWorldBondariesShown() |
boolean |
isWorldMapShown() |
void |
keyPressed(java.awt.event.KeyEvent keyEvt)
KeyListener implementation. |
void |
keyReleased(java.awt.event.KeyEvent keyEvt)
KeyListener implementation. |
void |
keyTyped(java.awt.event.KeyEvent keyEvt)
KeyListener implementation. |
void |
mapChanged(MapChangeEvent mapChange)
Implementation of
MapChangeListener interface |
void |
mouseClicked(java.awt.event.MouseEvent e)
MouseListener implementation. |
void |
mouseDragged(java.awt.event.MouseEvent e)
MouseMotionListener implementation. |
void |
mouseEntered(java.awt.event.MouseEvent e)
MouseListener implementation. |
void |
mouseExited(java.awt.event.MouseEvent e)
MouseListener implementation. |
void |
mouseMoved(java.awt.event.MouseEvent e)
MouseMotionListener implementation. |
void |
mousePressed(java.awt.event.MouseEvent e)
MouseListener implementation. |
void |
mouseReleased(java.awt.event.MouseEvent e)
MouseListener implementation. |
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent arg0)
This method is called when the mouse wheel rotates, changing the current zoom
|
protected void |
paintComponent(java.awt.Graphics g) |
void |
painterSelection()
Show a dialog where the user can select which layers to show
|
void |
preferencesUpdated() |
void |
removeChangeListener(javax.swing.event.ChangeListener cl)
Remove a listener from this renderer.
|
void |
removeInteraction(StateRendererInteraction interaction)
Remove the given interaction from this renderer
|
void |
removeMapClickListener(MapClickListener listener)
Removes the given MapClickListener object from the current active list
|
boolean |
removeMenuExtension(IEditorMenuExtension extension) |
void |
removePaintersOfType(java.lang.Class<?> clazz)
Remove any overlay that is an instance of the given class
|
boolean |
removePostRenderPainter(Renderer2DPainter painter)
Remove an overlay from this renderer
|
void |
removePreRenderPainter(Renderer2DPainter painter)
Remove the given overlay
|
void |
removeRightMouseClickListener(RightMouseClickListener listener)
Removes the lister.
|
void |
removeVehicle(VehicleType vehicle)
Removes the given vehicle from this Renderer's vehicle list
|
void |
resetView() |
void |
setActiveInteraction(StateRendererInteraction interaction)
Change the currently active interaction
|
void |
setAntialiasing(boolean antialiasing) |
void |
setCenter(LocationType center)
Translates the current view in order to have the given location at its center
NOTE: Don't use this method when you are translating the map (for this use the worldPixelXY ). |
void |
setEditingMap(java.lang.String editingMap)
Set the if of the map that is being edited
|
void |
setFixedVehicleWidth(double fixedVehicleWidth) |
void |
setGridColor(java.awt.Color gridColor)
Set the color of the grid
|
void |
setGridShown(boolean gridShown)
Sets the grid visibility
|
void |
setGridSize(double gridSize)
Change the grid cell width in meters
|
void |
setIgnoreRightClicks(boolean ignoreNextClick)
If set to true, right-click menus won't be shown
|
void |
setLegendShown(boolean legendShown)
Set the visibility for the legent overlay
|
int |
setLevelOfDetail(int levelOfDetail) |
void |
setLockedVehicle(java.lang.String lockedVehicle)
Change the currently locked vehicle
|
void |
setMap(MapType map)
Sets the world map
|
void |
setMapCenterShow(boolean mapCenterShown) |
void |
setMapDragEnable(boolean mapDragEnable) |
void |
setMapGroup(MapGroup mapGroup)
Set the map to be displayed in this renderer
|
void |
setMinDelay(int minDelay) |
void |
setPainterActive(java.lang.String painterName,
boolean active) |
void |
setProperties(com.l2fprod.common.propertysheet.Property[] properties)
PropertiesProvider implementation. |
void |
setRotation(double rotationAngle) |
void |
setShowWorldMapOnScreen(boolean showOnScreen) |
void |
setShowWorldMapOnScreenControls(boolean showOnScreenControls) |
void |
setSmoothResizing(boolean smoothResizing) |
void |
setVehicleImageShown(boolean vehicleImageShown) |
void |
setVehicleTailOff(java.lang.String[] vehicles)
Stop showing the tails of the given vehicles
|
void |
setVehicleTailOn(java.lang.String[] vehicles)
Start showing the tails of the given vehicles
|
void |
setViewMode(int mode)
Deprecated.
|
void |
setWorldBondariesShown(boolean worldBondariesShown) |
void |
setWorldMapShown(boolean worldMapShown) |
void |
setWorldMapStyle(java.lang.String worldMapStyle) |
float |
setZoom(float newZoom)
Changes the current world zoom
|
void |
showAllMap()
Resizes the current view in order to show all objects in the map
|
void |
update(java.awt.Graphics2D g2d,
boolean force)
Whenever the component is painted, its graphics are updated to the current vehicle state.
|
void |
vehicleStateChanged(java.lang.String systemId,
SystemPositionAndAttitude state)
Implementation of
VehicleStateListener that will repaint the renderer when vehicles are updated |
void |
vehicleStateChanged(java.lang.String systemId,
SystemPositionAndAttitude state,
boolean repaint)
Similar to
#vehicleStateChanged(VehicleType, SystemPositionAndAttitude) but the caller has a choice
of whether to repaint the renderer |
void |
zoomIn() |
void |
zoomInOut(boolean inOrOut,
double localRenderX,
double localRenderY) |
void |
zoomOut() |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, 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
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, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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 static final int MAP_MOVES
public static final int VEHICLE_MOVES
public static final float DEFAULT_ZOOM
public static java.awt.Cursor rotateCursor
public static java.awt.Cursor translateCursor
public static java.awt.Cursor zoomCursor
public static java.awt.Cursor grabCursor
public static java.awt.Cursor grab2Cursor
public static java.awt.Cursor crosshairCursor
public static java.awt.Cursor drawCursor
protected java.awt.geom.AffineTransform identity
public final java.awt.geom.Point2D worldPixelXY
protected double rotationRads
protected double gridSize
protected double fixedVehicleWidth
protected int show_mode
protected int lastClickedButton
protected java.util.LinkedList<MapClickListener> clickListeners
protected java.util.Hashtable<java.lang.String,SystemPositionAndAttitude> vehicleStates
protected java.lang.String[] vehicles
protected java.util.Hashtable<java.lang.String,java.awt.Image> vehicleImages
protected java.util.Hashtable<java.lang.String,VehicleTailElement> vehicleTails
protected java.util.HashSet<java.lang.String> vehiclesTailOn
protected boolean worldMapShown
protected boolean worldBondariesShown
protected java.lang.String worldMapStyle
protected boolean gridShown
protected boolean showDots
protected boolean legendShown
protected boolean vehicleImageShown
protected boolean mapCenterShown
protected boolean mapDragEnable
protected boolean isAllTailOn
protected int numberOfShownPoints
protected java.awt.geom.Point2D lastDragPoint
protected java.awt.geom.Point2D rulerFirstPoint
protected java.awt.geom.Point2D rulerLastPoint
protected MarkElement homeRef
protected MapLegend legend
protected CursorLocationPainter cursorPainter
protected final java.text.NumberFormat df
protected MapChangeEvent lastMapChangeEvent
protected java.awt.Color gridColor
protected MapGroup mapGroup
protected int countCache
protected static java.awt.geom.GeneralPath arrow
protected WorldRenderPainter worldMapPainter
protected java.lang.String lockedVehicle
protected TransponderSecurityArea securityArea
protected PaintersBag painters
protected boolean ignoreRightClicks
protected boolean showProperties
protected int minDelay
protected java.lang.String editingMap
protected java.util.Vector<RightMouseClickListener> rightClickListeners
protected java.awt.geom.GeneralPath triangle
protected java.util.Vector<javax.swing.event.ChangeListener> changeListeners
protected boolean smoothResizing
protected boolean antialiasing
protected java.util.Vector<StateRendererInteraction> interactions
protected StateRendererInteraction activeInteraction
protected long lastPaintTime
protected java.awt.image.BufferedImage cache
protected boolean forceRepaint
protected double lastAngle
protected boolean shuttingDown
public StateRenderer2D()
public StateRenderer2D(LocationType center)
center
- The location to be the center of this rendererpublic StateRenderer2D(MapGroup mapGroup)
mapGroup
- The map to be loaded in this Rendererprotected void init()
public boolean isShowWorldMapOnScreen()
public void setShowWorldMapOnScreen(boolean showOnScreen)
public boolean isShowWorldMapOnScreenControls()
public void setShowWorldMapOnScreenControls(boolean showOnScreenControls)
showOnScreenControls
- the showOnScreenControls to setprotected java.lang.Thread getRenderer2dUpdaterThread(int millisBetweenUpdates)
shuttingDown
to true to stop
the thread.millisBetweenUpdates
- Time, in milliseconds between updates (repaint)public LocationType getTopLeftLocationType()
public LocationType getBottomRightLocationType()
public LocationType getRandomVisibleLocationType()
public java.awt.geom.Point2D getScreenPosition(LocationType lt)
#getLocationOnScreen(LocationType)
but always returns a value, even if it is not currently
visiblelt
- The location to be transformed into renderer coordinatespublic void setFixedVehicleWidth(double fixedVehicleWidth)
fixedVehicleWidth
- the fixedVehicleWidth to setpublic void mapChanged(MapChangeEvent mapChange)
MapChangeListener
interfacemapChanged
in interface MapChangeListener
public void setMapGroup(MapGroup mapGroup)
setMapGroup
in interface Renderer
mapGroup
- The map to be renderedpublic void showAllMap()
public MapGroup getMapGroup()
Renderer
getMapGroup
in interface Renderer
MapGroup
currently being renderedpublic void vehicleStateChanged(java.lang.String systemId, SystemPositionAndAttitude state, boolean repaint)
#vehicleStateChanged(VehicleType, SystemPositionAndAttitude)
but the caller has a choice
of whether to repaint the renderersystemId
- The vehicle that has an updated statestate
- The new state for the the vehiclerepaint
- Whether to repaint the rendererpublic void vehicleStateChanged(java.lang.String systemId, SystemPositionAndAttitude state)
VehicleStateListener
that will repaint the renderer when vehicles are updatedvehicleStateChanged
in interface Renderer
systemId
- The vehicle whose statepublic void removeVehicle(VehicleType vehicle)
vehicle
- The vehicle to be removed from this Rendererpublic void mouseWheelMoved(java.awt.event.MouseWheelEvent arg0)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
arg0
- The MouseWheelEvent
generated by Swingpublic int getLevelOfDetail()
public int setLevelOfDetail(int levelOfDetail)
levelOfDetail
- the levelOfDetail to setpublic void zoomIn()
public void zoomOut()
public void zoomInOut(boolean inOrOut, double localRenderX, double localRenderY)
public void resetView()
public float getZoom()
public float setZoom(float newZoom)
public double getMapScale()
#getScreenResolution()
public void setMap(MapType map)
public void forceRepaint()
protected void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public void addMapClickListener(MapClickListener newListener)
newListener
- A class implementing the MapClickListener interfacepublic void removeMapClickListener(MapClickListener listener)
listener
- The MapClickListener to be removedpublic boolean isVehicleImageShown()
public void setVehicleImageShown(boolean vehicleImageShown)
vehicleImageShown
- the vehicleImageShown to setpublic boolean isMapCenterShown()
public void setMapCenterShow(boolean mapCenterShown)
mapCenterShown
- the mapCenterShown to setpublic boolean isMapDragEnable()
public void setMapDragEnable(boolean mapDragEnable)
mapDragEnable
- the mapDragEnable to setpublic void update(java.awt.Graphics2D g2d, boolean force)
public void mouseDragged(java.awt.event.MouseEvent e)
MouseMotionListener
implementation. Used to translate / rotate / zoom the mapmouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent e)
MouseMotionListener
implementation. Used to update the ruler position or mouse location.mouseMoved
in interface java.awt.event.MouseMotionListener
public void addRightMouseClickListener(RightMouseClickListener listener)
listener
- The listener to be addedpublic void removeRightMouseClickListener(RightMouseClickListener listener)
addRightMouseClickListener(RightMouseClickListener)
listener
- The listener to be removedpublic void mouseClicked(java.awt.event.MouseEvent e)
MouseListener
implementation. Used to display right-click popup menumouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
MouseListener
implementation. Currently empty.mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
MouseListener
implementation. Currently empty.mouseExited
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
MouseListener
implementation. Used for interacting with renderer, according to current modemousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
MouseListener
implementation. Used for interacting with renderer, according to current modemouseReleased
in interface java.awt.event.MouseListener
public void focusGained(java.awt.event.FocusEvent e)
focusGained
in interface java.awt.event.FocusListener
public void focusLost(java.awt.event.FocusEvent e)
focusLost
in interface java.awt.event.FocusListener
public double getRealXCoord(int screenX)
screenX
- The x-axis coordinate of a screen pixelpublic double getRealYCoord(int screenY)
screenY
- The y-axis coordinate of a screen pixelpublic LocationType getRealWorldLocation(java.awt.geom.Point2D screenCoordinates)
screenCoordinates
- A point on screenpublic void focusLocation(LocationType location)
focusLocation
in interface Renderer
location
- the location to focuspublic void focusObject(AbstractElement mo)
focusObject
in interface Renderer
mo
- The map object that will appear in the center of the Rendererpublic int getViewMode()
public int getMinDelay()
public void setMinDelay(int minDelay)
minDelay
- the minDelay to setpublic void followVehicle(java.lang.String systemId)
followVehicle
in interface Renderer
public void addChangeListener(javax.swing.event.ChangeListener cl)
Renderer
.addChangeListener
in interface Renderer
public void removeChangeListener(javax.swing.event.ChangeListener cl)
Renderer
removeChangeListener
in interface Renderer
public int getShowMode()
getShowMode
in interface Renderer
public boolean isLegendShown()
public void setLegendShown(boolean legendShown)
public boolean isWorldMapShown()
public void setWorldMapShown(boolean worldMapShown)
worldMapShown
- the worldMapShown to setpublic boolean isWorldBondariesShown()
public void setWorldBondariesShown(boolean worldBondariesShown)
worldBondariesShown
- the worldBondariesShown to setpublic java.lang.String getWorldMapStyle()
public void setWorldMapStyle(java.lang.String worldMapStyle)
worldMapStyle
- the worldMapStyle to setpublic LocationType getCenter()
public void setCenter(LocationType center)
worldPixelXY
).center
- The new centerpublic void drawGrid(java.awt.Graphics2D g, double cellSize)
g
- Draws a grid overlaycellSize
- The width of each grid cell, in meterspublic boolean isGridShown()
public void setGridShown(boolean gridShown)
public double getGridSize()
public void setGridSize(double gridSize)
public java.awt.Color getGridColor()
public void setGridColor(java.awt.Color gridColor)
public java.lang.String getLockedVehicle()
getLockedVehicle
in interface Renderer
public void setLockedVehicle(java.lang.String lockedVehicle)
lockedVehicle
- The vehicle to be lockedpublic void keyPressed(java.awt.event.KeyEvent keyEvt)
KeyListener
implementation. Monitors key presses for changing the current viewkeyPressed
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent keyEvt)
KeyListener
implementation. Currently empty.keyReleased
in interface java.awt.event.KeyListener
public void keyTyped(java.awt.event.KeyEvent keyEvt)
KeyListener
implementation. Currently empty.keyTyped
in interface java.awt.event.KeyListener
public com.l2fprod.common.propertysheet.DefaultProperty[] getProperties()
PropertiesProvider
implementation.getProperties
in interface PropertiesProvider
public java.lang.String getPropertiesDialogTitle()
PropertiesProvider
implementation.getPropertiesDialogTitle
in interface PropertiesProvider
public void setProperties(com.l2fprod.common.propertysheet.Property[] properties)
PropertiesProvider
implementation.setProperties
in interface PropertiesProvider
public java.lang.String[] getPropertiesErrors(com.l2fprod.common.propertysheet.Property[] properties)
PropertiesProvider
implementation.getPropertiesErrors
in interface PropertiesProvider
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public boolean addPostRenderPainter(Renderer2DPainter painter, java.lang.String name)
addPostRenderPainter
in interface ILayerPainter
public boolean removePostRenderPainter(Renderer2DPainter painter)
removePostRenderPainter
in interface ILayerPainter
public void addPreRenderPainter(Renderer2DPainter painter)
addPreRenderPainter
in interface ILayerPainter
public void removePreRenderPainter(Renderer2DPainter painter)
removePreRenderPainter
in interface ILayerPainter
public void removePaintersOfType(java.lang.Class<?> clazz)
clazz
- A classpublic void setPainterActive(java.lang.String painterName, boolean active)
public void addMouseListener(java.awt.event.MouseListener l)
addMouseListener
in class java.awt.Component
public void setIgnoreRightClicks(boolean ignoreNextClick)
public double getRotation()
public void setRotation(double rotationAngle)
rotationAngle
- the rotationAngle to be set on the renderer, in radianspublic AbstractElement getFirstInterceptedObject(java.awt.geom.Point2D screenPoint)
screenPoint
- The point in the screen to test for possible interceptionspublic java.lang.String getEditingMap()
public void setEditingMap(java.lang.String editingMap)
editingMap
- The id of the map that is being editedpublic void clearVehicleTail(java.lang.String[] vehicles)
clearVehicleTail
in interface Renderer
An
- array of vehicles whose tails should be clearedpublic void setVehicleTailOff(java.lang.String[] vehicles)
setVehicleTailOff
in interface Renderer
An
- array of vehicles whose tails should not be displayedpublic void setVehicleTailOn(java.lang.String[] vehicles)
setVehicleTailOn
in interface Renderer
An
- array of vehicles whose tails should be displayedpublic void preferencesUpdated()
preferencesUpdated
in interface PreferencesListener
PreferencesListener.preferencesUpdated()
public boolean isSmoothResizing()
public void setSmoothResizing(boolean smoothResizing)
smoothResizing
- the smoothResizing to setpublic boolean isAntialiasing()
public void setAntialiasing(boolean antialiasing)
antialiasing
- the antialiasing to setpublic LocationType getVehicleLocation(java.lang.String vehicle)
public SystemPositionAndAttitude getVehicleState(java.lang.String vehicle)
public java.lang.String[] getVehiclesInRender()
public void addInteraction(StateRendererInteraction interaction)
addInteraction
in interface CustomInteractionSupport
public void removeInteraction(StateRendererInteraction interaction)
removeInteraction
in interface CustomInteractionSupport
@Deprecated public void setViewMode(int mode)
Renderer
setViewMode
in interface Renderer
public void setActiveInteraction(StateRendererInteraction interaction)
setActiveInteraction
in interface CustomInteractionSupport
public StateRendererInteraction getActiveInteraction()
getActiveInteraction
in interface CustomInteractionSupport
public final java.util.Collection<StateRendererInteraction> getInteractionModes()
getInteractionModes
in interface CustomInteractionSupport
public java.awt.geom.Point2D getLastDragPoint()
public void painterSelection()
public boolean addMenuExtension(IEditorMenuExtension extension)
addMenuExtension
in interface IMapPopup
public final java.util.Collection<IEditorMenuExtension> getMenuExtensions()
getMenuExtensions
in interface IMapPopup
public boolean removeMenuExtension(IEditorMenuExtension extension)
removeMenuExtension
in interface IMapPopup
public StateRenderer2D getRenderer()
getRenderer
in interface IMapPopup
public WorldRenderPainter getWorldMapPainter()
Copyright © 2004-2014 FEUP-LSTS and Neptus developers. All Rights Reserved.