Search in sources :

Example 16 with ChartComposite

use of org.jfree.experimental.chart.swt.ChartComposite in project cubrid-manager by CUBRID.

the class VolumeFolderInfoEditor method paintComp1.

/**
	 * paint the composite
	 *
	 */
public void paintComp1() {
    for (DbSpaceInfo dbSpaceInfo : dbSpaceList) {
        JFreeChart chart = createChart(createDataset(dbSpaceInfo), dbSpaceInfo);
        final ChartComposite frame = new ChartComposite(chartComp, SWT.NONE, chart, false, true, false, true, true);
        GridData gdDescGroup = new GridData();
        gdDescGroup.widthHint = 350;
        gdDescGroup.heightHint = 250;
        frame.setLayoutData(gdDescGroup);
    }
}
Also used : ChartComposite(org.jfree.experimental.chart.swt.ChartComposite) DbSpaceInfo(com.cubrid.cubridmanager.core.cubrid.dbspace.model.DbSpaceInfo) GridData(org.eclipse.swt.layout.GridData) JFreeChart(org.jfree.chart.JFreeChart)

Example 17 with ChartComposite

use of org.jfree.experimental.chart.swt.ChartComposite in project cubrid-manager by CUBRID.

the class VolumeInformationEditor method paintComp.

/**
	 * paint composite
	 *
	 */
public void paintComp() {
    if (chartComp == null || chartComp.isDisposed()) {
        return;
    }
    Control[] controls = chartComp.getChildren();
    for (Control control : controls) {
        control.dispose();
    }
    JFreeChart chart = createChart(createDataset());
    final ChartComposite frame = new ChartComposite(chartComp, SWT.NONE, chart, false, true, false, true, true);
    GridData gdDescGroup = new GridData(GridData.FILL_HORIZONTAL);
    gdDescGroup.widthHint = 600;
    gdDescGroup.heightHint = 400;
    frame.setLayoutData(gdDescGroup);
}
Also used : ChartComposite(org.jfree.experimental.chart.swt.ChartComposite) Control(org.eclipse.swt.widgets.Control) GridData(org.eclipse.swt.layout.GridData) JFreeChart(org.jfree.chart.JFreeChart)

Example 18 with ChartComposite

use of org.jfree.experimental.chart.swt.ChartComposite in project cubrid-manager by CUBRID.

the class DatabaseStatusEditor method paintOnePie.

/**
	 *
	 * Paint the pie chart
	 *
	 * @param dbSpaceInfo the DbSpace information
	 */
public void paintOnePie(DbSpaceInfo dbSpaceInfo) {
    JFreeChart chart = createChart(createDataset(dbSpaceInfo), dbSpaceInfo);
    final ChartComposite frame = new ChartComposite(chartComp, SWT.NONE, chart, false, true, false, true, true);
    GridData gdDescGroup = new GridData(GridData.FILL_HORIZONTAL);
    gdDescGroup.heightHint = 220;
    frame.setLayoutData(gdDescGroup);
}
Also used : ChartComposite(org.jfree.experimental.chart.swt.ChartComposite) GridData(org.eclipse.swt.layout.GridData) JFreeChart(org.jfree.chart.JFreeChart)

Example 19 with ChartComposite

use of org.jfree.experimental.chart.swt.ChartComposite in project cubrid-manager by CUBRID.

the class ReplicationMonitorViewPart method createPlotTableUnit.

/**
	 * Creates the plot table unit
	 * 
	 * @param composite Composite
	 */
private void createPlotTableUnit(Composite composite) {
    final JFreeChart chart = createChart();
    ChartComposite chartFrame = new ChartComposite(composite, SWT.NONE, chart, false, true, false, true, true);
    GridData gdFrame = new GridData(SWT.FILL, SWT.FILL, true, true);
    chartFrame.setLayoutData(gdFrame);
    chartFrame.setLayout(new FillLayout());
}
Also used : ChartComposite(org.jfree.experimental.chart.swt.ChartComposite) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout) JFreeChart(org.jfree.chart.JFreeChart)

Example 20 with ChartComposite

use of org.jfree.experimental.chart.swt.ChartComposite in project tdq-studio-se by Talend.

the class TOPChartService method addListenerToChartComp.

@Override
public void addListenerToChartComp(Object chartComposite, final String referenceLink, final String menuText) {
    final ChartComposite chartComp = (ChartComposite) chartComposite;
    final ChartMouseListener listener = new ChartMouseListener() {

        @Override
        public void chartMouseClicked(ChartMouseEvent event) {
            if (event.getTrigger().getButton() == 1 && referenceLink != null) {
                Menu menu = new Menu(chartComp.getShell(), SWT.POP_UP);
                chartComp.setMenu(menu);
                MenuItem item = new MenuItem(menu, SWT.PUSH);
                item.setText(menuText);
                item.addSelectionListener(new SelectionAdapter() {

                    @Override
                    public void widgetSelected(SelectionEvent e) {
                        ChartUtils.openReferenceLink(referenceLink);
                    }
                });
                menu.setVisible(true);
            }
        }

        @Override
        public void chartMouseMoved(ChartMouseEvent event) {
        // no need to implement
        }
    };
    chartComp.addChartMouseListener(listener);
    chartComp.addDisposeListener(new DisposeListener() {

        @Override
        public void widgetDisposed(DisposeEvent e) {
            chartComp.removeChartMouseListener(listener);
            chartComp.dispose();
        }
    });
}
Also used : TalendChartComposite(org.talend.dataprofiler.chart.util.TalendChartComposite) ChartComposite(org.jfree.experimental.chart.swt.ChartComposite) DisposeListener(org.eclipse.swt.events.DisposeListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) MenuItem(org.eclipse.swt.widgets.MenuItem) Menu(org.eclipse.swt.widgets.Menu) ChartMouseEvent(org.jfree.chart.ChartMouseEvent) DisposeEvent(org.eclipse.swt.events.DisposeEvent) ChartMouseListener(org.jfree.chart.ChartMouseListener)

Aggregations

ChartComposite (org.jfree.experimental.chart.swt.ChartComposite)25 GridData (org.eclipse.swt.layout.GridData)17 FillLayout (org.eclipse.swt.layout.FillLayout)11 JFreeChart (org.jfree.chart.JFreeChart)9 TalendChartComposite (org.talend.dataprofiler.chart.util.TalendChartComposite)8 ChartMouseEvent (org.jfree.chart.ChartMouseEvent)7 ChartMouseListener (org.jfree.chart.ChartMouseListener)7 Display (org.eclipse.swt.widgets.Display)4 Group (org.eclipse.swt.widgets.Group)4 Shell (org.eclipse.swt.widgets.Shell)4 DisposeEvent (org.eclipse.swt.events.DisposeEvent)3 DisposeListener (org.eclipse.swt.events.DisposeListener)3 GridLayout (org.eclipse.swt.layout.GridLayout)3 Menu (org.eclipse.swt.widgets.Menu)3 CategoryItemEntity (org.jfree.chart.entity.CategoryItemEntity)3 ChartEntity (org.jfree.chart.entity.ChartEntity)3 Color (java.awt.Color)2 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 MenuItem (org.eclipse.swt.widgets.MenuItem)2