Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6956306

BasicTreeUI.drawDashedHorizontal/VerticalLine() are dependant on non-specified impl-specific props

    XMLWordPrintable

Details

    Description

      There are two methods in javax.swing.plaf.basic.BasicTreeUI

      protected void drawDashedHorizontalLine(Graphics g, int y, int x1, int x2)
      protected void drawDashedVerticalLine(Graphics g, int x, int y1, int y2)

      They both have no spec.
      They are supposed to be invoked when branches of the tree are painted and lines have to be painted dashed.

      Looking into RI - they are invoked when

          /** UI property for painting dashed lines */
          private boolean lineTypeDashed;

      is set to true.
      This property is private so I cannot access and change it.

      And it is initialized as:
         lineTypeDashed = UIManager.getBoolean("Tree.lineTypeDashed");

      While "Tree.lineTypeDashed" is not part of the spec

      So for applications and the tests the only way to make sure that the methods are invoked is to set "Tree.lineTypeDashed" to 'true' somehow which is not good as it's not an official property and its name might get changed or removed.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dbessono Dmitry Bessonov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: