Class MColorSchema

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_PA_ColorSchema, I_Persistent, Evaluatee, ImmutablePOSupport

public class MColorSchema extends X_PA_ColorSchema implements ImmutablePOSupport
Color Schema for Performance Measurement
Version:
$Id: MColorSchema.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $
Author:
Jorg Janke
See Also:
  • Constructor Details

    • MColorSchema

      public MColorSchema(Properties ctx, String PA_ColorSchema_UU, String trxName)
      UUID based Constructor
      Parameters:
      ctx - Context
      PA_ColorSchema_UU - UUID key
      trxName - Transaction
    • MColorSchema

      public MColorSchema(Properties ctx, int PA_ColorSchema_ID, String trxName)
      Standard Constructor
      Parameters:
      ctx - context
      PA_ColorSchema_ID - id
      trxName - trx
    • MColorSchema

      public MColorSchema(Properties ctx, ResultSet rs, String trxName)
      Load Constructor
      Parameters:
      ctx - context
      rs - result set
      trxName - trx
    • MColorSchema

      public MColorSchema(MColorSchema copy)
      Copy constructor
      Parameters:
      copy -
    • MColorSchema

      public MColorSchema(Properties ctx, MColorSchema copy)
      Copy constructor
      Parameters:
      ctx -
      copy -
    • MColorSchema

      public MColorSchema(Properties ctx, MColorSchema copy, String trxName)
      Copy constructor
      Parameters:
      ctx -
      copy -
      trxName -
  • Method Details

    • getColor

      public static Color getColor(Properties ctx, int PA_ColorSchema_ID, BigDecimal target, BigDecimal actual)
      Get Color
      Parameters:
      ctx - context
      PA_ColorSchema_ID - id
      target - target value
      actual - actual value
      Returns:
      color
    • getColor

      public static Color getColor(Properties ctx, int PA_ColorSchema_ID, int percent)
      Get Color
      Parameters:
      ctx - context
      PA_ColorSchema_ID - id
      percent - percent
      Returns:
      color
    • get

      public static MColorSchema get(int PA_ColorSchema_ID)
      Get MColorSchema from Cache (Immutable)
      Parameters:
      PA_ColorSchema_ID - id
      Returns:
      MColorSchema
    • get

      public static MColorSchema get(Properties ctx, int PA_ColorSchema_ID)
      Get MColorSchema from Cache (Immutable)
      Parameters:
      ctx - context
      PA_ColorSchema_ID - id
      Returns:
      MColorSchema
    • getCopy

      public static MColorSchema getCopy(Properties ctx, int PA_ColorSchema_ID, String trxName)
      Get updateable copy of MColorSchema from cache
      Parameters:
      ctx -
      PA_ColorSchema_ID -
      trxName -
      Returns:
      MColorSchema
    • setDefault

      public void setDefault()
      Set Default. Red (50) - Yellow (100) - Green (101 - 9999)
    • beforeSave

      protected boolean beforeSave(boolean newRecord)
      Before Save
      Overrides:
      beforeSave in class PO
      Parameters:
      newRecord - new
      Returns:
      true
    • getColor

      public Color getColor(int percent)
      Get color for percent
      Parameters:
      percent - percentage
      Returns:
      color
    • toString

      public String toString()
      String Representation
      Overrides:
      toString in class X_PA_ColorSchema
      Returns:
      info
    • markImmutable

      public MColorSchema markImmutable()
      Description copied from interface: ImmutablePOSupport
      mark PO as immutable
      Specified by:
      markImmutable in interface ImmutablePOSupport
      Returns:
      PO