javax.swing.plaf.metal.MetalToggleButtonUI源码实例Demo

类javax.swing.plaf.metal.MetalToggleButtonUI源码实例Demo

下面列出了javax.swing.plaf.metal.MetalToggleButtonUI 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: netbeans-mmd-plugin   文件: IconPanel.java
@Nonnull
private JToggleButton makeIconButton(@Nonnull final ButtonGroup group, @Nonnull final String name) {
  final JToggleButton result = Utils.UI_COMPO_FACTORY.makeToggleButton();

  final Color panelColor = this.getBackground();

  result.setUI(new MetalToggleButtonUI() {
    @Override
    @Nullable
    protected Color getSelectColor() {
      return panelColor.brighter();
    }
  });

  result.setBackground(panelColor.darker());

  result.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(), BorderFactory.createEmptyBorder(3, 3, 3, 3)));
  result.setIcon(new ImageIcon(MiscIcons.findForName(name)));
  result.setName(name);
  result.setFocusPainted(false);
  result.setToolTipText(name);

  group.add(result);
  return result;
}
 
源代码2 项目: openstego   文件: OpenStegoFrame.java
/**
 * Getter method for embedButton
 *
 * @return embedButton
 */
public JToggleButton getEmbedButton() {
    if (this.embedButton == null) {
        this.embedButton = new JToggleButton(labelUtil.getString("gui.label.tab.dhEmbed"),
                new ImageIcon(getClass().getResource("/image/EmbedIcon.png")), true);
        if (toggleUiHack) {
            this.embedButton.setUI(new MetalToggleButtonUI());
        }
        this.embedButton.setVerticalTextPosition(SwingConstants.BOTTOM);
        this.embedButton.setHorizontalTextPosition(SwingConstants.CENTER);
        this.embedButton.setFocusable(false);
        this.actionButtonGroup.add(this.embedButton);
    }
    return this.embedButton;
}
 
源代码3 项目: openstego   文件: OpenStegoFrame.java
/**
 * Getter method for extractButton
 *
 * @return extractButton
 */
public JToggleButton getExtractButton() {
    if (this.extractButton == null) {
        this.extractButton = new JToggleButton(labelUtil.getString("gui.label.tab.dhExtract"),
                new ImageIcon(getClass().getResource("/image/ExtractIcon.png")));
        if (toggleUiHack) {
            this.extractButton.setUI(new MetalToggleButtonUI());
        }
        this.extractButton.setVerticalTextPosition(SwingConstants.BOTTOM);
        this.extractButton.setHorizontalTextPosition(SwingConstants.CENTER);
        this.extractButton.setFocusable(false);
        this.actionButtonGroup.add(this.extractButton);
    }
    return this.extractButton;
}
 
源代码4 项目: openstego   文件: OpenStegoFrame.java
/**
 * Getter method for genSigButton
 *
 * @return genSigButton
 */
public JToggleButton getGenSigButton() {
    if (this.genSigButton == null) {
        this.genSigButton = new JToggleButton(labelUtil.getString("gui.label.tab.wmGenSig"),
                new ImageIcon(getClass().getResource("/image/EmbedIcon.png"))); // TODO
        if (toggleUiHack) {
            this.genSigButton.setUI(new MetalToggleButtonUI());
        }
        this.genSigButton.setVerticalTextPosition(SwingConstants.BOTTOM);
        this.genSigButton.setHorizontalTextPosition(SwingConstants.CENTER);
        this.genSigButton.setFocusable(false);
        this.actionButtonGroup.add(this.genSigButton);
    }
    return this.genSigButton;
}
 
源代码5 项目: openstego   文件: OpenStegoFrame.java
/**
 * Getter method for signWmButton
 *
 * @return signWmButton
 */
public JToggleButton getSignWmButton() {
    if (this.signWmButton == null) {
        this.signWmButton = new JToggleButton(labelUtil.getString("gui.label.tab.wmEmbed"),
                new ImageIcon(getClass().getResource("/image/EmbedIcon.png")));
        if (toggleUiHack) {
            this.signWmButton.setUI(new MetalToggleButtonUI());
        }
        this.signWmButton.setVerticalTextPosition(SwingConstants.BOTTOM);
        this.signWmButton.setHorizontalTextPosition(SwingConstants.CENTER);
        this.signWmButton.setFocusable(false);
        this.actionButtonGroup.add(this.signWmButton);
    }
    return this.signWmButton;
}
 
源代码6 项目: openstego   文件: OpenStegoFrame.java
/**
 * Getter method for verifyWmButton
 *
 * @return verifyWmButton
 */
public JToggleButton getVerifyWmButton() {
    if (this.verifyWmButton == null) {
        this.verifyWmButton = new JToggleButton(labelUtil.getString("gui.label.tab.wmVerify"),
                new ImageIcon(getClass().getResource("/image/ExtractIcon.png")));
        if (toggleUiHack) {
            this.verifyWmButton.setUI(new MetalToggleButtonUI());
        }
        this.verifyWmButton.setVerticalTextPosition(SwingConstants.BOTTOM);
        this.verifyWmButton.setHorizontalTextPosition(SwingConstants.CENTER);
        this.verifyWmButton.setFocusable(false);
        this.actionButtonGroup.add(this.verifyWmButton);
    }
    return this.verifyWmButton;
}
 
如果文章对您有帮助,请点击页面广告。以鼓励作者做出的努力。
 类所在包
 类方法
 同包方法