-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reuse the file logger in studio menu, and tidy up the class structure #…
- Loading branch information
Showing
15 changed files
with
240 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
lphy-studio/src/main/java/lphystudio/core/logger/TreeTextFormatter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package lphystudio.core.logger; | ||
|
||
import lphy.base.evolution.tree.TimeTree; | ||
import lphy.core.logger.ValueFormatter; | ||
import lphy.core.model.Symbols; | ||
|
||
public class TreeTextFormatter implements ValueFormatter<TimeTree> { | ||
|
||
String valueID; | ||
TimeTree tree; | ||
|
||
// public NexusTreeFormatter() { | ||
// } | ||
|
||
public TreeTextFormatter(String valueID, TimeTree tree) { | ||
this.valueID = Symbols.getCanonical(valueID); | ||
this.tree = tree; | ||
} | ||
|
||
@Override | ||
public String getExtension() { | ||
return ".txt"; | ||
} | ||
|
||
@Override | ||
public Mode getMode() { | ||
return Mode.VALUE_PER_LINE; | ||
} | ||
|
||
@Override | ||
public Class<TimeTree> getDataTypeClass() { | ||
return TimeTree.class; | ||
} | ||
|
||
@Override | ||
public String getValueID() { | ||
return valueID; | ||
} | ||
|
||
@Override | ||
public String format(TimeTree tree) { | ||
return tree.toNewick(false); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.