Skip to content

Instantly share code, notes, and snippets.

@IAMIronmanSam
Created October 7, 2012 09:16
Show Gist options
  • Save IAMIronmanSam/3847620 to your computer and use it in GitHub Desktop.
Save IAMIronmanSam/3847620 to your computer and use it in GitHub Desktop.
visage.javafx.scene.chart
/*
* Copyright (c) 2011-2012, Visage Project
* All rights reserved.
*
* Redistribution or use in source or binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions or the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions or the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name Visage nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS or CONTRIBUTORS "AS IS"
* or ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED or ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
//package visage.javafx.scene.chart;
package visage.javafx;
/**
* <p> Base class for all charts. It has 3 parts the title, legend and chartContent. The chart content is populated by the specific subclass of Chart.</p>
*
* @author Arivazhagan Ambigapathi <arivu86@gmail.com>
*/
import javafx.scene.layout.Region;
import javafx.scene.Parent;
import javafx.scene.Node;
public abstract class Chart extends Region
{
override wrappedRegion = javafx.scene.chart.Chart {};
def wrappedChart = bind wrappedRegion as javafx.scene.chart.Chart;
/**
* <p>When true any data changes will be animated.</p>
*/
public var animated:Boolean on replace{
if (isInitialized(this) or animated)
wrappedChart.setAnimated(animated);
}
/**
* <p>The node to display as the Legend.</p>
*/
public var legendSide:Side on replace{
if (isInitialized(this) )
wrappedChart.setLegendSide(legendSide);
}
/**
* <p>The side of the chart where the title is displayed.</p>
*/
public var titleSide:Side on replace{
if (isInitialized(this) )
wrappedChart.setTitleSide(titleSide);
}
/**
* <p>The node to display as the Legend. Subclasses can set a node here to be displayed on a side as the legend. If no legend is wanted then this can be set to null.</p>
*/
public var legend:Node on replace{
if (isInitialized(this) )
wrappedChart.setLegend(legend);
}
/**
* <p>When true the chart will display a legend if the chart implementation supports a legend..</p>
*/
public var legendVisible:Boolean on replace{
if (isInitialized(this) or legendVisible)
wrappedChart.setLegendVisible(legendVisible);
}
/**
* The title of the chart where the title is displayed
**/
public var title:String on replace{
if(isInitialized(this) or title != null){
wrappedChart.setTitle(title);
}
}
}
/*
* Copyright (c) 2011-2012, Visage Project
* All rights reserved.
*
* Redistribution or use in source or binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions or the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions or the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name Visage nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS or CONTRIBUTORS "AS IS"
* or ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED or ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
//package visage.javafx.scene.chart;
package visage.javafx;
/**
* <p> Base class for all charts. It has 3 parts the title, legend and chartContent. The chart content is populated by the specific subclass of Chart.</p>
*
* @author Arivazhagan Ambigapathi <arivu86@gmail.com>
*/
import javafx.scene.layout.Region;
import javafx.scene.Parent;
import javafx.scene.Node;
public abstract class Chart extends Region
{
override wrappedRegion = javafx.scene.chart.Chart {};
def wrappedChart = bind wrappedRegion as javafx.scene.chart.Chart;
/**
* <p>When true any data changes will be animated.</p>
*/
public var animated:Boolean on replace{
if (isInitialized(this) or animated)
wrappedChart.setAnimated(animated);
}
/**
* <p>The node to display as the Legend.</p>
*/
public var legendSide:Side on replace{
if (isInitialized(this) )
wrappedChart.setLegendSide(legendSide);
}
/**
* <p>The side of the chart where the title is displayed.</p>
*/
public var titleSide:Side on replace{
if (isInitialized(this) )
wrappedChart.setTitleSide(titleSide);
}
/**
* <p>The node to display as the Legend. Subclasses can set a node here to be displayed on a side as the legend. If no legend is wanted then this can be set to null.</p>
*/
public var legend:Node on replace{
if (isInitialized(this) )
wrappedChart.setLegend(legend);
}
/**
* <p>When true the chart will display a legend if the chart implementation supports a legend..</p>
*/
public var legendVisible:Boolean on replace{
if (isInitialized(this) or legendVisible)
wrappedChart.setLegendVisible(legendVisible);
}
/**
* The title of the chart where the title is displayed
**/
public var title:String on replace{
if(isInitialized(this) or title != null){
wrappedChart.setTitle(title);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment