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

SynthParser reports color values above #7FFFFFFF as invalid colors

    Details

    • Subcomponent:
    • Resolved In Build:
      b82
    • CPU:
      x86
    • OS:
      windows_nt

      Description

      FULL PRODUCT VERSION :
      jre 1.5.0_05

      ADDITIONAL OS VERSION INFORMATION :
      Windows 2000 5.00.2195 SP4

      A DESCRIPTION OF THE PROBLEM :
      In the synth file format, any color statement with a color greater than #7FFFFFFF will cause the SynthParser to throw a ParseException, stating that it is an invalid color. These should be valid color values. Note that without the alpha component, the full range from #000000 to #FFFFFF works correctly.

      It seems likely that the SynthParser startColor method has problems decoding hex values that are negative Integers.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Use the Java Synth skinning technology. Put a color statement in the XML file with a value greater than #7FFFFFFF. The value that I originally tried to use was #FFFFFF40, which would a highly transparent white color.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I was expecting to see a specific panel have a highly transparent white color.
      ACTUAL -
      Instead, an exception was thrown: Invalid color #FFFFFF40 null

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      ParseException

      Exception:
      Error parsing: org.xml.sax.SAXException: Invalid Color value: #FFFFFF40 null
      class java.text.ParseException
      javax.swing.plaf.synth.SynthParser.parse(Unknown Source)
      javax.swing.plaf.synth.SynthLookAndFeel.load(Unknown Source)
      com.d2audio.blackcomb.gui.Plaf.setSynthLookAndFeel(Plaf.java:28)
      com.d2audio.blackcomb.ApplicationManager.initialize(ApplicationManager.java:244)
      com.d2audio.blackcomb.ApplicationManager.main(ApplicationManager.java:65)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Here is a piece of the synth XML file. If you change the background color value to #77777780 (for example), it will work fine.

        <style id="csubpanel">
          <insets top="1" left="1" bottom="1" right="1" />
          <opaque value="true" />
          <state>
            <imagePainter method="panelBorder" path="res/d2audio/glass_border.png"
              sourceInsets="1 1 1 1" paintCenter="false" stretch="true" />
            <color type="BACKGROUND" value="#FFFFFF40" />
          </state>
        </style>
        <bind style="csubpanel" type="name" key="csubpanel.*"/>
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      For now I will settle with no alpha component setting or pick a darker grey tone. If I must have the white color, I can use an image painter, but this will slow down progress.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gromainsunw Guy Romain (Inactive)
                Reporter:
                ndcosta Nelson Dcosta (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: