下面列出了怎么用javax.swing.event.InternalFrameEvent的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Iconifies or de-iconifies this internal frame,
* if the look and feel supports iconification.
* If the internal frame's state changes to iconified,
* this method fires an <code>INTERNAL_FRAME_ICONIFIED</code> event.
* If the state changes to de-iconified,
* an <code>INTERNAL_FRAME_DEICONIFIED</code> event is fired.
*
* @param b a boolean, where <code>true</code> means to iconify this internal frame and
* <code>false</code> means to de-iconify it
* @exception PropertyVetoException when the attempt to set the
* property is vetoed by the <code>JInternalFrame</code>
*
* @see InternalFrameEvent#INTERNAL_FRAME_ICONIFIED
* @see InternalFrameEvent#INTERNAL_FRAME_DEICONIFIED
*
* @beaninfo
* bound: true
* constrained: true
* description: The image displayed when this internal frame is minimized.
*/
public void setIcon(boolean b) throws PropertyVetoException {
if (isIcon == b) {
return;
}
/* If an internal frame is being iconified before it has a
parent, (e.g., client wants it to start iconic), create the
parent if possible so that we can place the icon in its
proper place on the desktop. I am not sure the call to
validate() is necessary, since we are not going to display
this frame yet */
firePropertyChange("ancestor", null, getParent());
Boolean oldValue = isIcon ? Boolean.TRUE : Boolean.FALSE;
Boolean newValue = b ? Boolean.TRUE : Boolean.FALSE;
fireVetoableChange(IS_ICON_PROPERTY, oldValue, newValue);
isIcon = b;
firePropertyChange(IS_ICON_PROPERTY, oldValue, newValue);
if (b)
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_ICONIFIED);
else
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED);
}
/**
* Iconifies or de-iconifies this internal frame,
* if the look and feel supports iconification.
* If the internal frame's state changes to iconified,
* this method fires an <code>INTERNAL_FRAME_ICONIFIED</code> event.
* If the state changes to de-iconified,
* an <code>INTERNAL_FRAME_DEICONIFIED</code> event is fired.
*
* @param b a boolean, where <code>true</code> means to iconify this internal frame and
* <code>false</code> means to de-iconify it
* @exception PropertyVetoException when the attempt to set the
* property is vetoed by the <code>JInternalFrame</code>
*
* @see InternalFrameEvent#INTERNAL_FRAME_ICONIFIED
* @see InternalFrameEvent#INTERNAL_FRAME_DEICONIFIED
*
* @beaninfo
* bound: true
* constrained: true
* description: The image displayed when this internal frame is minimized.
*/
public void setIcon(boolean b) throws PropertyVetoException {
if (isIcon == b) {
return;
}
/* If an internal frame is being iconified before it has a
parent, (e.g., client wants it to start iconic), create the
parent if possible so that we can place the icon in its
proper place on the desktop. I am not sure the call to
validate() is necessary, since we are not going to display
this frame yet */
firePropertyChange("ancestor", null, getParent());
Boolean oldValue = isIcon ? Boolean.TRUE : Boolean.FALSE;
Boolean newValue = b ? Boolean.TRUE : Boolean.FALSE;
fireVetoableChange(IS_ICON_PROPERTY, oldValue, newValue);
isIcon = b;
firePropertyChange(IS_ICON_PROPERTY, oldValue, newValue);
if (b)
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_ICONIFIED);
else
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED);
}
/**
* Iconifies or de-iconifies this internal frame,
* if the look and feel supports iconification.
* If the internal frame's state changes to iconified,
* this method fires an <code>INTERNAL_FRAME_ICONIFIED</code> event.
* If the state changes to de-iconified,
* an <code>INTERNAL_FRAME_DEICONIFIED</code> event is fired.
*
* @param b a boolean, where <code>true</code> means to iconify this internal frame and
* <code>false</code> means to de-iconify it
* @exception PropertyVetoException when the attempt to set the
* property is vetoed by the <code>JInternalFrame</code>
*
* @see InternalFrameEvent#INTERNAL_FRAME_ICONIFIED
* @see InternalFrameEvent#INTERNAL_FRAME_DEICONIFIED
*
* @beaninfo
* bound: true
* constrained: true
* description: The image displayed when this internal frame is minimized.
*/
public void setIcon(boolean b) throws PropertyVetoException {
if (isIcon == b) {
return;
}
/* If an internal frame is being iconified before it has a
parent, (e.g., client wants it to start iconic), create the
parent if possible so that we can place the icon in its
proper place on the desktop. I am not sure the call to
validate() is necessary, since we are not going to display
this frame yet */
firePropertyChange("ancestor", null, getParent());
Boolean oldValue = isIcon ? Boolean.TRUE : Boolean.FALSE;
Boolean newValue = b ? Boolean.TRUE : Boolean.FALSE;
fireVetoableChange(IS_ICON_PROPERTY, oldValue, newValue);
isIcon = b;
firePropertyChange(IS_ICON_PROPERTY, oldValue, newValue);
if (b)
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_ICONIFIED);
else
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED);
}
/**
* Iconifies or de-iconifies this internal frame,
* if the look and feel supports iconification.
* If the internal frame's state changes to iconified,
* this method fires an <code>INTERNAL_FRAME_ICONIFIED</code> event.
* If the state changes to de-iconified,
* an <code>INTERNAL_FRAME_DEICONIFIED</code> event is fired.
*
* @param b a boolean, where <code>true</code> means to iconify this internal frame and
* <code>false</code> means to de-iconify it
* @exception PropertyVetoException when the attempt to set the
* property is vetoed by the <code>JInternalFrame</code>
*
* @see InternalFrameEvent#INTERNAL_FRAME_ICONIFIED
* @see InternalFrameEvent#INTERNAL_FRAME_DEICONIFIED
*
* @beaninfo
* bound: true
* constrained: true
* description: The image displayed when this internal frame is minimized.
*/
public void setIcon(boolean b) throws PropertyVetoException {
if (isIcon == b) {
return;
}
/* If an internal frame is being iconified before it has a
parent, (e.g., client wants it to start iconic), create the
parent if possible so that we can place the icon in its
proper place on the desktop. I am not sure the call to
validate() is necessary, since we are not going to display
this frame yet */
firePropertyChange("ancestor", null, getParent());
Boolean oldValue = isIcon ? Boolean.TRUE : Boolean.FALSE;
Boolean newValue = b ? Boolean.TRUE : Boolean.FALSE;
fireVetoableChange(IS_ICON_PROPERTY, oldValue, newValue);
isIcon = b;
firePropertyChange(IS_ICON_PROPERTY, oldValue, newValue);
if (b)
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_ICONIFIED);
else
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED);
}
/**
* Iconifies or de-iconifies this internal frame,
* if the look and feel supports iconification.
* If the internal frame's state changes to iconified,
* this method fires an <code>INTERNAL_FRAME_ICONIFIED</code> event.
* If the state changes to de-iconified,
* an <code>INTERNAL_FRAME_DEICONIFIED</code> event is fired.
*
* @param b a boolean, where <code>true</code> means to iconify this internal frame and
* <code>false</code> means to de-iconify it
* @exception PropertyVetoException when the attempt to set the
* property is vetoed by the <code>JInternalFrame</code>
*
* @see InternalFrameEvent#INTERNAL_FRAME_ICONIFIED
* @see InternalFrameEvent#INTERNAL_FRAME_DEICONIFIED
*
* @beaninfo
* bound: true
* constrained: true
* description: The image displayed when this internal frame is minimized.
*/
public void setIcon(boolean b) throws PropertyVetoException {
if (isIcon == b) {
return;
}
/* If an internal frame is being iconified before it has a
parent, (e.g., client wants it to start iconic), create the
parent if possible so that we can place the icon in its
proper place on the desktop. I am not sure the call to
validate() is necessary, since we are not going to display
this frame yet */
firePropertyChange("ancestor", null, getParent());
Boolean oldValue = isIcon ? Boolean.TRUE : Boolean.FALSE;
Boolean newValue = b ? Boolean.TRUE : Boolean.FALSE;
fireVetoableChange(IS_ICON_PROPERTY, oldValue, newValue);
isIcon = b;
firePropertyChange(IS_ICON_PROPERTY, oldValue, newValue);
if (b)
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_ICONIFIED);
else
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED);
}
/**
* Post a WINDOW_CLOSING-like event to the frame, so that it can be treated
* like a regular Frame.
*
* @param frame the internal frame to be closed.
*/
protected void postClosingEvent(JInternalFrame frame) {
InternalFrameEvent e = new InternalFrameEvent(frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
// Try posting event, unless there's a SecurityManager.
if (JInternalFrame.class.getClassLoader() == null) {
try {
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
return;
} catch (SecurityException se) {
// Use dispatchEvent instead.
}
}
frame.dispatchEvent(e);
}
/**
* Iconifies or de-iconifies this internal frame,
* if the look and feel supports iconification.
* If the internal frame's state changes to iconified,
* this method fires an <code>INTERNAL_FRAME_ICONIFIED</code> event.
* If the state changes to de-iconified,
* an <code>INTERNAL_FRAME_DEICONIFIED</code> event is fired.
*
* @param b a boolean, where <code>true</code> means to iconify this internal frame and
* <code>false</code> means to de-iconify it
* @exception PropertyVetoException when the attempt to set the
* property is vetoed by the <code>JInternalFrame</code>
*
* @see InternalFrameEvent#INTERNAL_FRAME_ICONIFIED
* @see InternalFrameEvent#INTERNAL_FRAME_DEICONIFIED
*
* @beaninfo
* bound: true
* constrained: true
* description: The image displayed when this internal frame is minimized.
*/
public void setIcon(boolean b) throws PropertyVetoException {
if (isIcon == b) {
return;
}
/* If an internal frame is being iconified before it has a
parent, (e.g., client wants it to start iconic), create the
parent if possible so that we can place the icon in its
proper place on the desktop. I am not sure the call to
validate() is necessary, since we are not going to display
this frame yet */
firePropertyChange("ancestor", null, getParent());
Boolean oldValue = isIcon ? Boolean.TRUE : Boolean.FALSE;
Boolean newValue = b ? Boolean.TRUE : Boolean.FALSE;
fireVetoableChange(IS_ICON_PROPERTY, oldValue, newValue);
isIcon = b;
firePropertyChange(IS_ICON_PROPERTY, oldValue, newValue);
if (b)
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_ICONIFIED);
else
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED);
}
/**
* Iconifies or de-iconifies this internal frame,
* if the look and feel supports iconification.
* If the internal frame's state changes to iconified,
* this method fires an <code>INTERNAL_FRAME_ICONIFIED</code> event.
* If the state changes to de-iconified,
* an <code>INTERNAL_FRAME_DEICONIFIED</code> event is fired.
*
* @param b a boolean, where <code>true</code> means to iconify this internal frame and
* <code>false</code> means to de-iconify it
* @exception PropertyVetoException when the attempt to set the
* property is vetoed by the <code>JInternalFrame</code>
*
* @see InternalFrameEvent#INTERNAL_FRAME_ICONIFIED
* @see InternalFrameEvent#INTERNAL_FRAME_DEICONIFIED
*
* @beaninfo
* bound: true
* constrained: true
* description: The image displayed when this internal frame is minimized.
*/
public void setIcon(boolean b) throws PropertyVetoException {
if (isIcon == b) {
return;
}
/* If an internal frame is being iconified before it has a
parent, (e.g., client wants it to start iconic), create the
parent if possible so that we can place the icon in its
proper place on the desktop. I am not sure the call to
validate() is necessary, since we are not going to display
this frame yet */
firePropertyChange("ancestor", null, getParent());
Boolean oldValue = isIcon ? Boolean.TRUE : Boolean.FALSE;
Boolean newValue = b ? Boolean.TRUE : Boolean.FALSE;
fireVetoableChange(IS_ICON_PROPERTY, oldValue, newValue);
isIcon = b;
firePropertyChange(IS_ICON_PROPERTY, oldValue, newValue);
if (b)
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_ICONIFIED);
else
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED);
}
/**
* Post a WINDOW_CLOSING-like event to the frame, so that it can
* be treated like a regular Frame.
*/
protected void postClosingEvent(JInternalFrame frame) {
InternalFrameEvent e = new InternalFrameEvent(
frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
// Try posting event, unless there's a SecurityManager.
try {
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
} catch (SecurityException se) {
frame.dispatchEvent(e);
}
}
@Override
public void internalFrameIconified(InternalFrameEvent e) {
//LOG.fine("internalFrameIconified: e = " + e);
tabbedContainer.updateUI();
TopComponent topComponent = getTopComponent(e.getInternalFrame());
NotifiableComponent.get(topComponent).componentHidden();
}
/**
* If the internal frame is not visible,
* brings the internal frame to the front,
* makes it visible,
* and attempts to select it.
* The first time the internal frame is made visible,
* this method also fires an <code>INTERNAL_FRAME_OPENED</code> event.
* This method does nothing if the internal frame is already visible.
* Invoking this method
* has the same result as invoking
* <code>setVisible(true)</code>.
*
* @see #moveToFront
* @see #setSelected
* @see InternalFrameEvent#INTERNAL_FRAME_OPENED
* @see #setVisible
*/
public void show() {
// bug 4312922
if (isVisible()) {
//match the behavior of setVisible(true): do nothing
return;
}
// bug 4149505
if (!opened) {
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_OPENED);
opened = true;
}
/* icon default visibility is false; set it to true so that it shows
up when user iconifies frame */
getDesktopIcon().setVisible(true);
toFront();
super.show();
if (isIcon) {
return;
}
if (!isSelected()) {
try {
setSelected(true);
} catch (PropertyVetoException pve) {}
}
}
@Override
public void internalFrameActivated(InternalFrameEvent e) {
//LOG.fine("internalFrameActivated: e = " + e);
// Synchronise tab selection state, if not already done
JInternalFrame internalFrame = e.getInternalFrame();
TabData selectedTab = frameToTabMap.get(internalFrame);
int selectedTabIndex = tabbedContainer.getSelectionModel().getSelectedIndex();
List<TabData> tabs = tabbedContainer.getModel().getTabs();
for (int i = 0; i < tabs.size(); i++) {
TabData tab = tabs.get(i);
if (tab == selectedTab && selectedTabIndex != i) {
tabbedContainer.getSelectionModel().setSelectedIndex(i);
break;
}
}
tabbedContainer.updateUI();
TopComponent topComponent = getTopComponent(internalFrame);
// Publish lookup contents of selected frame to parent window
lookup.setLookup(topComponent.getLookup());
// Publish activated nodes, if any
setActivatedNodes(topComponent.getActivatedNodes());
// May not really be required
if (WorkspaceTopComponent.this != WindowManager.getDefault().getRegistry().getActivated()) {
WorkspaceTopComponent.this.requestActive();
}
notifyActivated(topComponent);
}
public AbstractJDashlet() {
props = new Properties();
if (!confdir.exists())
{
boolean ret = confdir.mkdirs();
logger.debug(confdir + " doesn't exist, create it="+ret);
}
addInternalFrameListener(new InternalFrameAdapter() {
@Override
public void internalFrameClosed(InternalFrameEvent e) {
AbstractJDashlet dash = (AbstractJDashlet) e.getInternalFrame();
dash.onDestroy();
if (dash.getProperties().get("id") != null)
FileUtils.deleteQuietly(new File(confdir, dash.getProperties().get("id") + ".conf"));
}
});
loaded=true;
setFrameIcon(getIcon());
setTitle(getName());
setResizable(true);
setClosable(true);
setIconifiable(true);
setMaximizable(true);
setBounds(new Rectangle(5,5, 536,346));
}
/**
* If the internal frame is not visible,
* brings the internal frame to the front,
* makes it visible,
* and attempts to select it.
* The first time the internal frame is made visible,
* this method also fires an <code>INTERNAL_FRAME_OPENED</code> event.
* This method does nothing if the internal frame is already visible.
* Invoking this method
* has the same result as invoking
* <code>setVisible(true)</code>.
*
* @see #moveToFront
* @see #setSelected
* @see InternalFrameEvent#INTERNAL_FRAME_OPENED
* @see #setVisible
*/
public void show() {
// bug 4312922
if (isVisible()) {
//match the behavior of setVisible(true): do nothing
return;
}
// bug 4149505
if (!opened) {
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_OPENED);
opened = true;
}
/* icon default visibility is false; set it to true so that it shows
up when user iconifies frame */
getDesktopIcon().setVisible(true);
toFront();
super.show();
if (isIcon) {
return;
}
if (!isSelected()) {
try {
setSelected(true);
} catch (PropertyVetoException pve) {}
}
}
@Override
public void internalFrameDeiconified(InternalFrameEvent e) {
//LOG.fine("internalFrameDeiconified: e = " + e);
tabbedContainer.updateUI();
TopComponent topComponent = getTopComponent(e.getInternalFrame());
NotifiableComponent.get(topComponent).componentShowing();
}
/**
* If the internal frame is not visible,
* brings the internal frame to the front,
* makes it visible,
* and attempts to select it.
* The first time the internal frame is made visible,
* this method also fires an <code>INTERNAL_FRAME_OPENED</code> event.
* This method does nothing if the internal frame is already visible.
* Invoking this method
* has the same result as invoking
* <code>setVisible(true)</code>.
*
* @see #moveToFront
* @see #setSelected
* @see InternalFrameEvent#INTERNAL_FRAME_OPENED
* @see #setVisible
*/
public void show() {
// bug 4312922
if (isVisible()) {
//match the behavior of setVisible(true): do nothing
return;
}
// bug 4149505
if (!opened) {
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_OPENED);
opened = true;
}
/* icon default visibility is false; set it to true so that it shows
up when user iconifies frame */
getDesktopIcon().setVisible(true);
toFront();
super.show();
if (isIcon) {
return;
}
if (!isSelected()) {
try {
setSelected(true);
} catch (PropertyVetoException pve) {}
}
}
/**
* Post a WINDOW_CLOSING-like event to the frame, so that it can
* be treated like a regular Frame.
*/
protected void postClosingEvent(JInternalFrame frame) {
InternalFrameEvent e = new InternalFrameEvent(
frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
// Try posting event, unless there's a SecurityManager.
try {
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
} catch (SecurityException se) {
frame.dispatchEvent(e);
}
}
@Override
public void internalFrameActivated(InternalFrameEvent e) {
// We can get here as the result of a user click or as part
// of a programmatic activation, but it shouldn't matter as all
// activation takes place in the following method
OpenImages.viewActivated(view);
}
/**
* If the internal frame is not visible,
* brings the internal frame to the front,
* makes it visible,
* and attempts to select it.
* The first time the internal frame is made visible,
* this method also fires an <code>INTERNAL_FRAME_OPENED</code> event.
* This method does nothing if the internal frame is already visible.
* Invoking this method
* has the same result as invoking
* <code>setVisible(true)</code>.
*
* @see #moveToFront
* @see #setSelected
* @see InternalFrameEvent#INTERNAL_FRAME_OPENED
* @see #setVisible
*/
public void show() {
// bug 4312922
if (isVisible()) {
//match the behavior of setVisible(true): do nothing
return;
}
// bug 4149505
if (!opened) {
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_OPENED);
opened = true;
}
/* icon default visibility is false; set it to true so that it shows
up when user iconifies frame */
getDesktopIcon().setVisible(true);
toFront();
super.show();
if (isIcon) {
return;
}
if (!isSelected()) {
try {
setSelected(true);
} catch (PropertyVetoException pve) {}
}
}
/**
* If the internal frame is not visible,
* brings the internal frame to the front,
* makes it visible,
* and attempts to select it.
* The first time the internal frame is made visible,
* this method also fires an <code>INTERNAL_FRAME_OPENED</code> event.
* This method does nothing if the internal frame is already visible.
* Invoking this method
* has the same result as invoking
* <code>setVisible(true)</code>.
*
* @see #moveToFront
* @see #setSelected
* @see InternalFrameEvent#INTERNAL_FRAME_OPENED
* @see #setVisible
*/
public void show() {
// bug 4312922
if (isVisible()) {
//match the behavior of setVisible(true): do nothing
return;
}
// bug 4149505
if (!opened) {
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_OPENED);
opened = true;
}
/* icon default visibility is false; set it to true so that it shows
up when user iconifies frame */
getDesktopIcon().setVisible(true);
toFront();
super.show();
if (isIcon) {
return;
}
if (!isSelected()) {
try {
setSelected(true);
} catch (PropertyVetoException pve) {}
}
}
/**
* Post a WINDOW_CLOSING-like event to the frame, so that it can
* be treated like a regular Frame.
*/
protected void postClosingEvent(JInternalFrame frame) {
InternalFrameEvent e = new InternalFrameEvent(
frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
// Try posting event, unless there's a SecurityManager.
try {
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
} catch (SecurityException se) {
frame.dispatchEvent(e);
}
}
@Override
public void internalFrameClosing(InternalFrameEvent e) {
// TODO Auto-generated method stub
buildingPanelAO.setViewer(null);
this.dispose();
//System.out.println("internalFrameClosing()");
}
/**
* If the internal frame is not visible,
* brings the internal frame to the front,
* makes it visible,
* and attempts to select it.
* The first time the internal frame is made visible,
* this method also fires an <code>INTERNAL_FRAME_OPENED</code> event.
* This method does nothing if the internal frame is already visible.
* Invoking this method
* has the same result as invoking
* <code>setVisible(true)</code>.
*
* @see #moveToFront
* @see #setSelected
* @see InternalFrameEvent#INTERNAL_FRAME_OPENED
* @see #setVisible
*/
public void show() {
// bug 4312922
if (isVisible()) {
//match the behavior of setVisible(true): do nothing
return;
}
// bug 4149505
if (!opened) {
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_OPENED);
opened = true;
}
/* icon default visibility is false; set it to true so that it shows
up when user iconifies frame */
getDesktopIcon().setVisible(true);
toFront();
super.show();
if (isIcon) {
return;
}
if (!isSelected()) {
try {
setSelected(true);
} catch (PropertyVetoException pve) {}
}
}
/**
* Post a WINDOW_CLOSING-like event to the frame, so that it can
* be treated like a regular Frame.
*/
protected void postClosingEvent(JInternalFrame frame) {
InternalFrameEvent e = new InternalFrameEvent(
frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
// Try posting event, unless there's a SecurityManager.
try {
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
} catch (SecurityException se) {
frame.dispatchEvent(e);
}
}
/**
* If the internal frame is not visible,
* brings the internal frame to the front,
* makes it visible,
* and attempts to select it.
* The first time the internal frame is made visible,
* this method also fires an <code>INTERNAL_FRAME_OPENED</code> event.
* This method does nothing if the internal frame is already visible.
* Invoking this method
* has the same result as invoking
* <code>setVisible(true)</code>.
*
* @see #moveToFront
* @see #setSelected
* @see InternalFrameEvent#INTERNAL_FRAME_OPENED
* @see #setVisible
*/
@SuppressWarnings("deprecation")
public void show() {
// bug 4312922
if (isVisible()) {
//match the behavior of setVisible(true): do nothing
return;
}
// bug 4149505
if (!opened) {
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_OPENED);
opened = true;
}
/* icon default visibility is false; set it to true so that it shows
up when user iconifies frame */
getDesktopIcon().setVisible(true);
toFront();
super.show();
if (isIcon) {
return;
}
if (!isSelected()) {
try {
setSelected(true);
} catch (PropertyVetoException pve) {}
}
}
/**
* Post a WINDOW_CLOSING-like event to the frame, so that it can
* be treated like a regular {@code Frame}.
*
* @param frame an instance of {@code JInternalFrame}
*/
protected void postClosingEvent(JInternalFrame frame) {
InternalFrameEvent e = new InternalFrameEvent(
frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING);
// Try posting event, unless there's a SecurityManager.
try {
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(e);
} catch (SecurityException se) {
frame.dispatchEvent(e);
}
}
/**
* If the internal frame is not visible,
* brings the internal frame to the front,
* makes it visible,
* and attempts to select it.
* The first time the internal frame is made visible,
* this method also fires an <code>INTERNAL_FRAME_OPENED</code> event.
* This method does nothing if the internal frame is already visible.
* Invoking this method
* has the same result as invoking
* <code>setVisible(true)</code>.
*
* @see #moveToFront
* @see #setSelected
* @see InternalFrameEvent#INTERNAL_FRAME_OPENED
* @see #setVisible
*/
public void show() {
// bug 4312922
if (isVisible()) {
//match the behavior of setVisible(true): do nothing
return;
}
// bug 4149505
if (!opened) {
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_OPENED);
opened = true;
}
/* icon default visibility is false; set it to true so that it shows
up when user iconifies frame */
getDesktopIcon().setVisible(true);
toFront();
super.show();
if (isIcon) {
return;
}
if (!isSelected()) {
try {
setSelected(true);
} catch (PropertyVetoException pve) {}
}
}
/** opens internal frame (overridden) */
@Override
public void internalFrameOpened(InternalFrameEvent e) {
JInternalFrame frame = (JInternalFrame) e.getSource();
try { frame.setClosed(false); }
catch (java.beans.PropertyVetoException v) {
logger.log(
Level.SEVERE,
Msg.getString(
"ToolFrameListener.log.veto", //$NON-NLS-1$
frame.getTitle()
)
);
}
}
/**
* If the internal frame is not visible,
* brings the internal frame to the front,
* makes it visible,
* and attempts to select it.
* The first time the internal frame is made visible,
* this method also fires an <code>INTERNAL_FRAME_OPENED</code> event.
* This method does nothing if the internal frame is already visible.
* Invoking this method
* has the same result as invoking
* <code>setVisible(true)</code>.
*
* @see #moveToFront
* @see #setSelected
* @see InternalFrameEvent#INTERNAL_FRAME_OPENED
* @see #setVisible
*/
@SuppressWarnings("deprecation")
public void show() {
// bug 4312922
if (isVisible()) {
//match the behavior of setVisible(true): do nothing
return;
}
// bug 4149505
if (!opened) {
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_OPENED);
opened = true;
}
/* icon default visibility is false; set it to true so that it shows
up when user iconifies frame */
getDesktopIcon().setVisible(true);
toFront();
super.show();
if (isIcon) {
return;
}
if (!isSelected()) {
try {
setSelected(true);
} catch (PropertyVetoException pve) {}
}
}
/**
* If the internal frame is not visible,
* brings the internal frame to the front,
* makes it visible,
* and attempts to select it.
* The first time the internal frame is made visible,
* this method also fires an <code>INTERNAL_FRAME_OPENED</code> event.
* This method does nothing if the internal frame is already visible.
* Invoking this method
* has the same result as invoking
* <code>setVisible(true)</code>.
*
* @see #moveToFront
* @see #setSelected
* @see InternalFrameEvent#INTERNAL_FRAME_OPENED
* @see #setVisible
*/
public void show() {
// bug 4312922
if (isVisible()) {
//match the behavior of setVisible(true): do nothing
return;
}
// bug 4149505
if (!opened) {
fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_OPENED);
opened = true;
}
/* icon default visibility is false; set it to true so that it shows
up when user iconifies frame */
getDesktopIcon().setVisible(true);
toFront();
super.show();
if (isIcon) {
return;
}
if (!isSelected()) {
try {
setSelected(true);
} catch (PropertyVetoException pve) {}
}
}