本文整理匯總了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);
}