com.vividsolutions.jump.workbench.ui
Class WorkbenchFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by com.vividsolutions.jump.workbench.ui.WorkbenchFrame
All Implemented Interfaces:
ErrorHandler, LayerViewPanelContext, ViewportListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class WorkbenchFrame
extends javax.swing.JFrame
implements LayerViewPanelContext, ViewportListener

This class is responsible for the main window of the JUMP application.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
 
Fields inherited from class javax.swing.JFrame
EXIT_ON_CLOSE
 
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 javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WorkbenchFrame(java.lang.String title, javax.swing.ImageIcon icon, WorkbenchContext workbenchContext)
           
 
Method Summary
 void activateFrame(javax.swing.JInternalFrame frame)
           
 void addChoosableStyleClass(java.lang.Class choosableStyleClass)
           
 void addEasyKeyListener(java.awt.event.KeyListener l)
          Unlike #add(KeyListener), listeners registered using this method are notified when KeyEvents occur on this frame's child components.
 void addInternalFrame(javax.swing.JInternalFrame internalFrame)
          If internalFrame is a LayerManagerProxy, the close behaviour will be altered so that the user is prompted if it is the last window on the LayerManager.
 void addInternalFrame(javax.swing.JInternalFrame internalFrame, boolean alwaysOnTop, boolean autoUpdateToolBar)
           
 void addKeyboardShortcut(int keyCode, int modifiers, PlugIn plugIn, EnableCheck enableCheck)
          Adds a keyboard shortcut for a plugin.
 TaskFrame addTaskFrame()
           
 TaskFrame addTaskFrame(Task task)
           
 TaskFrame addTaskFrame(TaskFrame taskFrame)
           
 boolean confirmClose(java.lang.String action, java.util.Collection modifiedLayers)
           
 Task createTask()
           
 void displayLastStatusMessage()
           
 void flash(HTMLFrame frame)
           
 javax.swing.JInternalFrame getActiveInternalFrame()
           
 ApplicationExitHandler getApplicationExitHandler()
           
 TitledPopupMenu getCategoryPopupMenu()
           
 java.util.Set getChoosableStyleClasses()
          Fundamental Style classes (like BasicStyle, VertexStyle, and LabelStyle) cannot be removed, and are thus excluded from the choosable Style classes.
 WorkbenchContext getContext()
           
 javax.swing.JDesktopPane getDesktopPane()
           
 int getEnvelopeRenderingThreshold()
           
 InternalFrameCloseHandler getInternalFrameCloseHandler()
           
 javax.swing.JInternalFrame[] getInternalFrames()
           
 LayerNamePanelListener getLayerNamePanelListener()
           
 TitledPopupMenu getLayerNamePopupMenu()
           
 java.util.Collection getLayersWithModifiedFeatureCollections()
           
 LayerViewPanelListener getLayerViewPanelListener()
           
 java.lang.String getLog()
           
 int getMaximumFeatureExtentForEnvelopeRenderingInPixels()
           
 java.lang.String getMBCommittedMemory()
           
 int getMinimumFeatureExtentForAnyRenderingInPixels()
           
 java.util.Map getNodeClassToPopupMenuMap()
           
 HTMLFrame getOutputFrame()
           
 WorkbenchToolBar getToolBar()
           
 TitledPopupMenu getWMSLayerNamePopupMenu()
           
 void handleThrowable(java.lang.Throwable t)
          Can be called regardless of whether the current thread is the AWT event dispatch thread.
