Skip to content

Left/Right AutoHideButtons are drawn incorrectly on Mac OS X #2

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?

  dock = new ToolDockable("Console", console.makeUI());
  dock.getDockKey().setAutoHideBorder(DockingConstants.HIDE_RIGHT);
  desktop.addHiddenDockable(dock, RelativeDockablePosition.RIGHT);

  dock = new ToolDockable("Recording", recording.makeUI());
  dock.getDockKey().setAutoHideBorder(DockingConstants.HIDE_RIGHT);
  desktop.addHiddenDockable(dock, RelativeDockablePosition.RIGHT);



What is the expected output? What do you see instead?

  Expected output is two tabs on right side of application window,
  with the labels [ Console ] and [ Recording ] appearing vertically inside the tabs.

  On Mac OS X:
     Actual output is two tabs on right side of application window,
     with labels [oC       ] and [eR       ]

     See attached screen snapshot.

  On Windows:
     Works as expected.


What version of the product are you using? On what operating system?

  VLDocking 3.0.0

  Mac OS X version 10.8.3

  java version "1.7.0_07"
  Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
  Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)



Please provide any additional information below.


  Correct output can be generated with the following change to
    com/vlsolutions/swing/docking/ui/AutoHideButtonUI.java:


  public void paint(Graphics g, JComponent comp){

    /* ... snip ... */

      Graphics2D g2 = ( (Graphics2D) g.create());
      g2.setFont(btn.getFont());
      g2.setColor(btn.getForeground());

      /* WORK-AROUND: for bug in Mac OS X's Java Implementation */
      g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
                          RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
      /* END WORK-AROUND */

      FontMetrics fm = btn.getFontMetrics(btn.getFont());

    /* ... snip ... */
  }



  An e-mail with the above work-around was sent and answered January 30th.
  I was disappointed to see this was not included in 3.0.1

Original issue reported on code.google.com by Lost.Win...@gmail.com on 12 Apr 2013 at 7:49

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions