From: <raj...@us...> - 2006-09-26 19:03:20
|
Revision: 7060 http://svn.sourceforge.net/cdk/?rev=7060&view=rev Author: rajarshi Date: 2006-09-26 12:03:16 -0700 (Tue, 26 Sep 2006) Log Message: ----------- Added a field and method to indicate whetehr we should show the insert text field in the GUI. Currently does not do anything Modified Paths: -------------- trunk/cdk/src/org/openscience/cdk/applications/jchempaint/JChemPaintEditorPanel.java Modified: trunk/cdk/src/org/openscience/cdk/applications/jchempaint/JChemPaintEditorPanel.java =================================================================== --- trunk/cdk/src/org/openscience/cdk/applications/jchempaint/JChemPaintEditorPanel.java 2006-09-26 17:57:56 UTC (rev 7059) +++ trunk/cdk/src/org/openscience/cdk/applications/jchempaint/JChemPaintEditorPanel.java 2006-09-26 19:03:16 UTC (rev 7060) @@ -91,15 +91,17 @@ boolean showMenuBar = true; boolean showToolBar = true; boolean showStatusBar = true; + boolean showInsertTextField = true; protected CDKPluginManager pluginManager = null; protected EventListenerList changeListeners = null; - - /** - * Constructor for the panel - * - */ - public JChemPaintEditorPanel(){ + + + /** + * Constructor for the panel + * + */ + public JChemPaintEditorPanel(){ this(1, null); } @@ -182,8 +184,17 @@ return showStatusBar; } + /** + * Indicates whether the insert text field is shown. + * + * @return true is the text field widget is to be shown, false otherwise + */ + public boolean getShowInsertTextField() { + return showInsertTextField; + } - /** + + /** * Description of the Method */ public void customizeView() { @@ -350,8 +361,24 @@ customizeView(); } + /** + * Set to indicate whetehr the insert text field should be used. + * + * This function is a little kkludgy since we actually have to call the + * setShowToolbar() method to update the UI to remove or add the text entry + * widget. This is because the text entry widget has to be added between the + * toolbar and the drawing panel, but since we are using a BorderLayout we + * actually have to put the toolbar *and* the tetx field widget into a + * new panel and add that to the NORTH position. Like I said, kludgy :( + * + * @param showInsertTextField true is the text entry widget is to be shown + */ + public void setShowInsertTextField(boolean showInsertTextField) { + this.showInsertTextField = showInsertTextField; + } - /** + + /** * Sets the value of showToolbar. * *@param showToolBar The value to assign showToolbar. @@ -372,7 +399,7 @@ northPanel.add(textPanel, BorderLayout.SOUTH); // mainContainer.add(toolBar, BorderLayout.NORTH); - mainContainer.add(northPanel, BorderLayout.NORTH); + mainContainer.add(northPanel, BorderLayout.NORTH); mainContainer.revalidate(); } else { try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |