This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | After resize and deselection border is drawn within existing widget border | ||
---|---|---|---|
Product: | platform | Reporter: | Sergey Petrov <sj-nb> |
Component: | Graph | Assignee: | issues@platform <issues> |
Status: | RESOLVED WORKSFORME | ||
Severity: | blocker | ||
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 105060 |
Description
Sergey Petrov
2007-06-08 13:30:39 UTC
I miss it in steps above, but after step5 widget fills bounds of (widget+resize border), it seems the root issue here Yes, the issue is in the 5. step. You should use/assign borders with the same insets. If you have ResizeBorder(8), then by deselecting the object, you have to assign OpaqueBorder(8). Otherwise the widget is going to be resize. The second part of the issue is that by default the size/boundary of a widget is calculated. But when you resize it using ResizeAction, then the widget has overriden preferred-bounds property (Widget.setPreferredBounds). Therefore when you add a new resize border, the border is added within the previous widget boundary. This issue is not resolvable on the side of the library. If it is ok with, I would close this issue as WorksForMe. If you do not want to use borders of the same insets, then you would have to check with Widget.isPreferredBoundsSet method. The bounds includes even the widget border. If the method returns true, then the preferred bounds is set and therefore you have to update the preferred bounds: 1) When you are removing a border from the widget, then you have to shrink the preferred bounds by the border insets. 2) When you are adding a border to the widget, then you have to expand the preferred bounds by the border insets. Thanks for the solution, it works not sure if different behavior with not set and with set pref bounds is an issue or a big issue, at least such behavior allow to shrink-expand preferred bounds in my case and do nothing if there is no preferred bounds |