mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Table & Grid: fix for repaint before apply new component
This commit is contained in:
+9
-4
@@ -109,11 +109,16 @@ public class RadGridLayout extends RadViewLayoutWithData implements ILayoutDecor
|
||||
mySelectionDecorator = new GridSelectionDecorator(Color.red, 1) {
|
||||
@Override
|
||||
public Rectangle getCellBounds(Component layer, RadComponent component) {
|
||||
RadGridLayoutComponent parent = (RadGridLayoutComponent)component.getParent();
|
||||
GridInfo gridInfo = parent.getGridInfo();
|
||||
Rectangle cellInfo = RadGridLayoutComponent.getCellInfo(component);
|
||||
try {
|
||||
RadGridLayoutComponent parent = (RadGridLayoutComponent)component.getParent();
|
||||
GridInfo gridInfo = parent.getGridInfo();
|
||||
Rectangle cellInfo = RadGridLayoutComponent.getCellInfo(component);
|
||||
|
||||
return calculateBounds(layer, gridInfo, parent, component, cellInfo.y, cellInfo.x, cellInfo.height, cellInfo.width);
|
||||
return calculateBounds(layer, gridInfo, parent, component, cellInfo.y, cellInfo.x, cellInfo.height, cellInfo.width);
|
||||
}
|
||||
catch (Throwable e) {
|
||||
return new Rectangle();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
+19
-14
@@ -83,23 +83,28 @@ public class RadTableRowLayout extends RadLinearLayout {
|
||||
mySelectionDecorator = new GridSelectionDecorator(Color.red, 1) {
|
||||
@Override
|
||||
public Rectangle getCellBounds(Component layer, RadComponent component) {
|
||||
RadTableLayoutComponent tableComponent = (RadTableLayoutComponent)component.getParent().getParent();
|
||||
GridInfo gridInfo = tableComponent.getVirtualGridInfo();
|
||||
int row = tableComponent.getChildren().indexOf(component.getParent());
|
||||
RadComponent[] rowComponents = gridInfo.components[row];
|
||||
int column = ArrayUtil.indexOf(rowComponents, component);
|
||||
int columnSpan = 1;
|
||||
try {
|
||||
RadTableLayoutComponent tableComponent = (RadTableLayoutComponent)component.getParent().getParent();
|
||||
GridInfo gridInfo = tableComponent.getVirtualGridInfo();
|
||||
int row = tableComponent.getChildren().indexOf(component.getParent());
|
||||
RadComponent[] rowComponents = gridInfo.components[row];
|
||||
int column = ArrayUtil.indexOf(rowComponents, component);
|
||||
int columnSpan = 1;
|
||||
|
||||
for (int i = column + 1; i < rowComponents.length; i++) {
|
||||
if (rowComponents[i] == component) {
|
||||
columnSpan++;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
for (int i = column + 1; i < rowComponents.length; i++) {
|
||||
if (rowComponents[i] == component) {
|
||||
columnSpan++;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return calculateBounds(layer, gridInfo, tableComponent, component, row, column, 1, columnSpan);
|
||||
}
|
||||
catch (Throwable e) {
|
||||
return new Rectangle();
|
||||
}
|
||||
|
||||
return calculateBounds(layer, gridInfo, tableComponent, component, row, column, 1, columnSpan);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user