From: Ted B. <te...@et...> - 2001-12-24 12:39:35
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I am developing an application which stores data in XML format and allows users to maniuplate that data via a JTree control. There are a number of node-types that users can create and store in the tree. So far, all of them have been implemented in java. All of these nodes are subclasses of BaseNodehandler, and I would like to provide for users creating subclasses of BaseNodehandler with jython and then storing them in the tree ( and manipulating them ). I have tried subclassing like this: class foo( BaseNodehandler ): def __init__( self, element ): "@sig public foo( org.jdom.Element elem )" BaseNodehandler.__init__( self, element ) and 'pulling' it into the java code like this: Object tmp = interp.get( "instance_of_foo" ).__tojava__( BaseNodehandler.class ); BaseNodehandler bnh = (BaseNodehandler)tmp; But tmp is an instance of PySingleton, and so does not cast correctly to bnh. My question: Is there a HOWTO somewhere detailing how to do this? I have frittered days away trying to figure out what I'm doing, and haven't made much progress. ted -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8JyIA2YmJb3AmqHYRAg71AKCEY07Sfg7HwNwVe+8JAHmd7J0FVQCfWU3A kjF/f0ZjOG1uKlu0akqJn5E= =9crS -----END PGP SIGNATURE----- |