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
public class TableRowPainted extends TableRowSWTBase
-
-
Field Summary
Fields Modifier and Type Field Description private CopyOnWriteList<java.lang.Object[]>
BGRequesters
private org.eclipse.swt.graphics.Color
colorFG
private java.lang.Object
colorLock
private static boolean
DEBUG_SUBS
private org.eclipse.swt.graphics.Point
drawOffset
private CopyOnWriteList<java.lang.Object[]>
FGRequesters
private int
heightUseAccessors
private boolean
initializing
private boolean
inPaintItem
private boolean
isHidden
private int
numSubItems
private TableCellSWTBase[]
sortCells
private java.lang.Object[]
subDataSources
private TableRowPainted[]
subRows
private java.lang.Object
subRows_sync
private int
subRowsHeightUseAccessors
-
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
Constructors Constructor Description TableRowPainted(TableRowCore parentRow, TableViewPainted tv, java.lang.Object dataSource, boolean triggerHeightChange)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
buildCells()
protected void
debug(java.lang.String s)
void
delete()
Delete the rowprivate void
deleteExistingSubRows()
private void
destroyCells()
void
fakeRedraw(java.lang.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
getBackground()
org.eclipse.swt.graphics.Rectangle
getBounds()
org.eclipse.swt.graphics.Rectangle
getDrawBounds()
org.eclipse.swt.graphics.Point
getDrawOffset()
org.eclipse.swt.graphics.Color
getForeground()
int
getFullHeight()
int
getHeight()
int
getLineHeight()
private org.eclipse.swt.graphics.Font
getRandomFont()
TableCellCore[]
getSortColumnCells(java.lang.String hint)
int
getSubItemCount()
TableRowCore
getSubRow(int pos)
TableRowCore[]
getSubRowsRecursive(boolean includeHidden)
private void
getSubRowsRecursive(java.util.List<TableRowCore> result, TableRowCore[] rows, boolean includeHidden)
TableRowCore[]
getSubRowsWithNull()
TableCell
getTableCell(java.lang.String field)
Retrieve a cell based on its column nameTableCellCore
getTableCellCore(java.lang.String name)
Retrieve a cell based on the supplied valueTableCellSWT
getTableCellSWT(java.lang.String name)
TableViewPainted
getViewPainted()
void
heightChanged(int oldHeight, int newHeight)
boolean
isHidden()
boolean
isInPaintItem()
TableRowCore
linkSubItem(int indexOf)
void
redraw(boolean doChildren)
void
redraw(boolean doChildren, boolean immediateRedraw)
boolean
refilter()
java.util.List<TableCellCore>
refresh(boolean bDoGraphics, boolean bVisible)
void
removeSubRow(java.lang.Object datasource)
void
requestBackgroundColor(TableViewSWT.ColorRequester requester, org.eclipse.swt.graphics.Color color)
private void
requestColor(CopyOnWriteList<java.lang.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(java.lang.String... columnIDs)
void
setSubItemCount(int length)
private void
setSubItemCount(int length, boolean triggerHeightListener)
void
setSubItems(java.lang.Object[] datasources)
private void
setSubItems(java.lang.Object[] datasources, boolean triggerHeightListeners)
private void
setSubRowsHeight(int h)
void
setWidgetSelected(boolean selected)
boolean
sortSubRows(TableColumnCore col)
protected void
subRowHeightChanged(int oldHeight, int newHeight)
private void
swt_fakeRedraw(java.lang.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, 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 Detail
-
DEBUG_SUBS
private static final boolean DEBUG_SUBS
- See Also:
- Constant Field Values
-
drawOffset
private org.eclipse.swt.graphics.Point drawOffset
-
numSubItems
private int numSubItems
-
subDataSources
private java.lang.Object[] subDataSources
-
subRows
private TableRowPainted[] subRows
-
subRows_sync
private final java.lang.Object subRows_sync
-
subRowsHeightUseAccessors
private int subRowsHeightUseAccessors
-
sortCells
private TableCellSWTBase[] 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
private java.lang.Object colorLock
-
FGRequesters
private CopyOnWriteList<java.lang.Object[]> FGRequesters
-
BGRequesters
private CopyOnWriteList<java.lang.Object[]> BGRequesters
-
-
Constructor Detail
-
TableRowPainted
public TableRowPainted(TableRowCore parentRow, TableViewPainted tv, java.lang.Object dataSource, boolean triggerHeightChange)
-
-
Method Detail
-
refilter
public boolean refilter()
-
isHidden
public boolean isHidden()
-
buildCells
private void buildCells()
-
destroyCells
private void destroyCells()
-
getViewPainted
public TableViewPainted 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
public void fakeRedraw(java.lang.String col_name)
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
private void swt_fakeRedraw(java.lang.String col_name)
-
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
public java.util.List<TableCellCore> refresh(boolean bDoGraphics, boolean bVisible)
- 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
protected void debug(java.lang.String s)
-
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
Delete the row- 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
public TableRowCore linkSubItem(int indexOf)
- Returns:
-
setSubItems
public void setSubItems(java.lang.Object[] datasources)
-
setSubItems
private void setSubItems(java.lang.Object[] datasources, boolean triggerHeightListeners)
-
getSubRowsWithNull
public TableRowCore[] getSubRowsWithNull()
-
getSubRowsRecursive
public TableRowCore[] getSubRowsRecursive(boolean includeHidden)
-
getSubRowsRecursive
private void getSubRowsRecursive(java.util.List<TableRowCore> result, TableRowCore[] rows, boolean includeHidden)
-
removeSubRow
public void removeSubRow(java.lang.Object datasource)
-
setExpanded
public void setExpanded(boolean b)
- Specified by:
setExpanded
in interfaceTableRowCore
- Overrides:
setExpanded
in classTableRowSWTBase
-
setExpanded
private void setExpanded(boolean b, boolean triggerHeightChange)
-
getSubRow
public TableRowCore getSubRow(int pos)
-
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<java.lang.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
public TableCellCore getTableCellCore(java.lang.String name)
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
-
getTableCellSWT
public TableCellSWT getTableCellSWT(java.lang.String name)
- Specified by:
getTableCellSWT
in interfaceTableRowSWT
- Overrides:
getTableCellSWT
in classTableRowSWTBase
- Returns:
-
getTableCell
public TableCell getTableCell(java.lang.String field)
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
public TableCellCore[] getSortColumnCells(java.lang.String hint)
-
setSortColumn
public void setSortColumn(java.lang.String... columnIDs)
-
sortSubRows
public boolean sortSubRows(TableColumnCore col)
-
-