Class PieceMapView

java.lang.Object
com.biglybt.ui.swt.views.piece.PieceMapView
All Implemented Interfaces:
DownloadManagerPeerListener, DownloadManagerPieceListener, PiecePickerListener, UISWTViewEventListener, UISWTViewCoreEventListener

Piece Map View.

This view is placed within the PiecesView even though it relies on a DownloadManager datasource instead of a PEPiece

Also placed in Library views

  • Field Details

    • DEBUG

      public static final boolean DEBUG
      See Also:
    • KEY_INSTANCE

      public static final String KEY_INSTANCE
      See Also:
    • BLOCK_FILLSIZE

      private static final int BLOCK_FILLSIZE
      See Also:
    • BLOCK_SPACING

      private static final int BLOCK_SPACING
      See Also:
    • BLOCK_SIZE

      private static final int BLOCK_SIZE
      See Also:
    • BLOCKCOLOR_HAVE

      private static final int BLOCKCOLOR_HAVE
      See Also:
    • BLOCKCOLOR_NOHAVE

      private static final int BLOCKCOLOR_NOHAVE
      See Also:
    • BLOCKCOLOR_TRANSFER

      private static final int BLOCKCOLOR_TRANSFER
      See Also:
    • BLOCKCOLOR_NEXT

      private static final int BLOCKCOLOR_NEXT
      See Also:
    • BLOCKCOLOR_SHOWFILE

      private static final int BLOCKCOLOR_SHOWFILE
      See Also:
    • BLOCKCOLOR_MERGE_READ

      private static final int BLOCKCOLOR_MERGE_READ
      See Also:
    • BLOCKCOLOR_MERGE_WRITE

      private static final int BLOCKCOLOR_MERGE_WRITE
      See Also:
    • BLOCKCOLOR_FORCED

      private static final int BLOCKCOLOR_FORCED
      See Also:
    • MSGID_PREFIX

      public static final String MSGID_PREFIX
      See Also:
    • SHOW_BIG

      private static final byte SHOW_BIG
      See Also:
    • SHOW_SMALL

      private static final byte SHOW_SMALL
      See Also:
    • pieceInfoComposite

      private org.eclipse.swt.widgets.Composite pieceInfoComposite
    • sc

      private org.eclipse.swt.custom.ScrolledComposite sc
    • pieceInfoCanvas

      private org.eclipse.swt.widgets.Canvas pieceInfoCanvas
    • currentNumColumns

      private int currentNumColumns
    • currentNumPieces

      private int currentNumPieces
    • blockColors

      private static final org.eclipse.swt.graphics.Color[] blockColors
    • legendKeys

      private static final String[] legendKeys
    • topLabel

      private BufferedLabel topLabel
    • topLabelLHS

      private String topLabelLHS
    • topLabelRHS

      private String topLabelRHS
    • selectedPieceExplicit

      private List<Integer> selectedPieceExplicit
    • selectedPiece

      private int selectedPiece
    • selectedPieceShowFilePending

      private int selectedPieceShowFilePending
    • selectedPieceShowFile

      private boolean selectedPieceShowFile
    • scrollPending

      private boolean scrollPending
    • file_color

      private org.eclipse.swt.graphics.Color file_color
    • file_color_faded

      private org.eclipse.swt.graphics.Color file_color_faded
    • imageLabel

      private org.eclipse.swt.widgets.Label imageLabel
    • graphicsUpdate

      private final int graphicsUpdate
    • loopFactor

      private int loopFactor
    • font

      private org.eclipse.swt.graphics.Font font
    • img

      org.eclipse.swt.graphics.Image img
    • dlm

      private DownloadManager dlm
    • current_pp

      private PiecePicker current_pp
    • oldBlockInfo

      PieceMapView.BlockInfo[] oldBlockInfo
    • textExtents

      private Map<String,org.eclipse.swt.graphics.Point> textExtents
      extents for drawn "0" - "99" can be calculated once and stored until font changes
    • distinctPieceCache

      private final List<Integer> distinctPieceCache
    • alreadyFilling

      private boolean alreadyFilling
    • swtView

      private UISWTView swtView
  • Constructor Details

    • PieceMapView

      public PieceMapView()
      Initialize
  • Method Details

    • getLegendColor

      public static org.eclipse.swt.graphics.Color getLegendColor(String key)
    • dataSourceChanged

      private void dataSourceChanged(Object newDataSource)
    • getFullTitle

      private static String getFullTitle()
    • initialize

      private void initialize(org.eclipse.swt.widgets.Composite composite)
    • selectPieces

      public void selectPieces(PEPiece... pieces)
    • createPeerInfoPanel

      private void createPeerInfoPanel(org.eclipse.swt.widgets.Composite parent)
    • getPieceNumber

      private int getPieceNumber(int x, int y)
    • fillPieceInfoSection

      private void fillPieceInfoSection()
    • refresh

      private void refresh()
    • setTopLableRHS

      private void setTopLableRHS(Integer... piece_numbers)
    • updateTopLabel

      private void updateTopLabel()
    • refreshInfoCanvas

      protected void refreshInfoCanvas()
    • refreshInfoCanvasSupport

      protected int refreshInfoCanvasSupport()
    • log

      private static void log(String s)
    • drawDownloadIndicator

      public static void drawDownloadIndicator(org.eclipse.swt.graphics.GC gcImg, int iXPos, int iYPos, boolean small, int blockFillsize)
    • drawUploadIndicator

      public static void drawUploadIndicator(org.eclipse.swt.graphics.GC gcImg, int iXPos, int iYPos, boolean small, int blockFillsize)
    • getComposite

      private org.eclipse.swt.widgets.Composite getComposite()
    • delete

      private void delete()
    • somethingChanged

      public void somethingChanged(PiecePicker pp, int thing, Object data)
      Specified by:
      somethingChanged in interface PiecePickerListener
    • obfuscatedImage

      private void obfuscatedImage(org.eclipse.swt.graphics.Image image)
    • pieceAdded

      public void pieceAdded(PEPiece piece)
      Specified by:
      pieceAdded in interface DownloadManagerPieceListener
    • pieceRemoved

      public void pieceRemoved(PEPiece piece)
      Specified by:
      pieceRemoved in interface DownloadManagerPieceListener
    • peerManagerWillBeAdded

      public void peerManagerWillBeAdded(PEPeerManager manager)
      Description copied from interface: DownloadManagerPeerListener
      Called when a peer manager is created but not yet started
      Specified by:
      peerManagerWillBeAdded in interface DownloadManagerPeerListener
      Parameters:
      manager -
    • peerManagerAdded

      public void peerManagerAdded(PEPeerManager manager)
      Specified by:
      peerManagerAdded in interface DownloadManagerPeerListener
    • peerManagerRemoved

      public void peerManagerRemoved(PEPeerManager manager)
      Specified by:
      peerManagerRemoved in interface DownloadManagerPeerListener
    • peerAdded

      public void peerAdded(PEPeer peer)
      Specified by:
      peerAdded in interface DownloadManagerPeerListener
    • peerRemoved

      public void peerRemoved(PEPeer peer)
      Specified by:
      peerRemoved in interface DownloadManagerPeerListener
    • eventOccurred

      public boolean eventOccurred(UISWTViewEvent event)
      Description copied from interface: UISWTViewEventListener
      Triggers when an even listed in UISWTViewEvent occurs
      Specified by:
      eventOccurred in interface UISWTViewEventListener
      Parameters:
      event - event that occurred
      Returns:
      meaning dependent upon event type