Package com.biglybt.ui.swt.views.piece
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 class
private static class
private static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final org.eclipse.swt.graphics.Color[]
private PiecePicker
private int
private int
static final boolean
private DownloadManager
private org.eclipse.swt.graphics.Color
private org.eclipse.swt.graphics.Color
private org.eclipse.swt.graphics.Font
private final int
private org.eclipse.swt.widgets.Label
(package private) org.eclipse.swt.graphics.Image
static final String
private static final String[]
private int
static final String
(package private) PieceMapView.BlockInfo[]
private org.eclipse.swt.widgets.Canvas
private org.eclipse.swt.widgets.Composite
private org.eclipse.swt.custom.ScrolledComposite
private boolean
private int
private boolean
private int
private static final byte
private static final byte
private UISWTView
extents for drawn "0" - "99" can be calculated once and stored until font changesprivate BufferedLabel
private String
private String
Fields inherited from interface com.biglybt.core.peermanager.piecepicker.PiecePickerListener
THING_FORCE_PIECE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
createPeerInfoPanel
(org.eclipse.swt.widgets.Composite parent) private void
dataSourceChanged
(Object newDataSource) private void
delete()
static void
drawDownloadIndicator
(org.eclipse.swt.graphics.GC gcImg, int iXPos, int iYPos, boolean small, int blockFillsize) static void
drawUploadIndicator
(org.eclipse.swt.graphics.GC gcImg, int iXPos, int iYPos, boolean small, int blockFillsize) boolean
eventOccurred
(UISWTViewEvent event) Triggers when an even listed in UISWTViewEvent occursprivate void
private org.eclipse.swt.widgets.Composite
private static String
static org.eclipse.swt.graphics.Color
getLegendColor
(String key) private int
getPieceNumber
(int x, int y) private void
initialize
(org.eclipse.swt.widgets.Composite composite) private static void
private void
obfuscatedImage
(org.eclipse.swt.graphics.Image image) void
void
peerManagerAdded
(PEPeerManager manager) void
peerManagerRemoved
(PEPeerManager manager) void
peerManagerWillBeAdded
(PEPeerManager manager) Called when a peer manager is created but not yet startedvoid
peerRemoved
(PEPeer peer) void
pieceAdded
(PEPiece piece) void
pieceRemoved
(PEPiece piece) private void
refresh()
protected void
protected int
void
selectPieces
(PEPiece... pieces) private void
setTopLableRHS
(Integer... piece_numbers) void
somethingChanged
(PiecePicker pp, int thing, Object data) private void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.core.peermanager.piecepicker.PiecePickerListener
providerAdded, providerAdded, providerRemoved, providerRemoved
Methods inherited from interface com.biglybt.ui.swt.pif.UISWTViewEventListener
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
extents for drawn "0" - "99" can be calculated once and stored until font changes -
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:
somethingChanged
in interfacePiecePickerListener
-
obfuscatedImage
private void obfuscatedImage(org.eclipse.swt.graphics.Image image) -
pieceAdded
- Specified by:
pieceAdded
in interfaceDownloadManagerPieceListener
-
pieceRemoved
- Specified by:
pieceRemoved
in interfaceDownloadManagerPieceListener
-
peerManagerWillBeAdded
Description copied from interface:DownloadManagerPeerListener
Called when a peer manager is created but not yet started- Specified by:
peerManagerWillBeAdded
in interfaceDownloadManagerPeerListener
-
peerManagerAdded
- Specified by:
peerManagerAdded
in interfaceDownloadManagerPeerListener
-
peerManagerRemoved
- Specified by:
peerManagerRemoved
in interfaceDownloadManagerPeerListener
-
peerAdded
- Specified by:
peerAdded
in interfaceDownloadManagerPeerListener
-
peerRemoved
- Specified by:
peerRemoved
in interfaceDownloadManagerPeerListener
-
eventOccurred
Description copied from interface:UISWTViewEventListener
Triggers when an even listed in UISWTViewEvent occurs- Specified by:
eventOccurred
in interfaceUISWTViewEventListener
- Parameters:
event
- event that occurred- Returns:
- meaning dependent upon event type
-