Class YListUI

Direct Known Subclasses:
BasicYListUI

public class YListUI extends ListUI
Similar to javax.swing.plaf.basic.ListUI this abstract class defines a pluggable look and feel delegate for JYList and JXList. Most of the implementation is like in javax.swing.plaf.basic.BasicListUI
See Also:
  • Field Details

    • list

      protected JList<Object> list
    • rendererPane

      protected CellRendererPane rendererPane
    • focusListener

      protected FocusListener focusListener
    • mouseInputListener

      protected MouseInputListener mouseInputListener
    • listSelectionListener

      protected ListSelectionListener listSelectionListener
    • listDataListener

      protected ListDataListener listDataListener
    • propertyChangeListener

      protected PropertyChangeListener propertyChangeListener
    • cellHeights

      protected int[] cellHeights
    • cellHeight

      protected int cellHeight
    • cellWidth

      protected int cellWidth
    • modelChanged

      protected static final int modelChanged
      See Also:
    • selectionModelChanged

      protected static final int selectionModelChanged
      See Also:
    • fontChanged

      protected static final int fontChanged
      See Also:
    • fixedCellWidthChanged

      protected static final int fixedCellWidthChanged
      See Also:
    • fixedCellHeightChanged

      protected static final int fixedCellHeightChanged
      See Also:
    • prototypeCellValueChanged

      protected static final int prototypeCellValueChanged
      See Also:
    • cellRendererChanged

      protected static final int cellRendererChanged
      See Also:
    • layoutOrientationChanged

      protected static final int layoutOrientationChanged
      See Also:
    • heightChanged

      protected static final int heightChanged
      See Also:
    • widthChanged

      protected static final int widthChanged
      See Also:
    • componentOrientationChanged

      protected static final int componentOrientationChanged
      See Also:
    • updateLayoutStateNeeded

      protected int updateLayoutStateNeeded
    • layoutOrientation

      protected int layoutOrientation
    • listHeight

      protected int listHeight
    • listWidth

      protected int listWidth
    • columnCount

      protected int columnCount
    • preferredHeight

      protected int preferredHeight
    • rowsPerColumn

      protected int rowsPerColumn
    • timeFactor

      protected long timeFactor
    • isFileList

      protected boolean isFileList
    • isLeftToRight

      protected boolean isLeftToRight
  • Constructor Details

    • YListUI

      public YListUI()
  • Method Details

    • locationToIndex

      public int locationToIndex(JList<?> list, Point location)
      Specified by:
      locationToIndex in class ListUI
    • indexToLocation

      public Point indexToLocation(JList<?> list, int index)
      Specified by:
      indexToLocation in class ListUI
    • getCellBounds

      public Rectangle getCellBounds(JList<?> list, int index1, int index2)
      Specified by:
      getCellBounds in class ListUI
    • getViewModel

      protected ListModel<Object> getViewModel()
    • getElementCount

      protected int getElementCount()
    • installUI

      public void installUI(JComponent c)

      Initializes super.list with JComponent c by calling protected void installDefaults() protected void installListeners() protected void installKeyboardActions()

      Overrides:
      installUI in class ComponentUI
    • installDefaults

      protected void installDefaults()
    • installListeners

      protected void installListeners()
    • installKeyboardActions

      protected void installKeyboardActions()
    • getCellBounds

      protected Rectangle getCellBounds(JList<?> list, int index)
      Gets the bounds of the specified model index, returning the resulting bounds, or null if index is not valid.
      Parameters:
      list - JList
      index - int
      Returns:
      Rectangle
    • convertLocationToRow

      protected int convertLocationToRow(int x, int y0, boolean closest)
      Returns the row at location x/y.
      Parameters:
      x - int
      y0 - int
      closest - If true and the location doesn't exactly match a particular location, this will return the closest row.
      Returns:
      int row at location x/y
    • convertLocationToColumn

      protected int convertLocationToColumn(int x, int y)
      Returns the closest column to the passed in location.
    • getModelIndex

      protected int getModelIndex(int column, int row)
      Returns the model index for the specified display location. If columnxrow is beyond the length of the model, this will return the model size - 1.
    • convertModelToRow

      protected int convertModelToRow(int index)
      Returns the row that the model index index will be displayed in.
    • convertModelToColumn

      protected int convertModelToColumn(int index)
      Returns the column that the model index index will be displayed in.
    • getHeight

      protected int getHeight(int column, int row)
      Returns the height of the cell at the passed in location.
    • maybeUpdateLayoutState

      protected void maybeUpdateLayoutState()
      If updateLayoutStateNeeded is non zero, call updateLayoutState() and reset updateLayoutStateNeeded. This method should be called by methods before doing any computation based on the geometry of the list. For example it's the first call in paint() and getPreferredSize().
      See Also:
    • updateLayoutState

      protected void updateLayoutState()
      Recompute the value of cellHeight or cellHeights based and cellWidth, based on the current font and the current values of fixedCellWidth, fixedCellHeight, and prototypeCellValue.
      See Also:
    • convertYToRow

      protected int convertYToRow(int y0)
      See Also:
    • convertRowToY

      protected int convertRowToY(int row)
      See Also:
    • getRowCount

      protected int getRowCount(int column)
      Returns the number of rows in the given column.