sun.lwawt.macosx.CPlatformWindow Java Examples

The following examples show how to use sun.lwawt.macosx.CPlatformWindow. 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: AquaUtils.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private static boolean isWindowTextured(final Component c) {
    if (!(c instanceof JComponent)) {
        return false;
    }
    final JRootPane pane = ((JComponent) c).getRootPane();
    if (pane == null) {
        return false;
    }
    Object prop = pane.getClientProperty(
            CPlatformWindow.WINDOW_BRUSH_METAL_LOOK);
    if (prop != null) {
        return Boolean.parseBoolean(prop.toString());
    }
    prop = pane.getClientProperty(CPlatformWindow.WINDOW_STYLE);
    return prop != null && "textured".equals(prop);
}
 
Example #2
Source File: AquaUtils.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private static boolean isWindowTextured(final Component c) {
    if (!(c instanceof JComponent)) {
        return false;
    }
    final JRootPane pane = ((JComponent) c).getRootPane();
    if (pane == null) {
        return false;
    }
    Object prop = pane.getClientProperty(
            CPlatformWindow.WINDOW_BRUSH_METAL_LOOK);
    if (prop != null) {
        return Boolean.parseBoolean(prop.toString());
    }
    prop = pane.getClientProperty(CPlatformWindow.WINDOW_STYLE);
    return prop != null && "textured".equals(prop);
}
 
Example #3
Source File: AquaUtils.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private static boolean isWindowTextured(final Component c) {
    if (!(c instanceof JComponent)) {
        return false;
    }
    final JRootPane pane = ((JComponent) c).getRootPane();
    if (pane == null) {
        return false;
    }
    Object prop = pane.getClientProperty(
            CPlatformWindow.WINDOW_BRUSH_METAL_LOOK);
    if (prop != null) {
        return Boolean.parseBoolean(prop.toString());
    }
    prop = pane.getClientProperty(CPlatformWindow.WINDOW_STYLE);
    return prop != null && "textured".equals(prop);
}
 
Example #4
Source File: AquaUtils.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private static boolean isWindowTextured(final Component c) {
    if (!(c instanceof JComponent)) {
        return false;
    }
    final JRootPane pane = ((JComponent) c).getRootPane();
    if (pane == null) {
        return false;
    }
    Object prop = pane.getClientProperty(
            CPlatformWindow.WINDOW_BRUSH_METAL_LOOK);
    if (prop != null) {
        return Boolean.parseBoolean(prop.toString());
    }
    prop = pane.getClientProperty(CPlatformWindow.WINDOW_STYLE);
    return prop != null && "textured".equals(prop);
}
 
Example #5
Source File: AquaUtils.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
private static boolean isWindowTextured(final Component c) {
    if (!(c instanceof JComponent)) {
        return false;
    }
    final JRootPane pane = ((JComponent) c).getRootPane();
    if (pane == null) {
        return false;
    }
    Object prop = pane.getClientProperty(
            CPlatformWindow.WINDOW_BRUSH_METAL_LOOK);
    if (prop != null) {
        return Boolean.parseBoolean(prop.toString());
    }
    prop = pane.getClientProperty(CPlatformWindow.WINDOW_STYLE);
    return prop != null && "textured".equals(prop);
}
 
Example #6
Source File: AquaUtils.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private static boolean isWindowTextured(final Component c) {
    if (!(c instanceof JComponent)) {
        return false;
    }
    final JRootPane pane = ((JComponent) c).getRootPane();
    if (pane == null) {
        return false;
    }
    Object prop = pane.getClientProperty(
            CPlatformWindow.WINDOW_BRUSH_METAL_LOOK);
    if (prop != null) {
        return Boolean.parseBoolean(prop.toString());
    }
    prop = pane.getClientProperty(CPlatformWindow.WINDOW_STYLE);
    return prop != null && "textured".equals(prop);
}
 
Example #7
Source File: AquaUtils.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private static boolean isWindowTextured(final Component c) {
    if (!(c instanceof JComponent)) {
        return false;
    }
    final JRootPane pane = ((JComponent) c).getRootPane();
    if (pane == null) {
        return false;
    }
    Object prop = pane.getClientProperty(
            CPlatformWindow.WINDOW_BRUSH_METAL_LOOK);
    if (prop != null) {
        return Boolean.parseBoolean(prop.toString());
    }
    prop = pane.getClientProperty(CPlatformWindow.WINDOW_STYLE);
    return prop != null && "textured".equals(prop);
}
 
Example #8
Source File: AquaUtils.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private static boolean isWindowTextured(final Component c) {
    if (!(c instanceof JComponent)) {
        return false;
    }
    final JRootPane pane = ((JComponent) c).getRootPane();
    if (pane == null) {
        return false;
    }
    Object prop = pane.getClientProperty(
            CPlatformWindow.WINDOW_BRUSH_METAL_LOOK);
    if (prop != null) {
        return Boolean.parseBoolean(prop.toString());
    }
    prop = pane.getClientProperty(CPlatformWindow.WINDOW_STYLE);
    return prop != null && "textured".equals(prop);
}
 
Example #9
Source File: AquaUtils.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private static boolean isWindowTextured(final Component c) {
    if (!(c instanceof JComponent)) {
        return false;
    }
    final JRootPane pane = ((JComponent) c).getRootPane();
    if (pane == null) {
        return false;
    }
    Object prop = pane.getClientProperty(
            CPlatformWindow.WINDOW_BRUSH_METAL_LOOK);
    if (prop != null) {
        return Boolean.parseBoolean(prop.toString());
    }
    prop = pane.getClientProperty(CPlatformWindow.WINDOW_STYLE);
    return prop != null && "textured".equals(prop);
}
 
Example #10
Source File: AquaUtils.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private static boolean isWindowTextured(final Component c) {
    if (!(c instanceof JComponent)) {
        return false;
    }
    final JRootPane pane = ((JComponent) c).getRootPane();
    if (pane == null) {
        return false;
    }
    Object prop = pane.getClientProperty(
            CPlatformWindow.WINDOW_BRUSH_METAL_LOOK);
    if (prop != null) {
        return Boolean.parseBoolean(prop.toString());
    }
    prop = pane.getClientProperty(CPlatformWindow.WINDOW_STYLE);
    return prop != null && "textured".equals(prop);
}
 
Example #11
Source File: AquaUtils.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
private static boolean isWindowTextured(final Component c) {
    if (!(c instanceof JComponent)) {
        return false;
    }
    final JRootPane pane = ((JComponent) c).getRootPane();
    if (pane == null) {
        return false;
    }
    Object prop = pane.getClientProperty(
            CPlatformWindow.WINDOW_BRUSH_METAL_LOOK);
    if (prop != null) {
        return Boolean.parseBoolean(prop.toString());
    }
    prop = pane.getClientProperty(CPlatformWindow.WINDOW_STYLE);
    return prop != null && "textured".equals(prop);
}
 
Example #12
Source File: AquaUtils.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
private static boolean isWindowTextured(final Component c) {
    if (!(c instanceof JComponent)) {
        return false;
    }
    final JRootPane pane = ((JComponent) c).getRootPane();
    if (pane == null) {
        return false;
    }
    Object prop = pane.getClientProperty(
            CPlatformWindow.WINDOW_BRUSH_METAL_LOOK);
    if (prop != null) {
        return Boolean.parseBoolean(prop.toString());
    }
    prop = pane.getClientProperty(CPlatformWindow.WINDOW_STYLE);
    return prop != null && "textured".equals(prop);
}
 
Example #13
Source File: AquaUtils.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private static boolean isWindowTextured(final Component c) {
    if (!(c instanceof JComponent)) {
        return false;
    }
    final JRootPane pane = ((JComponent) c).getRootPane();
    if (pane == null) {
        return false;
    }
    Object prop = pane.getClientProperty(
            CPlatformWindow.WINDOW_BRUSH_METAL_LOOK);
    if (prop != null) {
        return Boolean.parseBoolean(prop.toString());
    }
    prop = pane.getClientProperty(CPlatformWindow.WINDOW_STYLE);
    return prop != null && "textured".equals(prop);
}
 
Example #14
Source File: AquaInternalFrameUI.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void propertyChange(final PropertyChangeEvent e) {
    final String name = e.getPropertyName();
    if (FRAME_TYPE.equals(name)) {
        if (e.getNewValue() instanceof String) {
            setFrameType((String)e.getNewValue());
        }
    } else if (IS_PALETTE_PROPERTY.equals(name)) {
        if (e.getNewValue() != null) {
            setPalette(((Boolean)e.getNewValue()).booleanValue());
        } else {
            setPalette(false);
        }
        // TODO: CPlatformWindow?
    } else if ("windowModified".equals(name) || CPlatformWindow.WINDOW_DOCUMENT_MODIFIED.equals(name)) {
        // repaint title bar
        setDocumentEdited(((Boolean)e.getNewValue()).booleanValue());
        frame.repaint(0, 0, frame.getWidth(), frame.getBorder().getBorderInsets(frame).top);
    } else if ("resizable".equals(name) || "state".equals(name) || "iconable".equals(name) || "maximizable".equals(name) || "closable".equals(name)) {
        if ("resizable".equals(name)) {
            frame.revalidate();
        }
        frame.repaint();
    } else if ("title".equals(name)) {
        frame.repaint();
    } else if ("componentOrientation".equals(name)) {
        frame.revalidate();
        frame.repaint();
    } else if (JInternalFrame.IS_SELECTED_PROPERTY.equals(name)) {
        final Component source = (Component)(e.getSource());
        updateComponentTreeUIActivation(source, frame.isSelected() ? Boolean.TRUE : Boolean.FALSE);
    }

}
 
Example #15
Source File: AquaComboBoxPopup.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void configurePopup() {
    super.configurePopup();

    setBorderPainted(false);
    setBorder(null);
    updateContents(false);

    // TODO: CPlatformWindow?
    putClientProperty(CPlatformWindow.WINDOW_FADE_OUT, new Integer(150));
}
 
Example #16
Source File: AquaComboBoxPopup.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void configurePopup() {
    super.configurePopup();

    setBorderPainted(false);
    setBorder(null);
    updateContents(false);

    // TODO: CPlatformWindow?
    putClientProperty(CPlatformWindow.WINDOW_FADE_OUT, new Integer(150));
}
 
Example #17
Source File: ScreenPopupFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public Popup getPopup(final Component comp, final Component invoker, final int x, final int y) {
    if (invoker == null) throw new IllegalArgumentException("Popup.getPopup must be passed non-null contents");

    final Popup popup;
    if (fIsActive) {
        popup = _getHeavyWeightPopup(comp, invoker, x, y);
    } else {
        popup = super.getPopup(comp, invoker, x, y);
    }

    // Make the popup semi-translucent if it is a heavy weight
    // see <rdar://problem/3547670> JPopupMenus have incorrect background
    final Window w = getWindow(invoker);
    if (w == null) return popup;

    if (!(w instanceof RootPaneContainer)) return popup;
    final JRootPane popupRootPane = ((RootPaneContainer)w).getRootPane();

    // we need to set every time, because PopupFactory caches the heavy weight
    // TODO: CPlatformWindow constants?
    if (fIsActive) {
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_ALPHA, TRANSLUCENT);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW, Boolean.TRUE);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_FADE_DELEGATE, invoker);

        w.setBackground(UIManager.getColor("PopupMenu.translucentBackground"));
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_DRAGGABLE_BACKGROUND, Boolean.FALSE);
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW_REVALIDATE_NOW, Double.valueOf(Math.random()));
            }
        });
    } else {
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_ALPHA, OPAQUE);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW, Boolean.FALSE);
    }

    return popup;
}
 
Example #18
Source File: ScreenPopupFactory.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Popup getPopup(final Component comp, final Component invoker, final int x, final int y) {
    if (invoker == null) throw new IllegalArgumentException("Popup.getPopup must be passed non-null contents");

    final Popup popup;
    if (fIsActive) {
        popup = _getHeavyWeightPopup(comp, invoker, x, y);
    } else {
        popup = super.getPopup(comp, invoker, x, y);
    }

    // Make the popup semi-translucent if it is a heavy weight
    // see <rdar://problem/3547670> JPopupMenus have incorrect background
    final Window w = getWindow(invoker);
    if (w == null) return popup;

    if (!(w instanceof RootPaneContainer)) return popup;
    final JRootPane popupRootPane = ((RootPaneContainer)w).getRootPane();

    // we need to set every time, because PopupFactory caches the heavy weight
    // TODO: CPlatformWindow constants?
    if (fIsActive) {
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_ALPHA, TRANSLUCENT);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW, Boolean.TRUE);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_FADE_DELEGATE, invoker);

        w.setBackground(UIManager.getColor("PopupMenu.translucentBackground"));
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_DRAGGABLE_BACKGROUND, Boolean.FALSE);
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW_REVALIDATE_NOW, Double.valueOf(Math.random()));
            }
        });
    } else {
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_ALPHA, OPAQUE);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW, Boolean.FALSE);
    }

    return popup;
}
 
