if (sf != null && !sf.isIcon()) { sf.setMaximum(false); sf.moveToFront(); if (x >= desktopW || (desktopW - x) * wh < eacharea / 2)
private void cascadeMenuItemActionPerformed( ActionEvent evt) { try { int sfi = 1; for (JInternalFrame sf : getAllFrames()) { if (sf != null && !sf.isIcon()) { sf.setMaximum(false); sf.setLocation(30 * sfi, 30 * sfi); sf.moveToFront(); sf.setSelected(true); sfi++; } } } catch (Exception ex) { LOGGER.error("cascadeMenuItemActionPerformed", ex); // do nothing } }
protected void activateNextFrame(Container c) { int i; JInternalFrame nextFrame = null; if (c == null) return; for (i = 0; i < c.getComponentCount(); i++) { if (c.getComponent(i) instanceof JInternalFrame) { nextFrame = (JInternalFrame) c.getComponent(i); break; } } if (nextFrame != null) { try { nextFrame.setSelected(true); } catch (PropertyVetoException e2) { } nextFrame.moveToFront(); } }
/** * Reacts to selections of menu items in the window menu by moving their * corresponding internal frames to the front. * * @param e the action event indicating which internal frame should be moved * to the front. */ public void actionPerformed(ActionEvent e) { System.out.println(e.getActionCommand()); Object item = e.getSource(); JInternalFrame frame = (JInternalFrame) itemsToFrames.get(item); frame.moveToFront(); if(frame.getContentPane().getComponents().length > 0){ desktop.setMainTitle(frame.getContentPane().getComponent(0).getName()); } }
public void actionPerformed(ActionEvent ae) { JInternalFrame frame = ((ChildMenuItem) ae.getSource()).getFrame(); frame.moveToFront(); try { frame.setSelected(true); } catch (PropertyVetoException e) { e.printStackTrace(); } } });
protected void activateNextFrame() { if(DEBUG) FuLog.debug("BDM: activateNextFrame()"); JInternalFrame[] frames=desktop_.getNormalFrames(); if(frames.length>0) { try { frames[0].setSelected(true); } catch (PropertyVetoException ex) { } frames[0].moveToFront(); return; } frames=desktop_.getPalettes(); if(frames.length>0) { try { frames[0].setSelected(true); } catch (PropertyVetoException ex) { } frames[0].moveToFront(); } } }
public void bringToFront() { if(useDesktop) { if(jInternalFrame == null) return; jInternalFrame.moveToFront(); try { jInternalFrame.setSelected(true); } catch (PropertyVetoException e) { e.printStackTrace(); } } else { jFrame.toFront(); } }
/** * This will activate <b>f</b> moving it to the front. * @param f the <code>JInternalFrame</code> to be activated */ @Override public void activateFrame(JInternalFrame f) { Container p = f.getParent(); IconDesktopPane d = (IconDesktopPane)f.getDesktopPane(); // fix for bug: 4162443 if(p == null) return; if (d != null) d.addSelectedFrame(f); f.moveToFront(); }
public boolean close() { JInternalFrame[] frames = getDesktopPane().getAllFrames(); if (frames != null) { for (JInternalFrame frame : frames) { if (frame != null) { frame.moveToFront(); if ((frame instanceof EditWindow) && !((EditWindow) frame).fileSave(true)) { return false; } } } } dispose(); return true; }
public void run() { fr.moveToFront(); fr.setVisible(true); try { fr.setSelected(true); } catch (PropertyVetoException ex) { // i18n[WindowManager.error.bringtofront=Error bringing internal frame to the front] s_log.error(s_stringMgr.getString("WindowManager.error.bringtofront"), ex); } } });
public void activateFrame(JInternalFrame _f) { if(DEBUG) FuLog.debug("BDM: activateFrame()"); /*GCJ-BEGIN*/ JInternalFrame current=desktop_.getSelectedFrame(); if(current!=_f) { if((current!=null)&¤t.isSelected()) { try { current.setSelected(false); } catch(PropertyVetoException ex) { } } desktop_.setSelectedFrame(_f); } /*GCJ-END*/ _f.moveToFront(); }
public void run() { fr.moveToFront(); fr.setVisible(true); try { fr.setSelected(true); } catch (PropertyVetoException ex) { // i18n[WindowManager.error.bringtofront=Error bringing internal frame to the front] s_log.error(s_stringMgr.getString("WindowManager.error.bringtofront"), ex); } } });
internalFrame.setVisible(true); desktopPane.add(internalFrame); internalFrame.moveToFront();
public void deiconifyFrame(JInternalFrame f) { JInternalFrame.JDesktopIcon desktopIcon = f.getDesktopIcon(); Container c = desktopIcon.getParent(); if (c != null) { c = c.getParent(); if (c != null) { c.add(f); if (f.isMaximum()) { int w = c.getWidth(); int h = c.getHeight() - taskBar.getHeight(); if (f.getWidth() != w || f.getHeight() != h) { setBoundsForFrame(f, 0, 0, w, h); } } if (f.isSelected()) { f.moveToFront(); } else { try { f.setSelected(true); } catch (PropertyVetoException e2) { } } } } }
frame.moveToFront(); frame.setTitle(editor.getName()); frame.setVisible(true);
frame.setBackground(Color.white); desktop.add(frame); frame.moveToFront();
@Override public void actionPerformed(ActionEvent e) { if (frame instanceof JInternalFrame) { JInternalFrame internalF = (JInternalFrame) frame; try { internalF.setSelected(true); if (internalF.isIcon()) internalF.setIcon(false); internalF.moveToFront(); } catch (PropertyVetoException e1) { e1.printStackTrace(); } } else if (frame instanceof LauncherFrame) { LauncherFrame launcher = (LauncherFrame) frame; launcher.getJFrame().setState(Frame.NORMAL); launcher.getJFrame().toFront(); } } }
public void iconifyFrame(JInternalFrame f) { Container c = f.getParent(); boolean findNext = f.isSelected(); if (c == null) { return; } if (!f.isMaximum()) { f.setNormalBounds(f.getBounds()); } c.remove(f); c.repaint(f.getX(), f.getY(), f.getWidth(), f.getHeight()); try { f.setSelected(false); } catch (PropertyVetoException e2) { } // Get topmost of the remaining frames if (findNext) { for (Component comp : c.getComponents()) { if (comp instanceof JInternalFrame) { try { ((JInternalFrame) comp).setSelected(true); } catch (PropertyVetoException e2) { } ((JInternalFrame) comp).moveToFront(); return; } } } }
public void deiconifyFrame(JInternalFrame f) { JInternalFrame.JDesktopIcon desktopIcon = f.getDesktopIcon(); Container c = desktopIcon.getParent(); if (c != null) { c.add(f); // If the frame is to be restored to a maximized state make // sure it still fills the whole desktop. if (f.isMaximum()) { Rectangle desktopBounds = c.getBounds(); if (f.getWidth() != desktopBounds.width || f.getHeight() != desktopBounds.height) { setBoundsForFrame(f, 0, 0, desktopBounds.width, desktopBounds.height); } } removeIconFor(f); if (f.isSelected()) { f.moveToFront(); } else { try { f.setSelected(true); } catch (PropertyVetoException e2) { } } } }
public void activateFrame(JInternalFrame f) { Container p = f.getParent(); JDesktopPane d = f.getDesktopPane(); JInternalFrame currentlyActiveFrame = (d == null) ? null : d.getSelectedFrame(); // fix for bug: 4162443 if (p == null) { // If the frame is not in parent, its icon maybe, check it p = f.getDesktopIcon().getParent(); if (p == null) return; } // we only need to keep track of the currentActive InternalFrame, if any if (currentlyActiveFrame == null) { if (d != null) { d.setSelectedFrame(f); } } else if (currentlyActiveFrame != f) { // if not the same frame as the current active // we deactivate the current if (currentlyActiveFrame.isSelected()) { try { currentlyActiveFrame.setSelected(false); } catch (PropertyVetoException e2) { } } d.setSelectedFrame(f); } f.moveToFront(); }