类javax.swing.event.InternalFrameEvent源码实例Demo

下面列出了怎么用javax.swing.event.InternalFrameEvent的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: jdk1.8-source-analysis   文件: JInternalFrame.java
/**
 * 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);
}
 
源代码2 项目: dragonwell8_jdk   文件: JInternalFrame.java
/**
 * 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);
}
 
源代码3 项目: jdk8u60   文件: JInternalFrame.java
/**
 * 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);
}
 
源代码4 项目: JDKSourceCode1.8   文件: JInternalFrame.java
/**
 * 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);
}
 
源代码5 项目: jdk8u-dev-jdk   文件: JInternalFrame.java
/**
 * 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);
}
 
源代码6 项目: seaglass   文件: SeaGlassInternalFrameTitlePane.java
/**
 * 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);
}
 
源代码7 项目: jdk8u-jdk   文件: JInternalFrame.java
/**
 * 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);
}
 
源代码8 项目: Java8CN   文件: JInternalFrame.java
/**
 * 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);
    }
}
 
源代码10 项目: snap-desktop   文件: WorkspaceTopComponent.java
@Override
public void internalFrameIconified(InternalFrameEvent e) {
    //LOG.fine("internalFrameIconified: e = " + e);

    tabbedContainer.updateUI();

    TopComponent topComponent = getTopComponent(e.getInternalFrame());
    NotifiableComponent.get(topComponent).componentHidden();
}
 
源代码11 项目: TencentKona-8   文件: JInternalFrame.java
/**
 * 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) {}
    }
}
 
源代码12 项目: snap-desktop   文件: WorkspaceTopComponent.java
@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);
}
 
源代码13 项目: MtgDesktopCompanion   文件: AbstractJDashlet.java
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));
}
 
源代码14 项目: jdk8u60   文件: JInternalFrame.java
/**
 * 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) {}
    }
}
 
源代码15 项目: snap-desktop   文件: WorkspaceTopComponent.java
@Override
public void internalFrameDeiconified(InternalFrameEvent e) {
    //LOG.fine("internalFrameDeiconified: e = " + e);

    tabbedContainer.updateUI();

    TopComponent topComponent = getTopComponent(e.getInternalFrame());
    NotifiableComponent.get(topComponent).componentShowing();
}
 
源代码16 项目: JDKSourceCode1.8   文件: JInternalFrame.java
/**
 * 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);
    }
}
 
源代码18 项目: Pixelitor   文件: ImageFrame.java
@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);
}
 
源代码19 项目: jdk8u-jdk   文件: JInternalFrame.java
/**
 * 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) {}
    }
}
 
源代码20 项目: openjdk-jdk8u   文件: JInternalFrame.java
/**
 * 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);
    }
}
 
源代码22 项目: mars-sim   文件: OrbitViewer.java
@Override
public void internalFrameClosing(InternalFrameEvent e) {
	// TODO Auto-generated method stub
	 buildingPanelAO.setViewer(null);
	 this.dispose();
	//System.out.println("internalFrameClosing()");
}
 
源代码23 项目: openjdk-jdk8u-backup   文件: JInternalFrame.java
/**
 * 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);
    }
}
 
源代码25 项目: Bytecoder   文件: JInternalFrame.java
/**
 * 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) {}
    }
}
 
源代码26 项目: Bytecoder   文件: BasicInternalFrameTitlePane.java
/**
 * 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);
    }
}
 
源代码27 项目: jdk8u_jdk   文件: JInternalFrame.java
/**
 * 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) {}
    }
}
 
源代码28 项目: mars-sim   文件: ToolFrameListener.java
/** 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()
			)
		);
	}
}
 
源代码29 项目: openjdk-jdk9   文件: JInternalFrame.java
/**
 * 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) {}
    }
}
 
源代码30 项目: jdk8u-jdk   文件: JInternalFrame.java
/**
 * 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) {}
    }
}
 
 类所在包
 同包方法