static void handleThrowable(java.lang.Throwable t, java.awt.Component parent)
           
 boolean hasInternalFrame(javax.swing.JInternalFrame internalFrame)
           
 void log(java.lang.String message)
           
 void removeEasyKeyListener(java.awt.event.KeyListener l)
           
 void removeInternalFrame(javax.swing.JInternalFrame internalFrame)
           
 void setApplicationExitHandler(ApplicationExitHandler value)
           
 void setEnvelopeRenderingThreshold(int newEnvelopeRenderingThreshold)
           
 void setInternalFrameCloseHandler(InternalFrameCloseHandler value)
           
 void setMaximumFeatureExtentForEnvelopeRenderingInPixels(int newMaximumFeatureExtentForEnvelopeRenderingInPixels)
           
 void setMinimumFeatureExtentForAnyRenderingInPixels(int newMinimumFeatureExtentForAnyRenderingInPixels)
           
 void setStatusMessage(java.lang.String message)
          Displays a message indicating the status of current operations, typically in a status bar.
 void setTimeMessage(java.lang.String message)
           
static java.lang.String toMessage(java.lang.Throwable t)
           
 void warnUser(java.lang.String warning)
          Notifies the user about a minor issue.
 void zoomChanged(com.vividsolutions.jts.geom.Envelope modelEnvelope)
           
 
Methods inherited from class javax.swing.JFrame
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
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, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, 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, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Constructor Detail

WorkbenchFrame

public WorkbenchFrame(java.lang.String title,
                      javax.swing.ImageIcon icon,
                      WorkbenchContext workbenchContext)
               throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

addEasyKeyListener

public void addEasyKeyListener(java.awt.event.KeyListener l)
Unlike #add(KeyListener), listeners registered using this method are notified when KeyEvents occur on this frame's child components. Note: Bug: KeyListeners registered using this method may receive events multiple times.

See Also:
addKeyboardShortcut(int, int, com.vividsolutions.jump.workbench.plugin.PlugIn, com.vividsolutions.jump.workbench.plugin.EnableCheck)

removeEasyKeyListener

public void removeEasyKeyListener(java.awt.event.KeyListener l)

getMBCommittedMemory

public java.lang.String getMBCommittedMemory()

setEnvelopeRenderingThreshold

public void setEnvelopeRenderingThreshold(int newEnvelopeRenderingThreshold)
Parameters:
newEnvelopeRenderingThreshold - the number of on-screen features above which envelope rendering should occur

setMaximumFeatureExtentForEnvelopeRenderingInPixels

public void setMaximumFeatureExtentForEnvelopeRenderingInPixels(int newMaximumFeatureExtentForEnvelopeRenderingInPixels)

log

public void log(java.lang.String message)

getLog

public java.lang.String getLog()

setMinimumFeatureExtentForAnyRenderingInPixels

public void setMinimumFeatureExtentForAnyRenderingInPixels(int newMinimumFeatureExtentForAnyRenderingInPixels)

displayLastStatusMessage

public void displayLastStatusMessage()

setStatusMessage

public void setStatusMessage(java.lang.String message)
Description copied from interface: LayerViewPanelContext
Displays a message indicating the status of current operations, typically in a status bar.

Specified by:
setStatusMessage in interface LayerViewPanelContext

setTimeMessage

public void setTimeMessage(java.lang.String message)

getActiveInternalFrame

public javax.swing.JInternalFrame getActiveInternalFrame()

getInternalFrames

public javax.swing.JInternalFrame[] getInternalFrames()

getCategoryPopupMenu

public TitledPopupMenu getCategoryPopupMenu()

getContext

public WorkbenchContext getContext()

getDesktopPane

public javax.swing.JDesktopPane getDesktopPane()

getEnvelopeRenderingThreshold

public int getEnvelopeRenderingThreshold()

getLayerNamePopupMenu

public TitledPopupMenu getLayerNamePopupMenu()

getWMSLayerNamePopupMenu

public TitledPopupMenu getWMSLayerNamePopupMenu()

getLayerViewPanelListener

public LayerViewPanelListener getLayerViewPanelListener()

getNodeClassToPopupMenuMap

public java.util.Map getNodeClassToPopupMenuMap()

getLayerNamePanelListener

public LayerNamePanelListener getLayerNamePanelListener()

getMaximumFeatureExtentForEnvelopeRenderingInPixels

public int getMaximumFeatureExtentForEnvelopeRenderingInPixels()

getMinimumFeatureExtentForAnyRenderingInPixels

