Class TLspBusyLayerCellRenderer

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, TreeCellRenderer

public class TLspBusyLayerCellRenderer extends ALcdBusyLayerTreeNodeCellRenderer

This class is a wrapper around a TLcdLayerTreeNodeCellRenderer, adding support for displaying a busy icon to the renderer for lightspeed layers. It supports the progress indication offered by lightspeed layers.

Since:
2012.0
See Also:
  • Constructor Details

    • TLspBusyLayerCellRenderer

      public TLspBusyLayerCellRenderer(ILspView aView, TLcdLayerTreeNodeCellRenderer aDelegateRenderer)

      Wrap a new TLcdGXYBusyLayerTreeNodeCellRenderer around aDelegateRenderer. This renderer can only be used on one TLcdLayerTree at the same time. The wrapped TLcdLayerTreeNodeCellRenderer must not be set on another tree.

      Parameters:
      aView - the view containing the layers which will be displayed in the layer tree
      aDelegateRenderer - the renderer which is wrapper
  • Method Details

    • updateRendererFromLayer

      protected void updateRendererFromLayer(JTree aTree, ILcdLayer aLayer, boolean aSelected, boolean aExpanded, boolean aLeaf, int aRow, boolean aHasFocus, TLcdLayerTreeNodeCellRenderer aRenderer)

      Update the state of the renderer to match the state of layer aLayer

      Overrides:
      updateRendererFromLayer in class ALcdBusyLayerTreeNodeCellRenderer
      Parameters:
      aTree - the tree which is currently renderer
      aLayer - the layer which state the renderer should match
      aSelected - if true, the cell must be drawn as if selected
      aExpanded - if true, the node is currently expanded
      aLeaf - if true, the node represents a leaf
      aRow - the row number
      aHasFocus - if true, the node currently has focus
      aRenderer - the wrapped renderer
    • updateLabelIcon

      protected Icon updateLabelIcon(Icon aDefaultIcon, ILcdLayer aLayer, boolean aIsDeterminate, double aProgress)

      Method used to update a busy cell renderer icon. The return value will be set as the new cell renderer icon. Overriding this method allows you to plug in custom icons.

      Note that this method is only called when the passed layer or its descendant is painting.

      Parameters:
      aDefaultIcon - a default busy layer icon
      aLayer - the layer that matches the provided icon
      aIsDeterminate - whether how much of the layer that has already been drawn is known ( true ) or is not known ( false )
      aProgress - how much of the layer already has been drawn [0..1], in most cases only relevant when isDeterminate is true
      Returns:
      An updated busy layer icon
    • updateLabelDisabledIcon

      protected Icon updateLabelDisabledIcon(Icon aDefaultDisabledIcon, ILcdLayer aLayer, boolean aIsDeterminate, double aProgress)

      Method used to update a busy cell renderer icon. The return value will be set as the new cell renderer icon. Overriding this method allows you to plug in custom icons.

      Note that this method is only called when the passed layer or its descendant is painting.

      Parameters:
      aDefaultDisabledIcon - a default busy layer disabled icon
      aLayer - the layer that matches the provided icon
      aIsDeterminate - whether how much of the layer that has already been drawn is known ( true ) or is not known ( false )
      aProgress - how much of the layer already has been drawn [0..1], in most cases only relevant when isDeterminate is true
      Returns:
      An updated busy layer disabled icon
    • updateLabelText

      protected String updateLabelText(String aDefaultText, ILcdLayer aLayer, boolean aIsDeterminate, double aProgress)

      Method used to update a busy cell renderer string. The return value will be set as the new cell renderer label string. Overriding this method allows you to plug in custom label text.

      Note that this method is only called when the passed layer or its descendant is painting.

      Parameters:
      aDefaultText - a default busy layer label text
      aLayer - the layer that matches the provided text
      aIsDeterminate - whether how much of the layer that has already been drawn is known ( true ) or is not known ( false )
      aProgress - how much of the layer already has been drawn [0..1], in most cases only relevant when isDeterminate is true
      Returns:
      An updated busy layer label string
    • isLayerOrDescendantBusy

      protected boolean isLayerOrDescendantBusy(ILcdLayer aLayer)

      Used to trace whether a layer or descendant is finished loading or not: true when a layer or descendant is still busy, false otherwise.

      Specified by:
      isLayerOrDescendantBusy in class ALcdBusyLayerTreeNodeCellRenderer
      Parameters:
      aLayer - the layer for which the method should return if it, or its descendant, is still busy
      Returns:
      true if the layer is busy, false otherwise.
      See Also:
    • isLayerOrDescendantPainting

      protected boolean isLayerOrDescendantPainting(ILcdLayer aLayer)

      Used to trace whether a layer or descendant is finished painting or not: true when a layer or descendant is still painting, false otherwise.

      Specified by:
      isLayerOrDescendantPainting in class ALcdBusyLayerTreeNodeCellRenderer
      Parameters:
      aLayer - the layer for which the method should return if it, or its descendant, is still painting
      Returns:
      true if the layer is busy, false otherwise.
      See Also: