use of org.drools.workbench.screens.guided.dtable.client.widget.table.themes.GuidedDecisionTableRenderer in project drools-wb by kiegroup.
the class GuidedDecisionTableViewImpl method makeHeaderCaption.
private Group makeHeaderCaption() {
final Group g = GWT.create(Group.class);
final double captionWidth = ((GuidedDecisionTableRenderer) renderer).getHeaderCaptionWidth();
final GuidedDecisionTableTheme theme = (GuidedDecisionTableTheme) renderer.getTheme();
final Rectangle r = theme.getBaseRectangle(GuidedDecisionTableTheme.ModelColumnType.CAPTION);
r.setWidth(captionWidth);
r.setHeight(HEADER_CAPTION_HEIGHT);
final MultiPath border = theme.getBodyGridLine();
border.M(0.5, HEADER_CAPTION_HEIGHT + 0.5);
border.L(0.5, 0.5);
border.L(captionWidth + 0.5, 0.5);
border.L(captionWidth + 0.5, HEADER_CAPTION_HEIGHT + 0.5);
border.L(0.5, HEADER_CAPTION_HEIGHT + 0.5);
final Text caption = theme.getHeaderText();
caption.setText(model.getTableName());
caption.setX(captionWidth / 2);
caption.setY(HEADER_CAPTION_HEIGHT / 2);
// Clip Caption Group
final BoundingBox bb = new BoundingBox(0, 0, captionWidth + border.getStrokeWidth(), HEADER_CAPTION_HEIGHT + 0.5);
final IPathClipper clipper = getPathClipper(bb);
g.setPathClipper(clipper);
clipper.setActive(true);
g.add(r);
g.add(caption);
g.add(border);
return g;
}
use of org.drools.workbench.screens.guided.dtable.client.widget.table.themes.GuidedDecisionTableRenderer in project drools-wb by kiegroup.
the class GuidedDecisionTableModellerPresenterTest method makeDecisionTable.
private GuidedDecisionTableView.Presenter makeDecisionTable() {
final GuidedDecisionTableView.Presenter dtPresenter = mock(GuidedDecisionTableView.Presenter.class);
final GuidedDecisionTableView dtView = mock(GuidedDecisionTableView.class);
final GuidedDecisionTableRenderer renderer = mock(GuidedDecisionTableRenderer.class);
final GridData dtData = new BaseGridData();
when(dtPresenter.getView()).thenReturn(dtView);
when(dtPresenter.getAccess()).thenReturn(mock(GuidedDecisionTablePresenter.Access.class));
when(dtPresenter.getModel()).thenReturn(mock(GuidedDecisionTable52.class));
when(dtView.getModel()).thenReturn(dtData);
when(dtView.getRenderer()).thenReturn(renderer);
when(renderer.getHeaderCaptionWidth()).thenReturn(200.0);
return dtPresenter;
}
Aggregations