Hi Tom,
Would it be possible for the constructors to require the layer that the Fig
is on? That way, we would not need to call setLayer(), and thereby remove
the risk of a Fig being left without a layer assigned (see recent
discussions, and http://argouml.tigris.org/issues/show_bug.cgi?id=5460).
Dave
Tom Morris wrote:
I need design review and feedback on a proposed set of new
constructors for the diagram figs. I'm refactoring parts of the
diagram subsystem so that it will:
- not have strong dependencies on the current project
- not draw things wrong and then correct them later when projects are loaded
- have figs which are fully valid at the time they are constructed
This work requires a global change to the Fig constructors so that the
PGML parser can pass some additional information and I'd like to have
all the figs have a very small (preferably one), very regular set of
constructors that are used consistently everywhere.
Since this has wide impact, I'd like to get it as close to correct as
possible the first time around. Basically I'd like to require that
anything is that is associated with an owning model element require
that the owner by provided in the constructor. I've also introduced
an object that contains all the rendering settings (font family, font
size, multiplicity rendering settings, etc). This gets passed from
the project to the diagram to the figs, so we'll just have a single
global set of settings to start with (same as now), but the
infrastructure will be in place to have per-diagram or per-fig
rendering settings.
Below is the new set of constructors. The intent is to deprecate all
or almost all of the old ones.
FigNodeModelElement(Object owningElement, Rectangle bounds,
DiagramSetting settings)
FigEdgeModel(Object owningElement, DiagramSettings settings)
ArgoFigText(Object owningElement, DiagramSettings settings)
ArgoFigText(DiagramSettings settings) - static or application managed text
I have some questions:
- the FigNodeModelElement subclasses all have constructors which take
a GraphModel, but I haven't found anywhere that uses the GraphModel.
Does anyone know why this is or if there's a reason to continue to
have this constructor available?
- are there any other global changes to these constructors needed that
should be addressed now?
- does the proposed set of constructors look reasonable?
I've got enough of the work done that I'm reasonably confident that
the approach I'm taking is workable. Basically the work will be
phased as follows:
1. Factor presentation rendering settings out of ProjectSettings so
that they can be managed separately without any dependencies on
Project or ProjectManager. ProjectSettings will keep a copy of the
presentation settings that represent the project-wide defaults. For
backward compatibility, the old methods delegate to this copy of the
presentation settings. This work is done and has been committed. It
should be transparent to all current users of ProejctSettings.
2. Update ArgoFig, the four top level figs (FigNodeModelElement,
FigEdgeModelElement, ArgoFigText, ArgoFigGroup), ArgoDiagram, and
ArgoDiagramImpl to take DiagramSettings objects in their constructors
and return them when asked. Modify the PGML parser and the diagram
factory to propagate project settings to newly created diagrams.
Modify the PGML parser to look for the new constructors for Figs if
available, then fall back to our current set of constructors. This
work is complete, but hasn't been committed pending review of the new
constructors. It should be transparent to all current code, but will
make the new settings available for use as code is updated.
3. Go through all the figs, diagram by diagram, and update them to
have new style constructors and use the presentation settings that are
passed in that constructor. This work can be done incrementally with
figs that haven't yet been updated still working the old (current)
way, referencing the current project settings.
Please let me know what you think of the design for the new constructors.
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]