Skip to content

Commit

Permalink
merge popFunc viewer #483
Browse files Browse the repository at this point in the history
  • Loading branch information
walterxie committed Jun 4, 2024
1 parent 2fff550 commit 7459a3e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public boolean match(Object value) {
public JComponent getViewer(Object value) {
//TODO create PopulationFunctionComponent((Value<PopulationFunction>) value)
if (value instanceof PopulationFunction) {
return new JLabel("PopulationFunction TODO : " + value.toString());
return new JLabel(value.toString());
}
return new JLabel("Value<PopulationFunction> TODO : " + ((Value<PopulationFunction>) value).value().toString());
return new JLabel(((Value<PopulationFunction>) value).value().toString());
}
@Override
public String toString() {
Expand Down
3 changes: 1 addition & 2 deletions lphy-studio/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
lphystudio.viewer.PopSizeFuncViewer

0 comments on commit 7459a3e

Please sign in to comment.