|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jpicedt.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 kinds of documents supported:
PEDrawingBoard
's: they're directly wrapped into a MDIComponent
. The
"boardMap
" hash map holds the list of boards belonging to the desktop, together with
their UI delegate. The addDrawingBoard()
and removeDrawingBoard()
methods
allows one to add or remove boards from the desktop. These methods wrap board into their UI delegate
on-the-fly. Finally, the "activeBoard
" variable maintains a reference on the currently
active drawing board (or null if none is active and/or open).
DockablePanel
's: there's one more layer in this case, as
DockablePanel
management
directly in this class, instead of relying on concrete subclasses to do the job.
dockablePanelsMap
" which holds the list of
DockablePanel
's belonging to the desktop, together with a key which allows us to
retrieve these UI properties from jPicEdt
's properties.
DockablePanel
, instead of being directly wrapped into an
MDIComponent
, rather holds a reference to it; this in particular allows us to
create/hide/show/etc… DockablePanel
's directly in this class, since we do
not need to rely on a particular implementation of MDIComponent
.
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. the attribute editor or the toolkit palette. |
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 an event is triggered by a PEDrawingBoard |
protected HashMap<PEDrawingBoard,MDIComponent> |
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. |
static String |
DOCKABLE_PANEL_TOGGLE
PropertyChangeEvent 's name corresponding to a dockable panel change in visibility |
protected HashMap<String,MDIManager.DockablePanel> |
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 | |
---|---|
MDIManager.DockablePanel |
addDockablePanel(String key,
JPanel pane)
Adds the given pane to the hashtable of dockable panels, then shows it. |
void |
addDockablePanelPropertyChangeListener(PropertyChangeListener l)
|
void |
addDrawingBoard(PEDrawingBoard board)
Adds a new DrawingBoard component to the list of drawing boards. |
abstract void |
addMDIComponent(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 MDIComponent |
createMDIComponent(JComponent 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 |
Set<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 . |
Container |
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 |
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()
|
void |
removeDockablePanelPropertyChangeListener(PropertyChangeListener l)
|
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. |
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. |
int |
showDontAskMeAgainConfirmDialog(String message,
String title,
String dontAskMeAgainKey,
int messageType)
Describe showDontAskMeAgainConfirmDialog method here. |
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 |
Methods inherited from interface jpicedt.graphic.toolkit.DialogFactory |
---|
createCustomizerDialog, createCustomizerDialog, createDialog, showConfirmDialog, showConfirmDialog, showInputDialog, showInputDialog, showInputDialog, showMessageDialog |
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
PropertyChangeEvent
's name corresponding to a new board being activated
public static final String DOCKABLE_PANEL_TOGGLE
PropertyChangeEvent
's name corresponding to a dockable panel change in visibility
protected HashMap<String,MDIManager.DockablePanel> dockablePanelsMap
protected HashMap<PEDrawingBoard,MDIComponent> boardMap
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. JFrame
's as well as JInternalFrame
's. In particular, since this map
holds the list of PEDrawingBoard
's together with their hosting MDIComponent
,
it's at the core of the desktop management, e.g. for adding or removing boards properly.
protected MDIManager.BoardEventHandler boardEventHandler
PEDrawingBoard
protected PEDrawingBoard activeBoard
MDIDesktopManager
when a MDIComponent
gets
(de)activated, and it contains a PEDrawingBoard
.
Constructor Detail |
---|
public MDIManager()
Method Detail |
---|
public static MDIManager createMDIManager(String value, PEProgressBar progress)
MDIManager
according to the given value.
value
- one of MDI_CHILDFRAMES
or MDI_STANDALONEFRAMES
public static String[] getInstalledMDIManagers()
public static String getDefaultManagerName()
public abstract String getName()
public abstract MDIComponent createMDIComponent(JComponent pane)
MDIComponent
that acts as a wrapper for the given pane.
public abstract void addMDIComponent(MDIComponent c)
MDIManager
.
public abstract Dimension getDesktopSize()
MDIManager
.
Depending on the implementation, this may be either the whole screen, or the size of a
JFrame
containing all the documents.
public void update()
JPicEdt
's preferences (e.g. GUI colours,
rendering-hints,…) This implementation update the rendering hints of each currently opened
PEDrawingBoard
public void saveGeometry()
JPicEdt
's preferences.DockablePanel
only.
addDockablePanel(java.lang.String, javax.swing.JPanel)
,
MDIManager.DockablePanel.setVisible(boolean)
public void showStatus(String str)
public PopupMenuFactory createPopupMenuFactory()
PopupMenuFactory
for newly created board
public abstract void updateAccelerators()
JMenuItem
's accelerators from the key/value pairs stored in JPicEdt
's
preferences
public abstract void updateMenuBar()
PEMenu
's) of the menu-bar depending on the current state of the
MDIManager
.
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 MDIComponent getHostingContainer(PEDrawingBoard board)
public void setHostingContainerTitle(String title, PEDrawingBoard board)
public void addDrawingBoard(PEDrawingBoard board)
DrawingBoard
component to the list of drawing boards. The given board gets
wrapped into a MDIComponent
beforehands.
public abstract void closeBoard(PEDrawingBoard board)
protected boolean removeDrawingBoard(PEDrawingBoard board)
MDIComponent
) is the responsibility of the caller.
public Set<PEDrawingBoard> getAllDrawingBoards()
public abstract void selectDrawingBoard(PEDrawingBoard board)
show()
or any
similar method on the MDIComponent
(aka container) hosting the given board.
public int getDrawingBoardCount()
public abstract PEDrawingBoard getActiveDrawingBoard()
public MDIManager.DockablePanel addDockablePanel(String key, JPanel pane)
SelectionListener
(resp. PropertyChangeListener
), it will be notified
selection (resp. propery-change) events from any currently opened drawing board.
key
- used to retrieve geometrical properties from the JPicEdt
's preferences, i.e.
"ui." + key + ".visible" for the visible state at init time.
DockablePanel
, or null if it was already registered.public void toggleDockablePanel(String key)
public void showDockablePanel(String key, boolean visible)
public Set getDockablePanelKeys()
String
") that map to a
DockablePanel
public Container getDockablePanelFromKey(String key)
public void addDockablePanelPropertyChangeListener(PropertyChangeListener l)
public void removeDockablePanelPropertyChangeListener(PropertyChangeListener l)
public int showDontAskMeAgainConfirmDialog(String message, String title, String dontAskMeAgainKey, int messageType)
DialogFactory
showDontAskMeAgainConfirmDialog
method here.
showDontAskMeAgainConfirmDialog
in interface DialogFactory
message
- Un message textuel.title
- voir javax.swing#JOptionPane
dontAskMeAgainKey
- une clef de propriété de type jpicedt.ui.dialog
.messageType
- voir javax.swing.JOptionPane.
javax.swing#JOptionPane
, renvoie JOptionPane.YES_OPTION
ou
JOptionPane.NO_OPTION
.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 |