Class TableRowPainted
java.lang.Object
com.biglybt.ui.swt.views.table.impl.TableRowSWTBase
com.biglybt.ui.swt.views.table.painted.TableRowPainted
- All Implemented Interfaces:
TableRow, TableRowCore, TableRowSWT
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CopyOnWriteList<Object[]> private org.eclipse.swt.graphics.Colorprivate Objectprivate static final booleanprivate org.eclipse.swt.graphics.Pointprivate CopyOnWriteList<Object[]> private intprivate booleanprivate booleanprivate final booleanprivate booleanprivate intprivate TableCellSWTBase[]private Object[]private TableRowPainted[]private final Objectprivate intFields inherited from class TableRowSWTBase
DEBUG_ROW_PAINT, lock, mTableCells, wasShownFields inherited from interface TableRowCore
ID_EXPANDOHITAREA, ID_EXPANDOHITCOLUMN -
Constructor Summary
ConstructorsConstructorDescriptionTableRowPainted(TableRowCore parentRow, TableViewPainted tv, Object dataSource) FAKE row constructorTableRowPainted(TableRowCore parentRow, TableViewPainted tv, Object dataSource, boolean triggerHeightChange) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprotected voidvoiddelete()Don't call this directly to delete a row, it won't work - it is for internal use to allow an implementation to take action on deletingprivate voidprivate voidvoidfakeRedraw(String col_name) forces the cell to be refreshed/repainted onto an off-screen area so that any side-effects of the process (e.g.org.eclipse.swt.graphics.Colororg.eclipse.swt.graphics.Rectangleorg.eclipse.swt.graphics.Rectangleorg.eclipse.swt.graphics.Pointprivate static org.eclipse.swt.graphics.GCgetFakeImageGC(org.eclipse.swt.graphics.Rectangle bounds) org.eclipse.swt.graphics.Colorintintintprivate org.eclipse.swt.graphics.FontgetSortColumnCells(String hint) intgetSubRow(int pos) getSubRowsRecursive(boolean includeHidden) private voidgetSubRowsRecursive(List<TableRowCore> result, TableRowCore[] rows, boolean includeHidden) getTableCell(TableColumn column) getTableCell(String field) Retrieve a cell based on its column namegetTableCellCore(String name) Retrieve a cell based on the supplied valuegetTableCellSWT(String name) voidheightChanged(int oldHeight, int newHeight) voidinvalidate(boolean mustRefersh) booleanisHidden()booleanlinkSubItem(int indexOf) voidredraw(boolean doChildren) voidredraw(boolean doChildren, boolean immediateRedraw) booleanrefilter()refresh(boolean bDoGraphics, boolean bVisible) voidremoveSubRow(Object datasource) voidrequestBackgroundColor(TableViewSWT.ColorRequester requester, org.eclipse.swt.graphics.Color color) private voidrequestColor(CopyOnWriteList<Object[]> cow, TableViewSWT.ColorRequester requester, org.eclipse.swt.graphics.Color color) voidrequestForegroundColor(TableViewSWT.ColorRequester requester, org.eclipse.swt.graphics.Color color) voidsetBackgroundImage(org.eclipse.swt.graphics.Image image) booleansetDrawOffset(org.eclipse.swt.graphics.Point drawOffset) voidsetExpanded(boolean b) private voidsetExpanded(boolean b, boolean triggerHeightChange) booleansetHeight(int newHeight) Adjust cell height.booleansetHeight(int newHeight, boolean trigger) booleansetIconSize(org.eclipse.swt.graphics.Point pt) booleansetShown(boolean b, boolean force) voidsetSortColumn(String... columnIDs) voidsetSubItemCount(int length) private voidsetSubItemCount(int length, boolean triggerHeightListener) voidsetSubItems(Object[] datasources) private voidsetSubItems(Object[] datasources, boolean triggerHeightListeners) private voidsetSubRowsHeight(int h) voidsetWidgetSelected(boolean selected) booleansortSubRows(List<TableColumnCore> cols) protected voidsubRowHeightChanged(int oldHeight, int newHeight) private voidswt_fakeRedraw(String col_name) private booleanswt_paintCell(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle cellBounds, TableCellSWTBase cell, org.eclipse.swt.graphics.Color shadowColor, boolean enableColumnBG, boolean enableColumnFG, boolean isAltColor) voidswt_paintGC(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle drawBounds, int rowStartX, int rowStartY, int pos, boolean isTableSelected, boolean isTableEnabled) Methods inherited from class TableRowSWTBase
addMouseListener, canExpand, clearCellFlag, doesAnyCellHaveFlag, getAlpha, getData, getDataSource, getDataSource, getFontStyle, getIndex, getParentRowCore, getTableID, getView, getVisibleRowIndex, invalidate, invokeMouseListeners, isExpanded, isFocused, isMouseOver, isRequestAttention, isRowDisposed, isSelected, isShown, isValid, isVisible, locationChanged, redraw, refresh, removeMouseListener, setAlpha, setCellFlag, setData, setFontStyle, setRequestAttention, setSelected, setTableItem, setUpToDate, setVisibleRowIndex
-
Field Details
-
DEBUG_SUBS
private static final boolean DEBUG_SUBS- See Also:
-
isFake
private final boolean isFake -
drawOffset
private org.eclipse.swt.graphics.Point drawOffset -
numSubItems
private int numSubItems -
subDataSources
-
subRows
-
subRows_sync
-
subRowsHeightUseAccessors
private int subRowsHeightUseAccessors -
sortCells
-
heightUseAccessors
private int heightUseAccessors -
isHidden
private boolean isHidden -
initializing
private boolean initializing -
inPaintItem
private boolean inPaintItem -
colorFG
private org.eclipse.swt.graphics.Color colorFG -
colorLock
-
FGRequesters
-
BGRequesters
-
fake_images
-
-
Constructor Details
-
TableRowPainted
public TableRowPainted(TableRowCore parentRow, TableViewPainted tv, Object dataSource, boolean triggerHeightChange) -
TableRowPainted
FAKE row constructor- Parameters:
parentRow-tv-dataSource-
-
-
Method Details
-
refilter
public boolean refilter() -
isHidden
public boolean isHidden() -
invalidate
public void invalidate(boolean mustRefersh) - Specified by:
invalidatein interfaceTableRowCore- Overrides:
invalidatein classTableRowSWTBase
-
buildCells
private void buildCells() -
destroyCells
private void destroyCells() -
getViewPainted
-
swt_paintGC
public void swt_paintGC(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle drawBounds, int rowStartX, int rowStartY, int pos, boolean isTableSelected, boolean isTableEnabled) - Parameters:
gc- GC to draw todrawBounds- Area that needs redrawingrowStartX- where in the GC this row's x-axis startsrowStartY- where in the GC this row's y-axis startspos-
-
fakeRedraw
Description copied from interface:TableRowCoreforces the cell to be refreshed/repainted onto an off-screen area so that any side-effects of the process (e.g. preferred width) can be updated -
getFakeImageGC
private static org.eclipse.swt.graphics.GC getFakeImageGC(org.eclipse.swt.graphics.Rectangle bounds) -
swt_fakeRedraw
-
isInPaintItem
public boolean isInPaintItem()- Returns:
-
swt_paintCell
private boolean swt_paintCell(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle cellBounds, TableCellSWTBase cell, org.eclipse.swt.graphics.Color shadowColor, boolean enableColumnBG, boolean enableColumnFG, boolean isAltColor) -
getRandomFont
private org.eclipse.swt.graphics.Font getRandomFont() -
refresh
- Specified by:
refreshin interfaceTableRowCore- Overrides:
refreshin classTableRowSWTBase- Returns:
- List of invalid cells
-
redraw
public void redraw(boolean doChildren) -
redraw
public void redraw(boolean doChildren, boolean immediateRedraw) -
debug
-
getBounds
public org.eclipse.swt.graphics.Rectangle getBounds()- Specified by:
getBoundsin interfaceTableRowSWT- Specified by:
getBoundsin classTableRowSWTBase
-
getDrawBounds
public org.eclipse.swt.graphics.Rectangle getDrawBounds() -
getFullHeight
public int getFullHeight() -
getDrawOffset
public org.eclipse.swt.graphics.Point getDrawOffset() -
heightChanged
public void heightChanged(int oldHeight, int newHeight) -
setSubRowsHeight
private void setSubRowsHeight(int h) -
subRowHeightChanged
protected void subRowHeightChanged(int oldHeight, int newHeight) -
setDrawOffset
public boolean setDrawOffset(org.eclipse.swt.graphics.Point drawOffset) -
setWidgetSelected
public void setWidgetSelected(boolean selected) - Specified by:
setWidgetSelectedin interfaceTableRowSWT- Specified by:
setWidgetSelectedin classTableRowSWTBase- Parameters:
selected-
-
setShown
public boolean setShown(boolean b, boolean force) - Specified by:
setShownin interfaceTableRowCore- Overrides:
setShownin classTableRowSWTBase- Parameters:
b-force-- Returns:
- true: changed
-
delete
public void delete()Description copied from interface:TableRowCoreDon't call this directly to delete a row, it won't work - it is for internal use to allow an implementation to take action on deleting- Specified by:
deletein interfaceTableRowCore- Overrides:
deletein classTableRowSWTBase
-
deleteExistingSubRows
private void deleteExistingSubRows() -
setSubItemCount
public void setSubItemCount(int length) - Parameters:
length-
-
setSubItemCount
private void setSubItemCount(int length, boolean triggerHeightListener) -
getSubItemCount
public int getSubItemCount() -
linkSubItem
- Parameters:
indexOf-- Returns:
-
setSubItems
- Parameters:
datasources-
-
setSubItems
-
getSubRowsWithNull
-
getSubRowsRecursive
-
getSubRowsRecursive
private void getSubRowsRecursive(List<TableRowCore> result, TableRowCore[] rows, boolean includeHidden) -
removeSubRow
-
setExpanded
public void setExpanded(boolean b) - Specified by:
setExpandedin interfaceTableRowCore- Overrides:
setExpandedin classTableRowSWTBase
-
setExpanded
private void setExpanded(boolean b, boolean triggerHeightChange) -
getSubRow
-
getForeground
public org.eclipse.swt.graphics.Color getForeground()- Specified by:
getForegroundin interfaceTableRowSWT- Specified by:
getForegroundin classTableRowSWTBase
-
getBackground
public org.eclipse.swt.graphics.Color getBackground()- Specified by:
getBackgroundin interfaceTableRowSWT- Specified by:
getBackgroundin classTableRowSWTBase
-
requestForegroundColor
public void requestForegroundColor(TableViewSWT.ColorRequester requester, org.eclipse.swt.graphics.Color color) -
requestBackgroundColor
public void requestBackgroundColor(TableViewSWT.ColorRequester requester, org.eclipse.swt.graphics.Color color) -
requestColor
private void requestColor(CopyOnWriteList<Object[]> cow, TableViewSWT.ColorRequester requester, org.eclipse.swt.graphics.Color color) -
setBackgroundImage
public void setBackgroundImage(org.eclipse.swt.graphics.Image image) - Specified by:
setBackgroundImagein interfaceTableRowSWT- Specified by:
setBackgroundImagein classTableRowSWTBase
-
setIconSize
public boolean setIconSize(org.eclipse.swt.graphics.Point pt) - Specified by:
setIconSizein interfaceTableRowSWT- Specified by:
setIconSizein classTableRowSWTBase
-
getHeight
public int getHeight() -
setHeight
public boolean setHeight(int newHeight) Description copied from interface:TableRowCoreAdjust cell height. Don't use if any other column/cell uses setImage()- Parameters:
newHeight- new Row Height. Will not reduce row's height (SWT)- Returns:
- success level
-
setHeight
public boolean setHeight(int newHeight, boolean trigger) -
getLineHeight
public int getLineHeight()- Returns:
- Height in px of one standard line of text.
# of rows of text can be calculated by usingTableRowCore.getHeight()/TableRowCore.getLineHeight()
-
getTableCellCore
Description copied from interface:TableRowCoreRetrieve a cell based on the supplied value- Specified by:
getTableCellCorein interfaceTableRowCore- Overrides:
getTableCellCorein classTableRowSWTBase- Parameters:
name- Column name of the cell to be returned- Returns:
- TableCellCore object related to this row and the specified column
-
getTableCell
-
getTableCellSWT
- Specified by:
getTableCellSWTin interfaceTableRowSWT- Overrides:
getTableCellSWTin classTableRowSWTBase- Parameters:
name-- Returns:
-
getTableCell
Description copied from interface:TableRowRetrieve a cell based on its column name- Specified by:
getTableCellin interfaceTableRow- Overrides:
getTableCellin classTableRowSWTBase- Parameters:
field- Name/ID of column- Returns:
- TableCell object related to this row and the column specified
-
getSortColumnCells
-
setSortColumn
-
sortSubRows
-