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.Color
private Object
private static final boolean
private org.eclipse.swt.graphics.Point
private CopyOnWriteList<Object[]>
private int
private boolean
private boolean
private final boolean
private boolean
private int
private TableCellSWTBase[]
private Object[]
private TableRowPainted[]
private final Object
private int
Fields inherited from class com.biglybt.ui.swt.views.table.impl.TableRowSWTBase
DEBUG_ROW_PAINT, lock, mTableCells, wasShown
Fields inherited from interface com.biglybt.ui.common.table.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 void
protected void
void
delete()
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 void
private void
void
fakeRedraw
(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.Color
org.eclipse.swt.graphics.Rectangle
org.eclipse.swt.graphics.Rectangle
org.eclipse.swt.graphics.Point
org.eclipse.swt.graphics.Color
int
int
int
private org.eclipse.swt.graphics.Font
getSortColumnCells
(String hint) int
getSubRow
(int pos) getSubRowsRecursive
(boolean includeHidden) private void
getSubRowsRecursive
(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) void
heightChanged
(int oldHeight, int newHeight) void
invalidate
(boolean mustRefersh) boolean
isHidden()
boolean
linkSubItem
(int indexOf) void
redraw
(boolean doChildren) void
redraw
(boolean doChildren, boolean immediateRedraw) boolean
refilter()
refresh
(boolean bDoGraphics, boolean bVisible) void
removeSubRow
(Object datasource) void
requestBackgroundColor
(TableViewSWT.ColorRequester requester, org.eclipse.swt.graphics.Color color) private void
requestColor
(CopyOnWriteList<Object[]> cow, TableViewSWT.ColorRequester requester, org.eclipse.swt.graphics.Color color) void
requestForegroundColor
(TableViewSWT.ColorRequester requester, org.eclipse.swt.graphics.Color color) void
setBackgroundImage
(org.eclipse.swt.graphics.Image image) boolean
setDrawOffset
(org.eclipse.swt.graphics.Point drawOffset) void
setExpanded
(boolean b) private void
setExpanded
(boolean b, boolean triggerHeightChange) boolean
setHeight
(int newHeight) Adjust cell height.boolean
setHeight
(int newHeight, boolean trigger) boolean
setIconSize
(org.eclipse.swt.graphics.Point pt) boolean
setShown
(boolean b, boolean force) void
setSortColumn
(String... columnIDs) void
setSubItemCount
(int length) private void
setSubItemCount
(int length, boolean triggerHeightListener) void
setSubItems
(Object[] datasources) private void
setSubItems
(Object[] datasources, boolean triggerHeightListeners) private void
setSubRowsHeight
(int h) void
setWidgetSelected
(boolean selected) boolean
protected void
subRowHeightChanged
(int oldHeight, int newHeight) private void
swt_fakeRedraw
(String col_name) 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) 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) Methods inherited from class com.biglybt.ui.swt.views.table.impl.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
-
-
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:
invalidate
in interfaceTableRowCore
- Overrides:
invalidate
in 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:TableRowCore
forces 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 -
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:
refresh
in interfaceTableRowCore
- Overrides:
refresh
in 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:
getBounds
in interfaceTableRowSWT
- Specified by:
getBounds
in 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:
setWidgetSelected
in interfaceTableRowSWT
- Specified by:
setWidgetSelected
in classTableRowSWTBase
-
setShown
public boolean setShown(boolean b, boolean force) - Specified by:
setShown
in interfaceTableRowSWT
- Overrides:
setShown
in classTableRowSWTBase
- Returns:
- true: changed
-
delete
public void delete()Description copied from interface:TableRowCore
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 deleting- Specified by:
delete
in interfaceTableRowCore
- Overrides:
delete
in classTableRowSWTBase
-
deleteExistingSubRows
private void deleteExistingSubRows() -
setSubItemCount
public void setSubItemCount(int length) -
setSubItemCount
private void setSubItemCount(int length, boolean triggerHeightListener) -
getSubItemCount
public int getSubItemCount() -
linkSubItem
- Returns:
-
setSubItems
-
setSubItems
-
getSubRowsWithNull
-
getSubRowsRecursive
-
getSubRowsRecursive
private void getSubRowsRecursive(List<TableRowCore> result, TableRowCore[] rows, boolean includeHidden) -
removeSubRow
-
setExpanded
public void setExpanded(boolean b) - Specified by:
setExpanded
in interfaceTableRowCore
- Overrides:
setExpanded
in classTableRowSWTBase
-
setExpanded
private void setExpanded(boolean b, boolean triggerHeightChange) -
getSubRow
-
getForeground
public org.eclipse.swt.graphics.Color getForeground()- Specified by:
getForeground
in interfaceTableRowSWT
- Specified by:
getForeground
in classTableRowSWTBase
-
getBackground
public org.eclipse.swt.graphics.Color getBackground()- Specified by:
getBackground
in interfaceTableRowSWT
- Specified by:
getBackground
in 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:
setBackgroundImage
in interfaceTableRowSWT
- Specified by:
setBackgroundImage
in classTableRowSWTBase
-
setIconSize
public boolean setIconSize(org.eclipse.swt.graphics.Point pt) - Specified by:
setIconSize
in interfaceTableRowSWT
- Specified by:
setIconSize
in classTableRowSWTBase
-
getHeight
public int getHeight() -
setHeight
public boolean setHeight(int newHeight) Description copied from interface:TableRowCore
Adjust 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:TableRowCore
Retrieve a cell based on the supplied value- Specified by:
getTableCellCore
in interfaceTableRowCore
- Overrides:
getTableCellCore
in 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:
getTableCellSWT
in interfaceTableRowSWT
- Overrides:
getTableCellSWT
in classTableRowSWTBase
- Returns:
-
getTableCell
Description copied from interface:TableRow
Retrieve a cell based on its column name- Specified by:
getTableCell
in interfaceTableRow
- Overrides:
getTableCell
in classTableRowSWTBase
- Parameters:
field
- Name/ID of column- Returns:
- TableCell object related to this row and the column specified
-
getSortColumnCells
-
setSortColumn
-
sortSubRows
-