Example #19
Source File: AquaInternalFrameUI.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void propertyChange(final PropertyChangeEvent e) {
    final String name = e.getPropertyName();
    if (FRAME_TYPE.equals(name)) {
        if (e.getNewValue() instanceof String) {
            setFrameType((String)e.getNewValue());
        }
    } else if (IS_PALETTE_PROPERTY.equals(name)) {
        if (e.getNewValue() != null) {
            setPalette(((Boolean)e.getNewValue()).booleanValue());
        } else {
            setPalette(false);
        }
        // TODO: CPlatformWindow?
    } else if ("windowModified".equals(name) || CPlatformWindow.WINDOW_DOCUMENT_MODIFIED.equals(name)) {
        // repaint title bar
        setDocumentEdited(((Boolean)e.getNewValue()).booleanValue());
        frame.repaint(0, 0, frame.getWidth(), frame.getBorder().getBorderInsets(frame).top);
    } else if ("resizable".equals(name) || "state".equals(name) || "iconable".equals(name) || "maximizable".equals(name) || "closable".equals(name)) {
        if ("resizable".equals(name)) {
            frame.revalidate();
        }
        frame.repaint();
    } else if ("title".equals(name)) {
        frame.repaint();
    } else if ("componentOrientation".equals(name)) {
        frame.revalidate();
        frame.repaint();
    } else if (JInternalFrame.IS_SELECTED_PROPERTY.equals(name)) {
        final Component source = (Component)(e.getSource());
        updateComponentTreeUIActivation(source, frame.isSelected() ? Boolean.TRUE : Boolean.FALSE);
    }

}
 
Example #20
Source File: AquaComboBoxPopup.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void configurePopup() {
    super.configurePopup();

    setBorderPainted(false);
    setBorder(null);
    updateContents(false);

    // TODO: CPlatformWindow?
    putClientProperty(CPlatformWindow.WINDOW_FADE_OUT, new Integer(150));
}
 
Example #21
Source File: ScreenPopupFactory.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Popup getPopup(final Component comp, final Component invoker, final int x, final int y) {
    if (invoker == null) throw new IllegalArgumentException("Popup.getPopup must be passed non-null contents");

    final Popup popup;
    if (fIsActive) {
        popup = _getHeavyWeightPopup(comp, invoker, x, y);
    } else {
        popup = super.getPopup(comp, invoker, x, y);
    }

    // Make the popup semi-translucent if it is a heavy weight
    // see <rdar://problem/3547670> JPopupMenus have incorrect background
    final Window w = getWindow(invoker);
    if (w == null) return popup;

    if (!(w instanceof RootPaneContainer)) return popup;
    final JRootPane popupRootPane = ((RootPaneContainer)w).getRootPane();

    // we need to set every time, because PopupFactory caches the heavy weight
    // TODO: CPlatformWindow constants?
    if (fIsActive) {
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_ALPHA, TRANSLUCENT);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW, Boolean.TRUE);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_FADE_DELEGATE, invoker);

        w.setBackground(UIManager.getColor("PopupMenu.translucentBackground"));
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_DRAGGABLE_BACKGROUND, Boolean.FALSE);
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW_REVALIDATE_NOW, Double.valueOf(Math.random()));
            }
        });
    } else {
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_ALPHA, OPAQUE);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW, Boolean.FALSE);
    }

    return popup;
}
 
Example #22
Source File: AquaInternalFrameUI.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void propertyChange(final PropertyChangeEvent e) {
    final String name = e.getPropertyName();
    if (FRAME_TYPE.equals(name)) {
        if (e.getNewValue() instanceof String) {
            setFrameType((String)e.getNewValue());
        }
    } else if (IS_PALETTE_PROPERTY.equals(name)) {
        if (e.getNewValue() != null) {
            setPalette(((Boolean)e.getNewValue()).booleanValue());
        } else {
            setPalette(false);
        }
        // TODO: CPlatformWindow?
    } else if ("windowModified".equals(name) || CPlatformWindow.WINDOW_DOCUMENT_MODIFIED.equals(name)) {
        // repaint title bar
        setDocumentEdited(((Boolean)e.getNewValue()).booleanValue());
        frame.repaint(0, 0, frame.getWidth(), frame.getBorder().getBorderInsets(frame).top);
    } else if ("resizable".equals(name) || "state".equals(name) || "iconable".equals(name) || "maximizable".equals(name) || "closable".equals(name)) {
        if ("resizable".equals(name)) {
            frame.revalidate();
        }
        frame.repaint();
    } else if ("title".equals(name)) {
        frame.repaint();
    } else if ("componentOrientation".equals(name)) {
        frame.revalidate();
        frame.repaint();
    } else if (JInternalFrame.IS_SELECTED_PROPERTY.equals(name)) {
        final Component source = (Component)(e.getSource());
        updateComponentTreeUIActivation(source, frame.isSelected() ? Boolean.TRUE : Boolean.FALSE);
    }

}
 
