com.esri.map.popup
Class PopupDialog

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by javax.swing.JDialog
                      extended by com.esri.map.popup.PopupDialog
All Implemented Interfaces:
MapPopup, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class PopupDialog
extends JDialog
implements MapPopup

The Class PopupDialog.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialog
 
Nested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  Point _currentLocation
           
protected  Rectangle _resizingBounds
           
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PopupDialog(JComponent[] content)
          Instantiates a new popup dialog to display the given content.
PopupDialog(JMap map, JComponent[] content, Graphic graphic)
          Instantiates a new popup dialog to display the given content with a callout tail that will point at the given graphic.
 
Method Summary
 void close()
          Close the MapPopup rather than simply hiding it.
protected  void closeDialog()
          Close dialog.
 Point getAnchorPoint()
          Gets the anchor point that the callout tail will point at.
protected  void handleDrag(MouseEvent e)
          Handle mouse drag.
protected  void handleMousePress(MouseEvent e)
          Handle mouse press.
protected  void init(JComponent[] content)
          Initialise the dialog
 boolean isMovingWithMap()
          Checks if this MapPopup is set to move with the map.
static void main(String[] args)
          The main method.
 void setAnchorPoint(Point anchorPoint)
          Sets the anchor point that the callout tail is pointing at.
 void setBounds(int x, int y, int width, int height)
           
 void setBounds(Rectangle r)
           
 void setLocation(int x, int y)
           
 void setLocation(Point p)
           
 void setMovingWithMap(boolean moveWithMap)
          When this is set true, the MapPopup will move with the map.
 void setNewGraphic(Graphic newGraphic)
          Sets the new graphic.
 void setSize(Dimension d)
           
 void setSize(int width, int height)
           
 void setTitle(String title)
          Sets the title.
 void updateLocation()
           
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setUndecorated, setVisible, show, toBack
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, 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, 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, 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, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, 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, isOpaque, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.esri.map.popup.MapPopup
getTitle, setVisible
 

Field Detail

_currentLocation

protected Point _currentLocation

_resizingBounds

protected Rectangle _resizingBounds
Constructor Detail

PopupDialog

public PopupDialog(JComponent[] content)
Instantiates a new popup dialog to display the given content. If there is more than one JComponent in the array, the dialog will display arrows that can be used to page through the components. Unless an anchor point is set by calling setAnchorPoint(Point), the dialog will have no callout tail.

Parameters:
content - the content to display in the dialog

PopupDialog

public PopupDialog(JMap map,
                   JComponent[] content,
                   Graphic graphic)
Instantiates a new popup dialog to display the given content with a callout tail that will point at the given graphic. If there is more than one JComponent in the array, the dialog will display arrows that can be used to page through the components.

Parameters:
map - the map containing the given graphic
content - the content to display
graphic - the graphic that the callout tail will point at
Method Detail

main

public static void main(String[] args)
The main method.

Parameters:
args - the arguments

getAnchorPoint

public Point getAnchorPoint()
Gets the anchor point that the callout tail will point at.

Returns:
the anchor point

setAnchorPoint

public void setAnchorPoint(Point anchorPoint)
Description copied from interface: MapPopup
Sets the anchor point that the callout tail is pointing at. If this is not set, the anchor point will be derived from the location of the currently set graphic.

Specified by:
setAnchorPoint in interface MapPopup
Parameters:
anchorPoint - the new anchor point

isMovingWithMap

public boolean isMovingWithMap()
Description copied from interface: MapPopup
Checks if this MapPopup is set to move with the map.

Specified by:
isMovingWithMap in interface MapPopup
Returns:
true, if this is moving with the map

setMovingWithMap

public void setMovingWithMap(boolean moveWithMap)
Description copied from interface: MapPopup
When this is set true, the MapPopup will move with the map. If this is false, the MapPopup will stay where it is on the screen and the callout tail will move with the map to ensure that it still points at the associated graphic.

Specified by:
setMovingWithMap in interface MapPopup
Parameters:
moveWithMap - true to move with the map, false to stay in place on the screen

setTitle

public void setTitle(String title)
Description copied from interface: MapPopup
Sets the title.

Specified by:
setTitle in interface MapPopup
Overrides:
setTitle in class Dialog
Parameters:
title - the new title

setLocation

public void setLocation(int x,
                        int y)
Overrides:
setLocation in class Component

setLocation

public void setLocation(Point p)
Overrides:
setLocation in class Component

setSize

public void setSize(Dimension d)
Overrides:
setSize in class Window

setSize

public void setSize(int width,
                    int height)
Overrides:
setSize in class Window

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Overrides:
setBounds in class Window

setBounds

public void setBounds(Rectangle r)
Overrides:
setBounds in class Window

setNewGraphic

public void setNewGraphic(Graphic newGraphic)
Description copied from interface: MapPopup
Sets the new graphic. When this is called, the callout tail should be updated to point to the given graphic.

Specified by:
setNewGraphic in interface MapPopup
Parameters:
newGraphic - the new new graphic

close

public void close()
Description copied from interface: MapPopup
Close the MapPopup rather than simply hiding it.

Specified by:
close in interface MapPopup

updateLocation

public void updateLocation()
Specified by:
updateLocation in interface MapPopup

init

protected void init(JComponent[] content)
Initialise the dialog

Parameters:
content - the content

handleDrag

protected void handleDrag(MouseEvent e)
Handle mouse drag. This will either resize the dialog if the border is dragged or move the dialog otherwise.

Parameters:
e - the mosue event

handleMousePress

protected void handleMousePress(MouseEvent e)
Handle mouse press. Used to indicate the start of a drag or resize.

Parameters:
e - the mouse event

closeDialog

protected void closeDialog()
Close dialog.



Copyright © 2012. All Rights Reserved.