|
|
|
@ -1,27 +1,16 @@
|
|
|
|
|
package com.fr.design.gui.ibutton; |
|
|
|
|
|
|
|
|
|
import java.awt.FontMetrics; |
|
|
|
|
import java.awt.Graphics; |
|
|
|
|
import java.awt.Graphics2D; |
|
|
|
|
import java.awt.Insets; |
|
|
|
|
import java.awt.Rectangle; |
|
|
|
|
import java.awt.RenderingHints; |
|
|
|
|
|
|
|
|
|
import javax.swing.AbstractButton; |
|
|
|
|
import javax.swing.ButtonModel; |
|
|
|
|
import javax.swing.Icon; |
|
|
|
|
import javax.swing.JComponent; |
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
|
import javax.swing.plaf.basic.BasicButtonUI; |
|
|
|
|
import javax.swing.plaf.basic.BasicHTML; |
|
|
|
|
import javax.swing.text.View; |
|
|
|
|
|
|
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
|
import com.fr.design.roleAuthority.ReportAndFSManagePane; |
|
|
|
|
import com.fr.design.utils.gui.GUIPaintUtils; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import sun.swing.SwingUtilities2; |
|
|
|
|
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.design.utils.gui.GUIPaintUtils; |
|
|
|
|
import javax.swing.*; |
|
|
|
|
import javax.swing.plaf.basic.BasicButtonUI; |
|
|
|
|
import javax.swing.plaf.basic.BasicHTML; |
|
|
|
|
import javax.swing.text.View; |
|
|
|
|
import java.awt.*; |
|
|
|
|
|
|
|
|
|
public class UIButtonUI extends BasicButtonUI { |
|
|
|
|
|
|
|
|
@ -51,11 +40,11 @@ public class UIButtonUI extends BasicButtonUI {
|
|
|
|
|
|
|
|
|
|
protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) { |
|
|
|
|
if (isPressed(b) && b.isPressedPainted()) { |
|
|
|
|
GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles)); |
|
|
|
|
GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), UIConstants.COMBOBOX_BTN_PRESS); |
|
|
|
|
} else if (isRollOver(b)) { |
|
|
|
|
GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted()); |
|
|
|
|
GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), UIConstants.COMBOBOX_BTN_ROLLOVER); |
|
|
|
|
} else if (b.isNormalPainted()) { |
|
|
|
|
GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted()); |
|
|
|
|
GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), UIConstants.COMBOBOX_BTN_NORMAL); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -66,7 +55,7 @@ public class UIButtonUI extends BasicButtonUI {
|
|
|
|
|
|
|
|
|
|
protected boolean isPressed(AbstractButton b) { |
|
|
|
|
ButtonModel model = b.getModel(); |
|
|
|
|
return (model.isArmed() && model.isPressed()) || b.isSelected(); |
|
|
|
|
return model.isArmed() && model.isPressed(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void paintContent(Graphics g, AbstractButton b, String text) { |
|
|
|
|