com.esri.map.popup
Class PopupView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.esri.map.popup.PopupView
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class PopupView
extends JPanel

This class can be used for the following:

  • Display PopupInfo from web maps and other sources
  • Display basic attribute name/value pairs
  • Edit attributes on a graphic or feature
  • An instance of this class can be displayed in any JComponent but is intended mainly to be used with JMap.createPopup(javax.swing.JComponent[], Graphic, boolean) to show PopupInfo for a graphic selected in a map control.

    See Also:
    Serialized Form

    Nested Class Summary
     class PopupView.AttachmentInfoCallback
              This class is used to handle the response to attachment queries to a feature layer.
     class PopupView.AttachmentsListCellRenderer
              This class implements a list cell renderer for the attachments list.
    static interface PopupView.ZoomToGraphicCallback
               
     
    Nested classes/interfaces inherited from class javax.swing.JPanel
    JPanel.AccessibleJPanel
     
    Nested classes/interfaces inherited from class javax.swing.JComponent
    JComponent.AccessibleJComponent
     
    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
     
    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
    PopupView(boolean isForEditing)
              Create a PopupView instance.
     
    Method Summary
     void addPopupViewListener(PopupViewListener listener)
              Adds the popup view listener.
    static PopupView createAttributesView(String title, Field[] fields)
              Create an instance of the PopupView that displays a simple list of attributes and values.
    static PopupView createAttributesView(String itemTitle, Graphic graphic)
              Create an instance of the PopupView that displays a simple list of attributes and values.
    static PopupView createEditView(String title, ArcGISFeatureLayer featureLayer)
              Create an instance of the PopupView that can be used to edit the attributes of features in the given layer.
    static PopupView createEditView(String title, ArcGISFeatureLayer featureLayer, Map<String,com.esri.core.map.popup.PopupFieldInfo> fieldInfos)
              Create an instance of the PopupView that can be used to edit the attributes of features in the given layer.
    protected  void fireOnCancelEditEvent()
              Fire cancel edit event.
    protected  void fireOnCommitEditEvent()
              Fire commit edit event.
    protected  CallbackListener<FeatureEditResult[][]> getEditCallback()
              Gets the edit callback.
    protected  void handleZoomToGraphicEvent()
              Handle zoom to graphic event.
     void removePopupViewListener(PopupViewListener listener)
              Removes the popup view listener.
     void setEditCallbackListener(CallbackListener<FeatureEditResult[][]> callback)
              Setting an edit callback listener allows the calling code to handle the response to submitting edits to the associated feature class.
     void setGraphic(GraphicsLayer graphicsLayer, Graphic graphic)
              Sets the graphic that is to be displayed or edited.
     void setPopupInfo(ArcGISPopupInfo popupInfo)
              Sets the popup info.
    protected  void setupAttachmentsListData()
              Setup attachments list data.
     void setZoomToGraphicCallback(PopupView.ZoomToGraphicCallback callback)
               
     
    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, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, 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
     

    Constructor Detail

    PopupView

    public PopupView(boolean isForEditing)
    Create a PopupView instance. If this instance is intended to be used for editing attriubtes, set isForEditing true. In editing mode, the PopupView will show a list of attribute name/value pairs and allow the editing of the values. If the instance is not set to editing mode, any attachments and media associated with a given feature will be displayed. If a description field has been set for the PopupView, this will be displayed. If there is no description field set, a list of attribute name/value pairs will be displayed instead.

    Parameters:
    isForEditing - set true for editing mode, false otherwise.
    Method Detail

    createAttributesView

    public static PopupView createAttributesView(String title,
                                                 Field[] fields)
    Create an instance of the PopupView that displays a simple list of attributes and values. The field names used will be taken from the given array of Fields.

    Parameters:
    title - Title to set on the popup. Field names within '{}' will be replaced with the corresponding values
    fields - the fields
    Returns:
    the popup view

    createAttributesView

    public static PopupView createAttributesView(String itemTitle,
                                                 Graphic graphic)
    Create an instance of the PopupView that displays a simple list of attributes and values. The field names used will be taken from the given graphic.

    Parameters:
    itemTitle - Title to set on the popup. Field names within '{}' will be replaced with the corresponding values
    graphic - used to determine the fields to show in the popup
    Returns:
    the popup view

    createEditView

    public static PopupView createEditView(String title,
                                           ArcGISFeatureLayer featureLayer)
    Create an instance of the PopupView that can be used to edit the attributes of features in the given layer. If the given feature layer has popup info, this will be used to setup the edit view. If the feature layer has no popup info, this method will generate a basic attribute editor with no special formatting of values.

    Parameters:
    title - Title to set on the popup. Field names within '{}' will be replaced with the corresponding values
    featureLayer - the feature layer that will be edited
    Returns:
    the popup view

    createEditView

    public static PopupView createEditView(String title,
                                           ArcGISFeatureLayer featureLayer,
                                           Map<String,com.esri.core.map.popup.PopupFieldInfo> fieldInfos)
    Create an instance of the PopupView that can be used to edit the attributes of features in the given layer. Formatting of dates and numbers can be set by using the appropriate methods and properties of the given PopupFieldInfo instances. The FieldName property of each PopupFieldInfo should match the name of a field in the given feature layer.

    Parameters:
    title - Title to set on the popup. Field names within '{}' will be replaced with the corresponding values
    featureLayer - the feature layer that will be edited
    fieldInfos - array of PopupFieldInfo instances describing the attributes being edited.
    Returns:
    the popup view
    See Also:
    PopupFieldInfo

    setPopupInfo

    public void setPopupInfo(ArcGISPopupInfo popupInfo)
    Sets the popup info. This is used to configure the contents of this PopupView instance.

    Parameters:
    popupInfo - the new popup info
    See Also:
    PopupInfo

    setGraphic

    public void setGraphic(GraphicsLayer graphicsLayer,
                           Graphic graphic)
    Sets the graphic that is to be displayed or edited.

    Parameters:
    graphicsLayer - the graphics layer
    graphic - the graphic

    addPopupViewListener

    public void addPopupViewListener(PopupViewListener listener)
    Adds the popup view listener. This allows the calling code to listen for and handle commit and cancel events when editing and zoom to graphic events when not editing. The commit event will be fired after the changes have been submitted to the associated feature layer.

    Parameters:
    listener - the listener

    removePopupViewListener

    public void removePopupViewListener(PopupViewListener listener)
    Removes the popup view listener.

    Parameters:
    listener - the listener

    setEditCallbackListener

    public void setEditCallbackListener(CallbackListener<FeatureEditResult[][]> callback)
    Setting an edit callback listener allows the calling code to handle the response to submitting edits to the associated feature class.

    Parameters:
    callback - the new edits the callback listener

    setZoomToGraphicCallback

    public void setZoomToGraphicCallback(PopupView.ZoomToGraphicCallback callback)

    getEditCallback

    protected CallbackListener<FeatureEditResult[][]> getEditCallback()
    Gets the edit callback.

    Returns:
    the edits the callback

    setupAttachmentsListData

    protected void setupAttachmentsListData()
    Setup attachments list data.


    handleZoomToGraphicEvent

    protected void handleZoomToGraphicEvent()
    Handle zoom to graphic event.


    fireOnCancelEditEvent

    protected void fireOnCancelEditEvent()
    Fire cancel edit event.


    fireOnCommitEditEvent

    protected void fireOnCommitEditEvent()
    Fire commit edit event.



    Copyright © 2012. All Rights Reserved.