Methods Summary |
---|
protected void | activateFrame(javax.swing.JInternalFrame f)This method is called when the frame becomes selected.
This action is delegated to the desktopManager.
getDesktopManager().activateFrame(f);
|
protected void | closeFrame(javax.swing.JInternalFrame f)This method is called when the user wants to close the frame.
The playCloseSound Action is fired.
This action is delegated to the desktopManager.
// Internal Frame Auditory Cue Activation
BasicLookAndFeel.playSound(frame,"InternalFrame.closeSound");
// delegate to desktop manager
getDesktopManager().closeFrame(f);
|
protected javax.swing.event.MouseInputAdapter | createBorderListener(javax.swing.JInternalFrame w)
return new BorderListener();
|
protected java.awt.event.ComponentListener | createComponentListener()
return getHandler();
|
protected javax.swing.DesktopManager | createDesktopManager()
return new DefaultDesktopManager();
|
protected javax.swing.JComponent | createEastPane(javax.swing.JInternalFrame w)
return null;
|
protected javax.swing.event.MouseInputListener | createGlassPaneDispatcher()
return getHandler();
|
javax.swing.InputMap | createInputMap(int condition)
if (condition == JComponent.WHEN_IN_FOCUSED_WINDOW) {
Object[] bindings = (Object[])DefaultLookup.get(
frame, this, "InternalFrame.windowBindings");
if (bindings != null) {
return LookAndFeel.makeComponentInputMap(frame, bindings);
}
}
return null;
|
protected void | createInternalFrameListener()
internalFrameListener = getHandler();
|
protected java.awt.LayoutManager | createLayoutManager()
return getHandler();
|
protected javax.swing.JComponent | createNorthPane(javax.swing.JInternalFrame w)
titlePane = new BasicInternalFrameTitlePane(w);
return titlePane;
|
protected java.beans.PropertyChangeListener | createPropertyChangeListener()
return getHandler();
|
protected javax.swing.JComponent | createSouthPane(javax.swing.JInternalFrame w)
return null;
|
public static javax.swing.plaf.ComponentUI | createUI(javax.swing.JComponent b)
/////////////////////////////////////////////////////////////////////////////
// ComponentUI Interface Implementation methods
/////////////////////////////////////////////////////////////////////////////
return new BasicInternalFrameUI((JInternalFrame)b);
|
protected javax.swing.JComponent | createWestPane(javax.swing.JInternalFrame w)
return null;
|
protected void | deactivateFrame(javax.swing.JInternalFrame f)This method is called when the frame is no longer selected.
This action is delegated to the desktopManager.
getDesktopManager().deactivateFrame(f);
|
protected void | deiconifyFrame(javax.swing.JInternalFrame f)This method is called when the user wants to deiconify the frame.
The playRestoreUpSound Action is fired.
This action is delegated to the desktopManager.
// Internal Frame Auditory Cue Activation
if ( ! f.isMaximum() ) {
// This method seems to regularly get called after an
// internal frame is maximized. Don't play this sound then.
BasicLookAndFeel.playSound(frame, "InternalFrame.restoreUpSound");
}
// delegate to desktop manager
getDesktopManager().deiconifyFrame(f);
|
protected void | deinstallMouseHandlers(javax.swing.JComponent c)
c.removeMouseListener(borderListener);
c.removeMouseMotionListener(borderListener);
|
protected javax.swing.DesktopManager | getDesktopManager()Returns the proper DesktopManager. Calls getDesktopPane() to
find the JDesktop component and returns the desktopManager from
it. If this fails, it will return a default DesktopManager that
should work in arbitrary parents.
if(frame.getDesktopPane() != null
&& frame.getDesktopPane().getDesktopManager() != null)
return frame.getDesktopPane().getDesktopManager();
if(sharedDesktopManager == null)
sharedDesktopManager = createDesktopManager();
return sharedDesktopManager;
|
public javax.swing.JComponent | getEastPane()
return eastPane;
|
private javax.swing.plaf.basic.BasicInternalFrameUI$Handler | getHandler()
if (handler == null) {
handler = new Handler();
}
return handler;
|
javax.swing.InputMap | getInputMap(int condition)
if (condition == JComponent.WHEN_IN_FOCUSED_WINDOW) {
return createInputMap(condition);
}
return null;
|
public java.awt.Dimension | getMaximumSize(javax.swing.JComponent x)
return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
|
public java.awt.Dimension | getMinimumSize(javax.swing.JComponent x)
if((JComponent)frame == x) {
return frame.getLayout().minimumLayoutSize(x);
}
return new Dimension(0, 0);
|
public javax.swing.JComponent | getNorthPane()
return northPane;
|
public java.awt.Dimension | getPreferredSize(javax.swing.JComponent x)
if((JComponent)frame == x)
return frame.getLayout().preferredLayoutSize(x);
return new Dimension(100, 100);
|
public javax.swing.JComponent | getSouthPane()
return southPane;
|
public javax.swing.JComponent | getWestPane()
return westPane;
|
protected void | iconifyFrame(javax.swing.JInternalFrame f)This method is called when the user wants to iconify the frame.
The playMinimizeSound Action is fired.
This action is delegated to the desktopManager.
// Internal Frame Auditory Cue Activation
BasicLookAndFeel.playSound(frame, "InternalFrame.minimizeSound");
// delegate to desktop manager
getDesktopManager().iconifyFrame(f);
|
protected void | installComponents()
setNorthPane(createNorthPane(frame));
setSouthPane(createSouthPane(frame));
setEastPane(createEastPane(frame));
setWestPane(createWestPane(frame));
|
protected void | installDefaults()
Icon frameIcon = frame.getFrameIcon();
if (frameIcon == null || frameIcon instanceof UIResource) {
frame.setFrameIcon(UIManager.getIcon("InternalFrame.icon"));
}
// Enable the content pane to inherit background color from its
// parent by setting its background color to null.
JComponent contentPane = (JComponent) frame.getContentPane();
if (contentPane != null) {
Color bg = contentPane.getBackground();
if (bg instanceof UIResource)
contentPane.setBackground(null);
}
frame.setLayout(internalFrameLayout = createLayoutManager());
frame.setBackground(UIManager.getLookAndFeelDefaults().getColor("control"));
LookAndFeel.installBorder(frame, "InternalFrame.border");
|
protected void | installKeyboardActions()
createInternalFrameListener();
if (internalFrameListener != null) {
frame.addInternalFrameListener(internalFrameListener);
}
LazyActionMap.installLazyActionMap(frame, BasicInternalFrameUI.class,
"InternalFrame.actionMap");
|
protected void | installListeners()
borderListener = createBorderListener(frame);
propertyChangeListener = createPropertyChangeListener();
frame.addPropertyChangeListener(propertyChangeListener);
installMouseHandlers(frame);
glassPaneDispatcher = createGlassPaneDispatcher();
frame.getGlassPane().addMouseListener(glassPaneDispatcher);
frame.getGlassPane().addMouseMotionListener(glassPaneDispatcher);
componentListener = createComponentListener();
if (frame.getParent() != null) {
parentBounds = frame.getParent().getBounds();
}
if ((frame.getParent() != null) && !componentListenerAdded) {
frame.getParent().addComponentListener(componentListener);
componentListenerAdded = true;
}
|
protected void | installMouseHandlers(javax.swing.JComponent c)
c.addMouseListener(borderListener);
c.addMouseMotionListener(borderListener);
|
public void | installUI(javax.swing.JComponent c)
frame = (JInternalFrame)c;
installDefaults();
installListeners();
installComponents();
installKeyboardActions();
LookAndFeel.installProperty(frame, "opaque", Boolean.TRUE);
|
public final boolean | isKeyBindingActive()
return keyBindingActive;
|
protected final boolean | isKeyBindingRegistered()
return keyBindingRegistered;
|
static void | loadActionMap(javax.swing.plaf.basic.LazyActionMap map)
map.put(new UIAction("showSystemMenu") {
public void actionPerformed(ActionEvent evt) {
JInternalFrame iFrame = (JInternalFrame)evt.getSource();
if (iFrame.getUI() instanceof BasicInternalFrameUI) {
JComponent comp = ((BasicInternalFrameUI)
iFrame.getUI()).getNorthPane();
if (comp instanceof BasicInternalFrameTitlePane) {
((BasicInternalFrameTitlePane)comp).
showSystemMenu();
}
}
}
public boolean isEnabled(Object sender){
if (sender instanceof JInternalFrame) {
JInternalFrame iFrame = (JInternalFrame)sender;
if (iFrame.getUI() instanceof BasicInternalFrameUI) {
return ((BasicInternalFrameUI)iFrame.getUI()).
isKeyBindingActive();
}
}
return false;
}
});
// Set the ActionMap's parent to the Auditory Feedback Action Map
BasicLookAndFeel.installAudioActionMap(map);
|
protected void | maximizeFrame(javax.swing.JInternalFrame f)This method is called when the user wants to maximize the frame.
The playMaximizeSound Action is fired.
This action is delegated to the desktopManager.
// Internal Frame Auditory Cue Activation
BasicLookAndFeel.playSound(frame,"InternalFrame.maximizeSound");
// delegate to desktop manager
getDesktopManager().maximizeFrame(f);
|
protected void | minimizeFrame(javax.swing.JInternalFrame f)This method is called when the user wants to minimize the frame.
The playRestoreDownSound Action is fired.
This action is delegated to the desktopManager.
// Internal Frame Auditory Cue Activation
if ( ! f.isIcon() ) {
// This method seems to regularly get called after an
// internal frame is iconified. Don't play this sound then.
BasicLookAndFeel.playSound(frame,"InternalFrame.restoreDownSound");
}
// delegate to desktop manager
getDesktopManager().minimizeFrame(f);
|
protected void | replacePane(javax.swing.JComponent currentPane, javax.swing.JComponent newPane)Installs necessary mouse handlers on newPane
and adds it to the frame.
Reverse process for the currentPane .
if(currentPane != null) {
deinstallMouseHandlers(currentPane);
frame.remove(currentPane);
}
if(newPane != null) {
frame.add(newPane);
installMouseHandlers(newPane);
}
|
public void | setEastPane(javax.swing.JComponent c)
eastPane = c;
|
protected final void | setKeyBindingActive(boolean b)
keyBindingActive = b;
|
protected final void | setKeyBindingRegistered(boolean b)
keyBindingRegistered = b;
|
public void | setNorthPane(javax.swing.JComponent c)
if (northPane != null &&
northPane instanceof BasicInternalFrameTitlePane) {
((BasicInternalFrameTitlePane)northPane).uninstallListeners();
}
replacePane(northPane, c);
northPane = c;
|
public void | setSouthPane(javax.swing.JComponent c)
southPane = c;
|
public void | setWestPane(javax.swing.JComponent c)
westPane = c;
|
protected void | setupMenuCloseKey()
|
protected void | setupMenuOpenKey()
// PENDING(hania): Why are these WHEN_IN_FOCUSED_WINDOWs? Shouldn't
// they be WHEN_ANCESTOR_OF_FOCUSED_COMPONENT?
// Also, no longer registering on the desktopicon, the previous
// action did nothing.
InputMap map = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
SwingUtilities.replaceUIInputMap(frame,
JComponent.WHEN_IN_FOCUSED_WINDOW, map);
//ActionMap actionMap = getActionMap();
//SwingUtilities.replaceUIActionMap(frame, actionMap);
|
protected void | uninstallComponents()
setNorthPane(null);
setSouthPane(null);
setEastPane(null);
setWestPane(null);
if(titlePane != null) {
titlePane.uninstallDefaults();
}
titlePane = null;
|
protected void | uninstallDefaults()
Icon frameIcon = frame.getFrameIcon();
if (frameIcon instanceof UIResource) {
frame.setFrameIcon(null);
}
internalFrameLayout = null;
frame.setLayout(null);
LookAndFeel.uninstallBorder(frame);
|
protected void | uninstallKeyboardActions()
if (internalFrameListener != null) {
frame.removeInternalFrameListener(internalFrameListener);
}
internalFrameListener = null;
SwingUtilities.replaceUIInputMap(frame, JComponent.
WHEN_IN_FOCUSED_WINDOW, null);
SwingUtilities.replaceUIActionMap(frame, null);
|
protected void | uninstallListeners()
if ((frame.getParent() != null) && componentListenerAdded) {
frame.getParent().removeComponentListener(componentListener);
componentListenerAdded = false;
}
componentListener = null;
frame.getGlassPane().removeMouseListener(glassPaneDispatcher);
frame.getGlassPane().removeMouseMotionListener(glassPaneDispatcher);
glassPaneDispatcher = null;
deinstallMouseHandlers(frame);
frame.removePropertyChangeListener(propertyChangeListener);
propertyChangeListener = null;
borderListener = null;
|
public void | uninstallUI(javax.swing.JComponent c)
if(c != frame)
throw new IllegalComponentStateException(
this + " was asked to deinstall() "
+ c + " when it only knows about "
+ frame + ".");
uninstallKeyboardActions();
uninstallComponents();
uninstallListeners();
uninstallDefaults();
frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
handler = null;
frame = null;
|