Example #23
Source File: AquaComboBoxPopup.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void configurePopup() {
    super.configurePopup();

    setBorderPainted(false);
    setBorder(null);
    updateContents(false);

    // TODO: CPlatformWindow?
    putClientProperty(CPlatformWindow.WINDOW_FADE_OUT, new Integer(150));
}
 
Example #24
Source File: ScreenPopupFactory.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public Popup getPopup(final Component comp, final Component invoker, final int x, final int y) {
    if (invoker == null) throw new IllegalArgumentException("Popup.getPopup must be passed non-null contents");

    final Popup popup;
    if (fIsActive) {
        popup = _getHeavyWeightPopup(comp, invoker, x, y);
    } else {
        popup = super.getPopup(comp, invoker, x, y);
    }

    // Make the popup semi-translucent if it is a heavy weight
    // see <rdar://problem/3547670> JPopupMenus have incorrect background
    final Window w = getWindow(invoker);
    if (w == null) return popup;

    if (!(w instanceof RootPaneContainer)) return popup;
    final JRootPane popupRootPane = ((RootPaneContainer)w).getRootPane();

    // we need to set every time, because PopupFactory caches the heavy weight
    // TODO: CPlatformWindow constants?
    if (fIsActive) {
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_ALPHA, TRANSLUCENT);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW, Boolean.TRUE);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_FADE_DELEGATE, invoker);

        w.setBackground(UIManager.getColor("PopupMenu.translucentBackground"));
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_DRAGGABLE_BACKGROUND, Boolean.FALSE);
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW_REVALIDATE_NOW, Double.valueOf(Math.random()));
            }
        });
    } else {
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_ALPHA, OPAQUE);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW, Boolean.FALSE);
    }

    return popup;
}
 
Example #25
Source File: AquaInternalFrameUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void propertyChange(final PropertyChangeEvent e) {
    final String name = e.getPropertyName();
    if (FRAME_TYPE.equals(name)) {
        if (e.getNewValue() instanceof String) {
            setFrameType((String)e.getNewValue());
        }
    } else if (IS_PALETTE_PROPERTY.equals(name)) {
        if (e.getNewValue() != null) {
            setPalette(((Boolean)e.getNewValue()).booleanValue());
        } else {
            setPalette(false);
        }
        // TODO: CPlatformWindow?
    } else if ("windowModified".equals(name) || CPlatformWindow.WINDOW_DOCUMENT_MODIFIED.equals(name)) {
        // repaint title bar
        setDocumentEdited(((Boolean)e.getNewValue()).booleanValue());
        frame.repaint(0, 0, frame.getWidth(), frame.getBorder().getBorderInsets(frame).top);
    } else if ("resizable".equals(name) || "state".equals(name) || "iconable".equals(name) || "maximizable".equals(name) || "closable".equals(name)) {
        if ("resizable".equals(name)) {
            frame.revalidate();
        }
        frame.repaint();
    } else if ("title".equals(name)) {
        frame.repaint();
    } else if ("componentOrientation".equals(name)) {
        frame.revalidate();
        frame.repaint();
    } else if (JInternalFrame.IS_SELECTED_PROPERTY.equals(name)) {
        final Component source = (Component)(e.getSource());
        updateComponentTreeUIActivation(source, frame.isSelected() ? Boolean.TRUE : Boolean.FALSE);
    }

}
 
Example #26
Source File: AquaComboBoxPopup.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void configurePopup() {
    super.configurePopup();

    setBorderPainted(false);
    setBorder(null);
    updateContents(false);

    // TODO: CPlatformWindow?
    putClientProperty(CPlatformWindow.WINDOW_FADE_OUT, new Integer(150));
}
 
Example #27
Source File: ScreenPopupFactory.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public Popup getPopup(final Component comp, final Component invoker, final int x, final int y) {
    if (invoker == null) throw new IllegalArgumentException("Popup.getPopup must be passed non-null contents");

    final Popup popup;
    if (fIsActive) {
        popup = _getHeavyWeightPopup(comp, invoker, x, y);
    } else {
        popup = super.getPopup(comp, invoker, x, y);
    }

    // Make the popup semi-translucent if it is a heavy weight
    // see <rdar://problem/3547670> JPopupMenus have incorrect background
    final Window w = getWindow(invoker);
    if (w == null) return popup;

    if (!(w instanceof RootPaneContainer)) return popup;
    final JRootPane popupRootPane = ((RootPaneContainer)w).getRootPane();

    // we need to set every time, because PopupFactory caches the heavy weight
    // TODO: CPlatformWindow constants?
    if (fIsActive) {
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_ALPHA, TRANSLUCENT);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW, Boolean.TRUE);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_FADE_DELEGATE, invoker);

        w.setBackground(UIManager.getColor("PopupMenu.translucentBackground"));
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_DRAGGABLE_BACKGROUND, Boolean.FALSE);
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW_REVALIDATE_NOW, Double.valueOf(Math.random()));
            }
        });
    } else {
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_ALPHA, OPAQUE);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW, Boolean.FALSE);
    }

    return popup;
}
 
Example #28
Source File: AquaInternalFrameUI.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void propertyChange(final PropertyChangeEvent e) {
    final String name = e.getPropertyName();
    if (FRAME_TYPE.equals(name)) {
        if (e.getNewValue() instanceof String) {
            setFrameType((String)e.getNewValue());
        }
    } else if (IS_PALETTE_PROPERTY.equals(name)) {
        if (e.getNewValue() != null) {
            setPalette(((Boolean)e.getNewValue()).booleanValue());
        } else {
            setPalette(false);
        }
        // TODO: CPlatformWindow?
    } else if ("windowModified".equals(name) || CPlatformWindow.WINDOW_DOCUMENT_MODIFIED.equals(name)) {
        // repaint title bar
        setDocumentEdited(((Boolean)e.getNewValue()).booleanValue());
        frame.repaint(0, 0, frame.getWidth(), frame.getBorder().getBorderInsets(frame).top);
    } else if ("resizable".equals(name) || "state".equals(name) || "iconable".equals(name) || "maximizable".equals(name) || "closable".equals(name)) {
        if ("resizable".equals(name)) {
            frame.revalidate();
        }
        frame.repaint();
    } else if ("title".equals(name)) {
        frame.repaint();
    } else if ("componentOrientation".equals(name)) {
        frame.revalidate();
        frame.repaint();
    } else if (JInternalFrame.IS_SELECTED_PROPERTY.equals(name)) {
        final Component source = (Component)(e.getSource());
        updateComponentTreeUIActivation(source, frame.isSelected() ? Boolean.TRUE : Boolean.FALSE);
    }

}
 
Example #29
Source File: AquaComboBoxPopup.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void configurePopup() {
    super.configurePopup();

    setBorderPainted(false);
    setBorder(null);
    updateContents(false);

    // TODO: CPlatformWindow?
    putClientProperty(CPlatformWindow.WINDOW_FADE_OUT, new Integer(150));
}
 
Example #30
Source File: ScreenPopupFactory.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public Popup getPopup(final Component comp, final Component invoker, final int x, final int y) {
    if (invoker == null) throw new IllegalArgumentException("Popup.getPopup must be passed non-null contents");

    final Popup popup;
    if (fIsActive) {
        popup = _getHeavyWeightPopup(comp, invoker, x, y);
    } else {
        popup = super.getPopup(comp, invoker, x, y);
    }

    // Make the popup semi-translucent if it is a heavy weight
    // see <rdar://problem/3547670> JPopupMenus have incorrect background
    final Window w = getWindow(invoker);
    if (w == null) return popup;

    if (!(w instanceof RootPaneContainer)) return popup;
    final JRootPane popupRootPane = ((RootPaneContainer)w).getRootPane();

    // we need to set every time, because PopupFactory caches the heavy weight
    // TODO: CPlatformWindow constants?
    if (fIsActive) {
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_ALPHA, TRANSLUCENT);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW, Boolean.TRUE);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_FADE_DELEGATE, invoker);

        w.setBackground(UIManager.getColor("PopupMenu.translucentBackground"));
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_DRAGGABLE_BACKGROUND, Boolean.FALSE);
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW_REVALIDATE_NOW, Double.valueOf(Math.random()));
            }
        });
    } else {
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_ALPHA, OPAQUE);
        popupRootPane.putClientProperty(CPlatformWindow.WINDOW_SHADOW, Boolean.FALSE);
    }

    return popup;
}