Package fr.soleil.comete.swing

Examples of fr.soleil.comete.swing.Chart


     *
     * @return fr.esrf.tangoatk.widget.attribute.NonAttrNumberSpectrumViewer
     */
    private Chart getFittedData() {
        if (fittedData == null) {
            fittedData = new Chart();
            fittedData.setUseDisplayNameForDataSaving(true);
            fittedData.setAutoHighlightOnLegend(true);
            fittedData.setManagementPanelVisible(false);
        }
        return fittedData;
View Full Code Here


            chartConstraints.gridx = 0;
            chartConstraints.gridy = 0;
            chartConstraints.weightx = 1;
            chartConstraints.weighty = 1;
            chartConstraints.gridwidth = GridBagConstraints.REMAINDER;
            roiSpectrumViewers[i] = new Chart();
            roiSpectrumViewers[i].setCometeBackground(CometeColor.WHITE);
            roiPanels[i].add(roiSpectrumViewers[i], chartConstraints);

            GridBagConstraints titleConstraints = new GridBagConstraints();
            titleConstraints.fill = GridBagConstraints.NONE;
View Full Code Here

            chartConstraints.gridx = 0;
            chartConstraints.gridy = 0;
            chartConstraints.weightx = 1;
            chartConstraints.weighty = 1;
            chartConstraints.gridwidth = GridBagConstraints.REMAINDER;
            roiSpectrumViewers[i] = new Chart();
            roiSpectrumViewers[i].setCometeBackground(CometeColor.WHITE);
            roiPanels[i].add(roiSpectrumViewers[i], chartConstraints);

            GridBagConstraints titleConstraints = new GridBagConstraints();
            titleConstraints.fill = GridBagConstraints.NONE;
View Full Code Here

    }

    public static void main(String[] args) {

        try {
            final Chart chart = new Chart();
            chart.setManagementPanelVisible(false);
            chart.setFreezePanelVisible(false);
            chart.setDataViewCometeColor("data", CometeColor.RED);
            chart.setAutoScale(false, IChartViewer.Y1);
            chart.setAxisMinimum(0, IChartViewer.Y1);
            chart.setAxisMaximum(2, IChartViewer.Y1);
            chart.setAutoScale(false, IChartViewer.X);
            chart.setAxisMinimum(0, IChartViewer.X);
            chart.setAxisMaximum(100, IChartViewer.X);

            String[] labels = new String[zoneColors.length];
            double[] pos = new double[zoneColors.length];
            for (int i = 0; i < zoneColors.length; i++) {
                String id = "Roi" + (i + 1);
                CometeColor color = ColorTool.getCometeColor(new Color(zoneColors[i]));
                chart.setDataViewCometeColor(id, color);
                chart.setDataViewFillStyle(id, IChartViewer.FILL_STYLE_SOLID);
                chart.setDataViewMarkerCometeColor(id, color);
                chart.setDataViewCometeColor(id, color);
                chart.setDataViewLabelVisible(id, false);
                labels[i] = Integer.toString(i + 1);
                pos[i] = 5 * (i + 0.5);
            }
            // chart.getXAxis().setLabels(labels, pos);

            Thread dataThread = new Thread(ColorTestComparator.class.getName() + ": updating rois") {
                @Override
                public void run() {
                    Map<String, Object> dataMap = new LinkedHashMap<String, Object>();
                    double max = Double.NEGATIVE_INFINITY;
                    double[] curveData = new double[200];
                    for (int i = 0; i <= 100; i++) {
                        double y = Math.random();
                        curveData[2 * i] = i;
                        curveData[2 * i + 1] = y;
                        if (y > max) {
                            max = y;
                        }
                    }
                    dataMap.put("Curve", curveData);
                    for (int i = 0; i < ColorTestComparator.zoneColors.length; i++) {
                        double[][] roiData = new double[2][2];
                        roiData[IChartViewer.X_INDEX] = new double[] { 5 * (i + 0.2), 5 * (i + 0.8) };
                        roiData[IChartViewer.Y_INDEX] = new double[] { max, max };
                        dataMap.put("Roi" + (i + 1), roiData);
                    }
                    chart.setData(dataMap);
                }
            };
            dataThread.start();

            JPanel color1Panel = new JPanel();
View Full Code Here

TOP

Related Classes of fr.soleil.comete.swing.Chart

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.