panelcomponent: add override for panel resizing. (#2535)
This commit is contained in:
@@ -61,6 +61,9 @@ public class PanelComponent implements LayoutableRenderableEntity
|
||||
@Setter
|
||||
private boolean wrap = false;
|
||||
|
||||
@Setter
|
||||
private boolean overrideResize = false;
|
||||
|
||||
@Setter
|
||||
private Rectangle border = new Rectangle(
|
||||
ComponentConstants.STANDARD_BORDER,
|
||||
@@ -131,6 +134,11 @@ public class PanelComponent implements LayoutableRenderableEntity
|
||||
}
|
||||
}
|
||||
|
||||
if (overrideResize)
|
||||
{
|
||||
child.setPreferredSize(childPreferredSize);
|
||||
}
|
||||
|
||||
child.setPreferredLocation(new Point(x, y));
|
||||
final Dimension childDimension = child.render(graphics);
|
||||
|
||||
@@ -206,4 +214,4 @@ public class PanelComponent implements LayoutableRenderableEntity
|
||||
bounds.setSize(dimension);
|
||||
return dimension;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user