Ticket #496 (closed defect: fixed)

Opened 9 years ago

Last modified 9 years ago

Resize image panel at appropriate times

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: biweekly-2011: May-09 to May-20
Component: UI Framework Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking:

Description

Currently there a re a couple places where the panel is not getting resized when it would be good to do so:

  • crop
  • rotate 90 left or right
  • zoom to initial scale (this one has its own ticket)

Probably just need to call pack() at the appropriate time.

Change History

comment:1 Changed 9 years ago by bdezonia

I have some sketchy notes about a related discussion with Curtis from before. Not sure any of it is applicable anymore:

call pack() after setImage() and not before calculating window dims before 1st pack.

there is a race condition with pack() [I think Curtis solved this]. we use threads and we make SwingImageWindow without an image and call pack() and then later call setImage() which packs again via redoLayout(). Need to use SwingUtilities.invokeLater() or SwingUtilities.invokeAndWait() as appropriate.

comment:2 Changed 9 years ago by bdezonia

more old discussion:

all images on my machine - initial display window wrong size. [again I think this is fixed] On the event dispatch thread we need to publish an event via SwingUtils.invokeLater().

comment:3 Changed 9 years ago by bdezonia

  • Status changed from new to closed
  • Resolution set to fixed

mostly fixed the problem where the display window would not resize when various operations were performed (rotate 90, crop). what is left is being filed as a ticket. note that this fix causes zoom and pan of the current image to be reset to (0,0) and 1X after a Dataset restructure event. window title and label reflect the new dimensions and zoom levels.

comment:4 Changed 9 years ago by bdezonia

Note that there was some special case code added to SwingImageDisplay to support this. It listens for DatsetStructuredEvents and repacks the image window in such a case. A code review of the tail of the update() method would be appreciated.

comment:5 Changed 9 years ago by bdezonia

  • Milestone changed from biweekly-2011: Apr-25 to May-06 to biweekly-2011: May-09 to May-20
Note: See TracTickets for help on using tickets.