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

项目:fmj-sourceforge-mirror    文件:MDIApp.java   
public JMFrame(Player player, String title) {
super(title, true, true, true, true);
getContentPane().setLayout( new BorderLayout() );
setSize(320, 10);
setLocation(50, 50);
setVisible(true);
mplayer = player;
mplayer.addControllerListener((ControllerListener) this);
mplayer.realize();
addInternalFrameListener( new InternalFrameAdapter() {
    public void internalFrameClosing(InternalFrameEvent ife) {
    mplayer.close();
    }
} );

   }
项目:repo.kmeanspp.silhouette_score    文件:Main.java   
/**
 * constructs a new internal frame that knows about its parent.
 * 
 * @param parent the parent frame
 * @param title the title of the frame
 */
public ChildFrameMDI(Main parent, String title) {
  super(title, true, true, true, true);

  m_Parent = parent;

  addInternalFrameListener(new InternalFrameAdapter() {
    @Override
    public void internalFrameActivated(InternalFrameEvent e) {
      // update title of parent
      if (getParentFrame() != null) {
        getParentFrame().createTitle(getTitle());
      }
    }
  });

  // add to parent
  if (getParentFrame() != null) {
    getParentFrame().addChildFrame(this);
    getParentFrame().jDesktopPane.add(this);
  }
}
项目:bisis-v4    文件:MainFrame.java   
private void initialize() {
    this.setSize(new Dimension(780, 530));
    //this.setPreferredSize(new Dimension(780, 550));
    this.setName("mframe"); //$NON-NLS-1$
    this.setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
    this.addInternalFrameListener(new InternalFrameAdapter(){
      public void internalFrameClosing(InternalFrameEvent e){
        handleClose();
      }
    });   
    this.setContentPane(getJContentPane());
    Dimension screen = getToolkit().getScreenSize();
    this.setLocation((screen.width - getSize().width) / 2,
            (screen.height - getSize().height) / 2);
    this.pack();
    panelStack = new Stack<String>();
    showPanel("blankPanel"); //$NON-NLS-1$
}
项目:erp    文件:FLanca.java   
private void novo() {

            if ( validaPeriodo() ) {
                Container cont = getContentPane();
                while ( true ) {
                    if ( cont instanceof FPrincipal )
                        break;
                    cont = cont.getParent();
                }
                if ( ! ( (FPrincipal) cont ).temTela( "FSubLanca" ) ) {
                    FSubLanca form = new FSubLanca( null, sCodPlan, dIniLanca, dFimLanca );
                    ( (FPrincipal) cont ).criatela( "FSubLanca", form, con );
                    form.addInternalFrameListener( new InternalFrameAdapter() {

                        public void internalFrameClosed( InternalFrameEvent ievt ) {

                            adicLanca( ( (FSubLanca) ievt.getSource() ).getValores() );
                        }
                    } );
                }
            }
        }
项目:erp    文件:FVendaConsig.java   
private void novoLanca() {

        String planejamento = getPlanejamentoVendedor();
        if ( planejamento == null ) {
            Funcoes.mensagemInforma( this, "Não foi encontrado planejamento do vendedor." );
            return;
        }

        if ( !Aplicativo.telaPrincipal.temTela( FSubLanca.class.getName() ) ) {
            FSubLanca form = new FSubLanca( null, planejamento, txtDataIniRedeber.getVlrDate(), txtDataFimReceber.getVlrDate() );
            Aplicativo.telaPrincipal.criatela( "FSubLanca", form, con );

            form.addInternalFrameListener( new InternalFrameAdapter() {

                public void internalFrameClosed( InternalFrameEvent ievt ) {

                    carregaFechamento();
                }
            } );
        }
    }
项目:erp    文件:FOP.java   
private void abreRma() {

    Container cont = getContentPane();
    while ( true ) {
        if ( cont instanceof FPrincipal )
            break;
        cont = cont.getParent();
    }
    int iRma = ( (Integer) tabRMA.getValor( tabRMA.getLinhaSel(), 1 ) ).intValue();
    if ( !((FPrincipal) cont ).temTela( "Requisição de material" ) ) {
        FRma tela = new FRma();
        fPrim.criatela( "Requisição de material", tela, con );
        tela.exec( iRma );
        tela.addInternalFrameListener( new InternalFrameAdapter() {
            public void internalFrameClosed( InternalFrameEvent ievt ) {
                lcCampos.carregaDados();
                desabilitaBtFinaliza();
            }
        } );
    }
}
项目:ca-iris    文件:SmartDesktop.java   
/** Create a new internal frame */
private JInternalFrame createFrame(final AbstractForm form) {
    final JInternalFrame frame = new JInternalFrame();
    frame.setTitle(form.getTitle());
    frame.setClosable(true);
    frame.setIconifiable(true);
    frame.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
    frame.addInternalFrameListener(new InternalFrameAdapter() {
        public void internalFrameClosed(InternalFrameEvent e) {
            smartDesktopRequestFocus(); // see note
            form.dispose();
        }
    });
    frame.setContentPane(form);
    return frame;
}
项目:incubator-netbeans    文件:QueryBuilderInternalFrame.java   
public QueryBuilderInternalFrame(QueryBuilderTableModel queryBuilderTableModel,
                                 QueryBuilder queryBuilder)
{
    _dragObject = null;
    // Set some private variables
    _queryBuilderTableModel = queryBuilderTableModel;
    _queryBuilder = queryBuilder;

    // Create the node that will be used for the property sheet
    _node = new TableNode(queryBuilderTableModel.getFullTableName(),
                          queryBuilderTableModel.getCorrName(),
                          _queryBuilder);
    setResizable(true);
    setFrameIcon(null);
    setIconifiable(false);

    // Add an anonymous listener for the internalFrameOpened event
    addInternalFrameListener(new InternalFrameAdapter() {
        public void internalFrameOpened(InternalFrameEvent e) {
            // As soon as a frame is opened select it.
            // This doesn't seem to work.
            try {
                QueryBuilderInternalFrame.this.setSelected(true);
            } catch(PropertyVetoException pve) {
            }
        }});

    this.setBackground(Color.white);

}
项目:AgentWorkbench    文件:MaximizedTab.java   
/**
     * Initialize.
     */
    private void initialize() {

        this.setClosable(true);
        this.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
        this.setVisible(true);
        this.registerEscapeKeyStroke();
        this.addInternalFrameListener(new InternalFrameAdapter() {
            /* (non-Javadoc)
             * @see javax.swing.event.InternalFrameAdapter#internalFrameClosing(javax.swing.event.InternalFrameEvent)
             */
            @Override
            public void internalFrameClosing(InternalFrameEvent ife) {
                projectWindow.tabRestore();
                super.internalFrameClosing(ife);
            }
            /* (non-Javadoc)
             * @see javax.swing.event.InternalFrameAdapter#internalFrameDeactivated(javax.swing.event.InternalFrameEvent)
             */
            @Override
            public void internalFrameDeactivated(InternalFrameEvent e) {
//              projectWindow.tabRestore();
                super.internalFrameDeactivated(e);
            }

        });
        ((BasicInternalFrameUI) this.getUI()).setNorthPane(null);

        // --- Add ComponentListener to MainWindow -------- 
        this.addComponentListenerOfMainWindow();

    }
项目:AgentWorkbench    文件:BasicGraphGuiProperties.java   
/**
 * This method initializes this
 * @return void
 */
private void initialize() {

    this.setAutoscrolls(true);
    this.setMaximizable(true);
    this.setResizable(true);
    this.setIconifiable(true);

    this.setClosable(true);
    this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);

    this.setTitle("Component");

    // --- Remove Frame menu ----------------
    BasicInternalFrameUI ui = (BasicInternalFrameUI)this.getUI();
    ui.getNorthPane().remove(0);

    this.addInternalFrameListener(new InternalFrameAdapter() {
        @Override
        public void internalFrameClosing(InternalFrameEvent ife) {
            doClose();
        }
    });

    this.configureForGraphObject();
    this.setContentPane(this.getJContentPane());
    this.setSize(this.defaultWidth, this.defaultHeight);
    this.setInitialSizeAndPosition();

    // --- Call to the super-class ----------
    this.registerAtDesktopAndSetVisible();

}
项目:OpenJSharp    文件: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);
}
项目: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);
}
项目:openjdk-jdk10    文件: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
 */
@BeanProperty(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);
}
项目:openjdk9    文件: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
 */
@BeanProperty(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);
}
项目: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);
}
项目:CanReg5    文件:FrequenciesByYearInternalFrame.java   
/**
 * Creates new form FrequenciesByYearInternalFrame
 *
 * @param dtp
 */
public FrequenciesByYearInternalFrame(JDesktopPane dtp) {
    this.dtp = dtp;
    dictionary = CanRegClientApp.getApplication().getDictionary();
    initComponents();
    initOtherComponents();

    localSettings = CanRegClientApp.getApplication().getLocalSettings();
    addInternalFrameListener(new InternalFrameAdapter() {
        @Override
        public void internalFrameClosing(InternalFrameEvent e) {
            close();
        }
    });
}
项目:bisis-v4    文件:WarningsFrame.java   
private void initialize() {
    this.setSize(new java.awt.Dimension(780,550));
    this.setContentPane(getJContentPane());
    this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    this.addInternalFrameListener(new InternalFrameAdapter(){
      public void internalFrameClosing(InternalFrameEvent e){
        handleClose();
      }
    });   
    Dimension screen = getToolkit().getScreenSize();
    this.setLocation((screen.width - getSize().width) / 2,
        (screen.height - getSize().height) / 2);
}
项目:erp    文件:FFilho.java   
public void setPrimeiroFoco(final JComponent comp) {
    addInternalFrameListener(new InternalFrameAdapter() {
        public void internalFrameActivated(InternalFrameEvent ievt) {
            comp.requestFocusInWindow();
        }
    });
}
项目: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);
}
项目:lookaside_java-1.8.0-openjdk    文件: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);
}
项目:j2se_for_android    文件:JInternalFrame.java   
public void show() {
    if (isVisible()) {
        return;
    }

    if (!opened) {
        fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_OPENED);
        opened = true;
    }

    getDesktopIcon().setVisible(true);

    toFront();
    super.show();

}
项目:javify    文件:JInternalFrame.java   
/**
 * This method makes this JInternalFrame invisible, unselected and closed.
 * If this JInternalFrame is not closed already, it will fire an
 * INTERNAL_FRAME_CLoSED event. This method is similar to setClosed but it
 * doesn't give vetoable listeners a chance to veto and it will not fire an
 * INTERNAL_FRAME_CLOSING event.
 */
public void dispose()
{
  if (isVisible())
    setVisible(false);
  if (isSelected())
    {
      try
        {
          setSelected(false);
        }
      catch (PropertyVetoException e)
        {
          // Do nothing if they don't want to be unselected.
        }
    }
  if (! isClosed)
    {
      firePropertyChange(IS_CLOSED_PROPERTY, Boolean.FALSE, Boolean.TRUE);
      isClosed = true;
    }
  fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_CLOSED);
}
项目:javify    文件:JInternalFrame.java   
/**
 * This method sets whether this JInternalFrame is the selected frame in the
 * JDesktopPane (or other container). When selected, a JInternalFrame will
 * have focus and paint its TitlePane differently (usually a different
 * colour). If this method selects the frame, this JInternalFrame will fire
 * an INTERNAL_FRAME_ACTIVATED event. If it deselects this frame, it will
 * fire an INTERNAL_FRAME_DEACTIVATED event.
 *
 * @param selected Whether this JInternalFrame will become selected or
 *        deselected.
 *
 * @throws PropertyVetoException If a VetoableChangeListener vetoes the change.
 */
public void setSelected(boolean selected) throws PropertyVetoException
{
  if (selected != isSelected
      && (! selected || (isIcon ? desktopIcon.isShowing() : isShowing())))
    {
      fireVetoableChange(IS_SELECTED_PROPERTY, isSelected, selected);

      if (! selected)
        defaultFocus = getMostRecentFocusOwner();

      isSelected = selected;
      firePropertyChange(IS_SELECTED_PROPERTY, ! isSelected, isSelected);

      if (isSelected)
        fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_ACTIVATED);
      else
        fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED);

      if (selected)
        restoreSubcomponentFocus();

      repaint();
    }
}
项目:incubator-netbeans    文件:QueryBuilderGraphFrame.java   
public void internalFrameActivated(InternalFrameEvent ife) {
            Object source = (Object)(ife.getSource());

            // When any internal frame is activated, enable these two listeners?
//          _apifa.setEnabled(true);
//          _acifa.setEnabled(true);

            // Finally, bring up property sheet. Ignore event, just check which frame is selected.
            QueryBuilderInternalFrame currentSelectedFrame =
                    (QueryBuilderInternalFrame)_desktopPane.getSelectedFrame();
            setActivatedNode( currentSelectedFrame ) ;
        }
项目:SuperMarketManageSystem    文件:JinHuoTuiHuo.java   
public void internalFrameActivated(InternalFrameEvent e) {
    super.internalFrameActivated(e);
    initTimeField();
    initGysField();
    initPiaoHao();
    initSpBox();
}
项目:SuperMarketManageSystem    文件:JinHuoDan.java   
public void internalFrameActivated(InternalFrameEvent e) {
    super.internalFrameActivated(e);
    initTimeField();
    initGysField();
    initPiaoHao();
    initSpBox();
}
项目:SuperMarketManageSystem    文件:XiaoShouTuiHuo.java   
public void internalFrameActivated(InternalFrameEvent e) {
    super.internalFrameActivated(e);
    initTimeField();
    initKehuField();
    initPiaoHao();
    initSpBox();
}
项目:SuperMarketManageSystem    文件:XiaoShouDan.java   
public void internalFrameActivated(InternalFrameEvent e) {
    super.internalFrameActivated(e);
    initTimeField();
    initKehuField();
    initPiaoHao();
    initSpBox();
}
项目:OpenJSharp    文件: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) {}
    }
}
项目:OpenJSharp    文件:BasicInternalFrameTitlePane.java   
/**
 * 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);
    }
}
项目: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) {}
    }
}
项目:jdk8u-jdk    文件:BasicInternalFrameTitlePane.java   
/**
 * 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);
    }
}
项目:openjdk-jdk10    文件: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) {}
    }
}
项目:openjdk-jdk10    文件: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);
    }
}
项目:openjdk9    文件: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) {}
    }
}
项目:openjdk9    文件: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);
    }
}
项目:Java8CN    文件: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) {}
    }
}
项目:Java8CN    文件:BasicInternalFrameTitlePane.java   
/**
 * 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);
    }
}
项目:semtool    文件:PlaySheetFrameToolBarListener.java   
@Override
public void internalFrameActivated( InternalFrameEvent e ) {
    jtb.removeAll();
    if ( e.getInternalFrame() instanceof PlaySheetFrame ) {
        PlaySheetFrame.class.cast( e.getInternalFrame() ).populateToolbar( jtb );
    }
    jtb.revalidate();
}
项目:semtool    文件:PlaySheetFrameToolBarListener.java   
@Override
public void stateChanged( ChangeEvent e ) {
    JDesktopPane desktop = DIHelper.getInstance().getDesktop();
    JInternalFrame jif = desktop.getSelectedFrame();
    if ( null != jif ) {
        internalFrameActivated( new InternalFrameEvent( jif, 0 ) );
    }
}