javax.swing.JLabel#getDisplayedMnemonicIndex ( )源码实例Demo

下面列出了javax.swing.JLabel#getDisplayedMnemonicIndex ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: openjdk-8   文件: WindowsLabelUI.java
protected void paintDisabledText(JLabel l, Graphics g, String s,
                                 int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }
    if ( UIManager.getColor("Label.disabledForeground") instanceof Color &&
         UIManager.getColor("Label.disabledShadow") instanceof Color) {
        g.setColor( UIManager.getColor("Label.disabledShadow") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor( UIManager.getColor("Label.disabledForeground") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX, textY);
    } else {
        Color background = l.getBackground();
        g.setColor(background.brighter());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor(background.darker());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX, textY);
    }
}
 
源代码2 项目: jdk1.8-source-analysis   文件: WindowsLabelUI.java
protected void paintDisabledText(JLabel l, Graphics g, String s,
                                 int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }
    if ( UIManager.getColor("Label.disabledForeground") instanceof Color &&
         UIManager.getColor("Label.disabledShadow") instanceof Color) {
        g.setColor( UIManager.getColor("Label.disabledShadow") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor( UIManager.getColor("Label.disabledForeground") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX, textY);
    } else {
        Color background = l.getBackground();
        g.setColor(background.brighter());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor(background.darker());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX, textY);
    }
}
 
源代码3 项目: hottub   文件: WindowsLabelUI.java
protected void paintDisabledText(JLabel l, Graphics g, String s,
                                 int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }
    if ( UIManager.getColor("Label.disabledForeground") instanceof Color &&
         UIManager.getColor("Label.disabledShadow") instanceof Color) {
        g.setColor( UIManager.getColor("Label.disabledShadow") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor( UIManager.getColor("Label.disabledForeground") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX, textY);
    } else {
        Color background = l.getBackground();
        g.setColor(background.brighter());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor(background.darker());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX, textY);
    }
}
 
源代码4 项目: openjdk-8-source   文件: WindowsLabelUI.java
protected void paintEnabledText(JLabel l, Graphics g, String s,
                                int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }

    g.setColor(l.getForeground());
    SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemonicIndex,
                                                 textX, textY);
}
 
源代码5 项目: dragonwell8_jdk   文件: WindowsLabelUI.java
protected void paintEnabledText(JLabel l, Graphics g, String s,
                                int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }

    g.setColor(l.getForeground());
    SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemonicIndex,
                                                 textX, textY);
}
 
源代码6 项目: dragonwell8_jdk   文件: WindowsLabelUI.java
protected void paintDisabledText(JLabel l, Graphics g, String s,
                                 int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }
    if ( UIManager.getColor("Label.disabledForeground") instanceof Color &&
         UIManager.getColor("Label.disabledShadow") instanceof Color) {
        g.setColor( UIManager.getColor("Label.disabledShadow") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor( UIManager.getColor("Label.disabledForeground") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX, textY);
    } else {
        Color background = l.getBackground();
        g.setColor(background.brighter());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor(background.darker());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX, textY);
    }
}
 
源代码7 项目: TencentKona-8   文件: WindowsLabelUI.java
protected void paintEnabledText(JLabel l, Graphics g, String s,
                                int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }

    g.setColor(l.getForeground());
    SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemonicIndex,
                                                 textX, textY);
}
 
源代码8 项目: jdk8u-dev-jdk   文件: WindowsLabelUI.java
protected void paintDisabledText(JLabel l, Graphics g, String s,
                                 int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }
    if ( UIManager.getColor("Label.disabledForeground") instanceof Color &&
         UIManager.getColor("Label.disabledShadow") instanceof Color) {
        g.setColor( UIManager.getColor("Label.disabledShadow") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor( UIManager.getColor("Label.disabledForeground") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX, textY);
    } else {
        Color background = l.getBackground();
        g.setColor(background.brighter());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor(background.darker());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX, textY);
    }
}
 
源代码9 项目: jdk8u-dev-jdk   文件: WindowsLabelUI.java
protected void paintEnabledText(JLabel l, Graphics g, String s,
                                int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }

    g.setColor(l.getForeground());
    SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemonicIndex,
                                                 textX, textY);
}
 
源代码10 项目: jdk8u60   文件: WindowsLabelUI.java
protected void paintDisabledText(JLabel l, Graphics g, String s,
                                 int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }
    if ( UIManager.getColor("Label.disabledForeground") instanceof Color &&
         UIManager.getColor("Label.disabledShadow") instanceof Color) {
        g.setColor( UIManager.getColor("Label.disabledShadow") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor( UIManager.getColor("Label.disabledForeground") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX, textY);
    } else {
        Color background = l.getBackground();
        g.setColor(background.brighter());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor(background.darker());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX, textY);
    }
}
 
源代码11 项目: JDKSourceCode1.8   文件: WindowsLabelUI.java
protected void paintEnabledText(JLabel l, Graphics g, String s,
                                int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }

    g.setColor(l.getForeground());
    SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemonicIndex,
                                                 textX, textY);
}
 
