Search in sources :

Example 1 with TablePieChartConfig

use of org.netxms.ui.eclipse.dashboard.widgets.internal.TablePieChartConfig in project netxms by netxms.

the class TableComparisonChart method createContents.

/* (non-Javadoc)
	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
	 */
@Override
protected Control createContents(Composite parent) {
    config = (TableComparisonChartConfig) getElement().getAdapter(TableComparisonChartConfig.class);
    Composite dialogArea = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.makeColumnsEqualWidth = true;
    dialogArea.setLayout(layout);
    title = new LabeledText(dialogArea, SWT.NONE);
    title.setLabel(Messages.get().TableComparisonChart_Title);
    title.setText(config.getTitle());
    GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 2;
    title.setLayoutData(gd);
    legendPosition = WidgetHelper.createLabeledCombo(dialogArea, SWT.READ_ONLY, Messages.get().TableComparisonChart_LegendPosition, WidgetHelper.DEFAULT_LAYOUT_DATA);
    legendPosition.add(Messages.get().TableComparisonChart_Left);
    legendPosition.add(Messages.get().TableComparisonChart_Right);
    legendPosition.add(Messages.get().TableComparisonChart_Top);
    legendPosition.add(Messages.get().TableComparisonChart_Bottom);
    legendPosition.select(positionIndexFromValue(config.getLegendPosition()));
    Group optionsGroup = new Group(dialogArea, SWT.NONE);
    optionsGroup.setText(Messages.get().TableComparisonChart_Options);
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.verticalSpan = 2;
    optionsGroup.setLayoutData(gd);
    GridLayout optionsLayout = new GridLayout();
    optionsGroup.setLayout(optionsLayout);
    checkShowTitle = new Button(optionsGroup, SWT.CHECK);
    checkShowTitle.setText(Messages.get().TableComparisonChart_ShowTitle);
    checkShowTitle.setSelection(config.isShowTitle());
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    checkShowTitle.setLayoutData(gd);
    checkShowLegend = new Button(optionsGroup, SWT.CHECK);
    checkShowLegend.setText(Messages.get().TableComparisonChart_ShowLegend);
    checkShowLegend.setSelection(config.isShowLegend());
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    checkShowLegend.setLayoutData(gd);
    checkShowIn3D = new Button(optionsGroup, SWT.CHECK);
    checkShowIn3D.setText(Messages.get().TableComparisonChart_3DView);
    checkShowIn3D.setSelection(config.isShowIn3D());
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    checkShowIn3D.setLayoutData(gd);
    checkTranslucent = new Button(optionsGroup, SWT.CHECK);
    checkTranslucent.setText(Messages.get().TableComparisonChart_Translucent);
    checkTranslucent.setSelection(config.isTranslucent());
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    checkTranslucent.setLayoutData(gd);
    if ((config instanceof TableBarChartConfig) || (config instanceof TableTubeChartConfig)) {
        checkTransposed = new Button(optionsGroup, SWT.CHECK);
        checkTransposed.setText(Messages.get().TableComparisonChart_Transposed);
        checkTransposed.setSelection((config instanceof TableBarChartConfig) ? ((TableBarChartConfig) config).isTransposed() : ((TableTubeChartConfig) config).isTransposed());
        gd = new GridData();
        gd.horizontalAlignment = SWT.FILL;
        gd.grabExcessHorizontalSpace = true;
        checkTransposed.setLayoutData(gd);
    }
    gd = new GridData();
    gd.verticalAlignment = SWT.TOP;
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    refreshRate = WidgetHelper.createLabeledSpinner(dialogArea, SWT.BORDER, Messages.get().TableComparisonChart_RefreshInterval, 1, 10000, gd);
    refreshRate.setSelection(config.getRefreshRate());
    if (!(config instanceof TablePieChartConfig)) {
        yAxisRange = new YAxisRangeEditor(dialogArea, SWT.NONE);
        gd = new GridData();
        gd.horizontalSpan = layout.numColumns;
        gd.horizontalAlignment = SWT.FILL;
        gd.grabExcessHorizontalSpace = true;
        yAxisRange.setLayoutData(gd);
        yAxisRange.setSelection(config.isAutoScale(), config.modifyYBase(), config.getMinYScaleValue(), config.getMaxYScaleValue());
    }
    return dialogArea;
}
Also used : TableBarChartConfig(org.netxms.ui.eclipse.dashboard.widgets.internal.TableBarChartConfig) TableTubeChartConfig(org.netxms.ui.eclipse.dashboard.widgets.internal.TableTubeChartConfig) Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) LabeledText(org.netxms.ui.eclipse.widgets.LabeledText) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) YAxisRangeEditor(org.netxms.ui.eclipse.perfview.widgets.YAxisRangeEditor) TablePieChartConfig(org.netxms.ui.eclipse.dashboard.widgets.internal.TablePieChartConfig)

Aggregations

GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Button (org.eclipse.swt.widgets.Button)1 Composite (org.eclipse.swt.widgets.Composite)1 Group (org.eclipse.swt.widgets.Group)1 TableBarChartConfig (org.netxms.ui.eclipse.dashboard.widgets.internal.TableBarChartConfig)1 TablePieChartConfig (org.netxms.ui.eclipse.dashboard.widgets.internal.TablePieChartConfig)1 TableTubeChartConfig (org.netxms.ui.eclipse.dashboard.widgets.internal.TableTubeChartConfig)1 YAxisRangeEditor (org.netxms.ui.eclipse.perfview.widgets.YAxisRangeEditor)1 LabeledText (org.netxms.ui.eclipse.widgets.LabeledText)1