com.isti.util.gui
Class IstiRegionEditPanel

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.isti.util.gui.IstiRegionEditPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class IstiRegionEditPanel
extends javax.swing.JPanel

Class IstiRegionEditPanel defines a region edit panel.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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
static java.lang.String closeDialogCommandString
          close dialog command
protected  IstiDialogUtil dialogUtilObj
          Dialog utility object for popup messages.
static java.lang.String HELP_OPTION_TEXT
          Help option text.
static java.lang.String OK_OPTION_TEXT
          OK option text
static java.lang.String showDialogCommandString
          show dialog command
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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
IstiRegionEditPanel()
          Creates an empty region edit panel with all 'IstiRegion' option groups.
IstiRegionEditPanel(java.util.List optionGroups)
          Creates an empty region edit panel.
IstiRegionEditPanel(java.util.List optionGroups, java.lang.String str)
          Creates a region edit panel.
 
Method Summary
static void addActivePanelActionListener(java.awt.event.ActionListener l)
          Adds an ActionListener to the active panel.
 void addPoint(double lat, double lon)
          Add a lat/lon point to the region.
static void addPointToActivePanel(double lat, double lon)
          Add a lat/lon point to the active panel.
protected  void clearRegion()
          Clears the region informaton.
 void closeDialog()
          Closes the dialog for this panel.
 void createDialog(IstiRegionPanel regionPanel, boolean addFlag, java.awt.Component parentComp, boolean modalFlag, boolean centerFlag)
          Creates a dialog for this Client Configuration Panel.
protected static void fireActivePanelActionPerformed(java.awt.event.ActionEvent event)
          Notifies all listeners that have registered interest for notification on this event type.
 IstiDialogPopup getDialog()
          Gets the dialog for this panel.
 java.lang.String getRegionString()
          Gets the region string.
 boolean isCircle()
          Determines if the edit panel is for a circle or a polygon.
protected  void jbInit()
          Performs component initialization.
protected  void notifyCloseEvent()
          Notifies a close event.
protected  void notifyOpenEvent()
          Notifies an open event.
static void removeActivePanelActionListener(java.awt.event.ActionListener l)
          Removes an ActionListener from the active panel.
static void removeAllActivePanelActionListeners()
          Removes all ActionListeners from the active panel.
protected static java.lang.String replace(java.lang.String str, char oldChar, char newChar)
          Replace the old char with the new char in the coordinate part of the specified region string.
 void requestFocus()
          Overridden version that also calls 'requestFocus()' on the dialog hosting this panel.
 void setCircle(boolean b)
          Set the edit panel for circle or polygon.
 void setRegionString(java.lang.String str)
          Sets the region string.
 int showDialog()
          Shows the dialog with the Client Configuration Panel after the configuration settings are loaded.
 
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, 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
 

Field Detail

showDialogCommandString

public static final java.lang.String showDialogCommandString
show dialog command

See Also:
Constant Field Values

closeDialogCommandString

public static final java.lang.String closeDialogCommandString
close dialog command

See Also:
Constant Field Values

OK_OPTION_TEXT

public static final java.lang.String OK_OPTION_TEXT
OK option text

See Also:
Constant Field Values

HELP_OPTION_TEXT

public static final java.lang.String HELP_OPTION_TEXT
Help option text.

See Also:
Constant Field Values

dialogUtilObj

protected final IstiDialogUtil dialogUtilObj
Dialog utility object for popup messages.

Constructor Detail

IstiRegionEditPanel

public IstiRegionEditPanel()
Creates an empty region edit panel with all 'IstiRegion' option groups.


IstiRegionEditPanel

public IstiRegionEditPanel(java.util.List optionGroups)
Creates an empty region edit panel.

Parameters:
optionGroups - the 'IstiRegion' option groups or null for all.

IstiRegionEditPanel

public IstiRegionEditPanel(java.util.List optionGroups,
                           java.lang.String str)
Creates a region edit panel.

Parameters:
optionGroups - the 'IstiRegion' option groups or null for all.
str - the region string.
Method Detail

jbInit

protected final void jbInit()
                     throws java.lang.Exception
Performs component initialization.

Throws:
java.lang.Exception - if an error occurs.

addActivePanelActionListener

public static void addActivePanelActionListener(java.awt.event.ActionListener l)
Adds an ActionListener to the active panel.

Parameters:
l - the ActionListener to be added

addPoint

public void addPoint(double lat,
                     double lon)
Add a lat/lon point to the region.

Parameters:
lat - the latitude of the point.
lon - the longitude of the point.

addPointToActivePanel

public static void addPointToActivePanel(double lat,
                                         double lon)
Add a lat/lon point to the active panel.

Parameters:
lat - the latitude of the point.
lon - the longitude of the point.

createDialog

public void createDialog(IstiRegionPanel regionPanel,
                         boolean addFlag,
                         java.awt.Component parentComp,
                         boolean modalFlag,
                         boolean centerFlag)
Creates a dialog for this Client Configuration Panel.

Parameters:
regionPanel - the region panel.
addFlag - true for add, false for edit.
parentComp - the Component to check for a Frame or Dialog
modalFlag - true for a modal dialog, false for modeless (allows other windows to run).
centerFlag - true to have the dialog centered over its parent; false to have the dialog on the top-right part of the display screen.

getDialog

public IstiDialogPopup getDialog()
Gets the dialog for this panel.

Returns:
The dialog object for this panel, or null if none has been created.

closeDialog

public void closeDialog()
Closes the dialog for this panel.


requestFocus

public void requestFocus()
Overridden version that also calls 'requestFocus()' on the dialog hosting this panel.

Overrides:
requestFocus in class javax.swing.JComponent

getRegionString

public java.lang.String getRegionString()
Gets the region string.

Returns:
the region string.

isCircle

public boolean isCircle()
Determines if the edit panel is for a circle or a polygon.

Returns:
true for circle, false for polygon.

removeActivePanelActionListener

public static void removeActivePanelActionListener(java.awt.event.ActionListener l)
Removes an ActionListener from the active panel. If the listener is the currently set Action for the button, then the Action is set to null.

Parameters:
l - the listener to be removed

removeAllActivePanelActionListeners

public static void removeAllActivePanelActionListeners()
Removes all ActionListeners from the active panel.


setCircle

public void setCircle(boolean b)
Set the edit panel for circle or polygon.

Parameters:
b - true for circle, false for polygon.

setRegionString

public final void setRegionString(java.lang.String str)
Sets the region string.

Parameters:
str - the region string.

showDialog

public int showDialog()
Shows the dialog with the Client Configuration Panel after the configuration settings are loaded. Note that the dialog needs to be created with the createDialog method.

Returns:
An integer indicating the option chosen by the user, or CLOSED_OPTION if the user closed the dialog without selecting an option or if the dialog doesn't exist.
See Also:
#createDialog()

clearRegion

protected void clearRegion()
Clears the region informaton.


fireActivePanelActionPerformed

protected static void fireActivePanelActionPerformed(java.awt.event.ActionEvent event)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

Parameters:
event - the ChangeEvent object
See Also:
EventListenerList

notifyCloseEvent

protected void notifyCloseEvent()
Notifies a close event.


notifyOpenEvent

protected void notifyOpenEvent()
Notifies an open event.


replace

protected static java.lang.String replace(java.lang.String str,
                                          char oldChar,
                                          char newChar)
Replace the old char with the new char in the coordinate part of the specified region string.

Parameters:
str - the region string.
oldChar - the old character.
newChar - the new character.
Returns:
the updated region string.