Re: [pyGEF-develop] Some python tech: zope.interface andenthoughTraits
Status: Pre-Alpha
Brought to you by:
hrgerber
|
From: <pyg...@li...> - 2007-06-13 19:28:42
|
On 6/13/07, Bill Baxter <wb...@gm...> wrote: > > [[RETIEF:]] There are a couple of options. In pyGEF I create the new > Control (Document element), but don't add it to the document. All controls > have a createfigure and createdragfigure method. When a element is added to > the design the createfigure method is used to create the figure that is > added to the document. The createdragfigure is used to create the figure > that is dragged. This figure is held by the Tool, which adds and removes it > from the canvas. All dragfigures should be placed on the drag layer. Then > only this layer needs to be redrawn as the figure is moved. The other > layers can be drawn as a background bitmap. The CreateCommand, that adds > the element to the document, is then only called one the element is placed. > This make undo easy. It also makes the escape easy as the add figure to > canvas is not implemented as a command. You generally can't undo the escape > from a specific tool, although this could be an interesting feature. That sounds more or less like how I was doing it. Tool holds onto the new object till creation parameters are fixed, and then the "AddObject" command is issued. But for a more general drawing app you might want the interactive placement step to draw the object in the correct layer while dragging, so it won't necessarily be on top. > > [[RETIEF:]] I can see that I must change the names of some of my classes > to make things more clear. > > > > Here are some suggestions (please comment): > > > > Editor -> Document Document is often used to mean "DataModel" in things like the wx DocView framework. I'm not sure that's the role Editor is serving. > > Canvas -> View or DocumentView Similarly it seems Editor has-a Canvas whereas in the typical Doc/View paradigm one "Document" can have many "Views". > > > > Control -> Element or > DocumentElement/Component/DocumentControl I like Element, yep. > > > > DataModel -> ElementData or > ElementDataModel/DocumentDataModel/ElementModel I like ElementData too, yep. > > Figure -> ElementView/ Graphic ? or > GraphicObject/DrawObject/DocumentGraphic I lean towards Graphic or GraphicObject. --bb |