Java Code Examples for javax.swing.JInternalFrame#isSelected()
The following examples show how to use
javax.swing.JInternalFrame#isSelected() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SeaGlassDesktopPaneUI.java From seaglass with Apache License 2.0 | 8 votes |
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) { } } } } }
Example 2
Source File: WindowsDesktopManager.java From hottub with GNU General Public License v2.0 | 5 votes |
public void activateFrame(JInternalFrame f) { JInternalFrame currentFrame = currentFrameRef != null ? currentFrameRef.get() : null; try { super.activateFrame(f); if (currentFrame != null && f != currentFrame) { // If the current frame is maximized, transfer that // attribute to the frame being activated. if (currentFrame.isMaximum() && (f.getClientProperty("JInternalFrame.frameType") != "optionDialog") ) { //Special case. If key binding was used to select next //frame instead of minimizing the icon via the minimize //icon. if (!currentFrame.isIcon()) { currentFrame.setMaximum(false); if (f.isMaximizable()) { if (!f.isMaximum()) { f.setMaximum(true); } else if (f.isMaximum() && f.isIcon()) { f.setIcon(false); } else { f.setMaximum(false); } } } } if (currentFrame.isSelected()) { currentFrame.setSelected(false); } } if (!f.isSelected()) { f.setSelected(true); } } catch (PropertyVetoException e) {} if (f != currentFrame) { currentFrameRef = new WeakReference<JInternalFrame>(f); } }
Example 3
Source File: InternalFrameDemoFrame.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 5 votes |
private JInternalFrame findSelectedFrame() { final JInternalFrame[] frames = desktop.getAllFrames(); for (int i = 0; i < frames.length; i++) { final JInternalFrame frame = frames[i]; if (frame.isSelected()) { return frame; } } return null; }
Example 4
Source File: WindowsDesktopManager.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
public void activateFrame(JInternalFrame f) { JInternalFrame currentFrame = currentFrameRef != null ? currentFrameRef.get() : null; try { super.activateFrame(f); if (currentFrame != null && f != currentFrame) { // If the current frame is maximized, transfer that // attribute to the frame being activated. if (currentFrame.isMaximum() && (f.getClientProperty("JInternalFrame.frameType") != "optionDialog") ) { //Special case. If key binding was used to select next //frame instead of minimizing the icon via the minimize //icon. if (!currentFrame.isIcon()) { currentFrame.setMaximum(false); if (f.isMaximizable()) { if (!f.isMaximum()) { f.setMaximum(true); } else if (f.isMaximum() && f.isIcon()) { f.setIcon(false); } else { f.setMaximum(false); } } } } if (currentFrame.isSelected()) { currentFrame.setSelected(false); } } if (!f.isSelected()) { f.setSelected(true); } } catch (PropertyVetoException e) {} if (f != currentFrame) { currentFrameRef = new WeakReference<JInternalFrame>(f); } }
Example 5
Source File: OOODesktopManager.java From noa-libre with GNU Lesser General Public License v2.1 | 5 votes |
public void activateFrame(JInternalFrame f) { Container p = f.getParent(); Component[] c; 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 (Exception e2) { } } if (d != null) { d.setSelectedFrame(f); } } f.moveToFront(); }
Example 6
Source File: OOODesktopManager.java From noa-libre with GNU Lesser General Public License v2.1 | 5 votes |
public void deiconifyFrame(JInternalFrame f) { JInternalFrame.JDesktopIcon desktopIcon = f.getDesktopIcon(); Container c = desktopIcon.getParent(); if (c != null) { f.setBounds(oldBounds.remove(f)); //XXX //c.add(f); //XXX // 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) { } } } }
Example 7
Source File: WindowsDesktopManager.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
public void activateFrame(JInternalFrame f) { JInternalFrame currentFrame = currentFrameRef != null ? currentFrameRef.get() : null; try { super.activateFrame(f); if (currentFrame != null && f != currentFrame) { // If the current frame is maximized, transfer that // attribute to the frame being activated. if (currentFrame.isMaximum() && (f.getClientProperty("JInternalFrame.frameType") != "optionDialog") ) { //Special case. If key binding was used to select next //frame instead of minimizing the icon via the minimize //icon. if (!currentFrame.isIcon()) { currentFrame.setMaximum(false); if (f.isMaximizable()) { if (!f.isMaximum()) { f.setMaximum(true); } else if (f.isMaximum() && f.isIcon()) { f.setIcon(false); } else { f.setMaximum(false); } } } } if (currentFrame.isSelected()) { currentFrame.setSelected(false); } } if (!f.isSelected()) { f.setSelected(true); } } catch (PropertyVetoException e) {} if (f != currentFrame) { currentFrameRef = new WeakReference<JInternalFrame>(f); } }
Example 8
Source File: WindowsDesktopManager.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public void activateFrame(JInternalFrame f) { JInternalFrame currentFrame = currentFrameRef != null ? currentFrameRef.get() : null; try { super.activateFrame(f); if (currentFrame != null && f != currentFrame) { // If the current frame is maximized, transfer that // attribute to the frame being activated. if (currentFrame.isMaximum() && (f.getClientProperty("JInternalFrame.frameType") != "optionDialog") ) { //Special case. If key binding was used to select next //frame instead of minimizing the icon via the minimize //icon. if (!currentFrame.isIcon()) { currentFrame.setMaximum(false); if (f.isMaximizable()) { if (!f.isMaximum()) { f.setMaximum(true); } else if (f.isMaximum() && f.isIcon()) { f.setIcon(false); } else { f.setMaximum(false); } } } } if (currentFrame.isSelected()) { currentFrame.setSelected(false); } } if (!f.isSelected()) { f.setSelected(true); } } catch (PropertyVetoException e) {} if (f != currentFrame) { currentFrameRef = new WeakReference<JInternalFrame>(f); } }
Example 9
Source File: WindowsDesktopManager.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public void activateFrame(JInternalFrame f) { JInternalFrame currentFrame = currentFrameRef != null ? currentFrameRef.get() : null; try { super.activateFrame(f); if (currentFrame != null && f != currentFrame) { // If the current frame is maximized, transfer that // attribute to the frame being activated. if (currentFrame.isMaximum() && (f.getClientProperty("JInternalFrame.frameType") != "optionDialog") ) { //Special case. If key binding was used to select next //frame instead of minimizing the icon via the minimize //icon. if (!currentFrame.isIcon()) { currentFrame.setMaximum(false); if (f.isMaximizable()) { if (!f.isMaximum()) { f.setMaximum(true); } else if (f.isMaximum() && f.isIcon()) { f.setIcon(false); } else { f.setMaximum(false); } } } } if (currentFrame.isSelected()) { currentFrame.setSelected(false); } } if (!f.isSelected()) { f.setSelected(true); } } catch (PropertyVetoException e) {} if (f != currentFrame) { currentFrameRef = new WeakReference<JInternalFrame>(f); } }
Example 10
Source File: WindowsDesktopManager.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
public void activateFrame(JInternalFrame f) { JInternalFrame currentFrame = currentFrameRef != null ? currentFrameRef.get() : null; try { super.activateFrame(f); if (currentFrame != null && f != currentFrame) { // If the current frame is maximized, transfer that // attribute to the frame being activated. if (currentFrame.isMaximum() && (f.getClientProperty("JInternalFrame.frameType") != "optionDialog") ) { //Special case. If key binding was used to select next //frame instead of minimizing the icon via the minimize //icon. if (!currentFrame.isIcon()) { currentFrame.setMaximum(false); if (f.isMaximizable()) { if (!f.isMaximum()) { f.setMaximum(true); } else if (f.isMaximum() && f.isIcon()) { f.setIcon(false); } else { f.setMaximum(false); } } } } if (currentFrame.isSelected()) { currentFrame.setSelected(false); } } if (!f.isSelected()) { f.setSelected(true); } } catch (PropertyVetoException e) {} if (f != currentFrame) { currentFrameRef = new WeakReference<JInternalFrame>(f); } }
Example 11
Source File: WindowsDesktopManager.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
public void activateFrame(JInternalFrame f) { JInternalFrame currentFrame = currentFrameRef != null ? currentFrameRef.get() : null; try { super.activateFrame(f); if (currentFrame != null && f != currentFrame) { // If the current frame is maximized, transfer that // attribute to the frame being activated. if (currentFrame.isMaximum() && (f.getClientProperty("JInternalFrame.frameType") != "optionDialog") ) { //Special case. If key binding was used to select next //frame instead of minimizing the icon via the minimize //icon. if (!currentFrame.isIcon()) { currentFrame.setMaximum(false); if (f.isMaximizable()) { if (!f.isMaximum()) { f.setMaximum(true); } else if (f.isMaximum() && f.isIcon()) { f.setIcon(false); } else { f.setMaximum(false); } } } } if (currentFrame.isSelected()) { currentFrame.setSelected(false); } } if (!f.isSelected()) { f.setSelected(true); } } catch (PropertyVetoException e) {} if (f != currentFrame) { currentFrameRef = new WeakReference<JInternalFrame>(f); } }
Example 12
Source File: WindowsDesktopManager.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public void activateFrame(JInternalFrame f) { JInternalFrame currentFrame = currentFrameRef != null ? currentFrameRef.get() : null; try { super.activateFrame(f); if (currentFrame != null && f != currentFrame) { // If the current frame is maximized, transfer that // attribute to the frame being activated. if (!currentFrame.isClosed() && currentFrame.isMaximum() && (f.getClientProperty("JInternalFrame.frameType") != "optionDialog") ) { //Special case. If key binding was used to select next //frame instead of minimizing the icon via the minimize //icon. if (!currentFrame.isIcon()) { currentFrame.setMaximum(false); if (f.isMaximizable()) { if (!f.isMaximum()) { f.setMaximum(true); } else if (f.isMaximum() && f.isIcon()) { f.setIcon(false); } else { f.setMaximum(false); } } } } if (currentFrame.isSelected()) { currentFrame.setSelected(false); } } if (!f.isSelected()) { f.setSelected(true); } } catch (PropertyVetoException e) {} if (f != currentFrame) { currentFrameRef = new WeakReference<JInternalFrame>(f); } }
Example 13
Source File: WindowsDesktopManager.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public void activateFrame(JInternalFrame f) { JInternalFrame currentFrame = currentFrameRef != null ? currentFrameRef.get() : null; try { super.activateFrame(f); if (currentFrame != null && f != currentFrame) { // If the current frame is maximized, transfer that // attribute to the frame being activated. if (currentFrame.isMaximum() && (f.getClientProperty("JInternalFrame.frameType") != "optionDialog") ) { //Special case. If key binding was used to select next //frame instead of minimizing the icon via the minimize //icon. if (!currentFrame.isIcon()) { currentFrame.setMaximum(false); if (f.isMaximizable()) { if (!f.isMaximum()) { f.setMaximum(true); } else if (f.isMaximum() && f.isIcon()) { f.setIcon(false); } else { f.setMaximum(false); } } } } if (currentFrame.isSelected()) { currentFrame.setSelected(false); } } if (!f.isSelected()) { f.setSelected(true); } } catch (PropertyVetoException e) {} if (f != currentFrame) { currentFrameRef = new WeakReference<JInternalFrame>(f); } }
Example 14
Source File: WindowsDesktopManager.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public void activateFrame(JInternalFrame f) { JInternalFrame currentFrame = currentFrameRef != null ? currentFrameRef.get() : null; try { super.activateFrame(f); if (currentFrame != null && f != currentFrame) { // If the current frame is maximized, transfer that // attribute to the frame being activated. if (currentFrame.isMaximum() && (f.getClientProperty("JInternalFrame.frameType") != "optionDialog") ) { //Special case. If key binding was used to select next //frame instead of minimizing the icon via the minimize //icon. if (!currentFrame.isIcon()) { currentFrame.setMaximum(false); if (f.isMaximizable()) { if (!f.isMaximum()) { f.setMaximum(true); } else if (f.isMaximum() && f.isIcon()) { f.setIcon(false); } else { f.setMaximum(false); } } } } if (currentFrame.isSelected()) { currentFrame.setSelected(false); } } if (!f.isSelected()) { f.setSelected(true); } } catch (PropertyVetoException e) {} if (f != currentFrame) { currentFrameRef = new WeakReference<JInternalFrame>(f); } }
Example 15
Source File: WindowsDesktopManager.java From JDKSourceCode1.8 with MIT License | 5 votes |
public void activateFrame(JInternalFrame f) { JInternalFrame currentFrame = currentFrameRef != null ? currentFrameRef.get() : null; try { super.activateFrame(f); if (currentFrame != null && f != currentFrame) { // If the current frame is maximized, transfer that // attribute to the frame being activated. if (currentFrame.isMaximum() && (f.getClientProperty("JInternalFrame.frameType") != "optionDialog") ) { //Special case. If key binding was used to select next //frame instead of minimizing the icon via the minimize //icon. if (!currentFrame.isIcon()) { currentFrame.setMaximum(false); if (f.isMaximizable()) { if (!f.isMaximum()) { f.setMaximum(true); } else if (f.isMaximum() && f.isIcon()) { f.setIcon(false); } else { f.setMaximum(false); } } } } if (currentFrame.isSelected()) { currentFrame.setSelected(false); } } if (!f.isSelected()) { f.setSelected(true); } } catch (PropertyVetoException e) {} if (f != currentFrame) { currentFrameRef = new WeakReference<JInternalFrame>(f); } }
Example 16
Source File: WindowsDesktopManager.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public void activateFrame(JInternalFrame f) { JInternalFrame currentFrame = currentFrameRef != null ? currentFrameRef.get() : null; try { super.activateFrame(f); if (currentFrame != null && f != currentFrame) { // If the current frame is maximized, transfer that // attribute to the frame being activated. if (currentFrame.isMaximum() && (f.getClientProperty("JInternalFrame.frameType") != "optionDialog") ) { //Special case. If key binding was used to select next //frame instead of minimizing the icon via the minimize //icon. if (!currentFrame.isIcon()) { currentFrame.setMaximum(false); if (f.isMaximizable()) { if (!f.isMaximum()) { f.setMaximum(true); } else if (f.isMaximum() && f.isIcon()) { f.setIcon(false); } else { f.setMaximum(false); } } } } if (currentFrame.isSelected()) { currentFrame.setSelected(false); } } if (!f.isSelected()) { f.setSelected(true); } } catch (PropertyVetoException e) {} if (f != currentFrame) { currentFrameRef = new WeakReference<JInternalFrame>(f); } }
Example 17
Source File: WindowsDesktopManager.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public void activateFrame(JInternalFrame f) { JInternalFrame currentFrame = currentFrameRef != null ? currentFrameRef.get() : null; try { super.activateFrame(f); if (currentFrame != null && f != currentFrame) { // If the current frame is maximized, transfer that // attribute to the frame being activated. if (currentFrame.isMaximum() && (f.getClientProperty("JInternalFrame.frameType") != "optionDialog") ) { //Special case. If key binding was used to select next //frame instead of minimizing the icon via the minimize //icon. if (!currentFrame.isIcon()) { currentFrame.setMaximum(false); if (f.isMaximizable()) { if (!f.isMaximum()) { f.setMaximum(true); } else if (f.isMaximum() && f.isIcon()) { f.setIcon(false); } else { f.setMaximum(false); } } } } if (currentFrame.isSelected()) { currentFrame.setSelected(false); } } if (!f.isSelected()) { f.setSelected(true); } } catch (PropertyVetoException e) {} if (f != currentFrame) { currentFrameRef = new WeakReference<JInternalFrame>(f); } }
Example 18
Source File: WindowsDesktopManager.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
public void activateFrame(JInternalFrame f) { JInternalFrame currentFrame = currentFrameRef != null ? currentFrameRef.get() : null; try { super.activateFrame(f); if (currentFrame != null && f != currentFrame) { // If the current frame is maximized, transfer that // attribute to the frame being activated. if (currentFrame.isMaximum() && (f.getClientProperty("JInternalFrame.frameType") != "optionDialog") ) { //Special case. If key binding was used to select next //frame instead of minimizing the icon via the minimize //icon. if (!currentFrame.isIcon()) { currentFrame.setMaximum(false); if (f.isMaximizable()) { if (!f.isMaximum()) { f.setMaximum(true); } else if (f.isMaximum() && f.isIcon()) { f.setIcon(false); } else { f.setMaximum(false); } } } } if (currentFrame.isSelected()) { currentFrame.setSelected(false); } } if (!f.isSelected()) { f.setSelected(true); } } catch (PropertyVetoException e) {} if (f != currentFrame) { currentFrameRef = new WeakReference<JInternalFrame>(f); } }
Example 19
Source File: FlatInternalFrameUI.java From FlatLaf with Apache License 2.0 | 5 votes |
@Override public void paintBorder( Component c, Graphics g, int x, int y, int width, int height ) { JInternalFrame f = (JInternalFrame) c; Insets insets = getBorderInsets( c ); float lineWidth = scale( (float) borderLineWidth ); float rx = x + insets.left - lineWidth; float ry = y + insets.top - lineWidth; float rwidth = width - insets.left - insets.right + (lineWidth * 2); float rheight = height - insets.top - insets.bottom + (lineWidth * 2); Graphics2D g2 = (Graphics2D) g.create(); try { FlatUIUtils.setRenderingHints( g2 ); g2.setColor( f.isSelected() ? activeBorderColor : inactiveBorderColor ); // paint drop shadow if( dropShadowPainted ) { FlatDropShadowBorder dropShadowBorder = f.isSelected() ? activeDropShadowBorder : inactiveDropShadowBorder; Insets dropShadowInsets = dropShadowBorder.getBorderInsets(); dropShadowBorder.paintBorder( c, g2, (int) rx - dropShadowInsets.left, (int) ry - dropShadowInsets.top, (int) rwidth + dropShadowInsets.left + dropShadowInsets.right, (int) rheight + dropShadowInsets.top + dropShadowInsets.bottom ); } // paint border g2.fill( FlatUIUtils.createRectangle( rx, ry, rwidth, rheight, lineWidth ) ); } finally { g2.dispose(); } }
Example 20
Source File: OOODesktopManager.java From noa-libre with GNU Lesser General Public License v2.1 | 4 votes |
@Override public void iconifyFrame(JInternalFrame f) { JInternalFrame.JDesktopIcon desktopIcon; Container c = f.getParent(); JDesktopPane d = f.getDesktopPane(); boolean findNext = f.isSelected(); desktopIcon = f.getDesktopIcon(); if (!wasIcon(f)) { Rectangle r = getBoundsForIconOf(f); desktopIcon.setBounds(r.x, r.y, r.width, r.height); setWasIcon(f, Boolean.TRUE); } if (c == null) { return; } if (c instanceof JLayeredPane) { JLayeredPane lp = (JLayeredPane) c; int layer = JLayeredPane.getLayer(f); JLayeredPane.putLayer(desktopIcon, layer); } // If we are maximized we already have the normal bounds recorded // don't try to re-record them, otherwise we incorrectly set the // normal bounds to maximized state. if (!f.isMaximum()) { f.setNormalBounds(f.getBounds()); } //c.remove(f); XXX oldBounds.put(f, f.getBounds()); //XXX f.setBounds(0, 0, 0, 0); //XXX c.add(desktopIcon); 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) { activateNextFrame(c); } }