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

Add ability to get visually perceived borderline

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 5.0
    • client-libs

      A DESCRIPTION OF THE REQUEST :
        Bug ID 6237146 "Add ability to get baseline" describes ability to get the baseline for components as a requirement for professional layouts.

      In addition to baseline, we need an ability to get the visually perceived borderlines for components.
      This way, we could align components entirely using visual criterias (baseline of contained text, borderlines of components).

      JUSTIFICATION :
      In the current implementation, alignment is done based on the clip bounds of components.

      Curvatures, cast shadows and focus rings of components are part of the clip bounds of components, but mut not be used for their alignment.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Every component should have a translucent border margin.
      The border margin contains curvatures, cast shadows, focus rings and other visual elements, that do not account for the visual alignment of the component.
      Layout managers should subtract the border margin from the components, before they align the components with respect to each other. In extreme cases, this may result in layouts, where the clip bounds of components overlap each other. That shouldn't pose a problem, because components may be allowed to cast a shadow over other components, and focus rings may glow over other components.
      ACTUAL -
      Most current layout managers provided by AWT and the Swing API align components using their clip bounds as the only criteria.

      e.g. Thus, components which have no border, e.g. JLabel, does not properly align with a component that has an irregular (curved, shadowy, focus ring) border, e.g. a JRadioButton.
        To test this, put a JLabel with some text above a JRadioButton. You will notice, that the round button of the JRadioButton visually appears to be slightly indented to the right. A professional layouter would place the JRadioButton one pixel to the left, so that its bulge would go slightly more to the left than the text in the JLabel. Only then, the components align visually correctly.

      ---------- BEGIN SOURCE ----------
      I have implemented a client property and UI manager property named "Component.borderMargin" in the Quaqua Look and Feel 3.x for Mac OS X.
      See http://www.randelshofer.ch/quaqua/download.html
      ---------- END SOURCE ----------

            Unassigned Unassigned
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: