diff --git a/src/main/java/eva2/gui/editor/AbstractListSelectionEditor.java b/src/main/java/eva2/gui/editor/AbstractListSelectionEditor.java index 1e72e9e1..81d09352 100644 --- a/src/main/java/eva2/gui/editor/AbstractListSelectionEditor.java +++ b/src/main/java/eva2/gui/editor/AbstractListSelectionEditor.java @@ -12,7 +12,7 @@ import java.beans.PropertyEditor; /** */ -public abstract class AbstractListSelectionEditor extends JPanel implements PropertyEditor, PropertyChangeListener { +public abstract class AbstractListSelectionEditor implements PropertyEditor, PropertyChangeListener { /** * Handles property change notification @@ -192,7 +192,10 @@ public abstract class AbstractListSelectionEditor extends JPanel implements Prop public void paintValue(Graphics gfx, Rectangle box) { FontMetrics fm = gfx.getFontMetrics(); int vpad = (box.height - fm.getAscent()) / 2; - String rep = "Select from list"; + String rep; + if ((rep = getAsText()) == null) { + rep = "Select from list"; + } gfx.drawString(rep, 2, fm.getHeight() + vpad - 3); } diff --git a/src/main/java/eva2/gui/editor/StringSelectionEditor.java b/src/main/java/eva2/gui/editor/StringSelectionEditor.java index 6d948498..cf3eec6d 100644 --- a/src/main/java/eva2/gui/editor/StringSelectionEditor.java +++ b/src/main/java/eva2/gui/editor/StringSelectionEditor.java @@ -53,13 +53,12 @@ public class StringSelectionEditor extends AbstractListSelectionEditor { } } - @Override - public String getName() { - return "StringSelection"; - } - @Override public String getAsText() { + if (getElementCount() == 0) { + return null; + } + StringBuilder sbuf = new StringBuilder("{"); boolean first = true; for (int i = 0; i < getElementCount(); i++) { diff --git a/src/test/java/eva2/optimization/individuals/AbstractEAIndividualTest.java b/src/test/java/eva2/optimization/individuals/AbstractEAIndividualTest.java new file mode 100644 index 00000000..8deb4793 --- /dev/null +++ b/src/test/java/eva2/optimization/individuals/AbstractEAIndividualTest.java @@ -0,0 +1,53 @@ +package eva2.optimization.individuals; + +import org.junit.Test; + +/** + */ +public class AbstractEAIndividualTest { + + @Test + public void testIsDominatingFitness() throws Exception { + + } + + @Test + public void testIsDominatingFitnessNotEqual() throws Exception { + + } + + @Test + public void testGetStringRepresentation() throws Exception { + + } + + @Test + public void testGetDefaultStringRepresentation() throws Exception { + + } + + @Test + public void testGetDefaultDataString() throws Exception { + + } + + @Test + public void testGetDefaultDataObject() throws Exception { + + } + + @Test + public void testGetDefaultDataString1() throws Exception { + + } + + @Test + public void testGetDoublePositionShallow() throws Exception { + + } + + @Test + public void testGetDoublePosition() throws Exception { + + } +} \ No newline at end of file