I'm a little confused as to what Layer is. Is this extending the meta
model or extending a Fig class (you say "our figure extends from it").
If Layer is extending a meta model element then this seems incorrect
to me. I'f expect you to be using the standard meta model elements
such as UmlPackage and applying stereotypes to them. In fact by using
the model interface I wouldn't even expect to see a reference to
UmlPackage.
You can then write your own panel and register it to replace the
existing prop panel for UmlPackage. Your own panel should then contain
the logic of what to do depending on stereotypes applied.
I agree this does not seem to be flexible enough. Hopefully that will
get you working for now but do submit an enhancement request. I guess
we need modules to provide a their own factory method for generating
prop panels.
Bob.
On 6/22/06, Agustín Marín Ortega <[EMAIL PROTECTED]> wrote:
The type of Object trgt is UmlPackage because our figure extends from it, so
ArgoUML load the properties panels for Package, instead of that we do:
props.addPanel(Layer.class, new propPanelLayer());
Regards.
2006/6/22, Bob Tarling <[EMAIL PROTECTED]>:
>
If you've registered your panel as I described then you should have
called this method int TabProps.
public void addPanel(Class c, PropPanel p) {
panels.put(c, p);
}
As you can see all that does is to add your panel to a hashtable index
by the class.
When ArgoUML later tries to display the correct panel it's using this
code to pull out the panel from the above hastable according to the
class.
private TabModelTarget findPanelFor(Object trgt) {
/* 1st attempt: get a panel that we created before: */
TabModelTarget p = (TabModelTarget) panels.get(trgt.getClass());
if (p != null) {
LOG.debug("Getting prop panel for: " + trgt.getClass().getName()
+ ", " + "found (in cache?) " + p);
return p;
}
So my first thought is you are not registering the class name correctly.
If that's not the case then could you tell me what debug is appearing
in the log at this time.
Cheers
Bob.
On 6/22/06, Agustín Marín Ortega <[EMAIL PROTECTED] > wrote:
> Hello, I'm Agustín Marín, thanks for help me. My diagrams properties
panels
> are being loaded rightly, but now I've problems with my elements
properties
> panels.
>
> We have implemented a metamodel based in a profile of original macmas
> metatypes, e.g., we have an element called Layer that really is a
> stereotyped UMLPackage. The problem is that when the TargetManager request
> for a properties panel for our Layer elements the class PropPanel returns
> the panel of the original UMLPackage element (UMLPackagePanel) instead of
> our LayerPanel.
>
> The logic in this class only consider the original class of the metamodel
> element selected and we can't insert additional logic to support the
correct
> code because we work from a separate argouml module. As you can seen, we
> also can't change our element metatypes because this implies to lost the
> original MOF UML persistence supported by ArgoUML, that is the main reason
> to use the UML Profile mechanism.
>
> What can we do, any idea? Regards.
>
---------------------------------------------------------------------
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]