Class TableCellPainted
java.lang.Object
com.biglybt.ui.swt.views.table.impl.TableCellSWTBase
com.biglybt.ui.swt.views.table.painted.TableCellPainted
- All Implemented Interfaces:
TableCell, TableCellCore, TableCellSWT, Comparable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.eclipse.swt.graphics.Rectangleprivate org.eclipse.swt.graphics.Colorprivate static final booleanprivate intprivate intprivate booleanprivate StringInterner.StringSupplierFields inherited from class TableCellSWTBase
bDebug, cellSWTPaintListeners, FLAG_DISPOSED, FLAG_MUSTREFRESH, FLAG_SORTVALUEISTEXT, FLAG_TOOLTIPISAUTO, FLAG_UPTODATE, FLAG_VALID, FLAG_VISUALLY_CHANGED_SINCE_REFRESH, MAX_REFRESHES, numFastRefreshes, refreshListeners, sortValue, tableColumnCore, tableColumnSWT, tableRowSWTFields inherited from interface TableCellCore
TOOLTIPLISTENER_HOVER, TOOLTIPLISTENER_HOVERCOMPLETE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidReturns a Graphic of what's behind the cellorg.eclipse.swt.graphics.Imageorg.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Rectangleorg.eclipse.swt.graphics.Rectangleorg.eclipse.swt.graphics.RectangleRetrieve the data object associated with the current table row and cell.org.eclipse.swt.graphics.ColorintRetrieve the height of the cell's drawing area (excluding any margin) for TableColumn objects of TYPE_GRAPHIC only.intintintRetrieves the number of lines available for setting textorg.eclipse.swt.graphics.PointgetSize()Comparable<?> Retrieves the sorting valueRetreive the TableColumn that this cell belongs toReturns which table the cell is being displayed in.Retrieve the TableRow that this cell belongs togetText()Retrieve the Cell's textintgetWidth()Retrieve the width of the cell's drawing area (excluding any margin) for TableColumn objects of TYPE_GRAPHIC only.intbooleanisShown()Determines if the user has chosen to display the cellvoidLocation of the cell has changedvoidredraw()voidsetBoundsRaw(org.eclipse.swt.graphics.Rectangle bounds) booleansetCursorID(int cursorID) Set the cursor ID that should be used for the cellbooleansetForeground(org.eclipse.swt.graphics.Color color) Change the cell's foreground color.voidsetMarginHeight(int height) Specifies the number of pixels of vertical margin that will be placed along the top and bottom edges of the layout for TableColumn objects of TYPE_GRAPHIC only.voidsetMarginWidth(int width) Specifies the number of pixels of horizontal margin that will be placed along the left and right edges of the layout for TableColumn object of TYPE_GRAPHIC only.static booleanbooleanMethods inherited from class TableCellSWTBase
addDisposeListener, addListeners, addMenuListener, addMouseListener, addMouseMoveListener, addRefreshListener, addToolTipListener, addVisibilityListener, clearFlag, clearVisuallyChangedSinceRefresh, compareTo, constructionComplete, debug, dispose, doPaint, getBackground, getClipboardText, getCursorID, getData, getDefaultToolTip, getFillCell, getForeground, getGraphic, getGraphicSWT, getIcon, getMouseOffset, getNumeric, getObfuscatedText, getTableColumnCore, getTableColumnSWT, getTableRowCore, getTableRowSWT, getTextAlpha, getTextEquivalent, getToolTip, getVisuallyChangedSinceRefresh, hasFlag, invalidate, invalidate, invokeMenuListeners, invokeMouseListeners, invokeSWTPaintListeners, invokeToolTipListeners, invokeVisibilityListeners, isDisposed, isInvisibleAndCanRefresh, isMouseOver, isUpToDate, isValid, needsPainting, pluginError, pluginError, refresh, refresh, refresh, refresh, refreshAsync, removeDisposeListener, removeMenuListener, removeMouseListener, removeMouseMoveListener, removeRefreshListener, removeToolTipListener, removeVisibilityListener, setData, setDefaultToolTip, setFillCell, setFlag, setForeground, setForeground, setForegroundToErrorColor, setGraphic, setGraphic, setIcon, setMouseOver, setNumeric, setSortValue, setSortValue, setSortValue, setText, setText, setTextAlpha, setTextEquivalent, setToolTip, setUpToDate, useSimpleSortValueMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TableCell
isSecondarySortEnabled
-
Field Details
-
DEBUG_CELLPAINT
private static final boolean DEBUG_CELLPAINT- See Also:
-
bounds
private org.eclipse.swt.graphics.Rectangle bounds -
text
-
marginWidth
private int marginWidth -
marginHeight
private int marginHeight -
redrawScheduled
private boolean redrawScheduled -
colorFG
private org.eclipse.swt.graphics.Color colorFG
-
-
Constructor Details
-
TableCellPainted
-
-
Method Details
-
constructionCompleter
protected void constructionCompleter()- Specified by:
constructionCompleterin classTableCellSWTBase
-
getDataSource
Description copied from interface:TableCellRetrieve the data object associated with the current table row and cell. The results of this method MUST NOT BE CACHED. The link between a table cell and a DataSource is not persistent and can change from call to call (for example when the table is re-ordered, the link may be modified)- Returns:
- The return type is dependent upon which table the cell is for:
TABLE_MYTORRENTS_*:Downloadobject for the current row
TABLE_TORRENT_PEERS:Peerobject for the current row
TABLE_TORRENT_FILES:DiskManagerFileInfoobject for the current row
TABLE_MYTRACKER:TrackerTorrentobject for the current row
TABLE_MYSHARES:ShareResourceobject for the current row
remaining TABLE_* constants: undefined or null
-
getTableColumn
Description copied from interface:TableCellRetreive the TableColumn that this cell belongs to- Returns:
- this cell's TableColumn
-
getTableRow
-
getTableID
Description copied from interface:TableCellReturns which table the cell is being displayed in.- Returns:
TableManager.TABLE_* constant
-
stringEquals
public static boolean stringEquals(StringInterner.StringSupplier s0, StringInterner.StringSupplier s1) -
getText
-
getSortValue
Description copied from interface:TableCellRetrieves the sorting value- Specified by:
getSortValuein interfaceTableCell- Overrides:
getSortValuein classTableCellSWTBase- Returns:
- Object that will be sorted on
-
isShown
public boolean isShown()Description copied from interface:TableCellDetermines if the user has chosen to display the cell- Returns:
- True - User has chosen to display cell
-
getMaxLines
public int getMaxLines()Description copied from interface:TableCellRetrieves the number of lines available for setting text- Returns:
- # of lines available, -1 if unknown
-
getWidth
public int getWidth()Description copied from interface:TableCellRetrieve the width of the cell's drawing area (excluding any margin) for TableColumn objects of TYPE_GRAPHIC only.- Returns:
- if you are filling the cell, this is the width your image should be
-
getWidthRaw
public int getWidthRaw()- Specified by:
getWidthRawin classTableCellSWTBase
-
getHeight
public int getHeight()Description copied from interface:TableCellRetrieve the height of the cell's drawing area (excluding any margin) for TableColumn objects of TYPE_GRAPHIC only.- Returns:
- if you are filling the cell, this is the height your image should be
-
getMarginHeight
public int getMarginHeight()- Returns:
-
setMarginHeight
public void setMarginHeight(int height) Description copied from interface:TableCellSpecifies the number of pixels of vertical margin that will be placed along the top and bottom edges of the layout for TableColumn objects of TYPE_GRAPHIC only.The default is 1.
- Parameters:
height- new margin height
-
getMarginWidth
public int getMarginWidth()- Returns:
-
setMarginWidth
public void setMarginWidth(int width) Description copied from interface:TableCellSpecifies the number of pixels of horizontal margin that will be placed along the left and right edges of the layout for TableColumn object of TYPE_GRAPHIC only.The default is 1.
- Parameters:
width- new margin width
-
getBackgroundGraphic
-
locationChanged
public void locationChanged()Description copied from interface:TableCellCoreLocation of the cell has changed -
setCursorID
public boolean setCursorID(int cursorID) Description copied from interface:TableCellCoreSet the cursor ID that should be used for the cell- Specified by:
setCursorIDin interfaceTableCellCore- Overrides:
setCursorIDin classTableCellSWTBase- Returns:
- changed
-
redraw
public void redraw() -
setForeground
public boolean setForeground(org.eclipse.swt.graphics.Color color) Description copied from interface:TableCellSWTChange the cell's foreground color. NOTE: favor (R, G, B)- Parameters:
color- SWT Color object.- Returns:
- True - Color changed.
False - Color was already set.
-
getSize
public org.eclipse.swt.graphics.Point getSize() -
getBounds
public org.eclipse.swt.graphics.Rectangle getBounds() -
getBoundsRaw
public org.eclipse.swt.graphics.Rectangle getBoundsRaw() -
getBoundsOnDisplay
public org.eclipse.swt.graphics.Rectangle getBoundsOnDisplay() -
getBackgroundImage
public org.eclipse.swt.graphics.Image getBackgroundImage()- Returns:
-
getForegroundSWT
public org.eclipse.swt.graphics.Color getForegroundSWT()- Returns:
-
getBackgroundSWT
public org.eclipse.swt.graphics.Color getBackgroundSWT()- Returns:
-
setBoundsRaw
public void setBoundsRaw(org.eclipse.swt.graphics.Rectangle bounds) -
uiSetText
- Specified by:
uiSetTextin classTableCellSWTBase
-
getTextSupplier
-