From: <hee...@us...> - 2009-10-26 10:59:34
|
Revision: 1893 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1893&view=rev Author: heeroyuy Date: 2009-10-26 10:59:25 +0000 (Mon, 26 Oct 2009) Log Message: ----------- -start to add a progress bar in the main panel Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2009-10-22 07:21:21 UTC (rev 1892) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2009-10-26 10:59:25 UTC (rev 1893) @@ -216,6 +216,7 @@ protected List<? extends EvaluatedDescription> doInBackground() throws Exception { la = model.getLearningAlgorithm(); + view.startStatusBar(); timer = new Timer(); timer.schedule(new TimerTask() { Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2009-10-22 07:21:21 UTC (rev 1892) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2009-10-26 10:59:25 UTC (rev 1893) @@ -313,6 +313,9 @@ cm.applyConfigEntry(la, "maxExecutionTimeInSeconds", view .getPosAndNegSelectPanel().getOptionPanel() .getMaxExecutionTime()); + view.setLearningDuration(view + .getPosAndNegSelectPanel().getOptionPanel() + .getMaxExecutionTime()); try { // initializes the learning algorithm la.init(); Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java 2009-10-22 07:21:21 UTC (rev 1892) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java 2009-10-26 10:59:25 UTC (rev 1893) @@ -40,7 +40,7 @@ import javax.swing.JToggleButton; import org.dllearner.algorithms.celoe.CELOE; -//import org.dllearner.tools.ore.ui.StatusBar; +import org.dllearner.tools.ore.ui.StatusBar; import org.protege.editor.owl.OWLEditorKit; import org.semanticweb.owl.model.OWLDescription; /** @@ -128,7 +128,7 @@ private String labels; private int individualSize; private SuggestClassPanelHandler sugPanelHandler; - //private StatusBar stat; + private StatusBar stat; /** * The constructor for the DL-Learner tab in the class description @@ -166,7 +166,7 @@ runPanel = new JPanel(new FlowLayout()); accept = new JButton("ADD"); addButtonPanel = new JPanel(new BorderLayout()); - + stat = new StatusBar(); errorMessage = new JTextArea(); errorMessage.setEditable(false); hint = new JTextArea(); @@ -213,7 +213,7 @@ */ public void makeView(String label) { run.setEnabled(false); - //stat = new StatusBar(); + helpButton.setVisible(false); hint.setForeground(Color.BLACK); hint.setText("To get suggestions for class expression, please click the button above."); @@ -269,11 +269,18 @@ addButtonPanel.add("North", accept); learner.add(addButtonPanel, c); + c.fill = GridBagConstraints.WEST; + c.weightx = 0.0; + c.weighty = 0.0; + c.gridx = 0; + c.gridy = 2; + learner.add(stat, c); + c.fill = GridBagConstraints.BOTH; c.weightx = 0.0; c.weighty = 0.0; c.gridx = 0; - c.gridy = 2; + c.gridy = 3; hint.setPreferredSize(new Dimension(450, 60)); helpButton.setPreferredSize(new Dimension(30, 30)); hintPanel.add(BorderLayout.CENTER, hint); @@ -288,13 +295,13 @@ c.gridx = 0; c.weightx = 0.0; c.weighty = 0.0; - c.gridy = 3; + c.gridy = 4; learner.add(advancedPanel, c); posPanel.setVisible(false); c.fill = GridBagConstraints.BOTH; c.gridx = 0; - c.gridy = 4; + c.gridy = 5; c.weightx = 0.0; c.weighty = 0.0; c.gridwidth = 3; @@ -510,6 +517,7 @@ * This method sets the run button enable after learning. */ public void algorithmTerminated() { + this.stopStatusBar(); CELOE celoe = (CELOE) model.getLearningAlgorithm(); String error = "Learning successful. Currently searching class expressions with length between " + celoe.getMinimumHorizontalExpansion() + " and " + celoe.getMaximumHorizontalExpansion() + "."; hint.setForeground(Color.RED); @@ -552,4 +560,16 @@ public ReadingOntologyThread getReadingOntologyThread() { return readThread; } + + public void setLearningDuration(int time) { + stat.setMaximumValue(time); + } + + public void startStatusBar() { + stat.showProgress(true); + } + + public void stopStatusBar() { + stat.showProgress(false); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |