Package provided.owlMaps.demo.view
Class DemoFrame<TPlacesDropListItem>
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
provided.owlMaps.demo.view.DemoFrame<TPlacesDropListItem>
- Type Parameters:
TPlacesDropListItem
- The type of item held by the combobox of places
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,javax.accessibility.Accessible
,javax.swing.RootPaneContainer
,javax.swing.WindowConstants
public class DemoFrame<TPlacesDropListItem>
extends javax.swing.JFrame
The OwlMaps demo's view
- Author:
- swong
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JButton
btnAddGeoJson
Button to add GeoJSON from a stringprivate javax.swing.JButton
btnCircle
The button to make a circleprivate javax.swing.JButton
btnGoToPlaces
The button that will cause the map move to the selected placeprivate javax.swing.JButton
btnLoadGeoJson
Button to add GeoJSON from a URLprivate javax.swing.JButton
btnMakeInfoWin
The button to make an info windowprivate javax.swing.JButton
btnMakeOverlay
Button to make a ground image overlayprivate javax.swing.JButton
btnMakePolygon
The button to make a polygonprivate javax.swing.JButton
btnMakePolyline
The button to make a polylineprivate javax.swing.JButton
btnMakeRectangle
The button to make a rectangleprivate javax.swing.JButton
btnNav
The button to make the map go to the given lat/lngprivate javax.swing.JButton
btnResetMap
Button to reset the mapprivate javax.swing.JComboBox<TPlacesDropListItem>
cbxPlaces
A combobox of all the choices of places to move the map to.private javax.swing.JLabel
lblLatLngDirections
Directions on capturing a lat/lngprivate javax.swing.JLabel
lblNav
Label for the navigation subpanelprivate javax.swing.JLabel
lblToolTipInfo
Label for info about tool tipsprivate javax.swing.JPanel
pnlControl
The panel holding the controls to manipulate the mapprivate javax.swing.JPanel
pnlNav
The subpanel holding the map navigation controls.private javax.swing.JPanel
pnlPlaces
The panel holding the components to enable moving the map to a new placeprivate static long
serialVersionUID
For Serializableprivate javax.swing.JScrollPane
spDisplayText
Scrollpane for holding the scrolling text area for console messagesprivate javax.swing.JTextArea
taDisplayText
A text area to display console messagesprivate javax.swing.JTextField
tfLat
The text field for the latitude valueprivate javax.swing.JTextField
tfLng
The text field for the longitude valueprivate IView2ModelAdapter<TPlacesDropListItem>
view2ModelAdpt
The adapter to the modelFields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabled
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
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
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
Constructor Summary
Constructors Constructor Description DemoFrame(IView2ModelAdapter<TPlacesDropListItem> view2ModelAdpt)
Construct the demo's view -
Method Summary
Modifier and Type Method Description void
addMainComponent(java.util.function.Supplier<javax.swing.JComponent> compFac, java.lang.String label)
Add the given component to the main center display area of the frame and sets the title of the frame to the given label.void
addPlace(TPlacesDropListItem newItem)
Add an item to the places combobox (droplist)void
displayText(java.lang.String text)
Display the given text in the text display areaprivate void
initGUI()
Initialize the GUIvoid
setLatLng(double lat, double lng)
Display the latitude and longitude values on their respective text fields.void
start()
Start the demo viewMethods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor Serializable- See Also:
- Constant Field Values
-
pnlControl
private final javax.swing.JPanel pnlControlThe panel holding the controls to manipulate the map -
tfLat
private final javax.swing.JTextField tfLatThe text field for the latitude value -
tfLng
private final javax.swing.JTextField tfLngThe text field for the longitude value -
view2ModelAdpt
The adapter to the model -
btnMakeInfoWin
private final javax.swing.JButton btnMakeInfoWinThe button to make an info window -
btnMakePolygon
private final javax.swing.JButton btnMakePolygonThe button to make a polygon -
btnMakePolyline
private final javax.swing.JButton btnMakePolylineThe button to make a polyline -
btnMakeRectangle
private final javax.swing.JButton btnMakeRectangleThe button to make a rectangle -
btnCircle
private final javax.swing.JButton btnCircleThe button to make a circle -
spDisplayText
private final javax.swing.JScrollPane spDisplayTextScrollpane for holding the scrolling text area for console messages -
taDisplayText
private final javax.swing.JTextArea taDisplayTextA text area to display console messages -
btnResetMap
private final javax.swing.JButton btnResetMapButton to reset the map -
btnMakeOverlay
private final javax.swing.JButton btnMakeOverlayButton to make a ground image overlay -
lblLatLngDirections
private final javax.swing.JLabel lblLatLngDirectionsDirections on capturing a lat/lng -
lblToolTipInfo
private final javax.swing.JLabel lblToolTipInfoLabel for info about tool tips -
btnAddGeoJson
private final javax.swing.JButton btnAddGeoJsonButton to add GeoJSON from a string -
btnLoadGeoJson
private final javax.swing.JButton btnLoadGeoJsonButton to add GeoJSON from a URL -
pnlPlaces
private final javax.swing.JPanel pnlPlacesThe panel holding the components to enable moving the map to a new place -
btnGoToPlaces
private final javax.swing.JButton btnGoToPlacesThe button that will cause the map move to the selected place -
cbxPlaces
A combobox of all the choices of places to move the map to.
-
-
Constructor Details
-
DemoFrame
Construct the demo's view- Parameters:
view2ModelAdpt
- The adapter to the demo view's model
-
-
Method Details
-
initGUI
private void initGUI()Initialize the GUI -
addMainComponent
public void addMainComponent(java.util.function.Supplier<javax.swing.JComponent> compFac, java.lang.String label)Add the given component to the main center display area of the frame and sets the title of the frame to the given label.- Parameters:
compFac
- The factory for the component to addlabel
- The label associated with the component.
-
start
public void start()Start the demo view -
setLatLng
public void setLatLng(double lat, double lng)Display the latitude and longitude values on their respective text fields.- Parameters:
lat
- The latitude valuelng
- The longitude value
-
displayText
public void displayText(java.lang.String text)Display the given text in the text display area- Parameters:
text
- the text to display
-
addPlace
Add an item to the places combobox (droplist)- Parameters:
newItem
- The new place to add to the combobox
-