|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjpicedt.ui.MDIManager
public abstract class MDIManager
An abstract class that serves as the superclass for jPicEdt's Multiple Document Interface desktop managers.
Concrete implementation know how to add or remove a document (e.g. a PEDrawingBoard or a DockablePanel) to the MDI interface. Each document is actually contained in a MDIComponent (i.e. either a JFrame or a JInternalFrame), which is created by the factory method createMDIComponent(). The list of MDIComponent's which currently belong to the desktop is hold in separate hash maps, one for each family of documents. There are currently two kind of documents supported:
Nested Class Summary | |
---|---|
protected class |
MDIManager.BoardEventHandler
A handler for events triggered from any PEDrawingBoard, its PECanvas or its EditorKit. |
class |
MDIManager.DockablePanel
A wrapper for dockable panels, e.g. |
static interface |
MDIManager.MDIComponent
A common interface for UI components being hosted by this MDIManager. |
Field Summary | |
---|---|
static String |
ACTIVE_BOARD_CHANGE
PropertyChangeEvent's name corresponding to a new board being activated |
protected PEDrawingBoard |
activeBoard
Reference on the currently active board, or null if no board is currently open. |
protected MDIManager.BoardEventHandler |
boardEventHandler
delegate which notifies dockable panels when a an event is triggered by a PEDrawingBoard |
protected HashMap |
boardMap
A hash table used to bind a PEDrawingBoard (the key) and its MDIComponent container (the value) This map plays pretty much the same role as JDesktopPane, but it's able to manage any desktop component implementing the MDIComponent interface, e.g. |
protected HashMap |
dockablePanelsMap
a hash table used to remember dockable panels added to the desktop, with key=panel's title |
static String |
KEY_MDIMANAGER
key for persistent storage |
static String |
MDI_CHILDFRAMES
value for persistent storage |
static String |
MDI_STANDALONEFRAMES
value for persistent storage |
Constructor Summary | |
---|---|
MDIManager()
|
Method Summary | |
---|---|
void |
addDockablePanel(String key,
JPanel pane)
Adds the given pane to the hashtable of dockable panels, then shows it. |
void |
addDrawingBoard(PEDrawingBoard board)
Adds a new DrawingBoard component to the list of drawing boards. |
abstract void |
addMDIComponent(MDIManager.MDIComponent c)
Adds the given component to the desktop of this MDIManager. |
abstract void |
cascadeDrawingBoards()
Rearranges all open drawing-boards by cascading them |
abstract void |
closeBoard(PEDrawingBoard board)
Ask the given board to close itself |
abstract MDIManager.MDIComponent |
createMDIComponent(JPanel pane)
Factory method that creates a MDIComponent that acts as a wrapper for the given pane. |
static MDIManager |
createMDIManager(String value,
PEProgressBar progress)
Create an MDIManager according to the given value. |
PopupMenuFactory |
createPopupMenuFactory()
Factory method to create a PopupMenuFactory for newly created board |
abstract PEDrawingBoard |
getActiveDrawingBoard()
Returns the currently active drawing board |
PEDrawingBoard[] |
getAllDrawingBoards()
Returns all opened drawing boards |
static String |
getDefaultManagerName()
|
abstract Dimension |
getDesktopSize()
Returns the dimension of the desktop that hosts the components of this MDIManager. |
JPanel |
getDockablePanelFromKey(String key)
Return the inner pane contained in the dockable panel associated with the given key, or null if none match. |
Set |
getDockablePanelKeys()
Returns a set containing all keys (of class "String") that map to a DockablePanel |
int |
getDrawingBoardCount()
Returns the number of open boards |
MDIManager.MDIComponent |
getHostingContainer(PEDrawingBoard board)
Returns the MDIComponent that contains the given board |
static String[] |
getInstalledMDIManagers()
|
abstract JMenuItem[] |
getMenuItems()
Return an array containing all the menu-items components attached to menubars |
abstract String |
getName()
|
protected boolean |
removeDrawingBoard(PEDrawingBoard board)
Remove the given drawing board from the list of open drawing boards, possibly attempting to save its content if necessary, then unregisters any previously registered listener. |
void |
saveGeometry()
Saves UI geometry to JPicEdt's preferences. This implementation saves geometrical properties related to DockablePanel only. |
abstract void |
selectDrawingBoard(PEDrawingBoard board)
Selects the given drawing board ; concrete implementation should call show() or any similar method on the MDIComponent (aka container) hosting the given board. |
void |
setHostingContainerTitle(String title,
PEDrawingBoard board)
Sets the title of the frame/internal frame hosting the given board to the given string. |
void |
showDockablePanel(String key,
boolean visible)
Set the visible state of the dockable pane with the given key. |
void |
showStatus(String str)
Requests that the argument string be displayed in the status bar |
abstract void |
tileDrawingBoardsHorizontally()
Tiles all open drawing-boards horizontally |
abstract void |
tileDrawingBoardsVertically()
Tiles all open drawing-boards vertically |
void |
toggleDockablePanel(String key)
Toggle the visible state of the dockable pane with the given key. |
void |
update()
Updates local properties from the JPicEdt's preferences (e.g. |
abstract void |
updateAccelerators()
Update JMenuItem's accelerators from the key/value pairs stored in JPicEdt's preferences |
abstract void |
updateFragmentsMenu()
Updates the "fragments" menu items |
abstract void |
updateMenuBar()
Update the content (i.e. |
abstract void |
updateRecentFilesSubmenu()
Updates the "recent files" sub-menu items after a frame was saved or opened. |
abstract void |
updateScriptsMenu()
Updates the "script" menu items |
abstract void |
updateToolkitMenu(PropertyChangeEvent e)
update currently "selected" menuitem in Toolkit menu |
abstract void |
updateUndoRedoMenus(String undoName,
String redoName)
update "undo" and "redo" text |
abstract 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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String KEY_MDIMANAGER
public static final String MDI_CHILDFRAMES
public static final String MDI_STANDALONEFRAMES
public static final String ACTIVE_BOARD_CHANGE
protected HashMap dockablePanelsMap
protected HashMap boardMap
protected MDIManager.BoardEventHandler boardEventHandler
protected PEDrawingBoard activeBoard
Constructor Detail |
---|
public MDIManager()
Method Detail |
---|
public static MDIManager createMDIManager(String value, PEProgressBar progress)
value
- one of MDI_CHILDFRAMES or MDI_STANDALONEFRAMESpublic static String[] getInstalledMDIManagers()
public static String getDefaultManagerName()
public abstract String getName()
public abstract MDIManager.MDIComponent createMDIComponent(JPanel pane)
public abstract void addMDIComponent(MDIManager.MDIComponent c)
public abstract Dimension getDesktopSize()
public void update()
public void saveGeometry()
addDockablePanel(java.lang.String, javax.swing.JPanel)
,
MDIManager.DockablePanel.setVisible(boolean)
public void showStatus(String str)
public PopupMenuFactory createPopupMenuFactory()
public abstract void updateAccelerators()
public abstract void updateMenuBar()
public abstract void updateRecentFilesSubmenu()
public abstract void updateScriptsMenu()
public abstract void updateFragmentsMenu()
public abstract void updateUndoRedoMenus(String undoName, String redoName)
public abstract void updateWindowMenu() throws MissingResourceException
MissingResourceException
public abstract void updateToolkitMenu(PropertyChangeEvent e)
public abstract JMenuItem[] getMenuItems()
public MDIManager.MDIComponent getHostingContainer(PEDrawingBoard board)
public void setHostingContainerTitle(String title, PEDrawingBoard board)
public void addDrawingBoard(PEDrawingBoard board)
public abstract void closeBoard(PEDrawingBoard board)
protected boolean removeDrawingBoard(PEDrawingBoard board)
public PEDrawingBoard[] getAllDrawingBoards()
public abstract void selectDrawingBoard(PEDrawingBoard board)
public int getDrawingBoardCount()
public abstract PEDrawingBoard getActiveDrawingBoard()
public void addDockablePanel(String key, JPanel pane)
key
- used to retrieve geometrical properties from the JPicEdt's preferences, i.e.
"ui." + key + ".visible" for the visible state at init time.public void toggleDockablePanel(String key)
public void showDockablePanel(String key, boolean visible)
public Set getDockablePanelKeys()
public JPanel getDockablePanelFromKey(String key)
public abstract void cascadeDrawingBoards()
public abstract void tileDrawingBoardsHorizontally()
public abstract void tileDrawingBoardsVertically()
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |