Class PieceMapView
java.lang.Object
com.biglybt.ui.swt.views.piece.PieceMapView
- All Implemented Interfaces:
DownloadManagerPeerListener, DownloadManagerPieceListener, PiecePickerListener, UISWTViewEventListener, UISWTViewCoreEventListener
public class PieceMapView
extends Object
implements DownloadManagerPieceListener, DownloadManagerPeerListener, PiecePickerListener, 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final org.eclipse.swt.graphics.Color[]private PiecePickerprivate intprivate intstatic final booleanprivate DownloadManagerprivate org.eclipse.swt.graphics.Colorprivate org.eclipse.swt.graphics.Colorprivate org.eclipse.swt.graphics.Fontprivate final intprivate org.eclipse.swt.widgets.Label(package private) org.eclipse.swt.graphics.Imagestatic final Stringprivate static final String[]private intstatic final String(package private) PieceMapView.BlockInfo[]private org.eclipse.swt.widgets.Canvasprivate org.eclipse.swt.widgets.Compositeprivate org.eclipse.swt.custom.ScrolledCompositeprivate booleanprivate intprivate booleanprivate intprivate static final byteprivate static final byteprivate UISWTViewextents for drawn "0" - "99" can be calculated once and stored until font changesprivate BufferedLabelprivate Stringprivate StringFields inherited from interface PiecePickerListener
THING_FORCE_PIECE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcreatePeerInfoPanel(org.eclipse.swt.widgets.Composite parent) private voiddataSourceChanged(Object newDataSource) private voiddelete()static voiddrawDownloadIndicator(org.eclipse.swt.graphics.GC gcImg, int iXPos, int iYPos, boolean small, int blockFillsize) static voiddrawUploadIndicator(org.eclipse.swt.graphics.GC gcImg, int iXPos, int iYPos, boolean small, int blockFillsize) booleaneventOccurred(UISWTViewEvent event) Triggers when an even listed in UISWTViewEvent occursprivate voidprivate org.eclipse.swt.widgets.Compositeprivate static Stringstatic org.eclipse.swt.graphics.ColorgetLegendColor(String key) private intgetPieceNumber(int x, int y) private voidinitialize(org.eclipse.swt.widgets.Composite composite) private static voidprivate voidobfuscatedImage(org.eclipse.swt.graphics.Image image) voidvoidpeerManagerAdded(PEPeerManager manager) voidpeerManagerRemoved(PEPeerManager manager) voidpeerManagerWillBeAdded(PEPeerManager manager) Called when a peer manager is created but not yet startedvoidpeerRemoved(PEPeer peer) voidpieceAdded(PEPiece piece) voidpieceRemoved(PEPiece piece) private voidrefresh()protected voidprotected intvoidselectPieces(PEPiece... pieces) private voidsetTopLableRHS(Integer... piece_numbers) voidsomethingChanged(PiecePicker pp, int thing, Object data) private voidMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PiecePickerListener
providerAdded, providerAdded, providerRemoved, providerRemovedMethods inherited from interface UISWTViewEventListener
builderNotRequired, informOfDuplicates
-
Field Details
-
DEBUG
public static final boolean DEBUG- See Also:
-
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
- 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
-
topLabel
-
topLabelLHS
-
topLabelRHS
-
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
-
current_pp
-
oldBlockInfo
PieceMapView.BlockInfo[] oldBlockInfo -
textExtents
-
distinctPieceCache
-
alreadyFilling
private boolean alreadyFilling -
swtView
-
-
Constructor Details
-
PieceMapView
public PieceMapView()Initialize
-
-
Method Details
-
getLegendColor
-
dataSourceChanged
-
getFullTitle
-
initialize
private void initialize(org.eclipse.swt.widgets.Composite composite) -
selectPieces
-
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
-
updateTopLabel
private void updateTopLabel() -
refreshInfoCanvas
protected void refreshInfoCanvas() -
refreshInfoCanvasSupport
protected int refreshInfoCanvasSupport() -
log
-
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
- Specified by:
somethingChangedin interfacePiecePickerListener
-
obfuscatedImage
private void obfuscatedImage(org.eclipse.swt.graphics.Image image) -
pieceAdded
- Specified by:
pieceAddedin interfaceDownloadManagerPieceListener
-
pieceRemoved
- Specified by:
pieceRemovedin interfaceDownloadManagerPieceListener
-
peerManagerWillBeAdded
Description copied from interface:DownloadManagerPeerListenerCalled when a peer manager is created but not yet started- Specified by:
peerManagerWillBeAddedin interfaceDownloadManagerPeerListener- Parameters:
manager-
-
peerManagerAdded
- Specified by:
peerManagerAddedin interfaceDownloadManagerPeerListener
-
peerManagerRemoved
- Specified by:
peerManagerRemovedin interfaceDownloadManagerPeerListener
-
peerAdded
- Specified by:
peerAddedin interfaceDownloadManagerPeerListener
-
peerRemoved
- Specified by:
peerRemovedin interfaceDownloadManagerPeerListener
-
eventOccurred
Description copied from interface:UISWTViewEventListenerTriggers when an even listed in UISWTViewEvent occurs- Specified by:
eventOccurredin interfaceUISWTViewEventListener- Parameters:
event- event that occurred- Returns:
- meaning dependent upon event type
-