Skip to content

Commit

Permalink
Merge pull request #3 from starteam/develop
Browse files Browse the repository at this point in the history
NullPointerException fixes for tooltip and drag from an empty mating site
  • Loading branch information
iceraj committed Dec 11, 2013
2 parents a6c000d + e558cd8 commit a144787
Show file tree
Hide file tree
Showing 19 changed files with 2,143 additions and 598 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified StarGenetics.jar
Binary file not shown.
8 changes: 8 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>

<project name="StarGenetics" default="build" basedir=".">

<condition property="is_windows">
<os family="windows"/>
</condition>
<condition property="is_mac">
<os family="mac"/>
</condition>

<taskdef name="jreleaseinfo" classname="ch.oscg.jreleaseinfo.anttask.JReleaseInfoAntTask" classpath="../star_signalsystem_java/lib/jreleaseinfo-1.2.0.jar"/>

<property name="src" value="${basedir}/src" />
Expand Down
2,665 changes: 2,092 additions & 573 deletions src/resources/star.mit.edu/genetics/documentation/index.html

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/resources/star.mit.edu/genetics/problemsets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ <h3>Navigation</h3>
</tr>
</tbody>
</table>
</div>
</div><script async="true" src=
"../../media/uploads/star/scripts/on_every_page.js" type=
"text/javascript">
</script>
</body>
</html>
5 changes: 4 additions & 1 deletion src/resources/star.mit.edu/genetics/tutorial/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ <h3>Navigation</h3>
</tr>
</tbody>
</table>
</div>
</div><script async="true" src=
"../../media/uploads/star/scripts/on_every_page.js" type=
"text/javascript">
</script>
</body>
</html>
8 changes: 4 additions & 4 deletions src/star/genetics/Version.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Created by JReleaseInfo AntTask from Open Source Competence Group */
/* Creation date Tue Oct 29 13:29:44 EDT 2013 */
/* Creation date Wed Dec 11 10:51:34 EST 2013 */
package star.genetics;

import java.util.Date;
Expand All @@ -12,11 +12,11 @@
public class Version {


/** buildDate (set during build process to 1383067784600L). */
private static Date buildDate = new Date(1383067784600L);
/** buildDate (set during build process to 1386777094654L). */
private static Date buildDate = new Date(1386777094654L);

/**
* Get buildDate (set during build process to Tue Oct 29 13:29:44 EDT 2013).
* Get buildDate (set during build process to Wed Dec 11 10:51:34 EST 2013).
* @return Date buildDate
*/
public static final Date getBuildDate() { return buildDate; }
Expand Down
2 changes: 1 addition & 1 deletion src/star/genetics/messages_en.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#en
#Tue Oct 29 13:29:43 EDT 2013
#Wed Dec 11 10:51:34 EST 2013
GroupBy.4={0} ({1}%)
GroupBy.3=<html><b>Male</b></html>
Cow.0=m\:
Expand Down
2 changes: 1 addition & 1 deletion src/star/genetics/messages_ht.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ht
#Tue Oct 29 13:29:41 EDT 2013
#Wed Dec 11 10:51:31 EST 2013
GroupBy.4={0} ({1}%)
GroupBy.3=<html><b>Mal</b></html>
Cow.0=m\:
Expand Down
2 changes: 1 addition & 1 deletion src/star/genetics/messages_pt.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pt
#Tue Oct 29 13:29:42 EDT 2013
#Wed Dec 11 10:51:32 EST 2013
GroupBy.4={0} ({1}%)
GroupBy.3=<html><b>Macho</b></html>
Cow.0=m\:
Expand Down
2 changes: 1 addition & 1 deletion src/star/genetics/messages_uk.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#uk
#Tue Oct 29 13:29:43 EDT 2013
#Wed Dec 11 10:51:33 EST 2013
GroupBy.4=GroupBy.4
GroupBy.3=GroupBy.3
Cow.0=Cow.0
Expand Down
18 changes: 12 additions & 6 deletions src/star/genetics/v1/ui/crate/parents/ParentsTransferHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,18 @@ public boolean importData(JComponent comp, Transferable t)
@Override
public void exportAsDrag(JComponent comp, InputEvent e, int action)
{
myCreature = parentList.getSelectedCreature();
Visualizer v = parentList.getGeneticModel().getVisualizerFactory().newVisualizerInstance();
v.setName(myCreature.getName());
v.setProperties(myCreature.getProperties(), myCreature.getSex());
UIHelpers.setVisual(v.getJComponent());
super.exportAsDrag(comp, e, action);
if( parentList != null )
{
myCreature = parentList.getSelectedCreature();
if( myCreature != null )
{
Visualizer v = parentList.getGeneticModel().getVisualizerFactory().newVisualizerInstance();
v.setName(myCreature.getName());
v.setProperties(myCreature.getProperties(), myCreature.getSex());
UIHelpers.setVisual(v.getJComponent());
super.exportAsDrag(comp, e, action);
}
}
}

@Override
Expand Down
8 changes: 7 additions & 1 deletion src/star/genetics/v2/ui/common/Button.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ public void addNotify()
setEnabled(isEnabledOnInit());
setToolTipText(getButtonTooltipText());
}


