|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel org.free.garminimg.swing.MapPanel<COORD>
public class MapPanel<COORD>
A swing panel displaying a map.
MapControlPanel
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static java.awt.Color |
BG_COLOR
|
static java.awt.Color |
LABEL_BACKGROUND
|
static java.awt.Color |
LABEL_COLOR
|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
MapPanel(ImgFilesBag map,
MapTransformer<COORD> transformer)
Create a dependent MapPanel, with its converter and maps provided from outside. |
|
MapPanel(MapTransformer.Converter<COORD> converter,
int margin)
Create a stand-alone MapPanel, with its own converter and its own maps. |
Method Summary | |
---|---|
void |
addMapLocation(java.io.File location)
|
void |
clearMaps()
|
void |
componentResized()
|
TransformedMapListener |
createMapDrawer(MapConfig workConfig,
java.awt.Graphics2D g2,
float fontSize,
MapTransformer<COORD> workTransformer)
Create a map drawer. |
java.lang.String |
getInfo(int x,
int y,
int maxNbInfo)
|
ImgFilesBag |
getMap()
|
int |
getResolution(int minLon,
int maxLon)
|
static int |
getResolution(int minLon,
int maxLon,
int width)
|
int |
getResolution(MapTransformer<COORD> transformer)
|
MapTransformer<COORD> |
getTransformer()
|
void |
hideInfo()
|
void |
movePosition(double deltaX,
double deltaY)
|
void |
paintComponent(java.awt.Graphics g)
|
void |
saveMapAs(java.io.File selectedFile,
FileExporter exporter,
MapTransformer<COORD> transformer)
|
void |
setDetailLevel(int detailLevel)
|
void |
setPoiThreshold(int threshold)
|
void |
setPosition(double minLon,
double maxLon,
double minLat,
double maxLat)
|
void |
setQuality(MapConfig.Quality quality)
Does not trigger a repaint... |
void |
setShading(boolean enabled)
|
void |
setShowLineLabel(boolean showLineLabel)
|
void |
setShowPointLabel(boolean showPointLabel)
|
void |
setShowPolygonLabel(boolean showPolygonLabel)
|
void |
showAllMap()
Zoom and position the map in order to see everything. |
void |
showInfo(int x,
int y,
int maxNbInfo)
|
protected void |
showInfoPopup(java.lang.String info,
int x,
int y)
|
protected void |
transformerChanged()
|
void |
transformerChangedManually()
If an external class changed manually the transformer, it must call this method to make the change effective. |
void |
zoom(double factor)
|
void |
zoom(double factor,
int x,
int y)
If factor>1 zoom in, otherwise zoom out. |
void |
zoomToGarminGeo(double factor,
int longitude,
int latitude)
|
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, 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 |
Methods inherited from class java.awt.Container |
---|
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, transferFocusBackward, transferFocusDownCycle, 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, 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, hide, 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, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.awt.Color BG_COLOR
public static final java.awt.Color LABEL_COLOR
public static final java.awt.Color LABEL_BACKGROUND
Constructor Detail |
---|
public MapPanel(MapTransformer.Converter<COORD> converter, int margin)
public MapPanel(ImgFilesBag map, MapTransformer<COORD> transformer)
Method Detail |
---|
public void componentResized()
protected void transformerChanged()
public void transformerChangedManually()
public void addMapLocation(java.io.File location) throws java.io.IOException
java.io.IOException
public void clearMaps() throws java.io.IOException
java.io.IOException
public void setPosition(double minLon, double maxLon, double minLat, double maxLat)
public void movePosition(double deltaX, double deltaY)
public void zoom(double factor, int x, int y)
public void zoom(double factor)
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public java.lang.String getInfo(int x, int y, int maxNbInfo)
public MapTransformer<COORD> getTransformer()
public void showAllMap()
public void setQuality(MapConfig.Quality quality)
public void showInfo(int x, int y, int maxNbInfo)
protected void showInfoPopup(java.lang.String info, int x, int y)
public void hideInfo()
public void zoomToGarminGeo(double factor, int longitude, int latitude)
public ImgFilesBag getMap()
public int getResolution(MapTransformer<COORD> transformer)
public int getResolution(int minLon, int maxLon)
public static int getResolution(int minLon, int maxLon, int width)
public TransformedMapListener createMapDrawer(MapConfig workConfig, java.awt.Graphics2D g2, float fontSize, MapTransformer<COORD> workTransformer)
Override this if you want a custom drawer.
public void saveMapAs(java.io.File selectedFile, FileExporter exporter, MapTransformer<COORD> transformer) throws java.io.IOException
java.io.IOException
public void setShowLineLabel(boolean showLineLabel)
public void setShowPolygonLabel(boolean showPolygonLabel)
public void setShowPointLabel(boolean showPointLabel)
public void setPoiThreshold(int threshold)
public void setDetailLevel(int detailLevel)
public void setShading(boolean enabled)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |