本文整理汇总了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);
}
}
示例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);
}