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

new method in AlphaComposite to derive new instances by rule or extra alpha

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 1.2.1
    • client-libs
    • None
    • 2d
    • beta
    • generic
    • generic

      The following new methods on AlphaComposite would simplify a fair amount
      of code:

      public AlphaComposite derive(float alpha);

      public AlphaComposite derive(int rule);

      The first one in particular would simplify the creation of new objects from:

      AlphaComposite ac = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f);

      to:

      AlphaComposite ac = AlphaComposite.SrcOver.derive(0.5);

      this would also simplify a fade operation where a new AlphaComposite needs
      to be created with a different alpha parameter for each iteration of the
      fade:

      ac = ac.derive(newfadeamount);

      The latter method that derives a new instance with a new rule is probably
      less useful, but is included for completeness.

            flar Jim Graham
            flar Jim Graham
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: