Package limelight.styles.compiling

Source Code of limelight.styles.compiling.ColorAttributeCompiler

//- Copyright © 2008-2011 8th Light, Inc. All Rights Reserved.
//- Limelight and all included source files are distributed under terms of the MIT License.

package limelight.styles.compiling;

import limelight.LimelightException;
import limelight.styles.abstrstyling.StyleCompiler;
import limelight.styles.abstrstyling.StyleValue;
import limelight.styles.values.SimpleColorValue;
import limelight.util.Colors;

import java.awt.*;

public class ColorAttributeCompiler extends StyleCompiler
{
  public StyleValue compile(Object objValue)
  {
    String value = stringify(objValue);
    try
    {
      Color color = Colors.resolve(value);
      return new SimpleColorValue(color);
    }
    catch(LimelightException e)
    {
      throw makeError(value);
    }
  }
}
TOP

Related Classes of limelight.styles.compiling.ColorAttributeCompiler

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.