javax.swing.plaf.RootPaneUI Java Examples

The following examples show how to use javax.swing.plaf.RootPaneUI. 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: LafUtils.java    From weblaf with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns whether {@link Window} in which specified {@link Component} located is decorated by LaF or not.
 *
 * @param component {@link Component} used to determine {@link Window} decoration state
 * @return true if {@link Window} in which specified {@link Component} located is decorated by LaF, false otherwise
 */
public static boolean isInDecoratedWindow ( @Nullable final Component component )
{
    boolean result = false;
    final JRootPane rootPane = CoreSwingUtils.getRootPane ( component );
    if ( rootPane != null )
    {
        final RootPaneUI ui = rootPane.getUI ();
        if ( ui instanceof WRootPaneUI )
        {
            result = ( ( WRootPaneUI ) ui ).isDecorated ();
        }
    }
    return result;
}
 
Example #2
Source File: LuckMetalRootPaneLayout.java    From littleluck with Apache License 2.0 4 votes vote down vote up
public void layoutContainer(Container parent)
{
    JRootPane root = (JRootPane) parent;
    Rectangle bound = root.getBounds();
    Insets inset = root.getInsets();

    // 获取内容面板实际宽度, 减去左右边框面积
    // Calculate the actual width
    int w = bound.width - inset.right - inset.left;

    // 获取内容面板实际高度, 减去上下边框面积
    // Calculate the actual height
    int h = bound.height - inset.top - inset.bottom;

    // 设置层级面板在根窗格中的位置
    // layout LayeredPane
    if(root.getLayeredPane() != null)
    {
        root.getLayeredPane().setBounds(inset.left, inset.top, w, h);
    }

    // 玻璃窗格是在层级面板中,所以坐标从(0, 0)开始
    // layout GlassPane
    if(root.getGlassPane() != null)
    {
        root.getGlassPane().setBounds(inset.left, inset.top, w, h);
    }

    int nextY = 0;

    RootPaneUI rootPaneUI = root.getUI();

    if(rootPaneUI instanceof LuckMetalRootPaneUI)
    {
        // 布局标题面板
        // layout TitlePane
        Component titlePanel = ((LuckMetalRootPaneUI)rootPaneUI).getTitlePane();

        // 如果未取消窗体装饰
        if (titlePanel != null)
        {
            titlePanel.setBounds(0, nextY, w, titlePanel.getHeight());

            nextY += titlePanel.getHeight();
        }
    }

    // 布局JMenuBar
    // layout JMenuBar
    JMenuBar menuBar = root.getJMenuBar();

    if(menuBar != null && menuBar.isVisible())
    {
        menuBar.setBounds(0, nextY, w, menuBar.getPreferredSize().height);

        nextY += menuBar.getPreferredSize().getHeight();
    }

    // 布局内容面板
    // layout ContentPane
    root.getContentPane().setBounds(0, nextY, w, h - nextY);
}
 
Example #3
Source File: JRootPane.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the L&F object that renders this component.
 *
 * @return <code>LabelUI</code> object
 * @since 1.3
 */
public RootPaneUI getUI() {
    return (RootPaneUI)ui;
}
 
Example #4
Source File: JRootPane.java    From openjdk-jdk9 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Resets the UI property to a value from the current look and feel.
 *
 * @see JComponent#updateUI
 */
public void updateUI() {
    setUI((RootPaneUI)UIManager.getUI(this));
}
 
Example #5
Source File: JRootPane.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Sets the L&amp;F object that renders this component.
 *
 * @param ui  the <code>LabelUI</code> L&amp;F object
 * @see UIDefaults#getUI
 * @beaninfo
 *        bound: true
 *       hidden: true
 *      expert: true
 *    attribute: visualUpdate true
 *  description: The UI object that implements the Component's LookAndFeel.
 * @since 1.3
 */
public void setUI(RootPaneUI ui) {
    super.setUI(ui);
}
 
Example #6
Source File: JRootPane.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Resets the UI property to a value from the current look and feel.
 *
 * @see JComponent#updateUI
 */
public void updateUI() {
    setUI((RootPaneUI)UIManager.getUI(this));
}
 
Example #7
Source File: JRootPane.java    From Java8CN with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the L&amp;F object that renders this component.
 *
 * @return <code>LabelUI</code> object
 * @since 1.3
 */
public RootPaneUI getUI() {
    return (RootPaneUI)ui;
}
 
Example #8
Source File: JRootPane.java    From Java8CN with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the L&amp;F object that renders this component.
 *
 * @param ui  the <code>LabelUI</code> L&amp;F object
 * @see UIDefaults#getUI
 * @beaninfo
 *        bound: true
 *       hidden: true
 *      expert: true
 *    attribute: visualUpdate true
 *  description: The UI object that implements the Component's LookAndFeel.
 * @since 1.3
 */
public void setUI(RootPaneUI ui) {
    super.setUI(ui);
}
 
Example #9
Source File: JRootPane.java    From Java8CN with Apache License 2.0 2 votes vote down vote up
/**
 * Resets the UI property to a value from the current look and feel.
 *
 * @see JComponent#updateUI
 */
public void updateUI() {
    setUI((RootPaneUI)UIManager.getUI(this));
}
 
Example #10
Source File: JRootPane.java    From hottub with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the L&amp;F object that renders this component.
 *
 * @return <code>LabelUI</code> object
 * @since 1.3
 */
public RootPaneUI getUI() {
    return (RootPaneUI)ui;
}
 
Example #11
Source File: JRootPane.java    From hottub with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Sets the L&amp;F object that renders this component.
 *
 * @param ui  the <code>LabelUI</code> L&amp;F object
 * @see UIDefaults#getUI
 * @beaninfo
 *        bound: true
 *       hidden: true
 *      expert: true
 *    attribute: visualUpdate true
 *  description: The UI object that implements the Component's LookAndFeel.
 * @since 1.3
 */
public void setUI(RootPaneUI ui) {
    super.setUI(ui);
}
 
Example #12
Source File: JRootPane.java    From hottub with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Resets the UI property to a value from the current look and feel.
 *
 * @see JComponent#updateUI
 */
public void updateUI() {
    setUI((RootPaneUI)UIManager.getUI(this));
}
 
Example #13
Source File: JRootPane.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the L&amp;F object that renders this component.
 *
 * @return <code>LabelUI</code> object
 * @since 1.3
 */
public RootPaneUI getUI() {
    return (RootPaneUI)ui;
}
 
Example #14
Source File: JRootPane.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Sets the L&amp;F object that renders this component.
 *
 * @param ui  the <code>LabelUI</code> L&amp;F object
 * @see UIDefaults#getUI
 * @beaninfo
 *        bound: true
 *       hidden: true
 *      expert: true
 *    attribute: visualUpdate true
 *  description: The UI object that implements the Component's LookAndFeel.
 * @since 1.3
 */
public void setUI(RootPaneUI ui) {
    super.setUI(ui);
}
 
Example #15
Source File: JRootPane.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Resets the UI property to a value from the current look and feel.
 *
 * @see JComponent#updateUI
 */
public void updateUI() {
    setUI((RootPaneUI)UIManager.getUI(this));
}
 
Example #16
Source File: JRootPane.java    From openjdk-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the L&amp;F object that renders this component.
 *
 * @return <code>LabelUI</code> object
 * @since 1.3
 */
public RootPaneUI getUI() {
    return (RootPaneUI)ui;
}
 
Example #17
Source File: JRootPane.java    From openjdk-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Sets the L&amp;F object that renders this component.
 *
 * @param ui  the <code>LabelUI</code> L&amp;F object
 * @see UIDefaults#getUI
 * @beaninfo
 *        bound: true
 *       hidden: true
 *      expert: true
 *    attribute: visualUpdate true
 *  description: The UI object that implements the Component's LookAndFeel.
 * @since 1.3
 */
public void setUI(RootPaneUI ui) {
    super.setUI(ui);
}
 
Example #18
Source File: JRootPane.java    From openjdk-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Resets the UI property to a value from the current look and feel.
 *
 * @see JComponent#updateUI
 */
public void updateUI() {
    setUI((RootPaneUI)UIManager.getUI(this));
}
 
Example #19
Source File: JRootPane.java    From jdk8u_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the L&amp;F object that renders this component.
 *
 * @return <code>LabelUI</code> object
 * @since 1.3
 */
public RootPaneUI getUI() {
    return (RootPaneUI)ui;
}
 
Example #20
Source File: JRootPane.java    From jdk8u_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Sets the L&amp;F object that renders this component.
 *
 * @param ui  the <code>LabelUI</code> L&amp;F object
 * @see UIDefaults#getUI
 * @beaninfo
 *        bound: true
 *       hidden: true
 *      expert: true
 *    attribute: visualUpdate true
 *  description: The UI object that implements the Component's LookAndFeel.
 * @since 1.3
 */
public void setUI(RootPaneUI ui) {
    super.setUI(ui);
}
 
Example #21
Source File: JRootPane.java    From jdk8u_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Resets the UI property to a value from the current look and feel.
 *
 * @see JComponent#updateUI
 */
public void updateUI() {
    setUI((RootPaneUI)UIManager.getUI(this));
}
 
Example #22
Source File: JRootPane.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the L&amp;F object that renders this component.
 *
 * @return <code>LabelUI</code> object
 * @since 1.3
 */
public RootPaneUI getUI() {
    return (RootPaneUI)ui;
}
 
Example #23
Source File: JRootPane.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Sets the L&amp;F object that renders this component.
 *
 * @param ui  the <code>LabelUI</code> L&amp;F object
 * @see UIDefaults#getUI
 * @beaninfo
 *        bound: true
 *       hidden: true
 *      expert: true
 *    attribute: visualUpdate true
 *  description: The UI object that implements the Component's LookAndFeel.
 * @since 1.3
 */
public void setUI(RootPaneUI ui) {
    super.setUI(ui);
}
 
Example #24
Source File: JRootPane.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Resets the UI property to a value from the current look and feel.
 *
 * @see JComponent#updateUI
 */
public void updateUI() {
    setUI((RootPaneUI)UIManager.getUI(this));
}
 
Example #25
Source File: JRootPane.java    From jdk8u-dev-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the L&amp;F object that renders this component.
 *
 * @return <code>LabelUI</code> object
 * @since 1.3
 */
public RootPaneUI getUI() {
    return (RootPaneUI)ui;
}
 
Example #26
Source File: JRootPane.java    From jdk8u-dev-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Sets the L&amp;F object that renders this component.
 *
 * @param ui  the <code>LabelUI</code> L&amp;F object
 * @see UIDefaults#getUI
 * @beaninfo
 *        bound: true
 *       hidden: true
 *      expert: true
 *    attribute: visualUpdate true
 *  description: The UI object that implements the Component's LookAndFeel.
 * @since 1.3
 */
public void setUI(RootPaneUI ui) {
    super.setUI(ui);
}
 
Example #27
Source File: JRootPane.java    From jdk8u-dev-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Resets the UI property to a value from the current look and feel.
 *
 * @see JComponent#updateUI
 */
public void updateUI() {
    setUI((RootPaneUI)UIManager.getUI(this));
}
 
Example #28
Source File: JRootPane.java    From JDKSourceCode1.8 with MIT License 2 votes vote down vote up
/**
 * Sets the L&amp;F object that renders this component.
 *
 * @param ui  the <code>LabelUI</code> L&amp;F object
 * @see UIDefaults#getUI
 * @beaninfo
 *        bound: true
 *       hidden: true
 *      expert: true
 *    attribute: visualUpdate true
 *  description: The UI object that implements the Component's LookAndFeel.
 * @since 1.3
 */
public void setUI(RootPaneUI ui) {
    super.setUI(ui);
}
 
Example #29
Source File: JRootPane.java    From jdk1.8-source-analysis with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the L&amp;F object that renders this component.
 *
 * @param ui  the <code>LabelUI</code> L&amp;F object
 * @see UIDefaults#getUI
 * @beaninfo
 *        bound: true
 *       hidden: true
 *      expert: true
 *    attribute: visualUpdate true
 *  description: The UI object that implements the Component's LookAndFeel.
 * @since 1.3
 */
public void setUI(RootPaneUI ui) {
    super.setUI(ui);
}
 
Example #30
Source File: JRootPane.java    From jdk1.8-source-analysis with Apache License 2.0 2 votes vote down vote up
/**
 * Resets the UI property to a value from the current look and feel.
 *
 * @see JComponent#updateUI
 */
public void updateUI() {
    setUI((RootPaneUI)UIManager.getUI(this));
}