Package com.biglybt.ui.swt.views.piece
Class PieceInfoView
- java.lang.Object
-
- com.biglybt.ui.swt.views.piece.PieceInfoView
-
- All Implemented Interfaces:
DownloadManagerPeerListener
,DownloadManagerPieceListener
,PiecePickerListener
,UISWTViewEventListener
,UISWTViewCoreEventListener
public class PieceInfoView extends java.lang.Object implements DownloadManagerPieceListener, DownloadManagerPeerListener, PiecePickerListener, UISWTViewCoreEventListener
Piece Map View.This view is placed within the
PiecesView
even though it relies on aDownloadManager
datasource instead of aPEPiece
Also placed in Library views
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
PieceInfoView.BlockInfo
private static class
PieceInfoView.DoNothingListener
private static class
PieceInfoView.SelectionListenerForcePiece
private static class
PieceInfoView.SelectionListenerResetPiece
-
Field Summary
Fields Modifier and Type Field Description private boolean
alreadyFilling
private static int
BLOCK_FILLSIZE
private static int
BLOCK_SIZE
private static int
BLOCK_SPACING
private static int
BLOCKCOLOR_AVAILCOUNT
private static int
BLOCKCOLOR_FORCED
private static int
BLOCKCOLOR_HAVE
private static int
BLOCKCOLOR_MERGE_READ
private static int
BLOCKCOLOR_MERGE_WRITE
private static int
BLOCKCOLOR_NEXT
private static int
BLOCKCOLOR_NOHAVE
private static int
BLOCKCOLOR_SHOWFILE
private static int
BLOCKCOLOR_TRANSFER
private static org.eclipse.swt.graphics.Color[]
blockColors
private PiecePicker
current_pp
private int
currentNumColumns
private int
currentNumPieces
private DownloadManager
dlm
private org.eclipse.swt.graphics.Color
file_color
private org.eclipse.swt.graphics.Color
file_color_faded
private org.eclipse.swt.graphics.Font
font
private int
graphicsUpdate
private org.eclipse.swt.widgets.Label
imageLabel
(package private) org.eclipse.swt.graphics.Image
img
static java.lang.String
KEY_INSTANCE
private static java.lang.String[]
legendKeys
private int
loopFactor
static int
MAX_PIECE_CACHE
static java.lang.String
MSGID_PREFIX
(package private) PieceInfoView.BlockInfo[]
oldBlockInfo
(package private) int
oldBlockInfoStart
private org.eclipse.swt.widgets.Canvas
pieceInfoCanvas
private org.eclipse.swt.widgets.Composite
pieceInfoComposite
private org.eclipse.swt.custom.ScrolledComposite
sc
private boolean
scrollPending
private int
selectedPiece
private java.util.List<java.lang.Integer>
selectedPieceExplicit
private boolean
selectedPieceShowFile
private int
selectedPieceShowFilePending
private static byte
SHOW_BIG
private static byte
SHOW_SMALL
private UISWTView
swtView
private BufferedLabel
topLabel
private java.lang.String
topLabelLHS
private java.lang.String
topLabelRHS
-
Fields inherited from interface com.biglybt.core.peermanager.piecepicker.PiecePickerListener
THING_FORCE_PIECE
-
-
Constructor Summary
Constructors Constructor Description PieceInfoView()
Initialize
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
createPeerInfoPanel(org.eclipse.swt.widgets.Composite parent)
private void
dataSourceChanged(java.lang.Object newDataSource)
private void
delete()
private static void
drawDownloadIndicator(org.eclipse.swt.graphics.GC gcImg, int iXPos, int iYPos, boolean small)
private static void
drawUploadIndicator(org.eclipse.swt.graphics.GC gcImg, int iXPos, int iYPos, boolean small)
boolean
eventOccurred(UISWTViewEvent event)
Triggers when an even listed in UISWTViewEvent occursprivate void
fillPieceInfoSection()
private org.eclipse.swt.widgets.Composite
getComposite()
private static java.lang.String
getFullTitle()
static org.eclipse.swt.graphics.Color
getLegendColor(java.lang.String key)
private int
getPieceNumber(int x, int y)
private void
initialize(org.eclipse.swt.widgets.Composite composite)
private void
obfuscatedImage(org.eclipse.swt.graphics.Image image)
void
peerAdded(PEPeer peer)
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
refreshInfoCanvas()
protected int
refreshInfoCanvasSupport()
void
selectPieces(PEPiece... pieces)
private void
setTopLableRHS(java.lang.Integer... piece_numbers)
void
somethingChanged(PiecePicker pp, int thing, java.lang.Object data)
private void
updateTopLabel()
-
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
-
-
-
-
Field Detail
-
KEY_INSTANCE
public static final java.lang.String KEY_INSTANCE
- See Also:
- Constant Field Values
-
BLOCK_FILLSIZE
private static final int BLOCK_FILLSIZE
- See Also:
- Constant Field Values
-
BLOCK_SPACING
private static final int BLOCK_SPACING
- See Also:
- Constant Field Values
-
BLOCK_SIZE
private static final int BLOCK_SIZE
- See Also:
- Constant Field Values
-
BLOCKCOLOR_HAVE
private static final int BLOCKCOLOR_HAVE
- See Also:
- Constant Field Values
-
BLOCKCOLOR_NOHAVE
private static final int BLOCKCOLOR_NOHAVE
- See Also:
- Constant Field Values
-
BLOCKCOLOR_TRANSFER
private static final int BLOCKCOLOR_TRANSFER
- See Also:
- Constant Field Values
-
BLOCKCOLOR_NEXT
private static final int BLOCKCOLOR_NEXT
- See Also:
- Constant Field Values
-
BLOCKCOLOR_AVAILCOUNT
private static final int BLOCKCOLOR_AVAILCOUNT
- See Also:
- Constant Field Values
-
BLOCKCOLOR_SHOWFILE
private static final int BLOCKCOLOR_SHOWFILE
- See Also:
- Constant Field Values
-
BLOCKCOLOR_MERGE_READ
private static final int BLOCKCOLOR_MERGE_READ
- See Also:
- Constant Field Values
-
BLOCKCOLOR_MERGE_WRITE
private static final int BLOCKCOLOR_MERGE_WRITE
- See Also:
- Constant Field Values
-
BLOCKCOLOR_FORCED
private static final int BLOCKCOLOR_FORCED
- See Also:
- Constant Field Values
-
MSGID_PREFIX
public static final java.lang.String MSGID_PREFIX
- See Also:
- Constant Field Values
-
SHOW_BIG
private static final byte SHOW_BIG
- See Also:
- Constant Field Values
-
SHOW_SMALL
private static final byte SHOW_SMALL
- See Also:
- Constant Field Values
-
MAX_PIECE_CACHE
public static final int MAX_PIECE_CACHE
- See Also:
- Constant Field Values
-
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 java.lang.String[] legendKeys
-
topLabel
private BufferedLabel topLabel
-
topLabelLHS
private java.lang.String topLabelLHS
-
topLabelRHS
private java.lang.String topLabelRHS
-
selectedPieceExplicit
private java.util.List<java.lang.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
PieceInfoView.BlockInfo[] oldBlockInfo
-
oldBlockInfoStart
int oldBlockInfoStart
-
alreadyFilling
private boolean alreadyFilling
-
swtView
private UISWTView swtView
-
-
Method Detail
-
getLegendColor
public static org.eclipse.swt.graphics.Color getLegendColor(java.lang.String key)
-
dataSourceChanged
private void dataSourceChanged(java.lang.Object newDataSource)
-
getFullTitle
private static java.lang.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(java.lang.Integer... piece_numbers)
-
updateTopLabel
private void updateTopLabel()
-
refreshInfoCanvas
protected void refreshInfoCanvas()
-
refreshInfoCanvasSupport
protected int refreshInfoCanvasSupport()
-
drawDownloadIndicator
private static void drawDownloadIndicator(org.eclipse.swt.graphics.GC gcImg, int iXPos, int iYPos, boolean small)
-
drawUploadIndicator
private static void drawUploadIndicator(org.eclipse.swt.graphics.GC gcImg, int iXPos, int iYPos, boolean small)
-
getComposite
private org.eclipse.swt.widgets.Composite getComposite()
-
delete
private void delete()
-
somethingChanged
public void somethingChanged(PiecePicker pp, int thing, java.lang.Object data)
- Specified by:
somethingChanged
in interfacePiecePickerListener
-
obfuscatedImage
private void obfuscatedImage(org.eclipse.swt.graphics.Image image)
-
pieceAdded
public void pieceAdded(PEPiece piece)
- Specified by:
pieceAdded
in interfaceDownloadManagerPieceListener
-
pieceRemoved
public void pieceRemoved(PEPiece piece)
- Specified by:
pieceRemoved
in interfaceDownloadManagerPieceListener
-
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 interfaceDownloadManagerPeerListener
-
peerManagerAdded
public void peerManagerAdded(PEPeerManager manager)
- Specified by:
peerManagerAdded
in interfaceDownloadManagerPeerListener
-
peerManagerRemoved
public void peerManagerRemoved(PEPeerManager manager)
- Specified by:
peerManagerRemoved
in interfaceDownloadManagerPeerListener
-
peerAdded
public void peerAdded(PEPeer peer)
- Specified by:
peerAdded
in interfaceDownloadManagerPeerListener
-
peerRemoved
public void peerRemoved(PEPeer peer)
- Specified by:
peerRemoved
in interfaceDownloadManagerPeerListener
-
eventOccurred
public boolean eventOccurred(UISWTViewEvent event)
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
-
-