From: <sh...@us...> - 2010-02-25 17:54:53
|
Revision: 15441 http://cdk.svn.sourceforge.net/cdk/?rev=15441&view=rev Author: shk3 Date: 2010-02-25 17:54:36 +0000 (Thu, 25 Feb 2010) Log Message: ----------- made the getTopLevelContainer method more flexible Modified Paths: -------------- jchempaint/trunk/src/main/org/openscience/jchempaint/AbstractJChemPaintPanel.java Modified: jchempaint/trunk/src/main/org/openscience/jchempaint/AbstractJChemPaintPanel.java =================================================================== --- jchempaint/trunk/src/main/org/openscience/jchempaint/AbstractJChemPaintPanel.java 2010-02-25 17:46:55 UTC (rev 15440) +++ jchempaint/trunk/src/main/org/openscience/jchempaint/AbstractJChemPaintPanel.java 2010-02-25 17:54:36 UTC (rev 15441) @@ -240,7 +240,10 @@ } public Container getTopLevelContainer() { - return this.getParent().getParent().getParent().getParent(); + Container parent = this.getParent(); + while(parent.getParent()!=null) + parent = parent.getParent(); + return parent; } public String getSVGString() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |