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.

Bug 105784 - Widget jumps after applying select border
Summary: Widget jumps after applying select border
Status: RESOLVED WORKSFORME
Alias: None
Product: platform
Classification: Unclassified
Component: Graph (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@platform
URL:
Keywords:
Depends on:
Blocks: 105060
  Show dependency tree
 
Reported: 2007-06-05 19:38 UTC by Sergey Petrov
Modified: 2007-06-08 13:20 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
shifted selected and unshifted widgets (14.89 KB, image/png)
2007-06-05 19:39 UTC, Sergey Petrov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Petrov 2007-06-05 19:38:02 UTC
it's a regression comparing to 070529

My widget has two children with vertical flow layout with justify option, first
child has more children, I'm applying resize border next way:                  
  setBorder(BorderFactory.createResizeBorder(15));
And my widget jumps, I'll recheck tomorrow if it's my fault, but I don't
remember any significant changes in my sample here in last days.
See attached image showing shift of widget.
Comment 1 Sergey Petrov 2007-06-05 19:39:11 UTC
Created attachment 43268 [details]
shifted selected and unshifted widgets
Comment 2 David Kaspar 2007-06-07 13:13:53 UTC
Caused by wrong justification in FlowLayout class.
Fixed in main trunk.
Comment 3 Sergey Petrov 2007-06-07 14:49:43 UTC
Not sure if it's the same issue, I can filr a new one if necessary
In my case widget selection works better today, no jumps on initially placed
widget selection (i.e. border applied outside of widget area and do not affect
the widget), but after resizing(top side up) border is drawn within widget area,
i.e. collapse/jump/shift widget a bit, tried with my 'WidowSTyle' resize
strategy and with default action created by 'createResizeAction()'
Comment 4 Sergey Petrov 2007-06-07 14:59:06 UTC
And additionally, before resize there is some strange shift which is good
visible in satellite view, and is almost invisible in scene view (only a minor
scroll bar shift)
Comment 5 David Kaspar 2007-06-08 08:51:19 UTC
This new jump is caused by expanding policy of a scene.
The scene is a smallest encapsulation boundary of all widgets (including their
borders) in the scene. In case you are using LayerWidget, then [0,0] point is
included too.
When you add a border to your widget (which is top-left most widget in negative
coords in the scene), then you are expanding the size of the widget to all 4
sides. Therefore the scene has to be expanded too.
The workaround is easy - borders for all the ObjectStates have to have the same
insets. E.g. use ResizeBorder(8) for selected objects and otherwise OpaqueBorder(8).
Unfortunately I cannot change this expanding policy since I do not have a
replacement for it. If the proposed solution/workaround is ok, please, close the
issue as WorksForMe. Thanks.
Comment 6 Sergey Petrov 2007-06-08 12:20:50 UTC
Ok it's not a big issue, but not sure setting opaque border will not affect
other area, may be I'll file another less priority issue for the behavior, for
example scene expands and vertical scroll appears even if widget+border is fully
visible
Ok to set this issue as resolved.
What about inner/outer border applying?
Comment 7 David Kaspar 2007-06-08 13:20:40 UTC
The problem is that the widget border is a part of the widget boundary by
definition.
Regarding the scrollbar issue: Please, file a separate issue regarding that.
Note that if you have a connection widget attached to it, it may reserver some
space around it (e.g. Anchor does not have a rectangular boundary - it has
radius property only).