home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.text;
-
- import java.awt.Color;
- import java.awt.Toolkit;
- import java.awt.event.ActionEvent;
- import java.util.EventObject;
- import javax.swing.JEditorPane;
-
- public class StyledEditorKit$ForegroundAction extends StyledEditorKit.StyledTextAction {
- // $FF: renamed from: fg java.awt.Color
- private Color field_0;
-
- public StyledEditorKit$ForegroundAction(String var1, Color var2) {
- super(var1);
- this.field_0 = var2;
- }
-
- public void actionPerformed(ActionEvent var1) {
- JEditorPane var2 = ((StyledEditorKit.StyledTextAction)this).getEditor(var1);
- if (var2 != null) {
- Color var3 = this.field_0;
- if (var1 != null && ((EventObject)var1).getSource() == var2) {
- String var4 = var1.getActionCommand();
-
- try {
- var3 = Color.decode(var4);
- } catch (NumberFormatException var5) {
- }
- }
-
- if (var3 != null) {
- SimpleAttributeSet var6 = new SimpleAttributeSet();
- StyleConstants.setForeground(var6, var3);
- ((StyledEditorKit.StyledTextAction)this).setCharacterAttributes(var2, var6, false);
- } else {
- Toolkit.getDefaultToolkit().beep();
- }
- }
-
- }
- }
-