|
|
@ -1,27 +1,16 @@ |
|
|
|
package com.fr.design.gui.ibutton; |
|
|
|
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.constants.UIConstants; |
|
|
|
import com.fr.design.roleAuthority.ReportAndFSManagePane; |
|
|
|
import com.fr.design.roleAuthority.ReportAndFSManagePane; |
|
|
|
|
|
|
|
import com.fr.design.utils.gui.GUIPaintUtils; |
|
|
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import sun.swing.SwingUtilities2; |
|
|
|
import sun.swing.SwingUtilities2; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import javax.swing.*; |
|
|
|
import com.fr.design.utils.gui.GUIPaintUtils; |
|
|
|
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 { |
|
|
|
public class UIButtonUI extends BasicButtonUI { |
|
|
|
|
|
|
|
|
|
|
@ -66,7 +55,7 @@ public class UIButtonUI extends BasicButtonUI { |
|
|
|
|
|
|
|
|
|
|
|
protected boolean isPressed(AbstractButton b) { |
|
|
|
protected boolean isPressed(AbstractButton b) { |
|
|
|
ButtonModel model = b.getModel(); |
|
|
|
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) { |
|
|
|
private void paintContent(Graphics g, AbstractButton b, String text) { |
|
|
@ -127,7 +116,7 @@ public class UIButtonUI extends BasicButtonUI { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
Icon selectedIcon = null; |
|
|
|
Icon selectedIcon = null; |
|
|
|
/* the fallback icon should be based on the selected state */ |
|
|
|
/* the fallback icon should be based on the selected state */ |
|
|
|
if (model.isSelected()) { |
|
|
|
if (model.isSelected()) { |
|
|
|
selectedIcon = (Icon) b.getSelectedIcon(); |
|
|
|
selectedIcon = (Icon) b.getSelectedIcon(); |
|
|
|
if (selectedIcon != null) { |
|
|
|
if (selectedIcon != null) { |
|
|
|