Example usage for javax.swing JInternalFrame getName

List of usage examples for javax.swing JInternalFrame getName

Introduction

In this page you can find the example usage for javax.swing JInternalFrame getName.

Prototype

public String getName() 

Source Link

Document

Gets the name of the component.

Usage

From source file:org.en.tealEye.guiMain.MainAppFrame.java

public void insertInternalFrame(ExtendedJPanelImpl name) {
    ExtendedJPanelImpl jPanelImpl;//from w  ww .  j av a  2s  .c o  m
    try {
        jPanelImpl = name;
        panelMap.put(name.getName(), name);
        JInternalFrame jInternalFrame = new JInternalFrame();
        jInternalFrame.setSize(400, 300);
        jInternalFrame.setName(jPanelImpl.getName());
        jInternalFrame.setTitle(jPanelImpl.getTitle());
        jInternalFrame.getContentPane().add(new JScrollPane(jPanelImpl));
        jInternalFrame.setIconifiable(true);
        jInternalFrame.setMaximizable(true);
        jInternalFrame.setResizable(true);
        jInternalFrame.setClosable(true);
        jInternalFrame.addInternalFrameListener(windowController);
        frameMap.put(jInternalFrame.getName(), jInternalFrame);
        desktop.add(jInternalFrame);
        desktop.getDesktopManager().activateFrame(jInternalFrame);
        desktop.getDesktopManager().maximizeFrame(jInternalFrame);
        jInternalFrame.moveToFront();
        jInternalFrame.setSelected(true);
        jInternalFrame.setVisible(true);
        jInternalFrame.validate();
        activeFrameMenu.addFrameButton(jPanelImpl.getName());
        menuController.setActiveFrameName(jInternalFrame.getName());
    } catch (Exception e) {
        log.error("cannot open panel " + name, e);
    }

}

From source file:org.en.tealEye.guiMain.MainAppFrame.java

public void activateInternalFrame(String panelName) {
    JInternalFrame[] frames = desktop.getAllFrames();
    for (JInternalFrame frame : frames) {
        if (frame.getName().equals(panelName)) {
            frame.moveToFront();/*w w w.ja va 2s . c  o m*/
            //desktop.getDesktopManager().deactivateFrame(frame);
            desktop.getDesktopManager().activateFrame(frame);
            try {
                frame.setSelected(true);
                menuController.setActiveFrameName(frame.getName());
            } catch (PropertyVetoException e) {
                log.error(e.getMessage(), e);
            }
        } else {
            frame.moveToBack();
        }
    }
}

From source file:org.en.tealEye.guiMain.MainAppFrame.java

public void closeAllFrames() {
    Object[] obj = frameMap.values().toArray();
    for (Object oframe : obj) {
        JInternalFrame frame = (JInternalFrame) oframe;
        desktop.getDesktopManager().closeFrame(frame);
        frameMap.remove(frame.getName());
        h.removePanel(frame.getName());//from ww w .j  a  va 2s.  co m
        activeFrameMenu.removeAllButtons();
    }
}