源代码12 项目: JDKSourceCode1.8   文件: WindowsLabelUI.java
protected void paintDisabledText(JLabel l, Graphics g, String s,
                                 int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }
    if ( UIManager.getColor("Label.disabledForeground") instanceof Color &&
         UIManager.getColor("Label.disabledShadow") instanceof Color) {
        g.setColor( UIManager.getColor("Label.disabledShadow") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor( UIManager.getColor("Label.disabledForeground") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX, textY);
    } else {
        Color background = l.getBackground();
        g.setColor(background.brighter());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor(background.darker());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX, textY);
    }
}
 
源代码13 项目: openjdk-jdk8u   文件: WindowsLabelUI.java
protected void paintEnabledText(JLabel l, Graphics g, String s,
                                int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }

    g.setColor(l.getForeground());
    SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemonicIndex,
                                                 textX, textY);
}
 
源代码14 项目: openjdk-jdk8u   文件: WindowsLabelUI.java
protected void paintDisabledText(JLabel l, Graphics g, String s,
                                 int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }
    if ( UIManager.getColor("Label.disabledForeground") instanceof Color &&
         UIManager.getColor("Label.disabledShadow") instanceof Color) {
        g.setColor( UIManager.getColor("Label.disabledShadow") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor( UIManager.getColor("Label.disabledForeground") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX, textY);
    } else {
        Color background = l.getBackground();
        g.setColor(background.brighter());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor(background.darker());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX, textY);
    }
}
 
源代码15 项目: jdk8u_jdk   文件: WindowsLabelUI.java
protected void paintDisabledText(JLabel l, Graphics g, String s,
                                 int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }
    if ( UIManager.getColor("Label.disabledForeground") instanceof Color &&
         UIManager.getColor("Label.disabledShadow") instanceof Color) {
        g.setColor( UIManager.getColor("Label.disabledShadow") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor( UIManager.getColor("Label.disabledForeground") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX, textY);
    } else {
        Color background = l.getBackground();
        g.setColor(background.brighter());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor(background.darker());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX, textY);
    }
}
 
源代码16 项目: jdk8u-jdk   文件: WindowsLabelUI.java
protected void paintDisabledText(JLabel l, Graphics g, String s,
                                 int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }
    if ( UIManager.getColor("Label.disabledForeground") instanceof Color &&
         UIManager.getColor("Label.disabledShadow") instanceof Color) {
        g.setColor( UIManager.getColor("Label.disabledShadow") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor( UIManager.getColor("Label.disabledForeground") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX, textY);
    } else {
        Color background = l.getBackground();
        g.setColor(background.brighter());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor(background.darker());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX, textY);
    }
}
 
源代码17 项目: jdk8u-jdk   文件: WindowsLabelUI.java
protected void paintDisabledText(JLabel l, Graphics g, String s,
                                 int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }
    if ( UIManager.getColor("Label.disabledForeground") instanceof Color &&
         UIManager.getColor("Label.disabledShadow") instanceof Color) {
        g.setColor( UIManager.getColor("Label.disabledShadow") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor( UIManager.getColor("Label.disabledForeground") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX, textY);
    } else {
        Color background = l.getBackground();
        g.setColor(background.brighter());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor(background.darker());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX, textY);
    }
}
 
源代码18 项目: openjdk-jdk9   文件: WindowsLabelUI.java
protected void paintDisabledText(JLabel l, Graphics g, String s,
                                 int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }
    if ( UIManager.getColor("Label.disabledForeground") instanceof Color &&
         UIManager.getColor("Label.disabledShadow") instanceof Color) {
        g.setColor( UIManager.getColor("Label.disabledShadow") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor( UIManager.getColor("Label.disabledForeground") );
        SwingUtilities2.drawStringUnderlineCharAt(l, g, s,
                                                     mnemonicIndex,
                                                     textX, textY);
    } else {
        Color background = l.getBackground();
        g.setColor(background.brighter());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX + 1, textY + 1);
        g.setColor(background.darker());
        SwingUtilities2.drawStringUnderlineCharAt(l,g, s, mnemonicIndex,
                                                     textX, textY);
    }
}
 
源代码19 项目: jdk8u-jdk   文件: WindowsLabelUI.java
protected void paintEnabledText(JLabel l, Graphics g, String s,
                                int textX, int textY) {
    int mnemonicIndex = l.getDisplayedMnemonicIndex();
    // W2K Feature: Check to see if the Underscore should be rendered.
    if (WindowsLookAndFeel.isMnemonicHidden() == true) {
        mnemonicIndex = -1;
    }

    g.setColor(l.getForeground());
    SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemonicIndex,
                                                 textX, textY);
}
 
源代码20 项目: FlatLaf   文件: FlatBusyLabelUI.java
@Override
protected void paintDisabledText( JLabel l, Graphics g, String s, int textX, int textY ) {
	int mnemIndex = FlatLaf.isShowMnemonics() ? l.getDisplayedMnemonicIndex() : -1;
	g.setColor( disabledForeground );
	FlatUIUtils.drawStringUnderlineCharAt( l, g, s, mnemIndex, textX, textY );
}