当前位置: 首页>>代码示例>>Java>>正文


Java DisplayerSettings.setType方法代码示例

本文整理汇总了Java中org.dashbuilder.displayer.DisplayerSettings.setType方法的典型用法代码示例。如果您正苦于以下问题:Java DisplayerSettings.setType方法的具体用法?Java DisplayerSettings.setType怎么用?Java DisplayerSettings.setType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.dashbuilder.displayer.DisplayerSettings的用法示例。


在下文中一共展示了DisplayerSettings.setType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showDisplayer

import org.dashbuilder.displayer.DisplayerSettings; //导入方法依赖的package包/类
public void showDisplayer() {
    if (view.isTableDisplayModeOn()) {
        try {
            DisplayerSettings tableSettings = displayerSettings.cloneInstance();
            tableSettings.setTitleVisible(false);
            tableSettings.setType(DisplayerType.TABLE);
            tableSettings.setTablePageSize(8);
            tableSettings.setTableWidth(800);
            tableSettings.setRenderer("default");
            Displayer tableDisplayer = displayerLocator.lookupDisplayer(tableSettings);
            tableDisplayer.addListener(displayerListener);
            tableDisplayer.setRefreshOn(false);
            tableDisplayer.draw();
            view.showDisplayer(tableDisplayer);
        } catch (Exception e) {
            view.error(new ClientRuntimeError(e));
        }
    }
    else if (supportsHtmlTemplate()) {
        displayerHtmlEditor.setDisplayer(displayer);
        view.showDisplayer(displayerHtmlEditor);
    }
    else {
        view.showDisplayer(displayer);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:27,代码来源:DisplayerEditor.java

示例2: createChartMetric

import org.dashbuilder.displayer.DisplayerSettings; //导入方法依赖的package包/类
protected Displayer createChartMetric(String group) {

        DisplayerType type = DisplayerType.BARCHART;
        switch (chartTypeSelector.getSelectedIndex()) {
            case 1: type = DisplayerType.LINECHART; break;
            case 2: type = DisplayerType.AREACHART; break;
        }

        BarChartSettingsBuilder<BarChartSettingsBuilderImpl> builder = DisplayerSettingsFactory.newBarChartSettings()
                .title(group)
                .titleVisible(false)
                .width(700).height(200)
                .margins(30, 5, 60, 10)
                .legendOff()
                .filterOff(true)
                .dataset("clusterMetrics");

        if (DisplayerType.BARCHART.equals(type)) {
            builder.filter(COLUMN_TIMESTAMP, timeFrame("begin[minute] till end[minute]"));
            builder.group(COLUMN_TIMESTAMP).fixed(SECOND, true);
            builder.column(COLUMN_TIMESTAMP).format(AppConstants.INSTANCE.metrics_cluster_column_time());
            builder.subType_StackedColumn();
        } else {
            builder.filter(COLUMN_TIMESTAMP, timeFrame("-60second till now"));
            builder.group(COLUMN_TIMESTAMP).dynamic(60, SECOND, true);
            builder.column(COLUMN_TIMESTAMP).format(AppConstants.INSTANCE.metrics_cluster_column_time());
        }

        List<Integer> metricIdxs = metricChartDef.get(group);
        for (Integer metricIdx : metricIdxs) {
            ClusterMetric metric = metricDefList.get(metricIdx);
                builder.column(metric.column, AVERAGE);
                builder.expression(metric.expression);
                builder.format(metric.title, metric.format);
                builder.yAxisTitle(metric.units);
        }

        DisplayerSettings settings = builder.buildSettings();
        settings.setType(type);
        return displayerLocator.lookupDisplayer(settings);
    }
 
开发者ID:kiegroup,项目名称:appformer,代码行数:42,代码来源:ClusterMetricsDashboard.java


注:本文中的org.dashbuilder.displayer.DisplayerSettings.setType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。