endrov.gui.window
Class EvBasicWindow

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 endrov.gui.window.EvBasicWindow
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
ConsoleWindow, CustomDataWindow, DataBrowserWindow, EvBatchWindow, EvHardwareConfigWindow, FlowWindow, HardwareControlWindow, ImagesetMetaWindow, LineageDialogMapExp, LineageWindow, LiveWindow, MakeMaxWindow, MakeMovieWindow, MemoryUsageWindow, ParticleDialogIntegrate, PlateOverviewWindow, PlatePositionsWindow, PlateWindow, PluginWindow, RecControlWindow, RecWindowBurst, RecWindowFLIP, RecWindowFRAP, RecWindowMultiDim, RecWindowQuickBleach, ResolutionConfigWindow, ScriptEditorWindow, ScriptWindow, TimeRemapWindow, Viewer2DWindow, Viewer3DWindow, WindowAutoLineaging, WindowKeyBinding, WindowROI

public abstract class EvBasicWindow
extends javax.swing.JPanel

Any window in the application inherits this class.

See Also:
Serialized Form

Nested Class Summary
static class EvBasicWindow.DialogReturnStatus
           
static interface EvBasicWindow.EvWindowManagerMaker
           
 
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
 java.util.WeakHashMap<JinputListener,java.lang.Object> jinputListeners
           
static int KEY_GETCONSOLE
           
static java.io.File lastDataPath
          Remember last path used to load an imageset
 javax.swing.JMenu menuFile
           
 int windowInstance
          Instance number unique to this window.
static EvBasicWindow.EvWindowManagerMaker windowManager
          Manager for creating windows
 
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
EvBasicWindow()
          Just copy in needed data
 
Method Summary
static void addBasicWindowExtension(EvBasicWindowExtension e)
          Add an extension of Basic Window
 void addHook(java.lang.Class<?> cl, EvBasicWindowHook hook)
           
 void addMainMenubarCommon(javax.swing.JMenu ni)
          Add to the menubar
 void addMainMenubarWindowSpecific(javax.swing.JMenu ni)
          Add to the menubar
static void addMenuItemSorted(javax.swing.JMenu menu, javax.swing.JMenuItem ni)
          Add sorted entry, take label as name
static void addMenuItemSorted(javax.swing.JMenu menu, javax.swing.JMenuItem ni, java.lang.String itemName)
          Add menu item to a menu, put it in alphabetical order
 void addMenuOperation(javax.swing.JMenuItem ni, java.lang.String sortText)
          Add to the menu Operation
static void addMenuSorted(javax.swing.JMenuBar menu, javax.swing.JMenu ni)
          Add menu to a menubar, put in alphabetical order
 void addMenuWindow(javax.swing.JMenuItem ni)
          Add to the menu Window
static void attachDragAndDrop(javax.swing.JComponent c)
           
 void attachJinputListener(JinputListener listener)
           
static java.lang.String convertStreamToString(java.io.InputStream is)
           
static java.lang.String convertStreamToString(java.io.InputStreamReader r)
          Static: DnD utils *
 void createMenus()
          Set up basic menus
abstract  void dataChangedEvent()
          Called whenever EV has changed
static void dialogAbout()
          Show about dialog
 void dialogPreferences()
          Handle "preferences" from the Mac menu
static void dialogQuit()
          Show the quit dialog
static void dialogSysInfo()
          Show system info dialog
 void disposeEvWindow()
           
protected  void finalize()
           
 void freeResourcesBasic()
           
 java.awt.Rectangle getBounds()
           
 java.awt.Rectangle getBoundsEvWindow()
           
 javax.swing.JMenu getCreateMenuWindowCategory(java.lang.String category)
           
 EvWindowManager getEvw()
           
static java.io.File getLastDataPath()
          Get last path used to open or save data
static java.util.List<EvBasicWindow> getWindowList()
          Get the set of all windows, not to be modified
static java.awt.Rectangle getXMLbounds(org.jdom.Element e)
          Get bounds of window from XML element
static java.awt.Point getXMLposition(org.jdom.Element e)
          Get position of window from XML element.
static boolean holdModifier1(java.awt.event.KeyEvent e)
           
static void initPlugin()
          Plugin declaration
static java.io.File openDialogChooseDir()
          Open dialog to choose a directory.
static java.io.File openDialogOpenFile()
          Open dialog to open a file.
static java.io.File openDialogSaveFile(java.lang.String ext)
          Open dialog to open a file.
 void packEvWindow()
           
static void setAcceleratorCopy(javax.swing.JMenuItem mi)
           
static void setAcceleratorCut(javax.swing.JMenuItem mi)
           
static void setAcceleratorDelete(javax.swing.JMenuItem mi)
           
static void setAcceleratorPaste(javax.swing.JMenuItem mi)
           
 void setBoundsEvWindow(java.lang.Integer w, java.lang.Integer h)
           
 void setBoundsEvWindow(int x, int y, int width, int height)
           
 void setBoundsEvWindow(java.awt.Rectangle r)
           
static void setLastDataPath(java.io.File s)
          Set last path used to open or save data
 void setLocationEvWindow(int x, int y)
           
 void setLocationEvWindow(java.awt.Point p)
           
 void setResizable(boolean b)
           
 void setTitleEvWindow(java.lang.String title)
          Set title of this window
 void setVisibleEvWindow(boolean b)
          Set visibility of this window
 void setXMLbounds(org.jdom.Element e)
          Store bounds of this window into XML element
static EvBasicWindow.DialogReturnStatus showConfirmYesNoCancelDialog(java.lang.String question)
          Show dialog asking Yes/No/Cancel to a question
static boolean showConfirmYesNoDialog(java.lang.String question)
          Show dialog asking Yes/No to a question
static void showErrorDialog(java.lang.String error)
          Show error dialog
static void showInformativeDialog(java.lang.String message)
          Show informative dialog
static java.lang.String showInputDialog(java.lang.String message, java.lang.String value)
          Ask for input
static void showWarningDialog(java.lang.String warning)
          Show warning dialog
 void toFront()
           
static java.util.List<java.io.File> transferableToFileList(java.awt.datatransfer.Transferable t)
           
static void updateLoadedFile(EvData d)
          Broadcast that a file has been loaded
static void updateWindows()
          Tell all windows to update.
static void updateWindows(EvBasicWindow from)
          Tell all windows to update except where the signal came from.
abstract  void windowEventUserLoadedFile(EvData data)
          Called when a file has just been loaded and should be displayed in all windows
abstract  void windowFreeResources()
          Called when the window is closed.
abstract  java.lang.String windowHelpTopic()
          Help on how to use this window.
abstract  void windowLoadPersonalSettings(org.jdom.Element e)
           
abstract  void windowSavePersonalSettings(org.jdom.Element root)
          Called to obtain personal settings for that window.
 
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, 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, 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, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

windowManager

public static EvBasicWindow.EvWindowManagerMaker windowManager
Manager for creating windows


KEY_GETCONSOLE

public static final int KEY_GETCONSOLE

windowInstance

public int windowInstance
Instance number unique to this window. Can be presented to the user to keep track of related dialogs.


menuFile

public javax.swing.JMenu menuFile

jinputListeners

public java.util.WeakHashMap<JinputListener,java.lang.Object> jinputListeners

lastDataPath

public static java.io.File lastDataPath
Remember last path used to load an imageset

Constructor Detail

EvBasicWindow

public EvBasicWindow()
Just copy in needed data

Method Detail

getWindowList

public static java.util.List<EvBasicWindow> getWindowList()
Get the set of all windows, not to be modified


addBasicWindowExtension

public static void addBasicWindowExtension(EvBasicWindowExtension e)
Add an extension of Basic Window


updateWindows

public static void updateWindows(EvBasicWindow from)
Tell all windows to update except where the signal came from. This is needed to avoid nasty infinite recursion if signal is emitted during rendering. DEPRECATED!


updateWindows

public static void updateWindows()
Tell all windows to update. DO NOT USE! DEPRECATED!


holdModifier1

public static boolean holdModifier1(java.awt.event.KeyEvent e)

getXMLbounds

public static java.awt.Rectangle getXMLbounds(org.jdom.Element e)
                                       throws java.lang.Exception
Get bounds of window from XML element

Throws:
java.lang.Exception

setXMLbounds

public void setXMLbounds(org.jdom.Element e)
Store bounds of this window into XML element


getXMLposition

public static java.awt.Point getXMLposition(org.jdom.Element e)
Get position of window from XML element. Returns upper-left corner if it fails


addMenuItemSorted

public static void addMenuItemSorted(javax.swing.JMenu menu,
                                     javax.swing.JMenuItem ni,
                                     java.lang.String itemName)
Add menu item to a menu, put it in alphabetical order


addMenuItemSorted

public static void addMenuItemSorted(javax.swing.JMenu menu,
                                     javax.swing.JMenuItem ni)
Add sorted entry, take label as name


addMenuSorted

public static void addMenuSorted(javax.swing.JMenuBar menu,
                                 javax.swing.JMenu ni)
Add menu to a menubar, put in alphabetical order


updateLoadedFile

public static void updateLoadedFile(EvData d)
Broadcast that a file has been loaded


convertStreamToString

public static java.lang.String convertStreamToString(java.io.InputStreamReader r)
Static: DnD utils *


convertStreamToString

public static java.lang.String convertStreamToString(java.io.InputStream is)

attachDragAndDrop

public static void attachDragAndDrop(javax.swing.JComponent c)

transferableToFileList

public static java.util.List<java.io.File> transferableToFileList(java.awt.datatransfer.Transferable t)

getEvw

public EvWindowManager getEvw()

packEvWindow

public void packEvWindow()

getBoundsEvWindow

public java.awt.Rectangle getBoundsEvWindow()

setBoundsEvWindow

public void setBoundsEvWindow(java.awt.Rectangle r)

setBoundsEvWindow

public void setBoundsEvWindow(java.lang.Integer w,
                              java.lang.Integer h)

setBoundsEvWindow

public void setBoundsEvWindow(int x,
                              int y,
                              int width,
                              int height)

setLocationEvWindow

public void setLocationEvWindow(java.awt.Point p)

setLocationEvWindow

public void setLocationEvWindow(int x,
                                int y)

getBounds

public java.awt.Rectangle getBounds()
Overrides:
getBounds in class java.awt.Component

setTitleEvWindow

public void setTitleEvWindow(java.lang.String title)
Set title of this window


setVisibleEvWindow

public void setVisibleEvWindow(boolean b)
Set visibility of this window


setResizable

public void setResizable(boolean b)

disposeEvWindow

public void disposeEvWindow()

toFront

public void toFront()

addHook

public void addHook(java.lang.Class<?> cl,
                    EvBasicWindowHook hook)

addMenuWindow

public void addMenuWindow(javax.swing.JMenuItem ni)
Add to the menu Window


getCreateMenuWindowCategory

public javax.swing.JMenu getCreateMenuWindowCategory(java.lang.String category)

addMenuOperation

public void addMenuOperation(javax.swing.JMenuItem ni,
                             java.lang.String sortText)
Add to the menu Operation


addMainMenubarCommon

public void addMainMenubarCommon(javax.swing.JMenu ni)
Add to the menubar


addMainMenubarWindowSpecific

public void addMainMenubarWindowSpecific(javax.swing.JMenu ni)
Add to the menubar


createMenus

public void createMenus()
Set up basic menus


dialogAbout

public static void dialogAbout()
Show about dialog


dialogSysInfo

public static void dialogSysInfo()
Show system info dialog


dialogPreferences

public void dialogPreferences()
Handle "preferences" from the Mac menu


dialogQuit

public static void dialogQuit()
Show the quit dialog


finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

freeResourcesBasic

public void freeResourcesBasic()

showErrorDialog

public static void showErrorDialog(java.lang.String error)
Show error dialog


showWarningDialog

public static void showWarningDialog(java.lang.String warning)
Show warning dialog


showInputDialog

public static java.lang.String showInputDialog(java.lang.String message,
                                               java.lang.String value)
Ask for input


showInformativeDialog

public static void showInformativeDialog(java.lang.String message)
Show informative dialog


showConfirmYesNoDialog

public static boolean showConfirmYesNoDialog(java.lang.String question)
Show dialog asking Yes/No to a question


showConfirmYesNoCancelDialog

public static EvBasicWindow.DialogReturnStatus showConfirmYesNoCancelDialog(java.lang.String question)
Show dialog asking Yes/No/Cancel to a question


attachJinputListener

public void attachJinputListener(JinputListener listener)

setAcceleratorCopy

public static void setAcceleratorCopy(javax.swing.JMenuItem mi)

setAcceleratorPaste

public static void setAcceleratorPaste(javax.swing.JMenuItem mi)

setAcceleratorCut

public static void setAcceleratorCut(javax.swing.JMenuItem mi)

setAcceleratorDelete

public static void setAcceleratorDelete(javax.swing.JMenuItem mi)

dataChangedEvent

public abstract void dataChangedEvent()
Called whenever EV has changed


windowSavePersonalSettings

public abstract void windowSavePersonalSettings(org.jdom.Element root)
Called to obtain personal settings for that window. Function has to create new elements and add them to the given element.


windowLoadPersonalSettings

public abstract void windowLoadPersonalSettings(org.jdom.Element e)

windowEventUserLoadedFile

public abstract void windowEventUserLoadedFile(EvData data)
Called when a file has just been loaded and should be displayed in all windows


windowFreeResources

public abstract void windowFreeResources()
Called when the window is closed. Should take care of deallocating and stopping any threads


windowHelpTopic

public abstract java.lang.String windowHelpTopic()
Help on how to use this window. Can return null


getLastDataPath

public static java.io.File getLastDataPath()
Get last path used to open or save data


setLastDataPath

public static void setLastDataPath(java.io.File s)
Set last path used to open or save data


openDialogChooseDir

public static java.io.File openDialogChooseDir()
Open dialog to choose a directory. The parent of this directory is remembered for later


openDialogOpenFile

public static java.io.File openDialogOpenFile()
Open dialog to open a file. The parent of this file is remembered for later


openDialogSaveFile

public static java.io.File openDialogSaveFile(java.lang.String ext)
Open dialog to open a file. The parent of this file is remembered for later

Parameters:
ext - Can be null. Otherwise file extension, with the . included

initPlugin

public static void initPlugin()
Plugin declaration