http://www.jpicedt.org

jpicedt.ui.internal
Class InternalFrameMDIManager

java.lang.Object
  extended by jpicedt.ui.MDIManager
      extended by jpicedt.ui.internal.InternalFrameMDIManager
All Implemented Interfaces:
DialogFactory

public class InternalFrameMDIManager
extends MDIManager

An MDI Manager implementation for "childframe" mode (ie using JInternalFrame's).

Layer management:

Since:
jPicEdt 1.2
Version:
$Id: InternalFrameMDIManager.java,v 1.35 2013/03/27 06:51:21 vincentb1 Exp $
Author:
Sylvain Reynal

Nested Class Summary
 
Nested classes/interfaces inherited from class jpicedt.ui.MDIManager
MDIManager.BoardEventHandler, MDIManager.DockablePanel
 
Field Summary
static Color desktopColorDEFAULT
           
static String KEY_DESKTOP_COLOR
           
static String KEY_GEOMETRY_HEIGHT
           
static String KEY_GEOMETRY_WIDTH
           
static String KEY_GEOMETRY_X
           
static String KEY_GEOMETRY_Y
           
 
Fields inherited from class jpicedt.ui.MDIManager
ACTIVE_BOARD_CHANGE, activeBoard, boardEventHandler, boardMap, DOCKABLE_PANEL_TOGGLE, dockablePanelsMap, KEY_MDIMANAGER, MDI_CHILDFRAMES, MDI_STANDALONEFRAMES
 
Constructor Summary
InternalFrameMDIManager(PEProgressBar progressBar)
           
 
Method Summary
 MDIManager.DockablePanel addDockablePanel(String key, JPanel pane)
          Adds the given pane to the hashtable of dockable panels, then shows it.
 void addMDIComponent(MDIComponent c)
          Depending on the inner pane of the given container, adds it to the DEFAULT_LAYER or to the PALETTE_LAYER.
 void cascadeDrawingBoards()
          Cascade all open internal frames
 void closeBoard(PEDrawingBoard board)
          Ask the given board to close itself
 CustomizerDialog createCustomizerDialog(AbstractCustomizer customizer, boolean modal, EnumSet<CustomizerDialog.ButtonMask> buttonMask)
          Builds a new dialog box from a single customizer.
 CustomizerDialog createCustomizerDialog(ArrayList<AbstractCustomizer> customizers, int selected, String title, boolean modal, EnumSet<CustomizerDialog.ButtonMask> buttonMask)
          Creates a new dialog box from the given array of AbstractCustomizer's, laying them out in a JTabbedPane.
 MDIComponent createDialog(String title, boolean modal, JComponent p)
          Wraps the given component in a PEInternalDialog, and makes it visible.
 MDIComponent createMDIComponent(JComponent pane)
          Factory method that creates an MDIComponent which acts as a UI delegate to the given pane.
 PEDrawingBoard getActiveDrawingBoard()
          Returns the currently active drawing board ; null if there's no internal frame in the desktopPane.
 Dimension getDesktopSize()
          Returns the dimension of the desktop that hosts the components of this MDIManager.
 JMenuItem[] getMenuItems()
          Return an array containing all the menu-items components attached to menubars
 String getName()
           
 void saveGeometry()
          Saves UI geometry to JPicEdt's preferences.
 void selectDrawingBoard(PEDrawingBoard board)
          selects the given drawing board by bringing it to front.
 int showConfirmDialog(Object message, String title, int optionType)
           
 int showConfirmDialog(Object message, String title, int optionType, int msgType)
           
 String showInputDialog(Object message, String title, int messageType)
           
 Object showInputDialog(Object message, String title, int messageType, Object[] choices, Object initialChoice)
           
 String showInputDialog(Object message, String title, int messageType, String initialValue)
           
 void showMessageDialog(Object message, String title, int messageType)
           
 void tileDrawingBoardsHorizontally()
          Tiles all open internal frames horizontally
 void tileDrawingBoardsVertically()
          Tiles all open internal frames vertically.
 void update()
          Updates local properties from the JPicEdt's preferences (e.g.
 void updateAccelerators()
          Update JMenuItem's accelerators from the key/value pairs stored in JPicEdt's preferences
 void updateFragmentsMenu()
          Updates the "fragments" menu items
 void updateMenuBar()
          Update the content (i.e.
 void updateRecentFilesSubmenu()
          Updates the "recent files" sub-menu items after a frame was saved or opened.
 void updateScriptsMenu()
          Updates the "script" menu items
 void updateToolkitMenu(PropertyChangeEvent e)
          update currently "selected" menuitem in Toolkit menu
 void updateUndoRedoMenus(String undoName, String redoName)
          update "undo" and "redo" text
 void updateWindowMenu()
          Updates the Window menu as soon as an internal frame is opened or closed (this menu keeps tracks of every open internal frames so that the user can activate them quickly by use of a shortcut)
 
Methods inherited from class jpicedt.ui.MDIManager
addDockablePanelPropertyChangeListener, addDrawingBoard, createMDIManager, createPopupMenuFactory, getAllDrawingBoards, getDefaultManagerName, getDockablePanelFromKey, getDockablePanelKeys, getDrawingBoardCount, getHostingContainer, getInstalledMDIManagers, removeDockablePanelPropertyChangeListener, removeDrawingBoard, setHostingContainerTitle, showDockablePanel, showDontAskMeAgainConfirmDialog, showStatus, toggleDockablePanel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_GEOMETRY_X

public static final String KEY_GEOMETRY_X
See Also:
Constant Field Values

KEY_GEOMETRY_Y

public static final String KEY_GEOMETRY_Y
See Also:
Constant Field Values

KEY_GEOMETRY_WIDTH

public static final String KEY_GEOMETRY_WIDTH
See Also:
Constant Field Values

KEY_GEOMETRY_HEIGHT

public static final String KEY_GEOMETRY_HEIGHT
See Also:
Constant Field Values

KEY_DESKTOP_COLOR

public static final String KEY_DESKTOP_COLOR
See Also:
Constant Field Values

desktopColorDEFAULT

public static final Color desktopColorDEFAULT
Constructor Detail

InternalFrameMDIManager

public InternalFrameMDIManager(PEProgressBar progressBar)
Parameters:
progressBar - The progress bar to inform of progress in the initialization ; can be null.
Method Detail

getName

public String getName()
Specified by:
getName in class MDIManager

createMDIComponent

public MDIComponent createMDIComponent(JComponent pane)
Factory method that creates an MDIComponent which acts as a UI delegate to the given pane. This implementation returns a properly init'd JInternalFrame, with the given pane added to its content-pane.

Specified by:
createMDIComponent in class MDIManager

addMDIComponent

public void addMDIComponent(MDIComponent c)
Depending on the inner pane of the given container, adds it to the DEFAULT_LAYER or to the PALETTE_LAYER.

Specified by:
addMDIComponent in class MDIManager

closeBoard

public void closeBoard(PEDrawingBoard board)
Description copied from class: MDIManager
Ask the given board to close itself

Specified by:
closeBoard in class MDIManager

getDesktopSize

public Dimension getDesktopSize()
Returns the dimension of the desktop that hosts the components of this MDIManager.

Specified by:
getDesktopSize in class MDIManager

saveGeometry

public void saveGeometry()
Saves UI geometry to JPicEdt's preferences.

Overrides:
saveGeometry in class MDIManager
See Also:
InternalFrameMDIManager(jpicedt.ui.util.PEProgressBar), addDockablePanel(java.lang.String, javax.swing.JPanel), MDIManager.DockablePanel.setVisible(boolean)

update

public void update()
Updates local properties from the JPicEdt's preferences (e.g. GUI colours, rendering-hints,…) This implementation calls the superclass's method, then update the desktop-pane colour.

Overrides:
update in class MDIManager

updateAccelerators

public void updateAccelerators()
Update JMenuItem's accelerators from the key/value pairs stored in JPicEdt's preferences

Specified by:
updateAccelerators in class MDIManager

updateMenuBar

public void updateMenuBar()
Update the content (i.e. PEMenu's) of the menu-bar depending on the current state of the MDIManager.

Specified by:
updateMenuBar in class MDIManager

updateRecentFilesSubmenu

public void updateRecentFilesSubmenu()
Updates the "recent files" sub-menu items after a frame was saved or opened.

Specified by:
updateRecentFilesSubmenu in class MDIManager
Since:
PicEdt 1.1

updateScriptsMenu

public void updateScriptsMenu()
Updates the "script" menu items

Specified by:
updateScriptsMenu in class MDIManager
Since:
jpicedt 1.3.2

updateFragmentsMenu

public void updateFragmentsMenu()
Updates the "fragments" menu items

Specified by:
updateFragmentsMenu in class MDIManager
Since:
jpicedt 1.3.2

updateUndoRedoMenus

public void updateUndoRedoMenus(String undoName,
                                String redoName)
update "undo" and "redo" text

Specified by:
updateUndoRedoMenus in class MDIManager
Since:
jpicedt 1.3.2

updateWindowMenu

public void updateWindowMenu()
                      throws MissingResourceException
Updates the Window menu as soon as an internal frame is opened or closed (this menu keeps tracks of every open internal frames so that the user can activate them quickly by use of a shortcut)

Specified by:
updateWindowMenu in class MDIManager
Throws:
MissingResourceException
Since:
PicEdt 1.1

updateToolkitMenu

public void updateToolkitMenu(PropertyChangeEvent e)
update currently "selected" menuitem in Toolkit menu

Specified by:
updateToolkitMenu in class MDIManager

getMenuItems

public JMenuItem[] getMenuItems()
Return an array containing all the menu-items components attached to menubars

Specified by:
getMenuItems in class MDIManager

getActiveDrawingBoard

public PEDrawingBoard getActiveDrawingBoard()
Returns the currently active drawing board ; null if there's no internal frame in the desktopPane.
If there's at least one internal frame in the desktop, but it's deactivated (this should never happen however), then the policy is to arbitrarly activate one frame (namely the topmost frame on the desktop which is also the last one in the framearray)

Specified by:
getActiveDrawingBoard in class MDIManager

selectDrawingBoard

public void selectDrawingBoard(PEDrawingBoard board)
selects the given drawing board by bringing it to front.

Specified by:
selectDrawingBoard in class MDIManager

addDockablePanel

public MDIManager.DockablePanel addDockablePanel(String key,
                                                 JPanel pane)
Adds the given pane to the hashtable of dockable panels, then shows it. If "pane" is an instance of SelectionListener (resp. PropertyChangeListener), it will be notified selection (resp. propery-change) events from any currently opened drawing board.

Overrides:
addDockablePanel in class MDIManager
Parameters:
key - used to retrieve geometrical properties from the JPicEdt's preferences, i.e. "ui." + key + ".visible" for the visible state at init time.
Returns:
the DockablePanel, or null if it was already registered.

createDialog

public MDIComponent createDialog(String title,
                                 boolean modal,
                                 JComponent p)
Wraps the given component in a PEInternalDialog, and makes it visible.


createCustomizerDialog

public CustomizerDialog createCustomizerDialog(ArrayList<AbstractCustomizer> customizers,
                                               int selected,
                                               String title,
                                               boolean modal,
                                               EnumSet<CustomizerDialog.ButtonMask> buttonMask)
Creates a new dialog box from the given array of AbstractCustomizer's, laying them out in a JTabbedPane.
By default, clicking the OK button does not close this dialog box, this must be set separately by invoking CustomizerDialog.setOkButtonClosesDialog.

Parameters:
title - the dialog title ; if null, the title of the first customizer is used.
selected - index of the selected customizer on start-up
buttonMask - buttons to be displayed : a mask computed from predefinite masks OR'd together

createCustomizerDialog

public CustomizerDialog createCustomizerDialog(AbstractCustomizer customizer,
                                               boolean modal,
                                               EnumSet<CustomizerDialog.ButtonMask> buttonMask)
Builds a new dialog box from a single customizer.


showMessageDialog

public void showMessageDialog(Object message,
                              String title,
                              int messageType)
See Also:
JOptionPane

showConfirmDialog

public int showConfirmDialog(Object message,
                             String title,
                             int optionType)
See Also:
JOptionPane

showConfirmDialog

public int showConfirmDialog(Object message,
                             String title,
                             int optionType,
                             int msgType)
See Also:
JOptionPane

showInputDialog

public String showInputDialog(Object message,
                              String title,
                              int messageType)
See Also:
JOptionPane

showInputDialog

public String showInputDialog(Object message,
                              String title,
                              int messageType,
                              String initialValue)
See Also:
JOptionPane

showInputDialog

public Object showInputDialog(Object message,
                              String title,
                              int messageType,
                              Object[] choices,
                              Object initialChoice)
See Also:
JOptionPane

cascadeDrawingBoards

public void cascadeDrawingBoards()
Cascade all open internal frames

Specified by:
cascadeDrawingBoards in class MDIManager

tileDrawingBoardsHorizontally

public void tileDrawingBoardsHorizontally()
Tiles all open internal frames horizontally

Specified by:
tileDrawingBoardsHorizontally in class MDIManager

tileDrawingBoardsVertically

public void tileDrawingBoardsVertically()
Tiles all open internal frames vertically.

Specified by:
tileDrawingBoardsVertically in class MDIManager

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org