public class LatLonWidget
extends javax.swing.JPanel
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
LatLonWidget()
Create a widget with the blank values for latitude and longitude and with
the default field labels.
|
LatLonWidget(java.awt.event.ActionListener actionListener)
Create a widget with blank values for latitude and longitude and with
the default field labels.
|
LatLonWidget(double lat,
double lon)
Create a widget with the given initial values for latitude and longitude.
|
LatLonWidget(java.lang.String latLabel,
java.lang.String lonLabel,
java.awt.event.ActionListener actionListener)
Create a widget with the blank values for latitude and longitude and with
the given Strings for the field labels.
|
LatLonWidget(java.lang.String latLabel,
java.lang.String lonLabel,
java.lang.String altLabel,
java.awt.event.ActionListener actionListener)
Create a widget with the blank values for latitude and longitude and with
the given Strings for the field labels.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the contents of the lat/lon text fields.
|
protected java.lang.String |
formatLatLonString(java.lang.String latOrLon)
Format the lat or lon string
|
double |
getAlt()
Get the altitude
|
javax.swing.JTextField |
getAltField()
Get the text field for the alt.
|
boolean |
getDoFormat()
Get the DoFormat property.
|
double |
getLat()
Get a latitude
|
javax.swing.JTextField |
getLatField()
Get the text field for the latitude.
|
double |
getLon()
Get a longitude
|
javax.swing.JTextField |
getLonField()
Get the text field for the longitude.
|
boolean |
isAltDefined()
Is there any text entered in the alt field and is it enabled.
|
boolean |
isDefined(java.lang.String s)
See if the value is defined
|
boolean |
isLatDefined()
Is there any text entered in the lat field and is it enabled.
|
boolean |
isLatLonDefined()
Is there any text entered in both the lat and the lon field.
|
boolean |
isLonDefined()
Is there any text entered in the lon field and is it enabled.
|
java.lang.String |
isValidValues()
Check if the current field values are valid.
|
void |
setAlt(double alt)
Set the value of the alt field.
|
void |
setAlt(java.lang.String altString)
Set the value of the alt field with the given String value.
|
void |
setDoFormat(boolean value)
Set the DoFormat property.
|
void |
setLat(double lat)
Set the value of the latitude field.
|
void |
setLat(java.lang.String latString)
Set the value of the lat field with the given String value.
|
void |
setLatLon(double lat,
double lon)
Set the value of the lat and lon fields.
|
void |
setLatLon(java.lang.String lat,
java.lang.String lon)
Set the value of the lat and lon fields.
|
void |
setLon(double lon)
Set the value of the longitude field.
|
void |
setLon(java.lang.String lonString)
Set the value of the lon field with the given String value.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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, updateadd, 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, validateTreeaction, 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, 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, transferFocusUpCyclepublic LatLonWidget(java.awt.event.ActionListener actionListener)
actionListener - public LatLonWidget()
public LatLonWidget(java.lang.String latLabel,
java.lang.String lonLabel,
java.awt.event.ActionListener actionListener)
latLabel - lonLabel - actionListener - public LatLonWidget(java.lang.String latLabel,
java.lang.String lonLabel,
java.lang.String altLabel,
java.awt.event.ActionListener actionListener)
latLabel - lonLabel - altLabel - If non-null then add an alt fieldactionListener - public LatLonWidget(double lat,
double lon)
lat - lon - public void setLatLon(double lat,
double lon)
lat - lon - public void setLatLon(java.lang.String lat,
java.lang.String lon)
lat - lon - public void setLat(java.lang.String latString)
latString - public void setLon(java.lang.String lonString)
lonString - public void setAlt(java.lang.String altString)
altString - public void setLat(double lat)
lat - public void setLon(double lon)
lon - public void setAlt(double alt)
alt - public void clear()
public boolean isDefined(java.lang.String s)
s - the valuepublic boolean isLatDefined()
public boolean isLonDefined()
public boolean isAltDefined()
public boolean isLatLonDefined()
public java.lang.String isValidValues()
public double getLat()
throws java.lang.NumberFormatException
java.lang.NumberFormatException - illegal numberpublic double getLon()
throws java.lang.NumberFormatException
java.lang.NumberFormatException - illegal numberpublic double getAlt()
throws java.lang.NumberFormatException
java.lang.NumberFormatException - illegal numberpublic javax.swing.JTextField getLatField()
public javax.swing.JTextField getLonField()
public javax.swing.JTextField getAltField()
protected java.lang.String formatLatLonString(java.lang.String latOrLon)
latOrLon - lat or lon value as a string in decimal notationpublic void setDoFormat(boolean value)
value - The new value for DoFormatpublic boolean getDoFormat()