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