@Override
public void setToolTipText(String text)
{
super.setToolTipText(text != null ? text : "" );
}

public void actionPerformed(ActionEvent e)
{
onAction();
Expand Down
2 changes: 1 addition & 1 deletion src/star/genetics/v2/ui/fly/experiment/Mate.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected void onAction()
{
String text = Messages.getString("Mate.2"); //$NON-NLS-1$
setText(text);
setToolTipText(text);
setToolTipText(text != null ? text : "" );
raise_ListItemSelectedEvent();
ccount = 1;
raise_CrateMateEvent();
Expand Down
4 changes: 2 additions & 2 deletions src/star/genetics/v2/ui/fly/properties/PropertiesPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void addNotify()
String str = getName();
final JTextArea lname = new JTextArea(str);
lname.setEditable(false);
lname.setToolTipText(getName());
lname.setToolTipText(getName() != null ? getName() : "" );
if (OS.isMacOSX())
{
lname.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(CommonUI.get().getTitleBackground(), 1), BorderFactory.createEmptyBorder(2, 2, 2, 2)));
Expand All @@ -108,7 +108,7 @@ public void mouseClicked(MouseEvent e)
creature.setName(name);
visualization.setName(name);
lname.setText(name);
lname.setToolTipText(name);
lname.setToolTipText(name != null ? name : "");
raise_CreaturePropertiesChangedEvent(CreaturePropertiesChangedRaiser.Kind.NAME);
}

Expand Down
2 changes: 1 addition & 1 deletion src/star/genetics/v2/ui/yeast/common/MatingPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ private JLabel getLabel(Creature creature, String property)
String text = Messages.getString("MatingPanel.44") + getCreatureName(creature, "") + "&nbsp;<br>" + property + " &nbsp;</body></html>"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
String tooltip_text = (creature != null ? creature.getName() + ": " : "") + property; //$NON-NLS-1$ //$NON-NLS-2$
JLabel ret = new TitleLabel(text);
ret.setToolTipText(tooltip_text);
ret.setToolTipText(tooltip_text != null ? tooltip_text : "" );
return ret;
}

Expand Down
2 changes: 1 addition & 1 deletion src/star/genetics/v2/ui/yeast/common/ReplicaPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ private JLabel getLabel(Creature creature, String property)
String text = "<html><body>" + getCreatureName(creature, "") + "<br>" + property + "</body></html>"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
String tooltip_text = (creature != null ? creature.getName() + ": " : "") + property; //$NON-NLS-1$ //$NON-NLS-2$
JLabel ret = new TitleLabel(text);
ret.setToolTipText(tooltip_text);
ret.setToolTipText(tooltip_text != null ? tooltip_text : "");
return ret;
}

Expand Down
2 changes: 1 addition & 1 deletion src/star/genetics/v2/ui/yeast/common/Sporulate.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected void onAction()
{
String text = Messages.getString("Sporulate.2"); //$NON-NLS-1$
setText(text);
setToolTipText(text);
setToolTipText(text!=null?text:"");
raise_ListItemSelectedEvent();
ccount = 1;
raise_CrateMateEvent();
Expand Down
4 changes: 2 additions & 2 deletions src/star/genetics/v2/ui/yeast/properties/PropertiesPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void addNotify()
String str = getName();
final JTextArea creatureName = new JTextArea(str);
creatureName.setEditable(false);
creatureName.setToolTipText(getName());
creatureName.setToolTipText(getName() != null ? getName() : "");
if (OS.isMacOSX())
{
creatureName.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(CommonUI.get().getTitleBackground(), 1), BorderFactory.createEmptyBorder(2, 2, 2, 2)));
Expand All @@ -74,7 +74,7 @@ public void mouseClicked(MouseEvent e)
creature.setName(name);
visualization.setName(name);
creatureName.setText(name);
creatureName.setToolTipText(name);
creatureName.setToolTipText(name != null ? name : "");
raise_CreaturePropertiesChangedEvent(CreaturePropertiesChangedRaiser.Kind.NAME);
}

Expand Down

0 comments on commit a144787

Please sign in to comment.