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
,java.lang.Comparable
public class TableCellPainted extends TableCellSWTBase
-
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.swt.graphics.Rectangle
bounds
private org.eclipse.swt.graphics.Color
colorFG
private static boolean
DEBUG_CELLPAINT
private int
marginHeight
private int
marginWidth
private boolean
redrawScheduled
private java.lang.String
text
-
Fields inherited from class com.biglybt.ui.swt.views.table.impl.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, tableRowSWT
-
Fields inherited from interface com.biglybt.ui.common.table.TableCellCore
TOOLTIPLISTENER_HOVER, TOOLTIPLISTENER_HOVERCOMPLETE
-
-
Constructor Summary
Constructors Constructor Description TableCellPainted(TableRowPainted row, TableColumnPainted column, int pos)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
constructionCompleter()
Graphic
getBackgroundGraphic()
Returns a Graphic of what's behind the cellorg.eclipse.swt.graphics.Image
getBackgroundImage()
org.eclipse.swt.graphics.Color
getBackgroundSWT()
org.eclipse.swt.graphics.Rectangle
getBounds()
org.eclipse.swt.graphics.Rectangle
getBoundsOnDisplay()
org.eclipse.swt.graphics.Rectangle
getBoundsRaw()
java.lang.Object
getDataSource()
Retrieve the data object associated with the current table row and cell.org.eclipse.swt.graphics.Color
getForegroundSWT()
int
getHeight()
Retrieve the height of the cell's drawing area (excluding any margin) for TableColumn objects of TYPE_GRAPHIC only.int
getMarginHeight()
int
getMarginWidth()
int
getMaxLines()
Retrieves the number of lines available for setting textorg.eclipse.swt.graphics.Point
getSize()
java.lang.Comparable<?>
getSortValue()
Retrieves the sorting valueTableColumn
getTableColumn()
Retreive the TableColumn that this cell belongs tojava.lang.String
getTableID()
Returns which table the cell is being displayed in.TableRow
getTableRow()
Retrieve the TableRow that this cell belongs tojava.lang.String
getText()
Retrieve the Cell's textint
getWidth()
Retrieve the width of the cell's drawing area (excluding any margin) for TableColumn objects of TYPE_GRAPHIC only.int
getWidthRaw()
boolean
isShown()
Determines if the user has chosen to display the cellvoid
locationChanged()
Location of the cell has changedvoid
redraw()
void
setBoundsRaw(org.eclipse.swt.graphics.Rectangle bounds)
boolean
setCursorID(int cursorID)
Set the cursor ID that should be used for the cellboolean
setForeground(org.eclipse.swt.graphics.Color color)
Change the cell's foreground color.void
setMarginHeight(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.void
setMarginWidth(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 boolean
stringEquals(java.lang.String s0, java.lang.String s1)
boolean
uiSetText(java.lang.String text)
-
Methods inherited from class com.biglybt.ui.swt.views.table.impl.TableCellSWTBase
addDisposeListener, addListeners, addMouseListener, addMouseMoveListener, addRefreshListener, addToolTipListener, addVisibilityListener, clearFlag, clearVisuallyChangedSinceRefresh, compareTo, constructionComplete, debug, dispose, doPaint, getBackground, getClipboardText, getCursorID, getData, getDefaultToolTip, getFillCell, getForeground, getGraphic, getGraphicSWT, getIcon, getMouseOffset, getObfuscatedText, getTableColumnCore, getTableColumnSWT, getTableRowCore, getTableRowSWT, getTextAlpha, getToolTip, getVisuallyChangedSinceRefresh, hasFlag, invalidate, invalidate, invokeMouseListeners, invokeSWTPaintListeners, invokeToolTipListeners, invokeVisibilityListeners, isDisposed, isInvisibleAndCanRefresh, isMouseOver, isUpToDate, isValid, needsPainting, pluginError, pluginError, refresh, refresh, refresh, refresh, refreshAsync, removeDisposeListener, removeMouseListener, removeMouseMoveListener, removeRefreshListener, removeToolTipListener, removeVisibilityListener, setData, setDefaultToolTip, setFillCell, setFlag, setForeground, setForeground, setForegroundToErrorColor, setGraphic, setGraphic, setIcon, setMouseOver, setSortValue, setSortValue, setSortValue, setText, setTextAlpha, setToolTip, setUpToDate, useSimpleSortValue
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.biglybt.pif.ui.tables.TableCell
isSecondarySortEnabled
-
-
-
-
Field Detail
-
DEBUG_CELLPAINT
private static final boolean DEBUG_CELLPAINT
- See Also:
- Constant Field Values
-
bounds
private org.eclipse.swt.graphics.Rectangle bounds
-
text
private java.lang.String text
-
marginWidth
private int marginWidth
-
marginHeight
private int marginHeight
-
redrawScheduled
private boolean redrawScheduled
-
colorFG
private org.eclipse.swt.graphics.Color colorFG
-
-
Constructor Detail
-
TableCellPainted
public TableCellPainted(TableRowPainted row, TableColumnPainted column, int pos)
-
-
Method Detail
-
constructionCompleter
protected void constructionCompleter()
- Specified by:
constructionCompleter
in classTableCellSWTBase
-
getDataSource
public java.lang.Object getDataSource()
Description copied from interface:TableCell
Retrieve 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_*:Download
object for the current row
TABLE_TORRENT_PEERS:Peer
object for the current row
TABLE_TORRENT_FILES:DiskManagerFileInfo
object for the current row
TABLE_MYTRACKER:TrackerTorrent
object for the current row
TABLE_MYSHARES:ShareResource
object for the current row
remaining TABLE_* constants: undefined or null
-
getTableColumn
public TableColumn getTableColumn()
Description copied from interface:TableCell
Retreive the TableColumn that this cell belongs to- Returns:
- this cell's TableColumn
-
getTableRow
public TableRow getTableRow()
Description copied from interface:TableCell
Retrieve the TableRow that this cell belongs to- Returns:
- this cell's TableRow
-
getTableID
public java.lang.String getTableID()
Description copied from interface:TableCell
Returns which table the cell is being displayed in.- Returns:
TableManager
.TABLE_* constant
-
stringEquals
public static boolean stringEquals(java.lang.String s0, java.lang.String s1)
-
getText
public java.lang.String getText()
Description copied from interface:TableCell
Retrieve the Cell's text- Returns:
- Cell's text
-
getSortValue
public java.lang.Comparable<?> getSortValue()
Description copied from interface:TableCell
Retrieves the sorting value- Specified by:
getSortValue
in interfaceTableCell
- Overrides:
getSortValue
in classTableCellSWTBase
- Returns:
- Object that will be sorted on
-
isShown
public boolean isShown()
Description copied from interface:TableCell
Determines 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:TableCell
Retrieves the number of lines available for setting text- Returns:
- # of lines available, -1 if unknown
-
getWidth
public int getWidth()
Description copied from interface:TableCell
Retrieve 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:
getWidthRaw
in classTableCellSWTBase
-
getHeight
public int getHeight()
Description copied from interface:TableCell
Retrieve 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:TableCell
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.The default is 1.
- Parameters:
height
- new margin height
-
getMarginWidth
public int getMarginWidth()
- Returns:
-
setMarginWidth
public void setMarginWidth(int width)
Description copied from interface:TableCell
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.The default is 1.
- Parameters:
width
- new margin width
-
getBackgroundGraphic
public Graphic getBackgroundGraphic()
Description copied from interface:TableCell
Returns a Graphic of what's behind the cell- Returns:
-
locationChanged
public void locationChanged()
Description copied from interface:TableCellCore
Location of the cell has changed
-
setCursorID
public boolean setCursorID(int cursorID)
Description copied from interface:TableCellCore
Set the cursor ID that should be used for the cell- Specified by:
setCursorID
in interfaceTableCellCore
- Overrides:
setCursorID
in classTableCellSWTBase
- Returns:
- changed
-
redraw
public void redraw()
-
setForeground
public boolean setForeground(org.eclipse.swt.graphics.Color color)
Description copied from interface:TableCellSWT
Change 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
public boolean uiSetText(java.lang.String text)
- Specified by:
uiSetText
in classTableCellSWTBase
-
-