SourceForge: bina/bina_plugin_networkanalysis: changeset 13:5ca574e56e53
New Help View default tip
authorgerasch
Wed Nov 04 15:01:29 2009 +0100 (6 weeks ago)
changeset 135ca574e56e53
parent 12 eff880f6f68c
New Help View
src/org/bina/bcp/PluginExtensions.java
src/org/bina/bcp/datasource/QueryHandler.java
src/org/bina/bcp/datasource/StandardBioCoreDataSource.java
src/org/bina/bcp/datasource/importer/ImportedBioCoreData.java
src/org/bina/bcp/resources/help/NetworkAnalysisHelpResource.java
src/org/bina/bcp/resources/help/search/simple.html
src/org/bina/bcp/resources/help/views/metainformation.html
src/org/bina/bcp/resources/help/views/visualization.html
src/org/bina/bcp/search/simplesearch/DataSourceSearchConstraint.java
src/org/bina/bcp/search/simplesearch/DefaultSearchResult.java
src/org/bina/bcp/search/simplesearch/OrganismSearchConstraint.java
src/org/bina/bcp/search/simplesearch/SearchResultDialog.java
src/org/bina/bcp/search/simplesearch/SimpleSearchWizardPage.java
src/org/bina/bcp/start/advancedsearch/AdvancedSearchWizardPage.java
src/org/bina/bcp/start/pathwaysearch/SelectPathwayWizardPage.java
src/org/bina/bcp/util/things/ThingChooser.java
src/org/bina/bcp/util/tree/GroupMutableTreeNode.java
src/org/bina/bcp/util/tree/SearchMutableTreeNode.java
src/org/bina/bcp/views/MetainformationView.java
src/org/bina/bcp/views/VisualizationView.java
src/org/bina/bcp/wizards/datasource/ImporterWizardDialog.java
     1.1 --- a/src/org/bina/bcp/PluginExtensions.java	Mon Oct 26 15:33:29 2009 +0100
     1.2 +++ b/src/org/bina/bcp/PluginExtensions.java	Wed Nov 04 15:01:29 2009 +0100
     1.3 @@ -18,6 +18,7 @@
     1.4  import org.bina.bcp.mapping.provider.CytoscapeNodeAttributeValueProvider;
     1.5  import org.bina.bcp.mapping.provider.FileMappingValueProvider;
     1.6  import org.bina.bcp.resources.Resources;
     1.7 +import org.bina.bcp.resources.help.NetworkAnalysisHelpResource;
     1.8  import org.bina.bcp.search.simplesearch.SimpleSearchType;
     1.9  import org.bina.bcp.start.advancedsearch.AdvancedSearchType;
    1.10  import org.bina.bcp.views.MetainformationView;
    1.11 @@ -34,6 +35,7 @@
    1.12  import org.bina.platform.gui.wizards.WizardFactory.WizardFactoryExtension;
    1.13  import org.bina.platform.utils.dnd.DataFlavorExtension;
    1.14  import org.bina.platformx.util.start.StartTypeExtension;
    1.15 +import org.bina.platformx.views.help.HelpResource;
    1.16  
    1.17  
    1.18  /**
    1.19 @@ -92,7 +94,7 @@
    1.20  
    1.21  		ret = ret && addExtension(pm, "org.bina.platform.views", new View.ViewExtension("metainformation_view", "BN++ Metainformations", null, MetainformationView.class, true));
    1.22  
    1.23 -		
    1.24 +		ret = ret && addExtension(pm, "org.bina.platform.help", new DefaultExtension<HelpResource>("help", "bcp_help", "NetworkAnalysisHelp", NetworkAnalysisHelpResource.class));
    1.25  		return ret;
    1.26  	}
    1.27  
     2.1 --- a/src/org/bina/bcp/datasource/QueryHandler.java	Mon Oct 26 15:33:29 2009 +0100
     2.2 +++ b/src/org/bina/bcp/datasource/QueryHandler.java	Wed Nov 04 15:01:29 2009 +0100
     2.3 @@ -17,6 +17,8 @@
     2.4  	public boolean hasEvent() {
     2.5  		return isCanceled() || isError() || isFinished();
     2.6  	}
     2.7 +	
     2.8 +	public abstract T waitForResult();
     2.9  
    2.10  	public abstract T getResult();
    2.11  	
     3.1 --- a/src/org/bina/bcp/datasource/StandardBioCoreDataSource.java	Mon Oct 26 15:33:29 2009 +0100
     3.2 +++ b/src/org/bina/bcp/datasource/StandardBioCoreDataSource.java	Wed Nov 04 15:01:29 2009 +0100
     3.3 @@ -126,6 +126,14 @@
     3.4  		public boolean isError() {
     3.5  			return false;
     3.6  		}
     3.7 +		
     3.8 +		@Override
     3.9 +		public T waitForResult() {
    3.10 +			while (!hasEvent())
    3.11 +				Thread.yield();
    3.12 +			
    3.13 +			return getResult();
    3.14 +		}
    3.15  	}
    3.16  
    3.17  	/* (non-Javadoc)
     4.1 --- a/src/org/bina/bcp/datasource/importer/ImportedBioCoreData.java	Mon Oct 26 15:33:29 2009 +0100
     4.2 +++ b/src/org/bina/bcp/datasource/importer/ImportedBioCoreData.java	Wed Nov 04 15:01:29 2009 +0100
     4.3 @@ -206,6 +206,14 @@
     4.4  		public boolean isError() {
     4.5  			return false;
     4.6  		}
     4.7 +		
     4.8 +		@Override
     4.9 +		public T waitForResult() {
    4.10 +			while (!hasEvent())
    4.11 +				Thread.yield();
    4.12 +			
    4.13 +			return getResult();
    4.14 +		}
    4.15  	}
    4.16  
    4.17  }
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/src/org/bina/bcp/resources/help/NetworkAnalysisHelpResource.java	Wed Nov 04 15:01:29 2009 +0100
     5.3 @@ -0,0 +1,13 @@
     5.4 +package org.bina.bcp.resources.help;
     5.5 +
     5.6 +import org.bina.bcp.Plugin;
     5.7 +import org.bina.platformx.views.help.HelpResource;
     5.8 +
     5.9 +public class NetworkAnalysisHelpResource extends HelpResource {
    5.10 +
    5.11 +	@Override
    5.12 +	public String getId() {
    5.13 +		return Plugin.PLUGIN_ID;
    5.14 +	}
    5.15 +
    5.16 +}
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/src/org/bina/bcp/resources/help/search/simple.html	Wed Nov 04 15:01:29 2009 +0100
     6.3 @@ -0,0 +1,6 @@
     6.4 +<html>
     6.5 +<body>
     6.6 +<h1>Database Search</h1>
     6.7 +
     6.8 +</body>
     6.9 +</html>
    6.10 \ No newline at end of file
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/src/org/bina/bcp/resources/help/views/metainformation.html	Wed Nov 04 15:01:29 2009 +0100
     7.3 @@ -0,0 +1,8 @@
     7.4 +<html>
     7.5 +<body>
     7.6 +<h1>Metainformation View</h1>
     7.7 +
     7.8 +Displays meta-information from the data source, which are related to selected objects of the <a href="/platform/views/outline.html">outline view</a>.
     7.9 +
    7.10 +</body>
    7.11 +</html>
    7.12 \ No newline at end of file
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/src/org/bina/bcp/resources/help/views/visualization.html	Wed Nov 04 15:01:29 2009 +0100
     8.3 @@ -0,0 +1,5 @@
     8.4 +<html>
     8.5 +<body>
     8.6 +Visualization
     8.7 +</body>
     8.8 +</html>
     8.9 \ No newline at end of file
     9.1 --- a/src/org/bina/bcp/search/simplesearch/DataSourceSearchConstraint.java	Mon Oct 26 15:33:29 2009 +0100
     9.2 +++ b/src/org/bina/bcp/search/simplesearch/DataSourceSearchConstraint.java	Wed Nov 04 15:01:29 2009 +0100
     9.3 @@ -68,8 +68,11 @@
     9.4  		
     9.5  		QueryHandler<List<DataSource>> handler = ds.getThingsByType(DataSource.class);
     9.6  		this.searchPage.addQuery(handler);
     9.7 -		while (!handler.hasEvent())
     9.8 -			Thread.yield();
     9.9 +		
    9.10 +		handler.waitForResult();
    9.11 +		
    9.12 +//		while (!handler.hasEvent())
    9.13 +//			Thread.yield();
    9.14  		
    9.15  		if (handler.isFinished()) {
    9.16  			for (DataSource o : handler.getResult()) {
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/src/org/bina/bcp/search/simplesearch/DefaultSearchResult.java	Wed Nov 04 15:01:29 2009 +0100
    10.3 @@ -0,0 +1,204 @@
    10.4 +package org.bina.bcp.search.simplesearch;
    10.5 +
    10.6 +import java.awt.Color;
    10.7 +import java.awt.Cursor;
    10.8 +import java.awt.Font;
    10.9 +import java.awt.event.MouseAdapter;
   10.10 +import java.awt.event.MouseEvent;
   10.11 +import java.util.Collection;
   10.12 +import java.util.Collections;
   10.13 +import java.util.Comparator;
   10.14 +import java.util.HashMap;
   10.15 +import java.util.Iterator;
   10.16 +import java.util.LinkedList;
   10.17 +import java.util.Map;
   10.18 +
   10.19 +import javax.swing.ImageIcon;
   10.20 +import javax.swing.JCheckBox;
   10.21 +import javax.swing.JLabel;
   10.22 +import javax.swing.JPanel;
   10.23 +
   10.24 +import org.bina.bcp.resources.Resources;
   10.25 +import org.bnplusplus.model.bnpp.Pathway;
   10.26 +import org.bnplusplus.model.bnpp.Thing;
   10.27 +
   10.28 +import com.jgoodies.forms.layout.CellConstraints;
   10.29 +import com.jgoodies.forms.layout.FormLayout;
   10.30 +
   10.31 +public class DefaultSearchResult extends AbstractSearchResult {
   10.32 +
   10.33 +	final String name;
   10.34 +	
   10.35 +	HashMap<Pathway, Boolean> thing_selected = null;
   10.36 +	
   10.37 +	LinkedList<Pathway> shown_things = null;
   10.38 +
   10.39 +	/**
   10.40 +	 * @param list
   10.41 +	 */
   10.42 +	public DefaultSearchResult(String category_name, Color color) {
   10.43 +		super();
   10.44 +		this.color = color;
   10.45 +		
   10.46 +		this.name = category_name;
   10.47 +		
   10.48 +		this.thing_selected = new HashMap<Pathway, Boolean>(); 
   10.49 +		this.shown_things = new LinkedList<Pathway>();
   10.50 +	}
   10.51 +	
   10.52 +	/* (non-Javadoc)
   10.53 +	 * @see org.bina.bcp.search.easysearch.AbstractSearchConstraint#setThings(java.util.Collection)
   10.54 +	 */
   10.55 +	@Override
   10.56 +	public void setThings(Collection<? extends Thing> list) {
   10.57 +		this.shown_things.clear();
   10.58 +		this.thing_selected.clear();
   10.59 +
   10.60 +		for (Thing t : list) {
   10.61 +			if (Pathway.class.isInstance(t))
   10.62 +				this.thing_selected.put((Pathway) t, false);
   10.63 +		}
   10.64 +		
   10.65 +		if (this.thing_selected.size() <= 200) {
   10.66 +			this.shown_things.addAll(this.thing_selected.keySet());
   10.67 +		} else {
   10.68 +			Iterator<Pathway> iterator = this.thing_selected.keySet().iterator();
   10.69 +			for (int i = 0; i < 200; ++i) {
   10.70 +				this.shown_things.add(iterator.next());
   10.71 +			}
   10.72 +		}
   10.73 +
   10.74 +
   10.75 +		Collections.sort(this.shown_things, new Comparator<Thing>() {
   10.76 +			/* (non-Javadoc)
   10.77 +			 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
   10.78 +			 */
   10.79 +			@Override
   10.80 +			public int compare(Thing o1, Thing o2) {
   10.81 +				return o1.getFirstName().compareToIgnoreCase(o2.getFirstName());
   10.82 +			}
   10.83 +		});
   10.84 +
   10.85 +	}
   10.86 +	
   10.87 +	/* (non-Javadoc)
   10.88 +	 * @see org.bina.bcp.search.easysearch.AbstractSearchResult#getThings()
   10.89 +	 */
   10.90 +	@Override
   10.91 +	public Collection<Thing> getThings() {
   10.92 +		LinkedList<Thing> selectedThings = new LinkedList<Thing>();
   10.93 +		for (Map.Entry<Pathway, Boolean> e : this.thing_selected.entrySet()) {
   10.94 +			if (e.getValue())
   10.95 +				selectedThings.add(e.getKey());
   10.96 +		}
   10.97 +		return selectedThings;
   10.98 +	}
   10.99 +	
  10.100 +	/* (non-Javadoc)
  10.101 +	 * @see org.bina.bcp.search.easysearch.AbstractListItem#update()
  10.102 +	 */
  10.103 +	@Override
  10.104 +	public void update() {
  10.105 +		super.update();
  10.106 +	}
  10.107 +	
  10.108 +	/* (non-Javadoc)
  10.109 +	 * @see org.bina.bcp.search.easysearch.AbstractListItem#fillPanel(javax.swing.JPanel, boolean)
  10.110 +	 */
  10.111 +	@Override
  10.112 +	protected void fillPanel(JPanel panel, boolean selected) {
  10.113 +		String vertLayout = "2dlu,default";
  10.114 +		if (this.expanded) {
  10.115 +			vertLayout += ",2dlu,default,2dlu";
  10.116 +			if (this.thing_selected.size() > 200) {
  10.117 +				vertLayout += ",default, 2dlu";
  10.118 +			}
  10.119 +			for (int i = 0; i < this.shown_things.size(); ++i) 
  10.120 +				vertLayout += ",default, 2dlu";
  10.121 +			
  10.122 +			
  10.123 +						
  10.124 +		}
  10.125 +		vertLayout += ",2dlu";
  10.126 +		FormLayout layout = new FormLayout("2dlu, 10dlu, default, 2dlu, default, 5dlu, default:grow, 2dlu", vertLayout);
  10.127 +		CellConstraints cc = new CellConstraints();
  10.128 +		panel.setLayout(layout);
  10.129 +		
  10.130 +		JLabel label = new JLabel(this.thing_selected.size() + " " + this.name);
  10.131 +		if (this.expanded)
  10.132 +			label.setIcon(new ImageIcon(Resources.class.getResource("icons/arrow_down.png")));
  10.133 +		else 
  10.134 +			label.setIcon(new ImageIcon(Resources.class.getResource("icons/arrow_right.png")));
  10.135 +		label.setFont(label.getFont().deriveFont(Font.BOLD));
  10.136 +		label.addMouseListener(this.expandedAction);
  10.137 +
  10.138 +		panel.add(label, cc.xyw(2, 2, 6));
  10.139 +		if (this.expanded) {
  10.140 +			int i = 0;
  10.141 +			JLabel all = new JLabel("all");
  10.142 +			JLabel sep = new JLabel("|");
  10.143 +			JLabel none = new JLabel("none");
  10.144 +			all.setForeground(Color.BLUE);
  10.145 +			all.setToolTipText("Select all");
  10.146 +			all.setFont(all.getFont().deriveFont(10.0f));
  10.147 +			all.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  10.148 +			all.addMouseListener(new MouseAdapter() {
  10.149 +				/* (non-Javadoc)
  10.150 +				 * @see java.awt.event.MouseAdapter#mouseReleased(java.awt.event.MouseEvent)
  10.151 +				 */
  10.152 +				@Override
  10.153 +				public void mouseReleased(MouseEvent e) {
  10.154 +					for (Pathway t : new LinkedList<Pathway>(DefaultSearchResult.this.thing_selected.keySet()))
  10.155 +						DefaultSearchResult.this.thing_selected.put(t, true);
  10.156 +					update();
  10.157 +					
  10.158 +				}
  10.159 +			});
  10.160 +			sep.setForeground(Color.GRAY);
  10.161 +			sep.setFont(sep.getFont().deriveFont(10.0f));
  10.162 +			none.setForeground(Color.BLUE);
  10.163 +			all.setToolTipText("Select none");
  10.164 +			none.setFont(none.getFont().deriveFont(10.0f));
  10.165 +			none.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  10.166 +			none.addMouseListener(new MouseAdapter() {
  10.167 +				/* (non-Javadoc)
  10.168 +				 * @see java.awt.event.MouseAdapter#mouseReleased(java.awt.event.MouseEvent)
  10.169 +				 */
  10.170 +				@Override
  10.171 +				public void mouseReleased(MouseEvent e) {
  10.172 +					for (Pathway t : new LinkedList<Pathway>(DefaultSearchResult.this.thing_selected.keySet()))
  10.173 +						DefaultSearchResult.this.thing_selected.put(t, false);
  10.174 +					update();
  10.175 +				}
  10.176 +			});
  10.177 +			panel.add(all, cc.xy(5, 4 + 2*i, CellConstraints.RIGHT, CellConstraints.DEFAULT));
  10.178 +			panel.add(sep, cc.xy(6, 4 + 2*i, CellConstraints.CENTER, CellConstraints.DEFAULT));
  10.179 +			panel.add(none, cc.xy(7, 4 + 2*i, CellConstraints.LEFT, CellConstraints.DEFAULT));
  10.180 +			++i;
  10.181 +			for (int j = 0; j < this.shown_things.size(); ++j, ++i) {
  10.182 +				final Pathway t = this.shown_things.get(j);
  10.183 +				JCheckBox name = new JCheckBox(t.getFirstName());
  10.184 +				name.setOpaque(false);
  10.185 +				name.setSelected(this.thing_selected.get(t));
  10.186 +				name.addMouseListener(new MouseAdapter() {
  10.187 +					/* (non-Javadoc)
  10.188 +					 * @see java.awt.event.MouseAdapter#mouseReleased(java.awt.event.MouseEvent)
  10.189 +					 */
  10.190 +					@Override
  10.191 +					public void mouseReleased(MouseEvent e) {
  10.192 +						DefaultSearchResult.this.thing_selected.put(t, !DefaultSearchResult.this.thing_selected.get(t));
  10.193 +						update();
  10.194 +					}
  10.195 +				});
  10.196 +				panel.add(name, cc.xyw(3, 4 + 2*i, 5));
  10.197 +			}
  10.198 +			if (this.thing_selected.size() > 200) {
  10.199 +				JLabel info = new JLabel("...and " + (this.thing_selected.size() - 200) + " more.");
  10.200 +				info.setForeground(Color.GRAY);
  10.201 +				panel.add(info, cc.xyw(3, 4 + 2*i, 5));
  10.202 +				++i;
  10.203 +			}
  10.204 +			
  10.205 +		}
  10.206 +	}
  10.207 +}
    11.1 --- a/src/org/bina/bcp/search/simplesearch/OrganismSearchConstraint.java	Mon Oct 26 15:33:29 2009 +0100
    11.2 +++ b/src/org/bina/bcp/search/simplesearch/OrganismSearchConstraint.java	Wed Nov 04 15:01:29 2009 +0100
    11.3 @@ -73,8 +73,10 @@
    11.4  		
    11.5  		QueryHandler<List<Organism>> organism_handler = ds.getThingsByType(Organism.class);
    11.6  		this.searchPage.addQuery(organism_handler);
    11.7 -		while (!organism_handler.hasEvent())
    11.8 -			Thread.yield();
    11.9 +		organism_handler.waitForResult();
   11.10 +//		
   11.11 +//		while (!organism_handler.hasEvent())
   11.12 +//			Thread.yield();
   11.13  		
   11.14  		if (organism_handler.isFinished()) {
   11.15  			for (Organism o : organism_handler.getResult()) {
    12.1 --- a/src/org/bina/bcp/search/simplesearch/SearchResultDialog.java	Mon Oct 26 15:33:29 2009 +0100
    12.2 +++ b/src/org/bina/bcp/search/simplesearch/SearchResultDialog.java	Wed Nov 04 15:01:29 2009 +0100
    12.3 @@ -42,6 +42,11 @@
    12.4   */
    12.5  public class SearchResultDialog extends JDialog implements MenuContributor {
    12.6  	
    12.7 +	/**
    12.8 +	 * 
    12.9 +	 */
   12.10 +	private static final long serialVersionUID = 1L;
   12.11 +
   12.12  	public static SearchResultDialog showDialog(NetworkAnalysisWorkspace workspace, String title, AbstractSearchResult... results) {
   12.13  		SearchResultDialog d = new SearchResultDialog(workspace, workspace.getSession().getMainWindow(), title, ModalityType.MODELESS);
   12.14  		d.setAlwaysOnTop(true);
    13.1 --- a/src/org/bina/bcp/search/simplesearch/SimpleSearchWizardPage.java	Mon Oct 26 15:33:29 2009 +0100
    13.2 +++ b/src/org/bina/bcp/search/simplesearch/SimpleSearchWizardPage.java	Wed Nov 04 15:01:29 2009 +0100
    13.3 @@ -24,6 +24,7 @@
    13.4  import java.awt.event.MouseMotionAdapter;
    13.5  import java.beans.PropertyChangeEvent;
    13.6  import java.beans.PropertyChangeListener;
    13.7 +import java.net.URL;
    13.8  import java.util.ArrayList;
    13.9  import java.util.Collection;
   13.10  import java.util.Collections;
   13.11 @@ -57,6 +58,7 @@
   13.12  import org.bina.bcp.datasource.constraints.QueryConstraint;
   13.13  import org.bina.bcp.datasource.constraints.UnionQueryConstraint;
   13.14  import org.bina.bcp.datasource.extended.ExtendedDataSource;
   13.15 +import org.bina.bcp.resources.help.NetworkAnalysisHelpResource;
   13.16  import org.bina.bcp.util.dnd.ThingTransferable;
   13.17  import org.bina.bcp.util.lists.AbstractListItem;
   13.18  import org.bina.bcp.wizards.datasource.ChangeDataSourceWizardDialog;
   13.19 @@ -67,6 +69,7 @@
   13.20  import org.bina.platform.utils.swing.DefaultListModel;
   13.21  import org.bina.platform.utils.swing.FlexLineBorder;
   13.22  import org.bina.platformx.util.swing.JLockedPane;
   13.23 +import org.bina.platformx.views.help.IHelpProvider;
   13.24  import org.bnplusplus.model.bnpp.MetabolicPathway;
   13.25  import org.bnplusplus.model.bnpp.Pathway;
   13.26  import org.bnplusplus.model.bnpp.RegulatoryPathway;
   13.27 @@ -79,7 +82,7 @@
   13.28   * @author Andreas Gerasch
   13.29   *
   13.30   */
   13.31 -public class SimpleSearchWizardPage extends WizardPage {
   13.32 +public class SimpleSearchWizardPage extends WizardPage implements IHelpProvider {
   13.33  
   13.34  	NetworkAnalysisWorkspace workspace;
   13.35  	
   13.36 @@ -699,8 +702,9 @@
   13.37  
   13.38  		QueryHandler<List<Thing>> handler = bnppDataSource.getThingsByConstraints(constraints);
   13.39  		addQuery(handler);
   13.40 -		while (!handler.hasEvent())
   13.41 -			Thread.yield();
   13.42 +		handler.waitForResult();
   13.43 +//		while (!handler.hasEvent())
   13.44 +//			Thread.yield();
   13.45  
   13.46  
   13.47  
   13.48 @@ -733,8 +737,9 @@
   13.49  			if (bnppDataSource instanceof ExtendedDataSource && !result.isEmpty() && result.size() < 100) {
   13.50  				QueryHandler<List<Pathway>> handler2 = ((ExtendedDataSource) bnppDataSource).getPathwaysContaining(false, result.toArray(new Thing[0]));
   13.51  				addQuery(handler2);
   13.52 -				while (!handler2.hasEvent())
   13.53 -					Thread.yield();
   13.54 +				handler2.waitForResult();
   13.55 +//				while (!handler2.hasEvent())
   13.56 +//					Thread.yield();
   13.57  				
   13.58  				if (handler2.isFinished()) {
   13.59  					List<Pathway> result2 = handler2.getResult();
   13.60 @@ -886,6 +891,17 @@
   13.61  		public boolean isFinished() {
   13.62  			return this.finished;
   13.63  		}
   13.64 +		
   13.65 +		/* (non-Javadoc)
   13.66 +		 * @see org.bina.bcp.datasource.QueryHandler#waitForResult()
   13.67 +		 */
   13.68 +		@Override
   13.69 +		public Object waitForResult() {
   13.70 +			while (!hasEvent())
   13.71 +				Thread.yield();
   13.72 +			
   13.73 +			return getResult();
   13.74 +		}
   13.75      	
   13.76      }
   13.77      
   13.78 @@ -1230,4 +1246,9 @@
   13.79  		return selectedThings;
   13.80  	}
   13.81  	
   13.82 +	@Override
   13.83 +	public URL getHelpResource() {
   13.84 +		return NetworkAnalysisHelpResource.class.getResource("search/simple.html");
   13.85 +	}
   13.86 +	
   13.87  }
    14.1 --- a/src/org/bina/bcp/start/advancedsearch/AdvancedSearchWizardPage.java	Mon Oct 26 15:33:29 2009 +0100
    14.2 +++ b/src/org/bina/bcp/start/advancedsearch/AdvancedSearchWizardPage.java	Wed Nov 04 15:01:29 2009 +0100
    14.3 @@ -49,8 +49,6 @@
    14.4  import org.bina.platform.tasks.Task;
    14.5  import org.bina.platform.utils.swing.SwingWorker;
    14.6  import org.bina.platformx.util.swing.AutoCompletion;
    14.7 -import org.bina.platformx.views.help.HelpManagement;
    14.8 -import org.bina.platformx.views.help.HelpProvider;
    14.9  import org.bnplusplus.model.BNPPModelInformation;
   14.10  import org.bnplusplus.model.bnpp.Organism;
   14.11  import org.bnplusplus.model.bnpp.Thing;
   14.12 @@ -163,79 +161,30 @@
   14.13  		page.add(l = new JLabel("Name"), cc.xy(2, 2));
   14.14  		searchTextField = new JTextField(10);
   14.15  		autoCompletion = new AutoCompletion(searchTextField);
   14.16 +        
   14.17  		autoCompletion.setSQLRegularExpressionElements();
   14.18  		l.setLabelFor(searchTextField);
   14.19  	    page.add(searchTextField, cc.xyw(4, 2, 3));
   14.20  
   14.21 -	    HelpManagement.getInstance(workspace.getSession()).registerHelpProvider(searchTextField, new HelpProvider() {
   14.22 -	    	/* (non-Javadoc)
   14.23 -	    	 * @see org.bina.platform.views.help.HelpProvider#getHelpText(java.lang.Object)
   14.24 -	    	 */
   14.25 -	    	public String getHelpText(Object source) {
   14.26 -	    		return "<b>Specify the name of the thing you searching for.</b><br><br>" +
   14.27 -				"Expected: string or regular expression, press CTRL+SPACE for auto-completion.";
   14.28 -	    	}	
   14.29 -	    });
   14.30  	    
   14.31  		page.add(l = new JLabel("Organism"), cc.xy(2, 4));
   14.32  	    organismField = new JTextField(10);
   14.33  	    l.setLabelFor(organismField);
   14.34  	    page.add(organismField, cc.xyw(4, 4, 3));
   14.35  	    
   14.36 -	    HelpManagement.getInstance(workspace.getSession()).registerHelpProvider(organismField, new HelpProvider() {
   14.37 -	    	/* (non-Javadoc)
   14.38 -	    	 * @see org.bina.platform.views.help.HelpProvider#getHelpText(java.lang.Object)
   14.39 -	    	 */
   14.40 -	    	public String getHelpText(Object source) {
   14.41 -	    		return "<b>Specify the organism of the thing you searching for.</b><br><br>" +
   14.42 -				"Press CTRL+SPACE for organism listing.";
   14.43 -	    	}	
   14.44 -	    });
   14.45  
   14.46  	    page.add(l = new JLabel("Type"), cc.xy(2, 6));
   14.47  	    typeField = new JTextField(10);
   14.48  	    l.setLabelFor(typeField);
   14.49  	    page.add(typeField, cc.xyw(4, 6, 3));
   14.50  	    
   14.51 -	    HelpManagement.getInstance(workspace.getSession()).registerHelpProvider(typeField, new HelpProvider() {
   14.52 -	    	/* (non-Javadoc)
   14.53 -	    	 * @see org.bina.platform.views.help.HelpProvider#getHelpText(java.lang.Object)
   14.54 -	    	 */
   14.55 -	    	public String getHelpText(Object source) {
   14.56 -	    		return "<b>Specify the type of the thing you searching for.</b><br><br>" +
   14.57 -				"Press CTRL+SPACE for available types.";
   14.58 -	    	}	
   14.59 -	    });
   14.60 -
   14.61  	    page.add(searchAlsoInDescriptions = new JCheckBox("Search in descriptions"), cc.xyw(4, 8, 3));
   14.62  	    
   14.63 -	    HelpManagement.getInstance(workspace.getSession()).registerHelpProvider(searchAlsoInDescriptions, new HelpProvider() {
   14.64 -	    	/* (non-Javadoc)
   14.65 -	    	 * @see org.bina.platform.views.help.HelpProvider#getHelpText(java.lang.Object)
   14.66 -	    	 */
   14.67 -	    	public String getHelpText(Object source) {
   14.68 -	    		return "<b>Check this box, if you like to search the name value also in description.</b>";
   14.69 -	    	}	
   14.70 -	    });
   14.71  	    
   14.72  	    page.add(actOnCacheOnlyCheckBox = new JCheckBox("Search without string value"), cc.xyw(4, 10, 3));
   14.73 -	    HelpManagement.getInstance(workspace.getSession()).registerHelpProvider(actOnCacheOnlyCheckBox, new HelpProvider() {
   14.74 -			/* (non-Javadoc)
   14.75 -			 * @see org.bina.platform.views.help.HelpProvider#getHelpText(java.lang.Object)
   14.76 -			 */
   14.77 -			public String getHelpText(Object source) {
   14.78 -				return "<b>Check this box, if you don't want to search for any name.</b>";
   14.79 -			}	
   14.80 -		});
   14.81 +	   
   14.82  		page.add(searchButton = new JButton("Search"), cc.xyw(4, 12, 3));
   14.83 -		HelpManagement.getInstance(workspace.getSession()).registerHelpProvider(searchButton, new HelpProvider() {
   14.84 -			/* (non-Javadoc)
   14.85 -			 * @see org.bina.platform.views.help.HelpProvider#getHelpText(java.lang.Object)
   14.86 -			 */
   14.87 -			public String getHelpText(Object source) {
   14.88 -				return "<b>Pressing this button, will perform a search according to the constraints made above.</b>";
   14.89 -			}	
   14.90 -		});
   14.91 +		
   14.92  		
   14.93  		// center
   14.94  		resultTree = new JTree();
    15.1 --- a/src/org/bina/bcp/start/pathwaysearch/SelectPathwayWizardPage.java	Mon Oct 26 15:33:29 2009 +0100
    15.2 +++ b/src/org/bina/bcp/start/pathwaysearch/SelectPathwayWizardPage.java	Wed Nov 04 15:01:29 2009 +0100
    15.3 @@ -111,8 +111,9 @@
    15.4  			constr.add(ds.createSortByNameQueryConstraint());
    15.5  
    15.6  			QueryHandler<List<Thing>> ids = ds.getThingsByConstraints(constr);
    15.7 -			while (!ids.isCanceled() && !ids.isError() && !ids.isFinished())
    15.8 -				Thread.yield();
    15.9 +			ids.waitForResult();
   15.10 +//			while (!ids.isCanceled() && !ids.isError() && !ids.isFinished())
   15.11 +//				Thread.yield();
   15.12  
   15.13  
   15.14  			page = new JPanel(new FormLayout("2dlu, default:grow, 2dlu", "2dlu, default, 5dlu, default:grow, 2dlu"));
    16.1 --- a/src/org/bina/bcp/util/things/ThingChooser.java	Mon Oct 26 15:33:29 2009 +0100
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,28 +0,0 @@
    16.4 -/*
    16.5 - * Created on May 9, 2005
    16.6 - * 
    16.7 - * Project:  BiNA_v0.2 
    16.8 - * Package:  bina.util.things
    16.9 - * Filename: ThingChooser.java
   16.10 - * 
   16.11 - */
   16.12 -package org.bina.bcp.util.things;
   16.13 -
   16.14 -/**
   16.15 - * @author Andreas Gerasch
   16.16 - * 
   16.17 - */
   16.18 -public class ThingChooser {
   16.19 -
   16.20 -    /**
   16.21 -     * 
   16.22 -     */
   16.23 -    public ThingChooser() {
   16.24 -        super();
   16.25 -        // TODO Auto-generated constructor stub
   16.26 -    }
   16.27 -    
   16.28 -    
   16.29 -    
   16.30 -
   16.31 -}
    17.1 --- a/src/org/bina/bcp/util/tree/GroupMutableTreeNode.java	Mon Oct 26 15:33:29 2009 +0100
    17.2 +++ b/src/org/bina/bcp/util/tree/GroupMutableTreeNode.java	Wed Nov 04 15:01:29 2009 +0100
    17.3 @@ -64,9 +64,11 @@
    17.4  					constraints.add(lc);
    17.5  					QueryHandler<List<Thing>> handler = dataSource.getThingsByConstraints(constraints);
    17.6  
    17.7 -					while (!handler.isCanceled() && !handler.isError() && !handler.isFinished()) {
    17.8 -						Thread.yield();
    17.9 -					}
   17.10 +					handler.waitForResult();
   17.11 +//					
   17.12 +//					while (!handler.isCanceled() && !handler.isError() && !handler.isFinished()) {
   17.13 +//						Thread.yield();
   17.14 +//					}
   17.15  
   17.16  					
   17.17  
    18.1 --- a/src/org/bina/bcp/util/tree/SearchMutableTreeNode.java	Mon Oct 26 15:33:29 2009 +0100
    18.2 +++ b/src/org/bina/bcp/util/tree/SearchMutableTreeNode.java	Wed Nov 04 15:01:29 2009 +0100
    18.3 @@ -71,9 +71,11 @@
    18.4  	}
    18.5  	public void init(List<QueryConstraint> l, ConstraintsDataSource cds, int block_size) {
    18.6  		handler = cds.countThingsByConstraints(l);
    18.7 -
    18.8 -		while (!handler.isCanceled() && !handler.isError() && !handler.isFinished())
    18.9 -			Thread.yield();
   18.10 +		
   18.11 +		handler.waitForResult();
   18.12 +//
   18.13 +//		while (!handler.isCanceled() && !handler.isError() && !handler.isFinished())
   18.14 +//			Thread.yield();
   18.15  		
   18.16  		if (handler.isFinished() && !handler.isCanceled()) {
   18.17  			int num = handler.getResult();
    19.1 --- a/src/org/bina/bcp/views/MetainformationView.java	Mon Oct 26 15:33:29 2009 +0100
    19.2 +++ b/src/org/bina/bcp/views/MetainformationView.java	Wed Nov 04 15:01:29 2009 +0100
    19.3 @@ -13,6 +13,7 @@
    19.4  import java.awt.event.MouseMotionAdapter;
    19.5  import java.io.IOException;
    19.6  import java.lang.ref.WeakReference;
    19.7 +import java.net.URL;
    19.8  import java.util.LinkedList;
    19.9  import java.util.WeakHashMap;
   19.10  
   19.11 @@ -29,12 +30,14 @@
   19.12  
   19.13  import org.bina.bcp.NetworkAnalysisWorkspace;
   19.14  import org.bina.bcp.resources.Resources;
   19.15 +import org.bina.bcp.resources.help.NetworkAnalysisHelpResource;
   19.16  import org.bina.bcp.util.DataSourceKeyUrlizer;
   19.17  import org.bina.bcp.util.lists.AbstractListItem;
   19.18  import org.bina.bcp.util.things.ThingOutlineNode;
   19.19  import org.bina.platform.Session;
   19.20  import org.bina.platform.gui.View;
   19.21  import org.bina.platform.utils.swing.DefaultListModel;
   19.22 +import org.bina.platformx.views.help.IHelpProvider;
   19.23  import org.bina.platformx.views.outline.OutlineView;
   19.24  import org.bina.platformx.views.outline.OutlineViewSelectionEvent;
   19.25  import org.bina.platformx.views.outline.OutlineViewSelectionListener;
   19.26 @@ -64,7 +67,7 @@
   19.27  import com.jgoodies.forms.layout.CellConstraints;
   19.28  import com.jgoodies.forms.layout.FormLayout;
   19.29  
   19.30 -public class MetainformationView extends View implements OutlineViewSelectionListener {
   19.31 +public class MetainformationView extends View implements OutlineViewSelectionListener, IHelpProvider {
   19.32  
   19.33  	private static WeakHashMap<Session, WeakReference<MetainformationView>> session_view = new WeakHashMap<Session, WeakReference<MetainformationView>>();
   19.34  	
   19.35 @@ -177,6 +180,11 @@
   19.36  		}
   19.37  	}
   19.38  	
   19.39 +	@Override
   19.40 +	public URL getHelpResource() {
   19.41 +		return NetworkAnalysisHelpResource.class.getResource("views/metainformation.html");
   19.42 +	}
   19.43 +	
   19.44  	private class MyMouseMotionListener extends MouseMotionAdapter {
   19.45  		@Override
   19.46  		public void mouseMoved(MouseEvent e) {
   19.47 @@ -495,7 +503,6 @@
   19.48  	}
   19.49  	
   19.50  	
   19.51 -	@SuppressWarnings("unused")
   19.52  	private class OthersInfo extends MetaInformationInfo {
   19.53  
   19.54  		public OthersInfo() {
    20.1 --- a/src/org/bina/bcp/views/VisualizationView.java	Mon Oct 26 15:33:29 2009 +0100
    20.2 +++ b/src/org/bina/bcp/views/VisualizationView.java	Wed Nov 04 15:01:29 2009 +0100
    20.3 @@ -37,8 +37,6 @@
    20.4  import org.bina.platform.gui.IconRepository;
    20.5  import org.bina.platform.gui.action.IMenuContainer;
    20.6  import org.bina.platformx.util.swing.AutoCompletion;
    20.7 -import org.bina.platformx.views.help.HelpManagement;
    20.8 -import org.bina.platformx.views.help.HelpProvider;
    20.9  import org.bina.platformx.views.outline.Outline;
   20.10  import org.bina.platformx.views.outline.OutlineProvider;
   20.11  import org.bnplusplus.model.bnpp.Thing;
   20.12 @@ -130,15 +128,6 @@
   20.13          this.searchFieldAC.setFullReplacement(true);
   20.14          updateHistory();
   20.15          
   20.16 -        HelpManagement.getInstance(workspace.getSession()).registerHelpProvider(this.searchField, new HelpProvider(){
   20.17 -        	/* (non-Javadoc)
   20.18 -        	 * @see org.bina.platform.views.help.HelpProvider#getHelpText(java.lang.Object)
   20.19 -        	 */
   20.20 -        	public String getHelpText(Object source) {
   20.21 -        		return "<b>Enter a regular expression or just the search text.</b><br><br>Press CTRL+SPACE to show search history.";
   20.22 -        	}
   20.23 -        });
   20.24 -        
   20.25          this.searchSearchPanel_button.setIcon(IconRepository.getIcon("actions/edit-find", 16, 16));
   20.26          if (Environment.isMac()) {
   20.27          	this.searchSearchPanel_button.putClientProperty("JButton.buttonType", "default");
    21.1 --- a/src/org/bina/bcp/wizards/datasource/ImporterWizardDialog.java	Mon Oct 26 15:33:29 2009 +0100
    21.2 +++ b/src/org/bina/bcp/wizards/datasource/ImporterWizardDialog.java	Wed Nov 04 15:01:29 2009 +0100
    21.3 @@ -68,8 +68,9 @@
    21.4  						boolean okay = false;
    21.5  						if (!okay) {
    21.6  							QueryHandler<List<Pathway>> things = ds.getThingsByType(Pathway.class);
    21.7 -							while (!things.isCanceled() && !things.isError() && !things.isFinished())
    21.8 -								Thread.yield();
    21.9 +							things.waitForResult();
   21.10 +//							while (!things.isCanceled() && !things.isError() && !things.isFinished())
   21.11 +//								Thread.yield();
   21.12  							if (things.isFinished() && things.getResult().size() > 0) { 
   21.13  								thingsToVisualize.addAll(things.getResult());
   21.14  								okay = true;
   21.15 @@ -77,8 +78,9 @@
   21.16  						}
   21.17  						if (!okay) {
   21.18  							QueryHandler<List<Event>> things = ds.getThingsByType(Event.class);
   21.19 -							while (!things.isCanceled() && !things.isError() && !things.isFinished())
   21.20 -								Thread.yield();
   21.21 +							things.waitForResult();
   21.22 +//							while (!things.isCanceled() && !things.isError() && !things.isFinished())
   21.23 +//								Thread.yield();
   21.24  							if (things.isFinished() && things.getResult().size() > 0) { 
   21.25  								thingsToVisualize.addAll(things.getResult());
   21.26  								okay = true;
   21.27 @@ -87,8 +89,9 @@
   21.28  
   21.29  						if (!okay) {
   21.30  							QueryHandler<List<Participant>> things = ds.getThingsByType(Participant.class);
   21.31 -							while (!things.isCanceled() && !things.isError() && !things.isFinished())
   21.32 -								Thread.yield();
   21.33 +							things.waitForResult();
   21.34 +//							while (!things.isCanceled() && !things.isError() && !things.isFinished())
   21.35 +//								Thread.yield();
   21.36  							if (things.isFinished() && things.getResult().size() > 0) { 
   21.37  								thingsToVisualize.addAll(things.getResult());
   21.38  								okay = true;