public int getMinimumFeatureExtentForAnyRenderingInPixels()

getOutputFrame

public HTMLFrame getOutputFrame()

getToolBar

public WorkbenchToolBar getToolBar()

activateFrame

public void activateFrame(javax.swing.JInternalFrame frame)

addInternalFrame

public void addInternalFrame(javax.swing.JInternalFrame internalFrame)
If internalFrame is a LayerManagerProxy, the close behaviour will be altered so that the user is prompted if it is the last window on the LayerManager.


addInternalFrame

public void addInternalFrame(javax.swing.JInternalFrame internalFrame,
                             boolean alwaysOnTop,
                             boolean autoUpdateToolBar)

addTaskFrame

public TaskFrame addTaskFrame()

createTask

public Task createTask()

addTaskFrame

public TaskFrame addTaskFrame(Task task)

addTaskFrame

public TaskFrame addTaskFrame(TaskFrame taskFrame)

flash

public void flash(HTMLFrame frame)

handleThrowable

public void handleThrowable(java.lang.Throwable t)
Can be called regardless of whether the current thread is the AWT event dispatch thread.

Specified by:
handleThrowable in interface ErrorHandler
Parameters:
t - Description of the Parameter

handleThrowable

public static void handleThrowable(java.lang.Throwable t,
                                   java.awt.Component parent)

toMessage

public static java.lang.String toMessage(java.lang.Throwable t)

hasInternalFrame

public boolean hasInternalFrame(javax.swing.JInternalFrame internalFrame)

removeInternalFrame

public void removeInternalFrame(javax.swing.JInternalFrame internalFrame)

warnUser

public void warnUser(java.lang.String warning)
Description copied from interface: LayerViewPanelContext
Notifies the user about a minor issue. Subclasses may wish to simply forward the warning to #setStatusMessage.

Specified by:
warnUser in interface LayerViewPanelContext

zoomChanged

public void zoomChanged(com.vividsolutions.jts.geom.Envelope modelEnvelope)
Specified by:
zoomChanged in interface ViewportListener

getLayersWithModifiedFeatureCollections

public java.util.Collection getLayersWithModifiedFeatureCollections()

getChoosableStyleClasses

public java.util.Set getChoosableStyleClasses()
Fundamental Style classes (like BasicStyle, VertexStyle, and LabelStyle) cannot be removed, and are thus excluded from the choosable Style classes.


addChoosableStyleClass

public void addChoosableStyleClass(java.lang.Class choosableStyleClass)

addKeyboardShortcut

public void addKeyboardShortcut(int keyCode,
                                int modifiers,
                                PlugIn plugIn,
                                EnableCheck enableCheck)
Adds a keyboard shortcut for a plugin. logs plugin exceptions. note - attaching to keyCode 'a', modifiers =1 will detect shift-A events. It will *not* detect caps-lock-'a'. This is due to inconsistencies in java.awt.event.KeyEvent. In the unlikely event you actually do want to also also attach to caps-lock-'a', then make two shortcuts - one to keyCode 'a' and modifiers =1 (shift-A) and one to keyCode 'A' and modifiers=0 (caps-lock A). For more details, see the java.awt.event.KeyEvent class - it has a full explaination.

Parameters:
keyCode - What key to attach to (See java.awt.event.KeyEvent)
modifiers - 0= none, 1=shift, 2= cntrl, 8=alt, 3=shift+cntrl, etc... See the modifier mask constants in the Event class
plugIn - What plugin to execute
enableCheck - Is the key enabled at the moment?

getInternalFrameCloseHandler

public InternalFrameCloseHandler getInternalFrameCloseHandler()

setInternalFrameCloseHandler

public void setInternalFrameCloseHandler(InternalFrameCloseHandler value)

getApplicationExitHandler

public ApplicationExitHandler getApplicationExitHandler()

setApplicationExitHandler

public void setApplicationExitHandler(ApplicationExitHandler value)

confirmClose

public boolean confirmClose(java.lang.String action,
                            java.util.Collection modifiedLayers)