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

Spec issues with foreground/background inheritance and defaults

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Won't Fix
    • Affects Version/s: 1.4.0, 1.4.2, 5.0, 6, 7
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • CPU:
      x86, sparc
    • OS:
      linux, solaris_9, windows_98, windows_xp

      Description

      THE TEXT BELOW WAS FIXED FOR INACCURACIES - PLEASE RE-READ

      The spec for Component.getForeground() currently states:

        if this component does not have a foreground color, the foreground color of its
        parent is returned.

      Our customers and our internal J2ME implementation team were interpreting it that
      the foreground color is always inherited from the parent if it's not explicitly
      set. This interpretation doesn't match J2SE behavior for TextComponents, and the
      spec for setForeground() seems to hint that inheriting only happens if the child's
      foreground is set to null (explicitly or via a default value). The spec for
      getForeground() should say something like this instead:

        if this component HAS ITS foreground color SET TO NULL (EITHER EXPLICITLY OR BY
        DEFAULT), the foreground color of its parent is returned AND USED FOR RENDERING.

      Another issue is related to the default: which Components have nulls as defaults,
      and therefore implicitly inherit parent's settings. Sun's J2SE seems to have null
      defaults for all realized components except for TextComponents.
      This issue should be clarified in the spec as well.

      Third, it's unclear what inheriting from parent means when the component doesn't
      have a parent (such as Window). The spec should specifically cover this case.

      Finally, the exact same set of issues applies to background color. There might be
      other Component properties that have the same inheritance issues - if this is the
      case, we might want to cover them as well.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dav Andrei Dmitriev (Inactive)
              Reporter:
              savzan Stanislav Avzan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: