Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.flexstor.common.awt
Class FlexFrame  view FlexFrame download FlexFrame.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Frame
                  extended bycom.flexstor.common.awt.FlexFrame
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, WindowId

public abstract class FlexFrame
extends java.awt.Frame
implements WindowId, java.awt.event.ActionListener

This class creates a top level window with a toolbar panel, a content panel, and an optional status bar.

 +------------------+
 | toolbar          |
 +------------------+
 |                  |
 | content          |
 |                  |
 |                  |
 +------------------+
 | status bar       |
 +------------------+
 

Version:
3.0

Nested Class Summary
(package private)  class FlexFrame.FrameWindowEventHandler
          Inner class to handle window events.
 
Nested classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected static AboutHandlerI aboutHandler
           
protected  java.util.Vector fChildren
           
protected  FlexFrame fOwner
           
protected static HelpHandlerI helpHandler
           
private static java.awt.Image iconImage
           
protected  java.awt.Panel pContent
           
protected  com.flexstor.common.awt.toolbar.ToolBar pToolBar
           
protected  StatusBar statusBar
           
 
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.Window
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.flexstor.common.awt.WindowId
SUBID_DUAL, SUBID_NONE, SUBID_RECORD, SUBID_SEARCH_ADVANCED, SUBID_SEARCH_BASIC, SUBID_SEARCH_FILEBASED, SUBID_SEARCH_FULL_TEXT, SUBID_SUMMARY, SUBID_THUMBNAIL, WNDID_ADDRESSBOOK, WNDID_ADMIN_MAIN, WNDID_APPLICATION_RIGHT, WNDID_ARCHIVE_DLG, WNDID_ASSET_ROLE, WNDID_CHANGE_PASSWORD, WNDID_CLASSIFICATION, WNDID_ELEMENT_DETAILS, WNDID_FILE_MODIFIER, WNDID_FILE_VIEWER, WNDID_FULL_SIZE, WNDID_IMPORT, WNDID_LOGIN, WNDID_MAIN, WNDID_PREFERENCE, WNDID_REGISTRY_DEBUGGER, WNDID_RESTORE_DLG, WNDID_RETRIEVAL, WNDID_RPT_DESIGNER, WNDID_SEARCH, WNDID_SEND_CHG_SET, WNDID_SEND_ELEM, WNDID_SERVER_MAINTENANCE, WNDID_SERVER_UPDATE, WNDID_SETTINGS, WNDID_TRANSACTION_LOGGING, WNDID_USER_GROUP, WNDID_WHERE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
FlexFrame()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Handles common actions (originating from toolbar/menubar) for all Frames, e.g.
 void addChild(FlexFrame aChild)
          Adds a frame to the list of children
 void addNotify()
          Creates the native peer for this window.
protected  boolean canClose()
          Returns a boolean indicating wether the frame can be closed.
 void centerOn(java.awt.Frame f)
          Centers the frame on the screen or in relation to another frame.
 boolean close()
          Closes this frame and all children, calls canClose() to check for pending changes.
 java.util.Enumeration getChildren()
          Gets all child frames in an enumeration.
 java.awt.Panel getContentPanel()
          Accessor to the content panel
 FlexFrame getOwnerFrame()
          Gets the owner of this frame
abstract  int getSubWindowID()
          Returns the sub ID for this frame.
 java.awt.Panel getToolBar()
          Accessor to the toolbar panel
abstract  int getWindowID()
          Returns the ID for this frame.
 com.flexstor.common.settings.SettingKey getWindowName()
           
static void registerAboutHandler(AboutHandlerI handler)
           
static void registerHelpHandler(HelpHandlerI handler)
           
 void removeChild(FlexFrame aChild)
          Removes a frame from the list of children
 void saveSize()
          Saves the location and size of the frame as a user setting.
 void setContentPanel(java.awt.Panel panel)
          Sets/replaces the content panel.
private  void setIconImage()
           
 void setMenuBar(java.awt.MenuBar mb)
          Hooks up the frame as an action listener to the new menu bar.
 void setOwnerFrame(FlexFrame anOwner)
          Sets the owner of this frame
 void setSize()
          Resizes the frame to its previous size and location if it is found in user settings.
 void setStatusText(java.lang.String sStatus)
          Sets the text in the status bar to the specified value.
 void setToolBar(java.awt.Panel newToolBar)
          Mutator of the toolbar panel, replaces the existing toolbar with the passed in panel
 void setWaitCursor(boolean bWait)
           
 void showStatusBar(boolean bShow)
          Adds/removes a status bar to the bottom of this frame.
 
Methods inherited from class java.awt.Frame
getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getGraphicsConfiguration, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusDownCycle, update, 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, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, 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, isOpaque, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

iconImage

private static java.awt.Image iconImage

helpHandler

protected static HelpHandlerI helpHandler

aboutHandler

protected static AboutHandlerI aboutHandler

fOwner

protected FlexFrame fOwner

fChildren

protected java.util.Vector fChildren

pToolBar

protected com.flexstor.common.awt.toolbar.ToolBar pToolBar

pContent

protected java.awt.Panel pContent

statusBar

protected StatusBar statusBar
Constructor Detail

FlexFrame

public FlexFrame()
Method Detail

getWindowID

public abstract int getWindowID()
Returns the ID for this frame.


getSubWindowID

public abstract int getSubWindowID()
Returns the sub ID for this frame.


setIconImage

private void setIconImage()

getWindowName

public com.flexstor.common.settings.SettingKey getWindowName()

centerOn

public void centerOn(java.awt.Frame f)
Centers the frame on the screen or in relation to another frame.


setWaitCursor

public void setWaitCursor(boolean bWait)

getContentPanel

public java.awt.Panel getContentPanel()
Accessor to the content panel


setContentPanel

public void setContentPanel(java.awt.Panel panel)
Sets/replaces the content panel.


getToolBar

public java.awt.Panel getToolBar()
Accessor to the toolbar panel


setToolBar

public void setToolBar(java.awt.Panel newToolBar)
Mutator of the toolbar panel, replaces the existing toolbar with the passed in panel


setMenuBar

public void setMenuBar(java.awt.MenuBar mb)
Hooks up the frame as an action listener to the new menu bar. Also, removes the registration from the previous menu bar.


showStatusBar

public void showStatusBar(boolean bShow)
Adds/removes a status bar to the bottom of this frame.


setStatusText

public void setStatusText(java.lang.String sStatus)
Sets the text in the status bar to the specified value. The JCString parameter allows you to set fonts, styles, and colors.


setOwnerFrame

public void setOwnerFrame(FlexFrame anOwner)
Sets the owner of this frame


getOwnerFrame

public FlexFrame getOwnerFrame()
Gets the owner of this frame


addChild

public void addChild(FlexFrame aChild)
Adds a frame to the list of children


removeChild

public void removeChild(FlexFrame aChild)
Removes a frame from the list of children


getChildren

public java.util.Enumeration getChildren()
Gets all child frames in an enumeration.


close

public boolean close()
Closes this frame and all children, calls canClose() to check for pending changes.


canClose

protected boolean canClose()
Returns a boolean indicating wether the frame can be closed. The default behavior is to return true. This method needs to be overwritten in subclasses which require a check before they can be closed.


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Handles common actions (originating from toolbar/menubar) for all Frames, e.g. About Box, close and Main Help.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

addNotify

public void addNotify()
Description copied from class: java.awt.Window
Creates the native peer for this window.


setSize

public void setSize()
Resizes the frame to its previous size and location if it is found in user settings. Otherwise, its preferred size is used. Every subclass should override getPreferredSize() in order to set the default. Enforces these limitations: 1. Positions never off screen, i.e. x,y >= 0
2. Width and height always within screen size, i.e. w,h <= screen.w,h 3. A frame is always completely on screen, i.e. x+w < screen.w, y+h < screen.h setSize is called from addNotify, because a peer must exist.


saveSize

public void saveSize()
Saves the location and size of the frame as a user setting. saveSize() is called by close() and can also be called directly. PLEASE NOTE THAT THIS METHOD WILL REMOVE ANY CURRENT MENUBAR FOR ALL PLATFORMS, EXCEPT FOR MacOS, IN ORDER TO BE ABLE TO CALCULATE THE CORRECT FRAME SIZE.


registerHelpHandler

public static void registerHelpHandler(HelpHandlerI handler)

registerAboutHandler

public static void registerAboutHandler(AboutHandlerI handler)