/*
 *  The MIT License (MIT)
 *
 *  View the full license at:
 *  https://github.com/hendrixjoseph/FamilyTree/blob/master/LICENSE.md
 *
 *  Copyright (c) 2015 Joseph Hendrix
 *
 *  Hosted on GitHub at https://github.com/hendrixjoseph/FamilyTree
 *
 */

package edu.wright.hendrix11.svg.jsf.barChart;

/**
 * @author Joe Hendrix
 */
@FacesComponent(value = ChartComponent.COMPONENT_TYPE)
@ResourceDependency(library = "css", name = "chart.css")
public class ChartComponent extends UIComponentBase
{
    /**
     *
     */
    public static final String COMPONENT_TYPE = "edu.wright.hendrix11.c3.ChartComponent";

    /**
     *
     */
    public static final String DEFAULT_RENDERER = "edu.wright.hendrix11.c3.ChartRenderer";
    
        /**
     *
     */
    public static final String COMPONENT_FAMILY = "edu.wright.hendrix11.c3";

    @Override
    public String getFamily()
    {
        return COMPONENT_FAMILY;
    }

    /**
     * @return
     */
    public String getStyleClass()
    {
        return (String) getStateHelper().eval(PropertyKeys.styleClass, null);
    }

    /**
     * @param string
     */
    public void setStyleClass(String string)
    {
        getStateHelper().put(PropertyKeys.styleClass, string);
    }
    
        /**
     * @return
     */
    public String getStyle()
    {
        return (String) getStateHelper().eval(PropertyKeys.style, null);
    }

    /**
     * @param string
     */
    public void setStyle(String string)
    {
        getStateHelper().put(PropertyKeys.style, string);
    }

    public BarChartComponent()
    {
        setRendererType(DEFAULT_RENDERER);
    }

    /**
     * @return
     */
    public BarChartModel getChartModel()
    {
        return (BarChartModel) getStateHelper().eval(PropertyKeys.chartModel, null);
    }

    /**
     * @param model
     */
    public void setChartModel(BarChartModel model)
    {
        getStateHelper().put(PropertyKeys.chartModel, model);
    }
    
        /**
     *
     */
    protected enum PropertyKeys
    {

        /**
         *
         */
        styleClass,

        /**
         *
         */
        chartModel,

        /**
         *
         */
        style
    }
}

@@ -1542,27 +1542,24 @@
 %0A    public 
-Bar
 ChartCompone
@@ -1642,32 +1642,34 @@
 @return%0A     */%0A
+//
     public BarCh
@@ -1663,19 +1663,16 @@
  public 
-Bar
 ChartMod
@@ -1690,22 +1690,26 @@
 Model()%0A
+//
     %7B%0A
+//
         
@@ -1716,19 +1716,16 @@
 return (
-Bar
 ChartMod
@@ -1774,32 +1774,34 @@
 rtModel, null);%0A
+//
     %7D%0A%0A    /**%0A 
@@ -1819,32 +1819,34 @@
 m model%0A     */%0A
+//
     public void 
@@ -1863,11 +1863,8 @@
 del(
-Bar
 Char
@@ -1877,22 +1877,26 @@
  model)%0A
+//
     %7B%0A
+//
         
@@ -1945,24 +1945,26 @@
 el, model);%0A
+//
     %7D%0A    %0A 
@@ -1954,36 +1954,32 @@
 );%0A//    %7D%0A    %0A
-    
     /**%0A     *%0A 

Update ChartComponent.java