Methods Summary |
---|
protected void | addImpl(java.awt.Component comp, java.lang.Object constraints, int index){@inheritDoc}
super.addImpl(comp, constraints, index);
if (componentOrderCheckingEnabled) {
if (comp instanceof JInternalFrame ||
comp instanceof JInternalFrame.JDesktopIcon) {
componentOrderChanged = true;
}
}
|
public javax.accessibility.AccessibleContext | getAccessibleContext()Gets the AccessibleContext associated with this
JDesktopPane . For desktop panes, the
AccessibleContext takes the form of an
AccessibleJDesktopPane .
A new AccessibleJDesktopPane instance is created if necessary.
if (accessibleContext == null) {
accessibleContext = new AccessibleJDesktopPane();
}
return accessibleContext;
|
public javax.swing.JInternalFrame[] | getAllFrames()Returns all JInternalFrames currently displayed in the
desktop. Returns iconified frames as well as expanded frames.
int i, count;
JInternalFrame[] results;
Vector vResults = new Vector(10);
Object next, tmp;
count = getComponentCount();
for(i = 0; i < count; i++) {
next = getComponent(i);
if(next instanceof JInternalFrame)
vResults.addElement(next);
else if(next instanceof JInternalFrame.JDesktopIcon) {
tmp = ((JInternalFrame.JDesktopIcon)next).getInternalFrame();
if(tmp != null)
vResults.addElement(tmp);
}
}
results = new JInternalFrame[vResults.size()];
vResults.copyInto(results);
return results;
|
public javax.swing.JInternalFrame[] | getAllFramesInLayer(int layer)Returns all JInternalFrames currently displayed in the
specified layer of the desktop. Returns iconified frames as well
expanded frames.
int i, count;
JInternalFrame[] results;
Vector vResults = new Vector(10);
Object next, tmp;
count = getComponentCount();
for(i = 0; i < count; i++) {
next = getComponent(i);
if(next instanceof JInternalFrame) {
if(((JInternalFrame)next).getLayer() == layer)
vResults.addElement(next);
} else if(next instanceof JInternalFrame.JDesktopIcon) {
tmp = ((JInternalFrame.JDesktopIcon)next).getInternalFrame();
if(tmp != null && ((JInternalFrame)tmp).getLayer() == layer)
vResults.addElement(tmp);
}
}
results = new JInternalFrame[vResults.size()];
vResults.copyInto(results);
return results;
|
public javax.swing.DesktopManager | getDesktopManager()Returns the DesktopManger that handles
desktop-specific UI actions.
return desktopManager;
|
public int | getDragMode()Gets the current "dragging style" used by the desktop pane.
return dragMode;
|
private java.util.List | getFrames()
Component c;
Set<ComponentPosition> set = new TreeSet<ComponentPosition>();
for (int i = 0; i < getComponentCount(); i++) {
c = getComponent(i);
if (c instanceof JInternalFrame) {
set.add(new ComponentPosition((JInternalFrame)c, getLayer(c),
i));
}
else if (c instanceof JInternalFrame.JDesktopIcon) {
c = ((JInternalFrame.JDesktopIcon)c).getInternalFrame();
set.add(new ComponentPosition((JInternalFrame)c, getLayer(c),
i));
}
}
List<JInternalFrame> frames = new ArrayList<JInternalFrame>(
set.size());
for (ComponentPosition position : set) {
frames.add(position.component);
}
return frames;
|
private javax.swing.JInternalFrame | getNextFrame(javax.swing.JInternalFrame f, boolean forward)
verifyFramesCache();
if (f == null) {
return getTopInternalFrame();
}
int i = framesCache.indexOf(f);
if (i == -1 || framesCache.size() == 1) {
/* error */
return null;
}
if (forward) {
// navigate to the next frame
if (++i == framesCache.size()) {
/* wrap */
i = 0;
}
}
else {
// navigate to the previous frame
if (--i == -1) {
/* wrap */
i = framesCache.size() - 1;
}
}
return framesCache.get(i);
|
javax.swing.JInternalFrame | getNextFrame(javax.swing.JInternalFrame f)
return getNextFrame(f, true);
|
public javax.swing.JInternalFrame | getSelectedFrame()Returns the currently active JInternalFrame
in this JDesktopPane , or null
if no JInternalFrame is currently active.
return selectedFrame;
|
private javax.swing.JInternalFrame | getTopInternalFrame()
if (framesCache.size() == 0) {
return null;
}
return framesCache.get(0);
|
public javax.swing.plaf.DesktopPaneUI | getUI()Returns the L&F object that renders this component.
return (DesktopPaneUI)ui;
|
public java.lang.String | getUIClassID()Returns the name of the L&F class that renders this component.
return uiClassID;
|
protected java.lang.String | paramString()Returns a string representation of this JDesktopPane .
This method is intended to be used only for debugging purposes, and the
content and format of the returned string may vary between
implementations. The returned string may be empty but may not
be null .
String desktopManagerString = (desktopManager != null ?
desktopManager.toString() : "");
return super.paramString() +
",desktopManager=" + desktopManagerString;
|
public void | remove(int index){@inheritDoc}
if (componentOrderCheckingEnabled) {
Component comp = getComponent(index);
if (comp instanceof JInternalFrame ||
comp instanceof JInternalFrame.JDesktopIcon) {
componentOrderChanged = true;
}
}
super.remove(index);
|
public void | removeAll(){@inheritDoc}
if (componentOrderCheckingEnabled) {
int count = getComponentCount();
for (int i = 0; i < count; i++) {
Component comp = getComponent(i);
if (comp instanceof JInternalFrame ||
comp instanceof JInternalFrame.JDesktopIcon) {
componentOrderChanged = true;
break;
}
}
}
super.removeAll();
|
public javax.swing.JInternalFrame | selectFrame(boolean forward)Selects the next JInternalFrame in this desktop pane.
JInternalFrame selectedFrame = getSelectedFrame();
JInternalFrame frameToSelect = getNextFrame(selectedFrame, forward);
if (frameToSelect == null) {
return null;
}
// Maintain navigation traversal order until an
// external stack change, such as a click on a frame.
setComponentOrderCheckingEnabled(false);
if (forward && selectedFrame != null) {
selectedFrame.moveToBack(); // For Windows MDI fidelity.
}
try { frameToSelect.setSelected(true);
} catch (PropertyVetoException pve) {}
setComponentOrderCheckingEnabled(true);
return frameToSelect;
|
void | setComponentOrderCheckingEnabled(boolean enable)
componentOrderCheckingEnabled = enable;
|
public void | setComponentZOrder(java.awt.Component comp, int index){@inheritDoc}
super.setComponentZOrder(comp, index);
if (componentOrderCheckingEnabled) {
if (comp instanceof JInternalFrame ||
comp instanceof JInternalFrame.JDesktopIcon) {
componentOrderChanged = true;
}
}
|
public void | setDesktopManager(javax.swing.DesktopManager d)Sets the DesktopManger that will handle
desktop-specific UI actions.
DesktopManager oldValue = desktopManager;
desktopManager = d;
firePropertyChange("desktopManager", oldValue, desktopManager);
|
public void | setDragMode(int dragMode)Sets the "dragging style" used by the desktop pane.
You may want to change to one mode or another for
performance or aesthetic reasons.
int oldDragMode = this.dragMode;
this.dragMode = dragMode;
firePropertyChange("dragMode", oldDragMode, this.dragMode);
dragModeSet = true;
|
public void | setSelectedFrame(javax.swing.JInternalFrame f)Sets the currently active JInternalFrame
in this JDesktopPane . This method is used to bridge
the package gap between JDesktopPane and the platform implementation
code and should not be called directly. To visually select the frame
the client must call JInternalFrame.setSelected(true) to activate
the frame.
selectedFrame = f;
|
public void | setUI(javax.swing.plaf.DesktopPaneUI ui)Sets the L&F object that renders this component.
super.setUI(ui);
|
void | setUIProperty(java.lang.String propertyName, java.lang.Object value)
if (propertyName == "dragMode") {
if (!dragModeSet) {
setDragMode(((Integer)value).intValue());
dragModeSet = false;
}
} else {
super.setUIProperty(propertyName, value);
}
|
private void | updateFramesCache()
framesCache = getFrames();
|
public void | updateUI()Notification from the UIManager that the L&F has changed.
Replaces the current UI object with the latest version from the
UIManager .
setUI((DesktopPaneUI)UIManager.getUI(this));
|
private void | verifyFramesCache()
// If framesCache is dirty, then recreate it.
if (componentOrderChanged) {
componentOrderChanged = false;
updateFramesCache();
}
|
private void | writeObject(java.io.ObjectOutputStream s)See readObject() and writeObject() in JComponent for more
information about serialization in Swing.
s.defaultWriteObject();
if (getUIClassID().equals(uiClassID)) {
byte count = JComponent.getWriteObjCounter(this);
JComponent.setWriteObjCounter(this, --count);
if (count == 0 && ui != null) {
ui.installUI(this);
}
}
|