public class GeoMapper
extends javax.swing.JApplet
implements javax.swing.event.ChangeListener
javax.swing.JApplet.AccessibleJApplet
java.applet.Applet.AccessibleApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
Constructor and Description |
---|
GeoMapper()
Creates a new DemoGeoMapper object.
|
GeoMapper(javax.swing.JFrame frame)
Creates a new DemoGeoMapper as a local application.
|
GeoMapper(javax.swing.JFrame frame,
boolean useGoogle)
Creates a new DemoGeoMapper as a local application.
|
Modifier and Type | Method and Description |
---|---|
void |
addLayer(GeoLayer layer)
Add a geographic layer to the display.
|
protected void |
addRadioButton(java.lang.String buttonName)
Add a radio button to the internal button group and button panel.
|
protected void |
handleClick(java.awt.Point click,
int button,
java.lang.String action)
Handle the click of a mouse over the map.
|
protected void |
handlePick(GeoShape picked)
Handle the picking of a GeoShape.
|
void |
init()
Initialize this method when it is running as an applet.
|
void |
loadLayers(java.util.List<java.lang.String> names)
Load geographic layers into this map display.
|
static void |
main(java.lang.String[] args)
Run this class as a demonstration application.
|
java.util.List<java.lang.String> |
queryForLayers()
Query the user for layers to display.
|
void |
redrawMap()
Redraw the current map
|
void |
setBaseUrl(java.net.URL baseUrl)
Set the base ESRI url used to access shape files
|
protected javax.swing.JPanel |
setupActionPane()
Set up an action pane which can be used within this application.
|
void |
showLayerList()
Display the geographic layer editor
|
protected void |
showText(java.lang.String text)
Show the text string in the scrolling information window.
|
void |
stateChanged(javax.swing.event.ChangeEvent evt)
Receive a stateChanged event.
|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
add, add, add, add, add, addContainerListener, 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, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
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, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public GeoMapper()
public GeoMapper(javax.swing.JFrame frame)
frame
- The frame of the object to display the application inpublic GeoMapper(javax.swing.JFrame frame, boolean useGoogle)
frame
- The frame of the object to display the application inuseGoogle
- flag determining whether to use GoogleMaps as the
underlying geographic canvas.public void addLayer(GeoLayer layer)
layer
- the layer to addprotected final void addRadioButton(java.lang.String buttonName)
handleClick
method, with the name of the radio button
pass as the action parameter.buttonName
- the button name, used for both display and the action
associated with the button being selectedprotected void handleClick(java.awt.Point click, int button, java.lang.String action)
click
- The point clickedbutton
- the button used to make the clickaction
- The action stringprotected void handlePick(GeoShape picked)
picked
- the shape picked. This can be null if no shape was
actually picked.public void init()
mapType
and esriBase
parameters
when initializing. The esriBase is used to set the base URL where the
ESRI shape files may be found. If not set, the applet tries to use the
applet document base. The mapType is used to determine the type of
underlying geographic display. If the parameter is set to
google
, a Google map will be used as the underlying
display. Otherwise, a vector-based map will be used.init
in class java.applet.Applet
public void loadLayers(java.util.List<java.lang.String> names)
names
- the names of the ESRI shape files to be loaded.public java.util.List<java.lang.String> queryForLayers()
public void redrawMap()
public void setBaseUrl(java.net.URL baseUrl)
baseUrl
- the URL where the ESRI shape files are locatedprotected javax.swing.JPanel setupActionPane()
public void showLayerList()
protected void showText(java.lang.String text)
text
- the text to display in the information windowpublic void stateChanged(javax.swing.event.ChangeEvent evt)
stateChanged
in interface javax.swing.event.ChangeListener
evt
- The change event.public static void main(java.lang.String[] args)
args
- command line arguments. The first argument must be the ESRI
base directory. Any additional arguments are used as layer
names to be loaded.