com.levigo.jadice.swing.thumbnailview
Class BasicThumbnailViewUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by com.levigo.jadice.swing.thumbnailview.ThumbnailViewUI
          extended by com.levigo.jadice.swing.thumbnailview.BasicThumbnailViewUI

public class BasicThumbnailViewUI
extends ThumbnailViewUI


Field Summary
protected  Dimension cellSize
           
protected  CellRendererPane rendererPane
           
protected  ThumbnailView view
           
protected  Dimension viewSize
           
 
Constructor Summary
BasicThumbnailViewUI()
           
 
Method Summary
static ComponentUI createUI(JComponent list)
          Returns a new instance of BasicThumbnailViewUI.
 Rectangle getCellBounds(ThumbnailView list, int index1, int index2)
          
 Dimension getCellSize()
           
 Dimension getMaximumSize(JComponent c)
           
 Dimension getPreferredSize(JComponent c)
           
 Point indexToLocation(ThumbnailView list, int index)
          
protected  void installDefaults()
          Initialize ThumbnailView properties, e.g.
protected  void installKeyboardActions()
          Registers the keyboard bindings on the ThumbnailView that the BasicListUI is associated with.
protected  void installListeners()
          Create and install the listeners for the ThumbnailView, its model, and its selectionModel.
 void installUI(JComponent c)
          Initializes this.list by calling installDefaults(), installListeners(), and installKeyboardActions() in order.
 int locationToIndex(ThumbnailView list, Point location)
          
 void paint(Graphics g, JComponent c)
          Paint the rows that intersect the Graphics objects clipRect.
protected  void paintCell(Graphics g, int index, Rectangle cellBounds, ThumbnailCellRenderer cellRenderer, List<Page> dataModel, ListSelectionModel selModel, int leadIndex)
          Paint one List cell: compute the relevant state, get the "rubber stamp" cell renderer component, and then use the CellRendererPane to paint it.
protected  void selectNextIndex()
          Selected the previous row and force it to be visible.
protected  void selectPreviousIndex()
          Selected the previous row and force it to be visible.
protected  void uninstallDefaults()
          Set the ThumbnailView properties that haven't been explicitly overridden to null.
protected  void uninstallKeyboardActions()
          Unregisters keyboard actions installed from installKeyboardActions.
protected  void uninstallListeners()
          Remove the listeners for the ThumbnailView, its model, and its selectionModel.
 void uninstallUI(JComponent c)
          Uninitializes this.list by calling uninstallListeners(), uninstallKeyboardActions(), and uninstallDefaults() in order.
protected  void updateGrid()
          Update just the grid dimensions.
protected  void updateLayout()
          Update the whole view geometry.
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMinimumSize, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cellSize

protected Dimension cellSize

rendererPane

protected CellRendererPane rendererPane

view

protected ThumbnailView view

viewSize

protected Dimension viewSize
Constructor Detail

BasicThumbnailViewUI

public BasicThumbnailViewUI()
Method Detail

createUI

public static ComponentUI createUI(JComponent list)
Returns a new instance of BasicThumbnailViewUI. BasicThumbnailViewUI delegates are allocated one per ThumbnailView.

Returns:
A new ThumbnailViewUI implementation.

getCellBounds

public Rectangle getCellBounds(ThumbnailView list,
                               int index1,
                               int index2)

Specified by:
getCellBounds in class ThumbnailViewUI

getCellSize

public Dimension getCellSize()
Specified by:
getCellSize in class ThumbnailViewUI

getPreferredSize

public Dimension getPreferredSize(JComponent c)
Overrides:
getPreferredSize in class ComponentUI

getMaximumSize

public Dimension getMaximumSize(JComponent c)
Overrides:
getMaximumSize in class ComponentUI

indexToLocation

public Point indexToLocation(ThumbnailView list,
                             int index)

Specified by:
indexToLocation in class ThumbnailViewUI

installDefaults

protected void installDefaults()
Initialize ThumbnailView properties, e.g. font, foreground, and background, and add the CellRendererPane. The font, foreground, and background properties are only set if their current value is either null or a UIResource, other properties are set if the current value is null.

See Also:
uninstallDefaults(), installUI(javax.swing.JComponent), CellRendererPane

installKeyboardActions

protected void installKeyboardActions()
Registers the keyboard bindings on the ThumbnailView that the BasicListUI is associated with. This method is called at installUI() time.

See Also:
installUI(javax.swing.JComponent)

installListeners

protected void installListeners()
Create and install the listeners for the ThumbnailView, its model, and its selectionModel. This method is called at installUI() time.

See Also:
installUI(javax.swing.JComponent), uninstallListeners()

installUI

public void installUI(JComponent c)
Initializes this.list by calling installDefaults(), installListeners(), and installKeyboardActions() in order.

Overrides:
installUI in class ComponentUI
See Also:
installDefaults(), installListeners(), installKeyboardActions()

locationToIndex

public int locationToIndex(ThumbnailView list,
                           Point location)

Specified by:
locationToIndex in class ThumbnailViewUI
Throws:
NullPointerException

paint

public void paint(Graphics g,
                  JComponent c)
Paint the rows that intersect the Graphics objects clipRect. This method calls paintCell as necessary. Subclasses may want to override these methods.

Overrides:
paint in class ComponentUI
See Also:
paintCell(java.awt.Graphics, int, java.awt.Rectangle, com.levigo.jadice.swing.thumbnailview.ThumbnailCellRenderer, java.util.List, javax.swing.ListSelectionModel, int)

paintCell

protected void paintCell(Graphics g,
                         int index,
                         Rectangle cellBounds,
                         ThumbnailCellRenderer cellRenderer,
                         List<Page> dataModel,
                         ListSelectionModel selModel,
                         int leadIndex)
Paint one List cell: compute the relevant state, get the "rubber stamp" cell renderer component, and then use the CellRendererPane to paint it. Subclasses may want to override this method rather than paint().

See Also:
paint(java.awt.Graphics, javax.swing.JComponent)

selectNextIndex

protected void selectNextIndex()
Selected the previous row and force it to be visible.

See Also:
ThumbnailView.ensureIndexIsVisible(int)

selectPreviousIndex

protected void selectPreviousIndex()
Selected the previous row and force it to be visible.

See Also:
ThumbnailView.ensureIndexIsVisible(int)

uninstallDefaults

protected void uninstallDefaults()
Set the ThumbnailView properties that haven't been explicitly overridden to null. A property is considered overridden if its current value is not a UIResource.

See Also:
installDefaults(), uninstallUI(javax.swing.JComponent), CellRendererPane

uninstallKeyboardActions

protected void uninstallKeyboardActions()
Unregisters keyboard actions installed from installKeyboardActions. This method is called at uninstallUI() time - subclasses should ensure that all of the keyboard actions registered at installUI time are removed here.

See Also:
installUI(javax.swing.JComponent)

uninstallListeners

protected void uninstallListeners()
Remove the listeners for the ThumbnailView, its model, and its selectionModel. All of the listener fields, are reset to null here. This method is called at uninstallUI() time, it should be kept in sync with installListeners.

See Also:
uninstallUI(javax.swing.JComponent), installListeners()

uninstallUI

public void uninstallUI(JComponent c)
Uninitializes this.list by calling uninstallListeners(), uninstallKeyboardActions(), and uninstallDefaults() in order. Sets this.list to null.

Overrides:
uninstallUI in class ComponentUI
See Also:
uninstallListeners(), uninstallKeyboardActions(), uninstallDefaults()

updateGrid

protected void updateGrid()
Update just the grid dimensions.


updateLayout

protected void updateLayout()
Update the whole view geometry.



Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.