|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectjavax.swing.undo.AbstractUndoableEdit
javax.swing.undo.CompoundEdit
javax.swing.undo.UndoManager
public class UndoManager
UndoableEditListener として使用できる CompoundEdit の具象サブクラスで、さまざまなソースの UndoableEditEvents を連結し、それらを一度に 1 つずつ元に戻したり再実行したりします。
AbstractUndoableEdit や CompoundEdit とは異なり、このクラスの public メソッドは同期がとられるので、複数のスレッドから呼び出しても安全です。このため、元に戻せる JavaBeans のセットに対して UndoManager を使うと、整列化が容易になります。
警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。JDK バージョン 1.4 以降、すべての JavaBeans™ の長期間の運用サポートは、java.beans パッケージに追加されています。詳細は、XMLEncoder を参照してください。
| フィールドの概要 |
|---|
| クラス javax.swing.undo.CompoundEdit から継承されたフィールド |
|---|
edits |
| クラス javax.swing.undo.AbstractUndoableEdit から継承されたフィールド |
|---|
RedoName, UndoName |
| コンストラクタの概要 | |
|---|---|
UndoManager()
|
|
| メソッドの概要 | |
|---|---|
boolean |
addEdit(UndoableEdit anEdit)
進行中の場合、anEdit を indexOfNextAdd に挿入して、indexOfNextAdd 以降の古い編集結果を削除します。 |
boolean |
canRedo()
通常のセマンティクスを保護するために、オーバーライドされます。 |
boolean |
canUndo()
通常のセマンティクスを保護するために、オーバーライドされます。 |
boolean |
canUndoOrRedo()
呼び出し側 undoOrRedo が元に戻すか再実行する場合に true を返します。 |
void |
discardAllEdits()
undo マネージャを空にして、各編集結果の進行時に die メッセージを送ります。 |
protected UndoableEdit |
editToBeRedone()
redo が呼び出された場合に、再実行する意味のある次の編集結果を返します。 |
protected UndoableEdit |
editToBeUndone()
undo が呼び出された場合に、元に戻す意味のある次の編集結果を返します。 |
void |
end()
end() を UndoManager に送ると、それをプレーンな古い (終了済み) CompoundEdit に変換します。 |
int |
getLimit()
この UndoManager が保持する編集結果の最大数を返します。 |
String |
getRedoPresentationName()
進行中の場合、redo() が呼び出されたときにやり直す意味のある編集結果の getRedoPresentationName を返します。 |
String |
getUndoOrRedoPresentationName()
undo と redo を切り替えるコマンドの適切な名前を返します。 |
String |
getUndoPresentationName()
進行中の場合、undo() が呼び出されたときに元に戻される意味のある編集結果の getUndoPresentationName を返します。 |
void |
redo()
この UndoManager が inProgress である場合、indexOfNextAdd またはそれ以降にある最後の意味のある UndoableEdit と、それまでの間にある意味のない編集結果をすべてやり直します。 |
protected void |
redoTo(UndoableEdit edit)
編集対象の indexOfNextAdd からのすべての変更を再実行します。 |
void |
setLimit(int l)
この UndoManager が保持する編集結果の最大数を設定します。 |
String |
toString()
このオブジェクトのプロパティを表示および識別する文字列を返します。 |
protected void |
trimEdits(int from,
int to)
指定範囲 (上下限値を含む) の編集結果で終了するように通知し、それらを編集結果のコレクションから削除します。 |
protected void |
trimForLimit()
待機状態の編集結果の数を、indexOfNextAdd に絞られた、サイズ限度の範囲にまで減らします。 |
void |
undo()
この UndoManager が進行中の場合、indexOfNextAdd の前にある最後の意味のある UndoableEdit と、それまでの間にある意味のない編集結果をすべて元に戻します。 |
void |
undoableEditHappened(UndoableEditEvent e)
この UndoManager が待機する UndoabledEdit ソースによって呼び出されます。 |
void |
undoOrRedo()
undo または redo のうち、どちらか適切な方を行います。 |
protected void |
undoTo(UndoableEdit edit)
編集対象の indexOfNextAdd からのすべての変更を元に戻します。 |
| クラス javax.swing.undo.CompoundEdit から継承されたメソッド |
|---|
die, getPresentationName, isInProgress, isSignificant, lastEdit |
| クラス javax.swing.undo.AbstractUndoableEdit から継承されたメソッド |
|---|
replaceEdit |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| コンストラクタの詳細 |
|---|
public UndoManager()
| メソッドの詳細 |
|---|
public int getLimit()
addEdit(javax.swing.undo.UndoableEdit),
setLimit(int)public void discardAllEdits()
protected void trimForLimit()
protected void trimEdits(int from,
int to)
public void setLimit(int l)
addEdit(javax.swing.undo.UndoableEdit),
getLimit()protected UndoableEdit editToBeUndone()
protected UndoableEdit editToBeRedone()
protected void undoTo(UndoableEdit edit)
throws CannotUndoException
CannotUndoException
protected void redoTo(UndoableEdit edit)
throws CannotRedoException
CannotRedoException
public void undoOrRedo()
throws CannotRedoException,
CannotUndoException
CannotRedoException
CannotUndoExceptioncanUndoOrRedo(),
getUndoOrRedoPresentationName()public boolean canUndoOrRedo()
undoOrRedo()
public void undo()
throws CannotUndoException
inProgress でない場合、indexOfNextAdd は無視され、スーパークラスのルーチンが呼び出されます。
UndoableEdit 内の undoCompoundEdit 内の undoCannotUndoException - canUndo が false を返す場合CompoundEdit.end()public boolean canUndo()
UndoableEdit 内の canUndoCompoundEdit 内の canUndoalive であり、hasBeenDone が true の場合、trueCompoundEdit.isInProgress()
public void redo()
throws CannotRedoException
UndoManager が inProgress である場合、indexOfNextAdd またはそれ以降にある最後の意味のある UndoableEdit と、それまでの間にある意味のない編集結果をすべてやり直します。それに応じて indexOfNextAdd を更新します。
inProgress でない場合、indexOfNextAdd は無視され、スーパークラスのルーチンが呼び出されます。
UndoableEdit 内の redoCompoundEdit 内の redoCannotRedoException - canRedo が false を返す場合CompoundEdit.end()public boolean canRedo()
UndoableEdit 内の canRedoCompoundEdit 内の canRedoalive であり、hasBeenDone が false の場合、trueCompoundEdit.isInProgress()public boolean addEdit(UndoableEdit anEdit)
inProgress でない場合、CompoundEdit として動作します。
UndoableEdit 内の addEditCompoundEdit 内の addEditanEdit - 追加される編集結果
inProgress の場合は true、そうでない場合は false を返すCompoundEdit.end(),
CompoundEdit.addEdit(javax.swing.undo.UndoableEdit)public void end()
スーパークラスの end() メソッドを呼び出して (inProgress を false にして) から、indexOfNextAdd とそれ以降にある到達できない編集結果に、それらを追加したときと逆の順序で die() を送ります。
CompoundEdit 内の endCompoundEdit.end()public String getUndoOrRedoPresentationName()
public String getUndoPresentationName()
inProgress でない場合、CompoundEdit として動作します。
UndoableEdit 内の getUndoPresentationNameCompoundEdit 内の getUndoPresentationNamegetPresentationName が "" でない場合は、キー AbstractUndoableEdit.undoText を使用してデフォルトテーブルから取得した値に、空白文字および getPresentationName を追加した値。getPresentationName が "" の場合は、デフォルト値だけが返される。undo(),
CompoundEdit.getUndoPresentationName()public String getRedoPresentationName()
inProgress でない場合、CompoundEdit として動作します。
UndoableEdit 内の getRedoPresentationNameCompoundEdit 内の getRedoPresentationNamegetPresentationName が "" でない場合は、キー AbstractUndoableEdit.redoText を使用してデフォルトテーブルから取得した値の後ろに空白文字および getPresentationName を追加したもの。getPresentationName が "" の場合は、デフォルト値だけが返されるredo(),
CompoundEdit.getUndoPresentationName()public void undoableEditHappened(UndoableEditEvent e)
UndoableEditListener 内の undoableEditHappenedaddEdit(javax.swing.undo.UndoableEdit)public String toString()
CompoundEdit 内の toString
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。