From: Christoph F. <cf...@fo...> - 2004-03-26 11:53:15
|
Am Fr, den 26.03.2004 schrieb Tommy Johannessen um 11:22: > Hi, > > I am trying to make a simple AModel model. I have used the > ExampleOpenTopicMap code and tried to extend this. > > I have implemented the ModelProvider inteface into this, and added the two > getModel methods. But I don not manage to get the model. I have made one of > the method like this: > You shouldn't need to do this, unless you want to change the way panckoucke access topicmaps. > public AModel getModel(AMMember arg0, String arg1, AbstractionContext arg2) > throws UnsupportedAMMemberClassException, AbstractorInstantiationException { > > ModelProvider modelProvider = panckouckeContext.getModelProvider(); > > //Assuming you have an AMMember and the connection to the model-provider. > String abstractorClassname = > "org.tm4j.panckoucke.impl.abstraction.compact.CompactAbstractor"; > AModel model = modelProvider.getModel(arg0, abstractorClassname,null); > System.out.println(model); > //renderer.renderModel(model); > > return model; > } > > I have managed to run the panckouckeNotifies(Notification notification) > sucsessefully but how do I get a model and can render it? > Ah. I think I see what I did forget in the example. It stops on half way. Sorry. Basically, the StoreChangedNotification supplies you with a TopicMapReference. If this reference is in state ACCESSIBLE you may call its method getAMNode() to retrieve an AMMember that represents the TopicMap. This member is then passed to the getModel(...)-Method of the ModelProvider, along with an Abstractor that is able to process a Topicmap-Object. I just commited an improved version of the ExampleOpenTopicMap-Code to panckoucke cvs. The example performs theese steps and contains furthermore a simple renderer, that lists all of the topics in a topicmap. Hope that helps Christoph > Regards > > Tommy Johannessen > > _________________________________________________________________ > MSN Messenger http://www.msn.no/messenger Den korteste veien mellom deg og > dine venner > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Tm4j-developers mailing list > Tm4...@li... > https://lists.sourceforge.net/lists/listinfo/tm4j-developers -- Christoph Froehlich <cf...@fo...> |