use of com.biglybt.ui.common.table.TableRowCore in project BiglyBT by BiglySoftware.
the class TableCellPainted method getDataSource.
/* (non-Javadoc)
* @see com.biglybt.pif.ui.tables.TableCell#getDataSource()
*/
@Override
public Object getDataSource() {
// remove this because if a disposal-listener needs to get its hands on teh datasource to clean up
// properly we need to return it to them! (happens with the peers view PiecesItem for example)
// if (isDisposed()) {
// return null;
// }
TableRowCore row = tableRow;
TableColumnCore col = tableColumn;
if (row == null || col == null) {
return (null);
}
return row.getDataSource(col.getUseCoreDataSource());
}
use of com.biglybt.ui.common.table.TableRowCore in project BiglyBT by BiglySoftware.
the class TableRowPainted method setExpanded.
private void setExpanded(boolean b, boolean triggerHeightChange) {
if (canExpand()) {
int oldHeight = getFullHeight();
super.setExpanded(b);
synchronized (subRows_sync) {
TableRowPainted[] newSubRows = null;
if (b && (subRows == null || subRows.length != numSubItems) && subDataSources != null && subDataSources.length == numSubItems) {
if (DEBUG_SUBS) {
debug("building subrows " + numSubItems);
}
deleteExistingSubRows();
newSubRows = new TableRowPainted[numSubItems];
TableViewPainted tv = getViewPainted();
int h = 0;
for (int i = 0; i < newSubRows.length; i++) {
newSubRows[i] = new TableRowPainted(this, tv, subDataSources[i], false);
newSubRows[i].setTableItem(i, false);
h += newSubRows[i].getFullHeight();
}
setSubRowsHeight(h);
subRows = newSubRows;
}
int newHeight = getFullHeight();
TableRowCore row = getParentRowCore();
if (row instanceof TableRowPainted) {
((TableRowPainted) row).subRowHeightChanged(oldHeight, newHeight);
}
if (triggerHeightChange) {
getViewPainted().rowHeightChanged(this, oldHeight, newHeight);
}
if (newSubRows != null) {
getViewPainted().triggerListenerRowAdded(newSubRows);
}
}
Object ds = getDataSource(true);
if (ds instanceof TableRowSWTChildController) {
((TableRowSWTChildController) ds).setExpanded(b);
}
TableViewPainted tvp = getViewPainted();
if (triggerHeightChange) {
tvp.tableMutated();
}
if (isVisible()) {
tvp.visibleRowsChanged();
tvp.redrawTable();
}
}
}
use of com.biglybt.ui.common.table.TableRowCore in project BiglyBT by BiglySoftware.
the class TableRowPainted method subRowHeightChanged.
protected void subRowHeightChanged(int oldHeight, int newHeight) {
int old = subRowsHeightUseAccessors;
subRowsHeightUseAccessors += (newHeight - oldHeight);
if (old != subRowsHeightUseAccessors && isExpanded()) {
TableRowCore row = getParentRowCore();
if (row instanceof TableRowPainted) {
((TableRowPainted) row).subRowHeightChanged(old, subRowsHeightUseAccessors);
}
}
}
use of com.biglybt.ui.common.table.TableRowCore in project BiglyBT by BiglySoftware.
the class TableRowPainted method setSubItemCount.
private void setSubItemCount(int length, boolean triggerHeightListener) {
numSubItems = length;
if (isExpanded() && subDataSources.length == length) {
if (DEBUG_SUBS) {
debug("setSubItemCount to " + length);
}
deleteExistingSubRows();
TableRowPainted[] newSubRows = new TableRowPainted[length];
TableViewPainted tv = getViewPainted();
int h = 0;
for (int i = 0; i < newSubRows.length; i++) {
newSubRows[i] = new TableRowPainted(this, tv, subDataSources[i], false);
newSubRows[i].setTableItem(i, false);
h += newSubRows[i].getFullHeight();
}
int oldHeight = getFullHeight();
setSubRowsHeight(h);
int newHeight = getFullHeight();
TableRowCore row = getParentRowCore();
if (row instanceof TableRowPainted) {
((TableRowPainted) row).subRowHeightChanged(oldHeight, newHeight);
}
TableViewPainted tvp = getViewPainted();
if (triggerHeightListener) {
tvp.rowHeightChanged(this, oldHeight, newHeight);
}
tvp.triggerListenerRowAdded(newSubRows);
subRows = newSubRows;
}
}
use of com.biglybt.ui.common.table.TableRowCore in project BiglyBT by BiglySoftware.
the class TableRowPainted method setHeight.
/* (non-Javadoc)
* @see TableRowCore#setHeight(int)
*/
@Override
public boolean setHeight(int newHeight) {
TableRowCore parentRowCore = getParentRowCore();
boolean trigger = parentRowCore == null || parentRowCore.isExpanded();
return setHeight(newHeight, trigger);
}
Aggregations