remove BegButtonUI

This commit is contained in:
Konstantin Bulenkov
2019-04-18 13:29:06 +02:00
parent c4e605c319
commit 2a23aeecdd
2 changed files with 0 additions and 83 deletions
@@ -54,7 +54,6 @@ public final class IdeaLaf extends MetalLookAndFeel {
defaults.put("PopupMenu.border", popupMenuBorder);
defaults.put("ScrollPane.border", BegBorders.getScrollPaneBorder());
defaults.put("ButtonUI", BegButtonUI.class.getName());
defaults.put("ToggleButtonUI", BegToggleButtonUI.class.getName());
defaults.put("RadioButtonUI", BegRadioButtonUI.class.getName());
defaults.put("CheckBoxUI", BegCheckBoxUI.class.getName());
@@ -1,82 +0,0 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ui.plaf.beg;
import com.intellij.util.ui.UIUtil;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.metal.MetalButtonUI;
import java.awt.*;
public class BegButtonUI extends MetalButtonUI {
private final static BegButtonUI begButtonUI = new BegButtonUI();
private final Rectangle viewRect = new Rectangle();
private final Rectangle textRect = new Rectangle();
private final Rectangle iconRect = new Rectangle();
public static ComponentUI createUI(JComponent c) {
return begButtonUI;
}
/*
protected BasicButtonListener createButtonListener(AbstractButton b) {
return new BasicButtonListener(b);
}
*/
@Override
public void paint(Graphics g, JComponent c) {
AbstractButton b = (AbstractButton)c;
ButtonModel model = b.getModel();
FontMetrics fm = g.getFontMetrics();
Insets i = c.getInsets();
viewRect.x = i.left;
viewRect.y = i.top;
viewRect.width = b.getWidth() - (i.right + viewRect.x);
viewRect.height = b.getHeight() - (i.bottom + viewRect.y);
textRect.x = textRect.y = textRect.width = textRect.height = 0;
iconRect.x = iconRect.y = iconRect.width = iconRect.height = 0;
Font f = c.getFont();
g.setFont(f);
// layout the text and icon
String text = SwingUtilities.layoutCompoundLabel(
c, fm, b.getText(), b.getIcon(),
b.getVerticalAlignment(), b.getHorizontalAlignment(),
b.getVerticalTextPosition(), b.getHorizontalTextPosition(),
viewRect, iconRect, textRect,
b.getText() == null ? 0 : b.getIconTextGap()
);
clearTextShiftOffset();
// perform UI specific press action, e.g. Windows L&F shifts text
if (model.isArmed() && model.isPressed()){
paintButtonPressed(g, b);
}
// Paint the Icon
if (b.getIcon() != null){
paintIcon(g, c, iconRect);
}
if (text != null && !text.equals("")){
paintText(g, c, textRect, text);
}
if (b.isFocusPainted() && b.hasFocus()){
// paint UI specific focus
paintFocus(g, b, viewRect, textRect, iconRect);
}
}
@Override
protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect) {
UIUtil.drawDottedRectangle(g, viewRect.x, viewRect.y, viewRect.x + viewRect.width, viewRect.y + viewRect.height);
}
}