public class DesktopContext extends AppContextDelegate implements MDIContext
The implementation of JDesktopPane in Swing is not really quite what we want in a frame of this type, so there are various listeners attached to the JDesktopPane and the internal components that resize and reparent components in a more useful way.
Each "content pane" that is added to this frame is added by default to a JInternalFrame. However, the pane may be removed from the pane, either by the JDesktopPane when it is iconified, or by this class when the internal frame is maximized. Hence, users of this class should not rely on the content pane actually being contained by the internal frame that it is associated with.
MDI applications often contain multiple toolbars. This class implements a toolbar pane that contains the basic toolbar, along with any other toolbars in the application.
Modifier and Type | Field and Description |
---|---|
static int |
LAYOUT_CASCADED
The layout mode in which internal frames are cascaded one above another.
|
static int |
LAYOUT_HORIZONTAL
The layout mode in which internal frames are tiled horizontally.
|
static int |
LAYOUT_PLACED
The layout mode in which internal frames are placed by the user.
|
static int |
LAYOUT_VERTICAL
The layout mode in which internal frames are tiled vertically.
|
Constructor and Description |
---|
DesktopContext(AppContext context)
Create an instance of this Frame with the application.
|
DesktopContext(AppContext context,
JComponent palette)
Create an instance of this Frame with the application.
|
Modifier and Type | Method and Description |
---|---|
void |
addContentPane(String title,
JComponent pane)
Add a content pane to this frame.
|
void |
addViewListener(ViewListener listener)
Add a view listener to this frame.
|
JComponent |
getCurrentContentPane()
Get the content pane that is displayed as the current content
pane.
|
Icon |
getFrameIcon()
Return the icon that is displayed in the frame.
|
JInternalFrame |
getInternalFrame(JComponent pane)
Return the internal frame for a given component.
|
JToolBar |
getJToolBar()
Get the tool bar.
|
int |
getLayoutMode()
Get the layout mode
|
JComponent |
getPalettePane()
Get the component used for palettes and the like.
|
JSplitPane |
getSplitPane()
Get the split pane separating the shade pane and the desktop
pane.
|
JStatusBar |
getStatusBar()
Get the status bar.
|
JPanel |
getToolBarPane()
Get the tool bar pane.
|
boolean |
isMaximizeMode()
Test if we are in maximize mode
|
void |
refreshLayout()
Refresh the layout of the internal frames.
|
void |
removeContentPane(JComponent pane)
Remove the given content pane from the display and close.
|
void |
removeViewListener(ViewListener listener)
Remove a view listener from this frame.
|
void |
setCurrentContentPane(JComponent pane)
Set the given content pane to be displayed as the current
content pane.
|
void |
setFrameIcon(Icon icon)
Set the icon that is displayed in
internal frames.
|
void |
setLayoutMode(int mode)
Set the layout mode.
|
void |
setMaximizeMode(boolean mode)
Set the maximize mode.
|
void |
setPalettePane(JComponent pane)
Set the palette pane of the context to the given component.
|
void |
showStatus(String status)
Show the given status string in the context.
|
getContentPane, getDelegate, getExitAction, getGlassPane, getIconImage, getJMenuBar, getLayeredPane, getRootPane, getTitle, isVisible, makeComponent, setContentPane, setExitAction, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setSize, setTitle, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getExitAction, getIconImage, getJMenuBar, getTitle, isVisible, makeComponent, setExitAction, setIconImage, setJMenuBar, setSize, setTitle, setVisible
getContentPane, getGlassPane, getLayeredPane, getRootPane, setContentPane, setGlassPane, setLayeredPane
public static final int LAYOUT_PLACED
public static final int LAYOUT_HORIZONTAL
public static final int LAYOUT_VERTICAL
public static final int LAYOUT_CASCADED
public DesktopContext(AppContext context)
public DesktopContext(AppContext context, JComponent palette)
public void addContentPane(String title, JComponent pane)
addContentPane
in interface MDIContext
public void addViewListener(ViewListener listener)
addViewListener
in interface MDIContext
public JComponent getCurrentContentPane()
getCurrentContentPane
in interface MDIContext
public Icon getFrameIcon()
getFrameIcon
in interface MDIContext
public JInternalFrame getInternalFrame(JComponent pane)
public int getLayoutMode()
public JComponent getPalettePane()
public JStatusBar getStatusBar()
public JSplitPane getSplitPane()
public JToolBar getJToolBar()
public JPanel getToolBarPane()
public boolean isMaximizeMode()
public void refreshLayout()
public void removeContentPane(JComponent pane)
removeContentPane
in interface MDIContext
public void removeViewListener(ViewListener listener)
removeViewListener
in interface MDIContext
public void setCurrentContentPane(JComponent pane)
setCurrentContentPane
in interface MDIContext
public void setFrameIcon(Icon icon)
setFrameIcon
in interface MDIContext
public void setLayoutMode(int mode)
public void setMaximizeMode(boolean mode)
public void setPalettePane(JComponent pane)
public void showStatus(String status)
showStatus
in interface AppContext
showStatus
in class AppContextDelegate
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.