Package org.openfaces.component.chart.impl

Examples of org.openfaces.component.chart.impl.GridPointInfoImpl


    private static GridPointInfo getGridPointInfo(CategoryItemEntity en, Chart chart) {
        ChartModel model = chart.getModel();
        if (model == null)
            return null;

        GridPointInfo info = new GridPointInfoImpl();
        info.setSeries(new SeriesInfoImpl());
        info.getSeries().setIndex(en.getSeries());

        ModelInfo modelInfo = new ModelInfo(model);

        if (!modelInfo.isDataEmpty()) {
            CategoryDataset ds = ModelConverter.toCategoryDataset(modelInfo);
            Comparable seriesKey = ds.getRowKey(en.getSeries());
            Comparable tupleKey = ds.getColumnKey(en.getCategoryIndex());
            Object tupleValue = ds.getValue(seriesKey, tupleKey);
            info.setIndex(en.getCategoryIndex());
            info.setKey(tupleKey);
            info.setValue(tupleValue);
            info.getSeries().setKey(seriesKey);
        }

        return info;
    }
View Full Code Here


    private static GridPointInfo getGridPointInfo(XYItemEntity en, Chart chart) {
        ChartModel model = chart.getModel();
        if (model == null)
            return null;

        GridPointInfo info = new GridPointInfoImpl();
        info.setSeries(new SeriesInfoImpl());
        info.getSeries().setIndex(en.getSeriesIndex());
        info.setIndex(en.getItem());
        ModelInfo modelInfo = new ModelInfo(model);
        if (!modelInfo.isDataEmpty()) {
            if (modelInfo.getModelType() == ModelType.Date) {
                TimeSeriesCollection ds = ModelConverter.toTimeSeriesCollection(chart, modelInfo);
                Comparable seriesKey = ds.getSeriesKey(en.getSeriesIndex());
                Number tupleKey = ds.getX(en.getSeriesIndex(), en.getItem());
                if (tupleKey instanceof Long) {
                    info.setKey(new Date(tupleKey.longValue()));
                } else {
                    info.setKey(tupleKey);
                }

                Object tupleValue = ds.getY(en.getSeriesIndex(), en.getItem());

                info.setValue(tupleValue);
                info.getSeries().setKey(seriesKey);
            } else {
                XYDataset ds = ModelConverter.toXYSeriesCollection(modelInfo);
                Comparable seriesKey = ds.getSeriesKey(en.getSeriesIndex());
                Number tupleKey = ds.getX(en.getSeriesIndex(), en.getItem());
                info.setKey(tupleKey);

                Object tupleValue = ds.getY(en.getSeriesIndex(), en.getItem());

                info.setValue(tupleValue);
                info.getSeries().setKey(seriesKey);
            }
        }

        return info;
    }
View Full Code Here

    }

    private String getValue(XYDataset xyDataset, int i, int i1) {
        String currentValue = "";
        try {
            GridPointInfo point = new GridPointInfoImpl();
            point.setSeries(new SeriesInfoImpl());

            Object key = xyDataset.getX(i, i1);

            ModelInfo info = view.getChart().getRenderHints().getModelInfo();

            if ((key instanceof Long) && info != null && info.getModelType() == ModelType.Date) {
                key = new Date((Long) key);
            }

            point.setKey(key);
            point.setValue(xyDataset.getY(i, i1));

            point.getSeries().setKey(xyDataset.getSeriesKey(i));

            view.setPoint(point);
            //!
            //Object currentValue = DynamicPropertiesUtils.getDynamicValue("point", point, myDynamicProperty);
            //!
View Full Code Here

    }

    private String getValue(CategoryDataset categoryDataset, int i, int i1) {
        String currentValue = "";
        try {
            GridPointInfo point = new GridPointInfoImpl();
            point.setSeries(new SeriesInfoImpl());
            point.setKey(categoryDataset.getColumnKey(i1));
            point.setValue(categoryDataset.getValue(i, i1));

            point.getSeries().setKey(categoryDataset.getRowKey(i));
            point.getSeries().setIndex(categoryDataset.getRowIndex(categoryDataset.getRowKey(i)));

            view.setPoint(point);
            //!
            //String currentValue = DynamicPropertiesUtils.getDynamicValue("point", point, dynamicProperty);
View Full Code Here

TOP

Related Classes of org.openfaces.component.chart.impl.GridPointInfoImpl

Copyright © 2018 www.massapicom. 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.