JavaTM Platform
Standard Ed. 6

javax.swing.text
クラス StyledEditorKit.ForegroundAction

java.lang.Object
  上位を拡張 javax.swing.AbstractAction
      上位を拡張 javax.swing.text.TextAction
          上位を拡張 javax.swing.text.StyledEditorKit.StyledTextAction
              上位を拡張 javax.swing.text.StyledEditorKit.ForegroundAction
すべての実装されたインタフェース:
ActionListener, Serializable, Cloneable, EventListener, Action
含まれているクラス:
StyledEditorKit

public static class StyledEditorKit.ForegroundAction
extends StyledEditorKit.StyledTextAction

フォアグラウンドカラーを設定するアクションです。これによって、ターゲット JEditorPane の現在選択されている範囲における StyleConstants.Foreground 属性が設定されます。この処理は、ターゲット JEditorPane に関連付けられた書式付きドキュメント上で StyledDocument.setCharacterAttributes を呼び出すことで実行されます。

ターゲットのテキスト コンポーネントが ActionEvent のソースとして指定され、またコマンド文字列が存在する場合、そのコマンド文字列はフォアグラウンドカラーとして解釈されます。コマンド文字列は呼び出された Color.decode により解釈されるため、Color.decode メソッドの適正な入力値である必要があります。

警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。JDK Version 1.4 以降、すべての JavaBeans の長期間の運用サポートは、java.beans パッケージに追加されています。詳細は、XMLEncoder を参照してください。


フィールドの概要
 
クラス javax.swing.AbstractAction から継承されたフィールド
changeSupport, enabled
 
インタフェース javax.swing.Action から継承されたフィールド
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
コンストラクタの概要
StyledEditorKit.ForegroundAction(String nm, Color fg)
          新しい ForegroundAction を作成します。
 
メソッドの概要
 void actionPerformed(ActionEvent e)
          フォアグラウンドカラーを設定します。
 
クラス javax.swing.text.StyledEditorKit.StyledTextAction から継承されたメソッド
getEditor, getStyledDocument, getStyledEditorKit, setCharacterAttributes, setParagraphAttributes
 
クラス javax.swing.text.TextAction から継承されたメソッド
augmentList, getFocusedComponent, getTextComponent
 
クラス javax.swing.AbstractAction から継承されたメソッド
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
クラス java.lang.Object から継承されたメソッド
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

StyledEditorKit.ForegroundAction

public StyledEditorKit.ForegroundAction(String nm,
                                        Color fg)
新しい ForegroundAction を作成します。

パラメータ:
nm - アクション名
fg - フォアグラウンドカラー
メソッドの詳細

actionPerformed

public void actionPerformed(ActionEvent e)
フォアグラウンドカラーを設定します。

パラメータ:
e - アクションイベント

JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。