|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectjavax.swing.plaf.ComponentUI
javax.swing.plaf.ProgressBarUI
javax.swing.plaf.basic.BasicProgressBarUI
public class BasicProgressBarUI
ProgressBarUI の基本 Look & Feel による実装です。
| 入れ子のクラスの概要 | |
|---|---|
class |
BasicProgressBarUI.ChangeHandler
この内部クラスは「public」とマークされますが、これはコンパイラのバグが原因です。 |
| フィールドの概要 | |
|---|---|
protected Rectangle |
boxRect
ペイントされる (getBox によって返された) バウンシングボックスの位置とサイズを保持するために使用します。 |
protected ChangeListener |
changeListener
|
protected JProgressBar |
progressBar
|
| コンストラクタの概要 | |
|---|---|
BasicProgressBarUI()
|
|
| メソッドの概要 | |
|---|---|
static ComponentUI |
createUI(JComponent x)
|
protected int |
getAmountFull(Insets b,
int width,
int height)
モデルから集めた完了パーセント情報に基づいて、塗りつぶされる進捗バーの量を決定します。 |
protected int |
getAnimationIndex()
現在のアニメーションフレームのインデックスを取得します。 |
int |
getBaseline(JComponent c,
int width,
int height)
ベースラインを返します。 |
Component.BaselineResizeBehavior |
getBaselineResizeBehavior(JComponent c)
コンポーネントのサイズが変化するにつれてベースラインが変化する方法の列挙を返します。 |
protected Rectangle |
getBox(Rectangle r)
現在のアニメーションインデックスのために r でペイントされ、rを返すバウンシングボックスの位置とサイズを格納します。 |
protected int |
getBoxLength(int availableLength,
int otherDimension)
ペイントされる「バウンシングボックス」の長さを返します。 |
protected int |
getCellLength()
進捗バーに描画される個々のセルおよび単位の幅 (HORIZONTAL の場合) または高さ (VERTICAL の場合) を返します。 |
protected int |
getCellSpacing()
進捗バーにある各セルおよび単位の間隔を返します。 |
protected int |
getFrameCount()
不確定の JProgressBar で使用される完全なアニメーションループのためのフレーム数を返します。 |
Dimension |
getMaximumSize(JComponent c)
Look & Feel に適した、指定されたコンポーネントの最大サイズを返します。 |
Dimension |
getMinimumSize(JComponent c)
このコンポーネントでの最小サイズは 10 です。 |
protected Dimension |
getPreferredInnerHorizontal()
|
protected Dimension |
getPreferredInnerVertical()
|
Dimension |
getPreferredSize(JComponent c)
Look & Feel に適した、指定されたコンポーネントの適切なサイズを返します。 |
protected Color |
getSelectionBackground()
selectionBackground は、進捗バーの塗りつぶされていない領域に描画するときのテキストの色です。 |
protected Color |
getSelectionForeground()
selectionForeground は、進捗バーの塗りつぶされた領域に描画するときのテキストの色です。 |
protected Point |
getStringPlacement(Graphics g,
String progressString,
int x,
int y,
int width,
int height)
進捗文字列のペイント位置を指定します。 |
protected void |
incrementAnimationIndex()
現在のアニメーションフレームのインデックスを、次の有効値に設定し、進捗バーがペイントし直されるようにします。 |
protected void |
installDefaults()
|
protected void |
installListeners()
|
void |
installUI(JComponent c)
Look & Feel に適した、指定されたコンポーネントを構成します。 |
void |
paint(Graphics g,
JComponent c)
ペイントを 2 つのメソッド paintDeterminate または paintIndeterminate のどちらかに委譲します。 |
protected void |
paintDeterminate(Graphics g,
JComponent c)
ほぼすべての確定モードのリニアな進捗バーで正しく動作する、汎用の paint メソッドです。 |
protected void |
paintIndeterminate(Graphics g,
JComponent c)
すべての直線バウンシングボックス進捗バーが正しく動作する、汎用の paint メソッドです。 |
protected void |
paintString(Graphics g,
int x,
int y,
int width,
int height,
int amountFull,
Insets b)
|
protected void |
setAnimationIndex(int newValue)
現在のアニメーションフレームのインデックスを特定の値に設定し、進捗バーをペイントし直すよう要求します。 |
protected void |
setCellLength(int cellLen)
|
protected void |
setCellSpacing(int cellSpace)
|
protected void |
startAnimationTimer()
アニメーションスレッドを起動し、必要であれば作成して、初期化します。 |
protected void |
stopAnimationTimer()
アニメーションスレッドを停止します。 |
protected void |
uninstallDefaults()
|
protected void |
uninstallListeners()
このオブジェクトがインストールしたすべてのリスナーを削除します。 |
void |
uninstallUI(JComponent c)
installUI 時に、指定されたコンポーネントで構成された内容を取り消します。 |
| クラス javax.swing.plaf.ComponentUI から継承されたメソッド |
|---|
contains, getAccessibleChild, getAccessibleChildrenCount, update |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
|---|
protected JProgressBar progressBar
protected ChangeListener changeListener
protected Rectangle boxRect
| コンストラクタの詳細 |
|---|
public BasicProgressBarUI()
| メソッドの詳細 |
|---|
public static ComponentUI createUI(JComponent x)
public void installUI(JComponent c)
ComponentUI の記述:ComponentUI インスタンスが、指定されたコンポーネントの UI 委譲としてインストールされているときに呼び出されます。このメソッドは、次を含む Look & Feel 用のコンポーネントを完全に構成する必要があります。
LayoutManager をインストールする
PropertyChangeListener をコンポーネントに作成またはインストールする
ComponentUI 内の installUIc - UI 委譲がインストールされているコンポーネントComponentUI.uninstallUI(javax.swing.JComponent),
JComponent.setUI(javax.swing.plaf.ComponentUI),
JComponent.updateUI()public void uninstallUI(JComponent c)
ComponentUI の記述:installUI 時に、指定されたコンポーネントで構成された内容を取り消します。このメソッドは、指定されたコンポーネントの UI 委譲としての UIComponent インスタンスが削除されているときに呼び出されます。このメソッドは、installUI によって実行された構成を元に戻す必要があります。この場合、JComponent インスタンスをクリーンな状態 (余分なリスナーや、Look & Feel 固有のプロパティーオブジェクトが残らないように) にするよう十分注意してください。手順には次のものがあります。
ComponentUI 内の uninstallUIc - この UI 委譲を削除するコンポーネント。 この引数は通常無視されるが、 UI オブジェクトに状態がなく、複数のコンポーネントに共有されている場合は 使用されることがあるComponentUI.installUI(javax.swing.JComponent),
JComponent.updateUI()protected void installDefaults()
protected void uninstallDefaults()
protected void installListeners()
protected void startAnimationTimer()
stopAnimationTimer()protected void stopAnimationTimer()
startAnimationTimer()protected void uninstallListeners()
public int getBaseline(JComponent c,
int width,
int height)
ComponentUI 内の getBaselinec - 要求される JComponent ベースラインwidth - ベースラインを取得する幅height - ベースラインを取得する高さ
NullPointerException - c が null の場合
IllegalArgumentException - 幅または高さが 0 より小さい場合JComponent.getBaseline(int, int)public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
ComponentUI 内の getBaselineResizeBehaviorc - ベースラインのサイズ変更の動作を返す JComponent
NullPointerException - c が null の場合JComponent.getBaseline(int, int)protected Dimension getPreferredInnerHorizontal()
protected Dimension getPreferredInnerVertical()
protected Color getSelectionForeground()
protected Color getSelectionBackground()
protected int getCellLength()
setCellLength(int),
JProgressBar.isStringPainted()protected void setCellLength(int cellLen)
protected int getCellSpacing()
setCellSpacing(int),
JProgressBar.isStringPainted()protected void setCellSpacing(int cellSpace)
protected int getAmountFull(Insets b,
int width,
int height)
public void paint(Graphics g,
JComponent c)
ComponentUI 内の paintg - ペイント対象の Graphics コンテキストc - ペイントされるコンポーネント。 この引数は通常無視されるが、 UI オブジェクトに状態がなく、複数のコンポーネントに共有されている場合は 使用されることがあるComponentUI.update(java.awt.Graphics, javax.swing.JComponent)protected Rectangle getBox(Rectangle r)
r でペイントされ、rを返すバウンシングボックスの位置とサイズを格納します。paintIndeterminate のこのクラスでの実装で実行されるペイントに追加するサブクラスは、たとえば、バウンシングボックスの周りにアウトラインを描画するために、このメソッドを使用して、今ペイントされたバウンシングボックスの位置を取得できます。このメソッドをオーバーライドすることにより、paintIndeterminate を実装し直す必要なしに、バウンシングボックスのサイズと位置を完全に制御できます。
r - 変更される Rectangle のインスタンス。 null の場合もある
null。 そうでない場合は渡された矩形 (null 以外の場合)、 または 新しい矩形setAnimationIndex(int)
protected int getBoxLength(int availableLength,
int otherDimension)
paintIndeterminate のデフォルトの実装によって呼び出されます。例を示します。
boxRect.width = getBoxLength(componentInnards.width,
componentInnards.height);
availableLength - 移動するバウンシングボックスに 利用できるスペースの量。 たとえば、水平方向の進捗バーでは、 進捗バーの内部の幅 (コンポーネント幅から ボーダーを引いた値) となるotherDimension - 水平方向の進捗バーでは、 戻り値を制限したり決定したりするために 使用することができる 進捗バーの内部の高さとなる
availableLength 以下になる必要があるSwingUtilities.calculateInnerArea(javax.swing.JComponent, java.awt.Rectangle)
protected void paintIndeterminate(Graphics g,
JComponent c)
paintDeterminate(java.awt.Graphics, javax.swing.JComponent)
protected void paintDeterminate(Graphics g,
JComponent c)
paintIndeterminate(java.awt.Graphics, javax.swing.JComponent)
protected void paintString(Graphics g,
int x,
int y,
int width,
int height,
int amountFull,
Insets b)
protected Point getStringPlacement(Graphics g,
String progressString,
int x,
int y,
int width,
int height)
public Dimension getPreferredSize(JComponent c)
ComponentUI の記述:null が返される場合、適切なサイズは代わりにコンポーネントのレイアウトマネージャーによって計算されます (これは、特定のレイアウトマネージャーをインストールしてあるコンポーネントの場合に推奨する方法です)。このメソッドのデフォルト実装は null を返します。
ComponentUI 内の getPreferredSizec - 適切なサイズを照会されるコンポーネント。 この引数は通常無視されるが、 UI オブジェクトに状態がなく、複数のコンポーネントに共有されている場合は 使用されることがあるJComponent.getPreferredSize(),
LayoutManager.preferredLayoutSize(java.awt.Container)public Dimension getMinimumSize(JComponent c)
ComponentUI 内の getMinimumSizec - 最小サイズを照会されるコンポーネント。 この引数は通常無視されるが、 UI オブジェクトに状態がなく、複数のコンポーネントに共有されている場合は 使用されることがある
Dimension オブジェクト、または nullJComponent.getMinimumSize(),
LayoutManager.minimumLayoutSize(java.awt.Container),
ComponentUI.getPreferredSize(javax.swing.JComponent)public Dimension getMaximumSize(JComponent c)
ComponentUI の記述:null が返される場合、最大サイズは代わりにコンポーネントのレイアウトマネージャーによって計算されます (これは、特定のレイアウトマネージャーをインストールしてあるコンポーネントの場合に推奨する方法です)。このメソッドのデフォルト実装は getPreferredSize を呼び出して、その値を返します。
ComponentUI 内の getMaximumSizec - 最大サイズを照会されるコンポーネント。 この引数は通常無視されるが、 UI オブジェクトに状態がなく、複数のコンポーネントに共有されている場合は 使用されることがある
Dimension オブジェクト、または nullJComponent.getMaximumSize(),
LayoutManager2.maximumLayoutSize(java.awt.Container)protected int getAnimationIndex()
protected final int getFrameCount()
protected void setAnimationIndex(int newValue)
repaint メソッドの起動方法を変更する必要があります。
newValue - 新しいアニメーションインデックス。 この値はチェックされないincrementAnimationIndex()protected void incrementAnimationIndex()
setAnimationIndex(int)
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
Copyright 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。