Class NoPaintUIResource

java.lang.Object
com.github.tadukoo.view.paint.NoPaint
com.github.tadukoo.view.paint.NoPaintUIResource
All Implemented Interfaces:
PaintUIResource, SizablePaint, UIResource

public class NoPaintUIResource extends NoPaint implements PaintUIResource
No Paint UIResource is a PaintUIResource version of NoPaint - where it's used when you need a non-null PaintUIResource but don't want an actual paint.
Version:
Alpha v.0.3
Author:
Logan Ferree (Tadukoo)
  • Constructor Details

    • NoPaintUIResource

      public NoPaintUIResource()
  • Method Details

    • getColorUIResource

      public ColorUIResource getColorUIResource()
      In some cases, we need to return a ColorUIResource to support the Look & Feel properly. I don't like it, but it needs to be done for those Look & Feel pieces to work, and I'm trying to support all of them.
      Specified by:
      getColorUIResource in interface PaintUIResource
      Returns:
      A ColorUIResource
    • getMetalGradientList

      public List<Object> getMetalGradientList()
      Metal Look and Feel has a trash way of handling gradients. Basically it takes 3 colors and 2 fractions, but with the 3 colors, it repeats color 1 and does 1, 2, 1, 3. The fractions represent the 2 middle points, but the 2nd point is calculated as mid1 * 2 + mid2.

      This method exists for the purpose of appeasing the Metal Look & Feel god who decided this disgusting way of code.
      Specified by:
      getMetalGradientList in interface PaintUIResource
      Returns:
      The garbage List that Metal Look and Feel expects for gradients that matches best to the one defined here
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class NoPaint