本文整理匯總了Java中org.dashbuilder.displayer.DisplayerSettingsFactory類的典型用法代碼示例。如果您正苦於以下問題:Java DisplayerSettingsFactory類的具體用法?Java DisplayerSettingsFactory怎麽用?Java DisplayerSettingsFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DisplayerSettingsFactory類屬於org.dashbuilder.displayer包,在下文中一共展示了DisplayerSettingsFactory類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initBubbleChartCategory
import org.dashbuilder.displayer.DisplayerSettingsFactory; //導入依賴的package包/類
private void initBubbleChartCategory() {
GalleryTreeNodeList nodeList = new GalleryTreeNodeList(AppConstants.INSTANCE.gallerytree_bubble());
mainNodes.add(nodeList);
nodeList.add(new GalleryPlaceRequest(AppConstants.INSTANCE.gallerytree_bubble_basic(), createPlaceRequest(
DisplayerSettingsFactory.newBubbleChartSettings()
.dataset(SALES_OPPS)
.group(COUNTRY)
.column(COUNTRY, "Country")
.column(COUNT, "#opps").format(AppConstants.INSTANCE.gallerytree_bubble_basic_column1(), "#,###")
.column(PROBABILITY, AVERAGE).format(AppConstants.INSTANCE.gallerytree_bubble_basic_column2(), "#,###")
.column(COUNTRY, AppConstants.INSTANCE.gallerytree_bubble_basic_column4())
.column(EXPECTED_AMOUNT, SUM).format(AppConstants.INSTANCE.gallerytree_bubble_basic_column3(), "$ #,###")
.title(AppConstants.INSTANCE.gallerytree_bubble_basic_title())
.width(700).height(400)
.margins(20, 50, 50, 0)
.filterOn(false, true, true)
.buildSettings()
)));
}
示例2: testFilterNotAllowed
import org.dashbuilder.displayer.DisplayerSettingsFactory; //導入依賴的package包/類
@Test
public void testFilterNotAllowed() {
AbstractDisplayer allRowsTable = (AbstractDisplayer) displayerLocator.lookupDisplayer(
DisplayerSettingsFactory.newTableSettings()
.dataset(EXPENSES)
.filterOff(true)
.buildSettings());
DisplayerListener listener = mock(DisplayerListener.class);
allRowsTable.addListener(listener);
allRowsTable.draw();
reset(listener);
allRowsTable.filterUpdate(COLUMN_DEPARTMENT, 0);
DataSet dataSet = allRowsTable.getDataSetHandler().getLastDataSet();
assertEquals(dataSet.getRowCount(), 50);
verify(listener, never()).onDataLookup(allRowsTable);
verify(listener, never()).onRedraw(allRowsTable);
}
示例3: testChangeAttributes
import org.dashbuilder.displayer.DisplayerSettingsFactory; //導入依賴的package包/類
@Test
public void testChangeAttributes() {
DisplayerSettings settings = DisplayerSettingsFactory.newBarChartSettings().buildSettings();
when(displayer.getDisplayerSettings()).thenReturn(settings);
presenter.init(displayer);
presenter.onAttributeChanged(TITLE.getFullId(), "Test");
presenter.onAttributeChanged(TITLE_VISIBLE.getFullId(), "true");
presenter.onAttributeChanged(EXPORT_TO_CSV.getFullId(), "false");
presenter.onAttributeChanged(EXPORT_TO_XLS.getFullId(), "false");
presenter.onAttributeChanged(CHART_HEIGHT.getFullId(), "400");
presenter.onAttributeChanged("columns.amount.name", "Total");
presenter.onAttributeChanged("columns.amount.pattern", "#.###,00");
presenter.onAttributeChanged("columns.amount.expression", "value");
assertEquals(settings.getTitle(), "Test");
assertEquals(settings.isTitleVisible(), true);
assertEquals(settings.isCSVExportAllowed(), false);
assertEquals(settings.isExcelExportAllowed(), false);
assertEquals(settings.getChartHeight(), 400);
assertEquals(settings.getColumnSettings("amount").getColumnName(), "Total");
assertEquals(settings.getColumnSettings("amount").getValuePattern(), "#.###,00");
assertEquals(settings.getColumnSettings("amount").getValueExpression(), "value");
verify(event, atLeastOnce()).fire(any(DisplayerSettingsChangedEvent.class));
}
示例4: testMeterSettings
import org.dashbuilder.displayer.DisplayerSettingsFactory; //導入依賴的package包/類
@Test
public void testMeterSettings() {
when(displayer.getDisplayerConstraints()).thenReturn(
new DisplayerConstraints(null)
.supportsAttribute(METER_GROUP));
when(displayer.getDisplayerSettings()).thenReturn(DisplayerSettingsFactory.newMeterChartSettings()
.meter(0, 100, 500, 900)
.buildSettings());
presenter.init(displayer);
verify(view).clear();
verify(view).addTextProperty(eq(METER_START), eq("0"), any(DisplayerSettingsEditor.LongValidator.class));
verify(view).addTextProperty(eq(METER_WARNING), eq("100"), any(DisplayerSettingsEditor.LongValidator.class));
verify(view).addTextProperty(eq(METER_CRITICAL), eq("500"), any(DisplayerSettingsEditor.LongValidator.class));
verify(view).addTextProperty(eq(METER_END), eq("900"), any(DisplayerSettingsEditor.LongValidator.class));
verify(view).show();
}
示例5: testRenderer
import org.dashbuilder.displayer.DisplayerSettingsFactory; //導入依賴的package包/類
@Test
public void testRenderer() {
DisplayerSettings settings = DisplayerSettingsFactory.newBarChartSettings()
.renderer("rendererB")
.buildSettings();
when(rendererManager.getRendererForDisplayer(settings)).thenReturn(rendererB);
when(displayer.getDisplayerConstraints()).thenReturn(
new DisplayerConstraints(null)
.supportsAttribute(RENDERER));
when(displayer.getDisplayerSettings()).thenReturn(settings);
presenter.init(displayer);
verify(view).clear();
verify(view).addListProperty(RENDERER, Arrays.asList("rendererA", "rendererB"), "rendererB");
verify(view).show();
}
示例6: testSupportedAttrs
import org.dashbuilder.displayer.DisplayerSettingsFactory; //導入依賴的package包/類
@Test
public void testSupportedAttrs() {
when(displayer.getDisplayerConstraints()).thenReturn(new DisplayerConstraints(null)
.supportsAttribute(TYPE)
.supportsAttribute(SUBTYPE)
.supportsAttribute(TITLE)
.supportsAttribute(FILTER_GROUP));
when(displayer.getDisplayerSettings()).thenReturn(DisplayerSettingsFactory.newBarChartSettings().buildSettings());
presenter.init(displayer);
assertEquals(presenter.isSupported(TYPE), true);
assertEquals(presenter.isSupported(SUBTYPE), true);
assertEquals(presenter.isSupported(TITLE), true);
assertEquals(presenter.isSupported(TITLE_VISIBLE), false);
assertEquals(presenter.isSupported(RENDERER), false);
assertEquals(presenter.isSupported(FILTER_ENABLED), true);
assertEquals(presenter.isSupported(FILTER_LISTENING_ENABLED), true);
assertEquals(presenter.isSupported(FILTER_NOTIFICATION_ENABLED), true);
assertEquals(presenter.isSupported(FILTER_SELFAPPLY_ENABLED), true);
}
示例7: testFullTableFilterEvent
import org.dashbuilder.displayer.DisplayerSettingsFactory; //導入依賴的package包/類
/**
* Avoid IndexOutOfBoundsException caused when a filter is notified to
* a table consuming the whole data set (no data lookup columns set).
*/
@Test
public void testFullTableFilterEvent() {
AbstractDisplayer tableNoColumns = createNewDisplayer(
DisplayerSettingsFactory.newTableSettings()
.dataset(EXPENSES)
.filterOn(true, false, true)
.buildSettings());
displayerCoordinator = new DisplayerCoordinator(rendererManager);
displayerCoordinator.addDisplayers(deptPieChart, tableNoColumns);
displayerCoordinator.addListener(listener);
displayerCoordinator.drawAll();
// Click on the "Engineering" slice
reset(listener);
deptPieChart.filterUpdate(COLUMN_DEPARTMENT, 0);
// Check the allRowsTable receives the filter request
DataSet dataSet = allRowsTable.getDataSetHandler().getLastDataSet();
assertEquals(dataSet.getRowCount(), 19);
verify(listener).onDataLookup(allRowsTable);
verify(listener).onRedraw(tableNoColumns);
}
示例8: testSwitchRefreshOff
import org.dashbuilder.displayer.DisplayerSettingsFactory; //導入依賴的package包/類
@Test
public void testSwitchRefreshOff() {
AbstractDisplayer displayer = (AbstractDisplayer) displayerLocator.lookupDisplayer(
DisplayerSettingsFactory.newTableSettings()
.dataset(EXPENSES)
.refreshOn(10, false)
.buildSettings()
);
// Draw is always required ion order to switch refresh on
displayer.draw();
// Switch off
reset(displayer.getView());
displayer.setRefreshOn(false);
assertEquals(displayer.isRefreshOn(), false);
verify(displayer.getView()).cancelRefreshTimer();
}
示例9: testSwitchRefreshOn
import org.dashbuilder.displayer.DisplayerSettingsFactory; //導入依賴的package包/類
@Test
public void testSwitchRefreshOn() {
AbstractDisplayer displayer = (AbstractDisplayer) displayerLocator.lookupDisplayer(
DisplayerSettingsFactory.newTableSettings()
.dataset(EXPENSES)
.refreshOn(10, false)
.buildSettings()
);
// Refresh enabled on draw
AbstractDisplayer.View view = displayer.getView();
displayer.draw();
verify(view).enableRefreshTimer(10);
// Already on, nothing happens
reset(view);
displayer.setRefreshOn(true);
verify(view, never()).enableRefreshTimer(anyInt());
verify(view, never()).cancelRefreshTimer();
}
示例10: testTableDraw
import org.dashbuilder.displayer.DisplayerSettingsFactory; //導入依賴的package包/類
@Test
public void testTableDraw() {
DisplayerSettings allRows = DisplayerSettingsFactory.newTableSettings()
.dataset(EXPENSES)
.tableOrderDefault(COLUMN_DEPARTMENT, SortOrder.DESCENDING)
.tableOrderEnabled(true)
.tablePageSize(10)
.tableWidth(1000)
.buildSettings();
GoogleTableDisplayer table = createTableDisplayer(allRows);
GoogleTableDisplayer.View tableView = table.getView();
table.ready();
verify(tableView).setWidth(1000);
verify(tableView).setSortEnabled(true);
verify(tableView).setPageSize(10);
verify(tableView).setTotalRows(50);
verify(tableView).setTotalPages(5);
verify(tableView).setPagerEnabled(true);
verify(tableView).drawTable();
}
示例11: testEmptyTableDraw
import org.dashbuilder.displayer.DisplayerSettingsFactory; //導入依賴的package包/類
@Test
public void testEmptyTableDraw() {
DisplayerSettings allRows = DisplayerSettingsFactory.newTableSettings()
.dataset(EXPENSES)
.filter(COLUMN_ID, FilterFactory.isNull())
.tablePageSize(10)
.buildSettings();
GoogleTableDisplayer table = createTableDisplayer(allRows);
GoogleTableDisplayer.View tableView = table.getView();
table.ready();
verify(tableView).setPageSize(10);
verify(tableView).setTotalRows(0);
verify(tableView).setTotalPages(1);
verify(tableView).setPagerEnabled(false);
verify(tableView).nodata();
}
示例12: testDraw
import org.dashbuilder.displayer.DisplayerSettingsFactory; //導入依賴的package包/類
@Test
public void testDraw() {
DisplayerSettings departmentList = DisplayerSettingsFactory.newSelectorSettings()
.dataset(EXPENSES)
.group(COLUMN_DEPARTMENT)
.column(COLUMN_DEPARTMENT)
.column(COLUMN_ID, AggregateFunctionType.COUNT)
.filterOn(false, true, false)
.multiple(false)
.buildSettings();
SelectorDropDownDisplayer presenter = createSelectorDisplayer(departmentList);
SelectorDropDownDisplayer.View view = presenter.getView();
presenter.draw();
verify(view).clearItems();
verify(view).showSelectHint(COLUMN_DEPARTMENT, false);
verify(view, times(5)).addItem(any());
verify(view, never()).showResetHint(anyString(), anyBoolean());
// Verify the entries are sorted by default
DataSet dataSet = presenter.getDataSetHandler().getLastDataSet();
assertEquals(dataSet.getValueAt(0, 0), "Engineering");
assertEquals(dataSet.getValueAt(4, 0), "Support");
}
示例13: testNoData
import org.dashbuilder.displayer.DisplayerSettingsFactory; //導入依賴的package包/類
@Test
public void testNoData() {
DisplayerSettings departmentList = DisplayerSettingsFactory.newSelectorSettings()
.dataset(EXPENSES)
.filter(COLUMN_ID, FilterFactory.isNull())
.group(COLUMN_DEPARTMENT)
.column(COLUMN_DEPARTMENT)
.column(COLUMN_ID, AggregateFunctionType.COUNT)
.multiple(false)
.buildSettings();
SelectorDropDownDisplayer presenter = createSelectorDisplayer(departmentList);
SelectorDropDownDisplayer.View view = presenter.getView();
presenter.draw();
verify(view).clearItems();
verify(view).showSelectHint(COLUMN_DEPARTMENT, false);
verify(view, never()).addItem(any());
}
示例14: testDraw
import org.dashbuilder.displayer.DisplayerSettingsFactory; //導入依賴的package包/類
@Test
public void testDraw() {
DisplayerSettings departmentList = DisplayerSettingsFactory.newSelectorSettings()
.dataset(EXPENSES)
.group(COLUMN_DEPARTMENT)
.column(COLUMN_DEPARTMENT)
.column(COLUMN_ID, AggregateFunctionType.COUNT)
.filterOn(false, true, false)
.buildSettings();
SelectorLabelSetDisplayer presenter = createSelectorDisplayer(departmentList);
SelectorLabelSetDisplayer.View view = presenter.getView();
presenter.draw();
verify(view).clearItems();
verify(view, times(5)).addItem(any());
// Verify the entries are sorted by default
DataSet dataSet = presenter.getDataSetHandler().getLastDataSet();
assertEquals(dataSet.getValueAt(0, 0), "Engineering");
assertEquals(dataSet.getValueAt(4, 0), "Support");
}
示例15: testNoData
import org.dashbuilder.displayer.DisplayerSettingsFactory; //導入依賴的package包/類
@Test
public void testNoData() {
DisplayerSettings departmentList = DisplayerSettingsFactory.newSelectorSettings()
.dataset(EXPENSES)
.filter(COLUMN_ID, FilterFactory.isNull())
.group(COLUMN_DEPARTMENT)
.column(COLUMN_DEPARTMENT)
.column(COLUMN_ID, AggregateFunctionType.COUNT)
.buildSettings();
SelectorLabelSetDisplayer presenter = createSelectorDisplayer(departmentList);
SelectorLabelSetDisplayer.View view = presenter.getView();
presenter.draw();
verify(view).clearItems();
verify(view, never()).addItem(any());
}