After some investigation I discovered that the following code can be used in a ViewPart to display a GEF diagram.
@Override
public void createPartControl(Composite parent) {
DefaultEditDomain defaultEditDomain = new DefaultEditDomain(null);
sgv = new ScrollingGraphicalViewer();
defaultEditDomain.addViewer(sgv);
sgv.createControl(parent);
ScalableRootEditPart sffrep = new ScalableRootEditPart();
sgv.setRootEditPart(sffrep);
sgv.setEditPartFactory(new TournamentEditPartFactory());
sgv.getControl().setBackground(ColorConstants.listBackground);
initView();
}
private void initView() {
sgv.setContents(TournamentManager.get());
}
However, my diagram is still not displaying as expected...
No comments:
Post a Comment