diff --git a/lphy-base/src/main/java/lphy/base/evolution/coalescent/populationmodel/ExponentialPopulation.java b/lphy-base/src/main/java/lphy/base/evolution/coalescent/populationmodel/ExponentialPopulation.java index 5796e555..97e5082c 100644 --- a/lphy-base/src/main/java/lphy/base/evolution/coalescent/populationmodel/ExponentialPopulation.java +++ b/lphy-base/src/main/java/lphy/base/evolution/coalescent/populationmodel/ExponentialPopulation.java @@ -135,6 +135,11 @@ public boolean isAnalytical() { return false; //use numerical method here } + @Override + public String toString() { + return "Exponential growth at a rate of " + GrowthRate + + ",\nwith an initial population size (N0) of " + N0; + } public static void main(String[] args) { double GrowthRate = 0.1; diff --git a/lphy-studio/src/main/java/lphystudio/viewer/PopSizeFuncViewer.java b/lphy-studio/src/main/java/lphystudio/viewer/PopSizeFuncViewer.java index 8007f9d4..c45834a0 100644 --- a/lphy-studio/src/main/java/lphystudio/viewer/PopSizeFuncViewer.java +++ b/lphy-studio/src/main/java/lphystudio/viewer/PopSizeFuncViewer.java @@ -24,9 +24,9 @@ public boolean match(Object value) { public JComponent getViewer(Object value) { //TODO create PopulationFunctionComponent((Value) value) if (value instanceof PopulationFunction) { - return new JLabel("PopulationFunction TODO : " + value.toString()); + return new JLabel(value.toString()); } - return new JLabel("Value TODO : " + ((Value) value).value().toString()); + return new JLabel(((Value) value).value().toString()); } @Override public String toString() { diff --git a/lphy-studio/src/main/java/module-info.java b/lphy-studio/src/main/java/module-info.java index f39184a6..c01a3d0e 100644 --- a/lphy-studio/src/main/java/module-info.java +++ b/lphy-studio/src/main/java/module-info.java @@ -30,10 +30,9 @@ // ViewerRegister loads all Viewers uses lphystudio.app.graphicalmodelpanel.viewer.Viewer; // declare what service interface the provider intends to use - provides lphystudio.app.graphicalmodelpanel.viewer.Viewer with lphystudio.viewer.PopSizeFuncViewer; // the core uses hard core to register all internal Viewers, // but extensions need to declare what service interface the provider intends to use for new Viewers. -// provides lphystudio.app.graphicalmodelpanel.viewer.Viewer with lphystudio.app.graphicalmodelpanel.viewer.???Viewer, ...; + provides lphystudio.app.graphicalmodelpanel.viewer.Viewer with lphystudio.viewer.PopSizeFuncViewer; // Note: to adapt with the system not using Java module but using class path, // they need to be declared inside META-INF/services/lphystudio.app.graphicalmodelpanel.viewer.Viewer as well. diff --git a/lphy-studio/src/main/resources/META-INF/services/lphystudio.app.graphicalmodelpanel.viewer.Viewer b/lphy-studio/src/main/resources/META-INF/services/lphystudio.app.graphicalmodelpanel.viewer.Viewer index 7c4b7794..37748b92 100644 --- a/lphy-studio/src/main/resources/META-INF/services/lphystudio.app.graphicalmodelpanel.viewer.Viewer +++ b/lphy-studio/src/main/resources/META-INF/services/lphystudio.app.graphicalmodelpanel.viewer.Viewer @@ -7,4 +7,4 @@ # but extensions need to declare what service interface the provider intends to use for new Viewers. # for example, lphystudio.app.graphicalmodelpanel.viewer.???Viewer -popsizefunc.lphystudio.viewer.PopSizeFuncViewer \ No newline at end of file +lphystudio.viewer.PopSizeFuncViewer \ No newline at end of file