ICEpdf
  1. ICEpdf
  2. PDF-190

IcePDF UI manipulation from a custom thread

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.1
    • Fix Version/s: 4.1
    • Component/s: Viewer RI
    • Labels:
      None
    • Environment:
      -

      Description

      A user has reported the following issue:

      We came across an architectural problem in IcePDF. As you can see from the stack below and the corresponding coding there are UI manipulations done from a custom thread. Java defines Swing not to be thread safe. Therefore doing so might cause problems.

      ...
      org.icepdf.ri.common.SwingViewBuilder.buildAnnotationPanel(SwingViewBuilder.java:1574)
      org.icepdf.ri.common.SwingViewBuilder.buildUtilityTabbedPane(SwingViewBuilder.java:1541)
      org.icepdf.ri.common.SwingViewBuilder.buildUtilityAndDocumentSplitPane(SwingViewBuilder.java:1501)
      org.icepdf.ri.common.SwingViewBuilder.buildContents(SwingViewBuilder.java:499)
      org.icepdf.ri.common.SwingViewBuilder.buildViewerPanel(SwingViewBuilder.java:482)
      ice.pilots.pdf.ThePilot.createComponent(ThePilot.java:149)
      ice.storm.Viewport.setPilot(VCDO)
      ice.storm.StormBase.append(VCDO)
      ice.storm.StormBase.do_clear_content(VCDO)
      ice.storm.StormBase.do_render_content(VCDO)
      ice.storm.Viewport.runAsynchronousLoad(VCDO)
      ice.storm.LoadThread.run(VCDO)

        Activity

        Hide
        Tyler Johnson added a comment -

        We could change ice.pilots.pdf.ThePilot so that it uses SwingUtilities.invokeAndWait(Runnable) or possibly SwingUtilities.invokeLater(Runnable), so that Swing is accessed in a thread-safe manner.

        Mark

        Show
        Tyler Johnson added a comment - We could change ice.pilots.pdf.ThePilot so that it uses SwingUtilities.invokeAndWait(Runnable) or possibly SwingUtilities.invokeLater(Runnable), so that Swing is accessed in a thread-safe manner. Mark
        Hide
        Patrick Corless added a comment -

        Update ICEbrowser pilot and did a little testing. The Swing work should all be happening on the awt thread.

        Show
        Patrick Corless added a comment - Update ICEbrowser pilot and did a little testing. The Swing work should all be happening on the awt thread.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: