< prev index next >

src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java

Print this page

        

*** 618,639 **** * longer need 8 rows to display this, you only need 5, thus * the adjustedRowCount is 5. * <p>If the visible row * count is &lt;= 0, the preferred height is dictated by the * number of columns, which will be as many as can fit in the width ! * of the <code>JList</code> (width / max cell width), with at * least one column. The preferred height then becomes the * model size / number of columns * maximum cell height. * Max cell height is either the fixed * cell height, or is determined by iterating through all the cells * to find the maximum height from the ListCellRenderer. * </table> * The above specifies the raw preferred width and height. The resulting * preferred width is the above width + insets.left + insets.right and * the resulting preferred height is the above height + insets.top + ! * insets.bottom. Where the <code>Insets</code> are determined from ! * <code>list.getInsets()</code>. * * @param c The JList component. * @return The total size of the list. */ public Dimension getPreferredSize(JComponent c) { --- 618,639 ---- * longer need 8 rows to display this, you only need 5, thus * the adjustedRowCount is 5. * <p>If the visible row * count is &lt;= 0, the preferred height is dictated by the * number of columns, which will be as many as can fit in the width ! * of the {@code JList} (width / max cell width), with at * least one column. The preferred height then becomes the * model size / number of columns * maximum cell height. * Max cell height is either the fixed * cell height, or is determined by iterating through all the cells * to find the maximum height from the ListCellRenderer. * </table> * The above specifies the raw preferred width and height. The resulting * preferred width is the above width + insets.left + insets.right and * the resulting preferred height is the above height + insets.top + ! * insets.bottom. Where the {@code Insets} are determined from ! * {@code list.getInsets()}. * * @param c The JList component. * @return The total size of the list. */ public Dimension getPreferredSize(JComponent c) {
*** 695,706 **** } } /** ! * Registers the keyboard bindings on the <code>JList</code> that the ! * <code>BasicListUI</code> is associated with. This method is called at * installUI() time. * * @see #installUI */ protected void installKeyboardActions() { --- 695,706 ---- } } /** ! * Registers the keyboard bindings on the {@code JList} that the ! * {@code BasicListUI} is associated with. This method is called at * installUI() time. * * @see #installUI */ protected void installKeyboardActions() {
*** 731,741 **** return null; } /** * Unregisters keyboard actions installed from ! * <code>installKeyboardActions</code>. * This method is called at uninstallUI() time - subclassess should * ensure that all of the keyboard actions registered at installUI * time are removed here. * * @see #installUI --- 731,741 ---- return null; } /** * Unregisters keyboard actions installed from ! * {@code installKeyboardActions}. * This method is called at uninstallUI() time - subclassess should * ensure that all of the keyboard actions registered at installUI * time are removed here. * * @see #installUI
*** 918,929 **** } } /** ! * Initializes <code>this.list</code> by calling <code>installDefaults()</code>, ! * <code>installListeners()</code>, and <code>installKeyboardActions()</code> * in order. * * @see #installDefaults * @see #installListeners * @see #installKeyboardActions --- 918,929 ---- } } /** ! * Initializes {@code this.list} by calling {@code installDefaults()}, ! * {@code installListeners()}, and {@code installKeyboardActions()} * in order. * * @see #installDefaults * @see #installListeners * @see #installKeyboardActions
*** 949,960 **** installKeyboardActions(); } /** ! * Uninitializes <code>this.list</code> by calling <code>uninstallListeners()</code>, ! * <code>uninstallKeyboardActions()</code>, and <code>uninstallDefaults()</code> * in order. Sets this.list to null. * * @see #uninstallListeners * @see #uninstallKeyboardActions * @see #uninstallDefaults --- 949,960 ---- installKeyboardActions(); } /** ! * Uninitializes {@code this.list} by calling {@code uninstallListeners()}, ! * {@code uninstallKeyboardActions()}, and {@code uninstallDefaults()} * in order. Sets this.list to null. * * @see #uninstallListeners * @see #uninstallKeyboardActions * @see #uninstallDefaults
*** 1055,1065 **** return minBounds; } /** * Gets the bounds of the specified model index, returning the resulting ! * bounds, or null if <code>index</code> is not valid. */ private Rectangle getCellBounds(JList<?> list, int index) { maybeUpdateLayoutState(); int row = convertModelToRow(index); --- 1055,1065 ---- return minBounds; } /** * Gets the bounds of the specified model index, returning the resulting ! * bounds, or null if {@code index} is not valid. */ private Rectangle getCellBounds(JList<?> list, int index) { maybeUpdateLayoutState(); int row = convertModelToRow(index);
*** 1281,1291 **** return rowsPerColumn; } /** * Returns the model index for the specified display location. ! * If <code>column</code>x<code>row</code> is beyond the length of the * model, this will return the model size - 1. */ private int getModelIndex(int column, int row) { switch (layoutOrientation) { case JList.VERTICAL_WRAP: --- 1281,1291 ---- return rowsPerColumn; } /** * Returns the model index for the specified display location. ! * If {@code column}x{@code row} is beyond the length of the * model, this will return the model size - 1. */ private int getModelIndex(int column, int row) { switch (layoutOrientation) { case JList.VERTICAL_WRAP:
*** 1324,1334 **** } return 0; } /** ! * Returns the row that the model index <code>index</code> will be * displayed in.. */ private int convertModelToRow(int index) { int size = list.getModel().getSize(); --- 1324,1334 ---- } return 0; } /** ! * Returns the row that the model index {@code index} will be * displayed in.. */ private int convertModelToRow(int index) { int size = list.getModel().getSize();
*** 1345,1355 **** } return index; } /** ! * Returns the column that the model index <code>index</code> will be * displayed in. */ private int convertModelToColumn(int index) { int size = list.getModel().getSize(); --- 1345,1355 ---- } return index; } /** ! * Returns the column that the model index {@code index} will be * displayed in. */ private int convertModelToColumn(int index) { int size = list.getModel().getSize();
*** 1460,1471 **** /** * Invoked when the list is layed out horizontally to determine how * many columns to create. * <p> ! * This updates the <code>rowsPerColumn, </code><code>columnCount</code>, ! * <code>preferredHeight</code> and potentially <code>cellHeight</code> * instance variables. */ private void updateHorizontalLayoutState(int fixedCellWidth, int fixedCellHeight) { int visRows = list.getVisibleRowCount(); --- 1460,1471 ---- /** * Invoked when the list is layed out horizontally to determine how * many columns to create. * <p> ! * This updates the {@code rowsPerColumn,}{@code columnCount}, ! * {@code preferredHeight} and potentially {@code cellHeight} * instance variables. */ private void updateHorizontalLayoutState(int fixedCellWidth, int fixedCellHeight) { int visRows = list.getVisibleRowCount();
*** 1557,1567 **** * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. * * @see #createMouseInputListener * @see #installKeyboardActions * @see #installUI --- 1557,1567 ---- * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the {@code java.beans} package. * Please see {@link java.beans.XMLEncoder}. * * @see #createMouseInputListener * @see #installKeyboardActions * @see #installUI
*** 1671,1681 **** * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. * * @see #createListSelectionListener * @see #getCellBounds * @see #installUI --- 1671,1681 ---- * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the {@code java.beans} package. * Please see {@link java.beans.XMLEncoder}. * * @see #createListSelectionListener * @see #getCellBounds * @see #installUI
*** 1731,1741 **** * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. * * @see JList#getModel * @see #maybeUpdateLayoutState * @see #createListDataListener --- 1731,1741 ---- * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the {@code java.beans} package. * Please see {@link java.beans.XMLEncoder}. * * @see JList#getModel * @see #maybeUpdateLayoutState * @see #createListDataListener
*** 1800,1810 **** * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. * * @see #maybeUpdateLayoutState * @see #createPropertyChangeListener * @see #installUI --- 1800,1810 ---- * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the {@code java.beans} package. * Please see {@link java.beans.XMLEncoder}. * * @see #maybeUpdateLayoutState * @see #createPropertyChangeListener * @see #installUI
*** 2445,2455 **** /** * Invoked when a key has been typed. * * Moves the keyboard focus to the first element whose prefix matches the * sequence of alphanumeric keys pressed by the user with delay less ! * than value of <code>timeFactor</code> property (or 1000 milliseconds * if it is not defined). Subsequent same key presses move the keyboard * focus to the next object that starts with the same letter until another * key is pressed, then it is treated as the prefix with appropriate number * of the same letters followed by first typed another letter. */ --- 2445,2455 ---- /** * Invoked when a key has been typed. * * Moves the keyboard focus to the first element whose prefix matches the * sequence of alphanumeric keys pressed by the user with delay less ! * than value of {@code timeFactor} property (or 1000 milliseconds * if it is not defined). Subsequent same key presses move the keyboard * focus to the next object that starts with the same letter until another * key is pressed, then it is treated as the prefix with appropriate number * of the same letters followed by first typed another letter. */
< prev index next >