|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--javax.swing.plaf.ComponentUI | +--javax.swing.plaf.ListUI | +--javax.swing.plaf.basic.BasicListUI
ListUI の Windows Look & Feel による実装です。
内部クラスの概要 | |
class |
BasicListUI.FocusHandler
この内部クラスは public とマークされますが、これはコンパイラのバグが原因です。 |
class |
BasicListUI.ListDataHandler
installUI の実行時、および JList.model プロパティが変更された時に JLists モデルに追加される ListDataListener です。 |
class |
BasicListUI.ListSelectionHandler
installUI の実行時、および JList.selectionModel プロパティが変更された時に JLists の選択範囲モデルに追加される ListSelectionListener です。 |
class |
BasicListUI.MouseInputHandler
JList でのマウス入力、およびフォーカス処理を行います。 |
class |
BasicListUI.PropertyChangeHandler
PropertyChangeListener は、installUI の実行時に JList に追加されます。 |
フィールドの概要 | |
protected int |
cellHeight
|
protected int[] |
cellHeights
|
protected static int |
cellRendererChanged
|
protected int |
cellWidth
|
protected static int |
fixedCellHeightChanged
|
protected static int |
fixedCellWidthChanged
|
protected FocusListener |
focusListener
|
protected static int |
fontChanged
|
protected JList |
list
|
protected ListDataListener |
listDataListener
|
protected ListSelectionListener |
listSelectionListener
|
protected static int |
modelChanged
|
protected MouseInputListener |
mouseInputListener
|
protected PropertyChangeListener |
propertyChangeListener
|
protected static int |
prototypeCellValueChanged
|
protected CellRendererPane |
rendererPane
|
protected static int |
selectionModelChanged
|
protected int |
updateLayoutStateNeeded
|
コンストラクタの概要 | |
BasicListUI()
|
メソッドの概要 | |
protected int |
convertRowToY(int row)
指定された行の原点の相対 Y 座標を返します。 |
protected int |
convertYToRow(int y0)
JList の相対座標を、現在のレイアウトを基にして、座標を含む行に変換します。 |
protected FocusListener |
createFocusListener()
|
protected ListDataListener |
createListDataListener()
モデルによって必要に応じて JLists に追加される、ListDataListener のインスタンスを生成します。 |
protected ListSelectionListener |
createListSelectionListener()
selectionModel によって必要に応じて JLists に追加される、ListSelectionHandler のインスタンスを生成します。 |
protected MouseInputListener |
createMouseInputListener()
MouseInputListener を実装する委譲を作成します。 |
protected PropertyChangeListener |
createPropertyChangeListener()
installUI() によって JList に追加される、PropertyChangeHandler のインスタンスを生成します。 |
static ComponentUI |
createUI(JComponent list)
BasicListUI の新しいインスタンスを返します。 |
Rectangle |
getCellBounds(JList list,
int index1,
int index2)
|
Dimension |
getMaximumSize(JComponent c)
|
Dimension |
getMinimumSize(JComponent c)
|
Dimension |
getPreferredSize(JComponent c)
リストの最適なサイズは、行の高さの合計と、セルの最大幅です。 |
protected int |
getRowHeight(int row)
現在のレイアウトで、指定された行の高さを返します。 |
Point |
indexToLocation(JList list,
int index)
|
protected void |
installDefaults()
JList のプロパティ (フォント、フォアグラウンド、およびバックグラウンドなど) を初期化して、CellRendererPane を追加します。 |
protected void |
installKeyboardActions()
上矢印キー、および下矢印キーのキーボードアクションを登録します。 |
protected void |
installListeners()
JList、そのモデル、および selectionModel のリスナーを作成およびインストールします。 |
void |
installUI(JComponent c)
installDefaults() 、installListeners() 、および installKeyboardActions() を順に呼び出して、this.list を初期化します。 |
int |
locationToIndex(JList list,
Point location)
|
protected void |
maybeUpdateLayoutState()
updateLayoutStateNeeded がゼロでなければ、updateLayoutState() を呼び出して updateLayoutStateNeeded をリセットします。 |
void |
paint(Graphics g,
JComponent c)
Graphics オブジェクトの clipRect と交差する行をペイントします。 |
protected void |
paintCell(Graphics g,
int row,
Rectangle rowBounds,
ListCellRenderer cellRenderer,
ListModel dataModel,
ListSelectionModel selModel,
int leadIndex)
List のセルを 1 つペイントします。 |
protected void |
selectNextIndex()
1 つ後の行を選択して、それを強制的に可視にします。 |
protected void |
selectPreviousIndex()
1 つ前の行を選択して、それを強制的に可視にします。 |
protected void |
uninstallDefaults()
null に明示的にオーバーライドされていない JList のプロパティを設定します。 |
protected void |
uninstallKeyboardActions()
上矢印キー、および下矢印キーのキーボードアクションの登録を解除します。 |
protected void |
uninstallListeners()
JList、そのモデル、および selectionModel のリスナーを削除します。 |
void |
uninstallUI(JComponent c)
uninstallListeners() 、uninstallKeyboardActions() 、および uninstallDefaults() を順に呼び出して、this.list の初期化を解除します。 |
protected void |
updateLayoutState()
cellHeight (または cellHeights) および cellWidth の値を、現在のフォントと、fixedCellWidth、fixedCellHeight、および prototypeCellValue の現在の値を基にして計算し直します。 |
クラス javax.swing.plaf.ComponentUI から継承したメソッド |
contains,
getAccessibleChild,
getAccessibleChildrenCount,
update |
クラス java.lang.Object から継承したメソッド |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
フィールドの詳細 |
protected JList list
protected CellRendererPane rendererPane
protected FocusListener focusListener
protected MouseInputListener mouseInputListener
protected ListSelectionListener listSelectionListener
protected ListDataListener listDataListener
protected PropertyChangeListener propertyChangeListener
protected int[] cellHeights
protected int cellHeight
protected int cellWidth
protected int updateLayoutStateNeeded
protected static final int modelChanged
protected static final int selectionModelChanged
protected static final int fontChanged
protected static final int fixedCellWidthChanged
protected static final int fixedCellHeightChanged
protected static final int prototypeCellValueChanged
protected static final int cellRendererChanged
コンストラクタの詳細 |
public BasicListUI()
メソッドの詳細 |
protected void paintCell(Graphics g, int row, Rectangle rowBounds, ListCellRenderer cellRenderer, ListModel dataModel, ListSelectionModel selModel, int leadIndex)
paint(java.awt.Graphics, javax.swing.JComponent)
public void paint(Graphics g, JComponent c)
paintCell(java.awt.Graphics, int, java.awt.Rectangle, javax.swing.ListCellRenderer, javax.swing.ListModel, javax.swing.ListSelectionModel, int)
public Dimension getPreferredSize(JComponent c)
c
- JList コンポーネントpublic Dimension getMinimumSize(JComponent c)
getPreferredSize(javax.swing.JComponent)
public Dimension getMaximumSize(JComponent c)
getPreferredSize(javax.swing.JComponent)
protected void selectPreviousIndex()
installKeyboardActions()
,
JList.ensureIndexIsVisible(int)
protected void selectNextIndex()
installKeyboardActions()
,
JList.ensureIndexIsVisible(int)
protected void installKeyboardActions()
selectPreviousIndex()
,
selectNextIndex()
,
installUI(javax.swing.JComponent)
protected void uninstallKeyboardActions()
selectPreviousIndex()
,
selectNextIndex()
,
installUI(javax.swing.JComponent)
protected void installListeners()
installUI(javax.swing.JComponent)
,
uninstallListeners()
protected void uninstallListeners()
uninstallUI(javax.swing.JComponent)
,
installListeners()
protected void installDefaults()
uninstallDefaults()
,
installUI(javax.swing.JComponent)
,
CellRendererPane
protected void uninstallDefaults()
installDefaults()
,
uninstallUI(javax.swing.JComponent)
,
CellRendererPane
public void installUI(JComponent c)
installDefaults()
、installListeners()
、および installKeyboardActions()
を順に呼び出して、this.list
を初期化します。installDefaults()
,
installListeners()
,
installKeyboardActions()
public void uninstallUI(JComponent c)
uninstallListeners()
、uninstallKeyboardActions()
、および uninstallDefaults()
を順に呼び出して、this.list
の初期化を解除します。this.list は null に設定されます。uninstallListeners()
,
uninstallKeyboardActions()
,
uninstallDefaults()
public static ComponentUI createUI(JComponent list)
public int locationToIndex(JList list, Point location)
ListUI.locationToIndex(javax.swing.JList, java.awt.Point)
public Point indexToLocation(JList list, int index)
ListUI.indexToLocation(javax.swing.JList, int)
public Rectangle getCellBounds(JList list, int index1, int index2)
ListUI.getCellBounds(javax.swing.JList, int, int)
protected int getRowHeight(int row)
convertYToRow(int)
,
convertRowToY(int)
,
updateLayoutState()
protected int convertYToRow(int y0)
getRowHeight(int)
,
updateLayoutState()
protected int convertRowToY(int row)
getRowHeight(int)
,
updateLayoutState()
protected void maybeUpdateLayoutState()
updateLayoutState()
protected void updateLayoutState()
maybeUpdateLayoutState()
protected MouseInputListener createMouseInputListener()
class MyListUI extends BasicListUI { protected MouseInputListener createMouseInputListener() { return new MyMouseInputHandler(); } public class MyMouseInputHandler extends MouseInputHandler { public void mouseMoved(MouseEvent e) { // do some extra work when the mouse moves super.mouseMoved(e); } } }
BasicListUI.MouseInputHandler
,
installUI(javax.swing.JComponent)
protected FocusListener createFocusListener()
protected ListSelectionListener createListSelectionListener()
class MyListUI extends BasicListUI { protected ListSelectionListener createListSelectionListener() { return new MySelectionListener(); } public class MySelectionListener extends ListSelectionHandler { public void valueChanged(ListSelectionEvent e) { // do some extra work when the selection changes super.valueChange(e); } } }
BasicListUI.ListSelectionHandler
,
installUI(javax.swing.JComponent)
protected ListDataListener createListDataListener()
class MyListUI extends BasicListUI { protected ListDataListener createListDataListener() { return new MyListDataListener(); } public class MyListDataListener extends ListDataHandler { public void contentsChanged(ListDataEvent e) { // do some extra work when the models contents change super.contentsChange(e); } } }
ListDataListener
,
JList.getModel()
,
installUI(javax.swing.JComponent)
protected PropertyChangeListener createPropertyChangeListener()
class MyListUI extends BasicListUI { protected PropertyChangeListener createPropertyChangeListener() { return new MyPropertyChangeListener(); } public class MyPropertyChangeListener extends PropertyChangeHandler { public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("model")) { // do some extra work when the model changes } super.propertyChange(e); } } }
PropertyChangeListener
,
installUI(javax.swing.JComponent)
|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |