figures do not display in Eclipse GEF viewer -
i create scrollinggraphicalviewer show figures, no figure displays. debugged source , seems object (figures, editparts, models) created, no exceptions. why figures not display?
since code larege , spread many java files, briefly depict did.
creating model objects. in model, there 2 kinds of elements, directory , file. directory may contain other directories or files.
figure objects. create 2 kinds of figures, 1 directory, other file. directory figure can have nested figures nested directories , files.
editpart objects. each kind of model elements, i.e., directory , file, connect relation between model , figures.
an editpart factory object, create each editpart object.
create scrollinggraphicalviewer object (viewer). , invoke following methods on viewer: viewer.createcontrol(), viewer.setrooteditpart(), viewer.seteditpartfactory, , viewer.setcontents().
anything missing? clues , comments appriciated.
thanks.
overriding refreshvisuals()
in editpart
s trick. correct place react constraint changes dictated model. have set figures constraint relative parent editpart
(and figure's freeformlayout) well, fileeditpart
(cf. cross-posting on eclipse gef forum) following in refreshvisuals()
.
getparent().setlayoutconstraint(this, figure, layout);
layout
here have draw2d rectangle
. can calculate giving x
, y
values, , getfigure().getpreferredsize().width
layout.width
, , dto. height.
for basic gef usage - of case - i'd suggest have @ rubel et al.'s gef book.
Comments
Post a Comment