Uploaded image for project: 'Jalview'
  1. Jalview
  2. JAL-3781

Make the alignment panel graphics layer HiDPI aware (i.e. use a higher resolution instead of automatically scaling lower resolution)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: In Progress
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.11.1.3, 2.11.2.7, 2.11.3.0
    • Fix Version/s: 2.12.0
    • Component/s: gui
    • Urgency:
      Urgent

      Description

      There are many issues that relate to the Alignment panel's graphics layer being rendered differently (for efficiency reasons), and the resolution being noticeably lower when using Jalview on a HiDPI display.

      See
      JAL-1857
      JAL-3134
      JAL-3137
      JAL-3492
      JAL-3546 (related)
      JAL-3767

      The problem lies with the Swing scaling of window decoration, widgets, fonts and bitmap graphics when a HiDPI display is detected.
      Whilst this is fine for the first three, which are vector based, the bitmap graphics are just scaled up so appear to be a lower resolution (because they are).

      The graphics layer should detect when scaling has been applied (see property "sun.java2d.uiScale" or perhaps
      Graphics2D g = ...;
      double scaling = g.getTransform().getScaleX();

      The resolution of the graphics layer can then be multipled by scaling and actual scaling of this layer set to 1 using, e.g.
      Graphics2D g = (Graphics2D) graphics;
      AffineTransform t = g.getTransform();
      double scaling = t.getScaleX(); // Assuming square pixels :P
      t.setToScale(1, 1);
      g.setTransform(t);

      found from https://stackoverflow.com/questions/43057457/jdk-9-high-dpi-disable-for-specific-panel

      Keep fingers crossed...

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              soares Ben Soares
              Reporter:
              soares Ben Soares
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: