From c6d422d999493041afcc2beb2bca44f4b44dbce9 Mon Sep 17 00:00:00 2001 From: Jamie Mac Date: Fri, 26 Apr 2024 17:01:34 +0100 Subject: [PATCH] Getting DelphinID working and changes to the JavaFX detectin displays --- pom.xml | 4 +- src/Resources/css/delphinid_logo01.svg | 114 +++++++++++++++++ src/Resources/delphinid_logo01.svg | 114 +++++++++++++++++ src/dataPlotsFX/TDControlFX.java | 10 +- .../DetectionGroupDisplay.java | 34 +++-- .../DetectionGroupDisplayFX.java | 8 +- src/detectionPlotFX/DetectionPlotParams.java | 2 +- src/pamViewFX/fxGlyphs/PamSVGIcon.java | 10 +- src/pamViewFX/fxPlotPanes/PlotPane.java | 4 +- src/rawDeepLearningClassifier/DLControl.java | 2 + .../dlClassification/DLClassiferModel.java | 2 + .../dlClassification/DLClassifierChooser.java | 6 +- .../StandardClassifierModel.java | 5 +- .../animalSpot/SoundSpotUI.java | 7 + .../animalSpot/StandardModelPane.java | 21 ++- .../archiveModel/ArchiveModelClassifier.java | 6 +- .../archiveModel/ArchiveModelUI.java | 7 + .../archiveModel/ArchiveModelWorker.java | 6 +- .../delphinID/DelphinIDClassifier.java | 120 +++++++++++------- .../delphinID/DelphinIDPane.java | 88 +++++++++++++ .../delphinID/DelphinIDWorker.java | 97 ++++++++------ .../dlClassification/delphinID/DelphinUI.java | 106 ++++++++++++++++ .../genericModel/GenericModelUI.java | 7 + .../dlClassification/ketos/KetosUI.java | 7 + .../orcaSpot/OrcaSpotClassifierUI.java | 7 + .../layoutFX/DLCLassiferModelUI.java | 9 ++ .../layoutFX/DLSettingsPane.java | 4 +- 27 files changed, 681 insertions(+), 126 deletions(-) create mode 100644 src/Resources/css/delphinid_logo01.svg create mode 100644 src/Resources/delphinid_logo01.svg create mode 100644 src/rawDeepLearningClassifier/dlClassification/delphinID/DelphinIDPane.java create mode 100644 src/rawDeepLearningClassifier/dlClassification/delphinID/DelphinUI.java diff --git a/pom.xml b/pom.xml index bc7315b0..ca91aa43 100644 --- a/pom.xml +++ b/pom.xml @@ -303,14 +303,14 @@ io.github.macster110 jpamutils - 0.0.57 + 0.0.58 io.github.macster110 jdl4pam - 0.0.97 + 0.0.98 diff --git a/src/Resources/css/delphinid_logo01.svg b/src/Resources/css/delphinid_logo01.svg new file mode 100644 index 00000000..744670bf --- /dev/null +++ b/src/Resources/css/delphinid_logo01.svg @@ -0,0 +1,114 @@ + + + + + + + + + + + + delphinID + + + + + + diff --git a/src/Resources/delphinid_logo01.svg b/src/Resources/delphinid_logo01.svg new file mode 100644 index 00000000..744670bf --- /dev/null +++ b/src/Resources/delphinid_logo01.svg @@ -0,0 +1,114 @@ + + + + + + + + + + + + delphinID + + + + + + diff --git a/src/dataPlotsFX/TDControlFX.java b/src/dataPlotsFX/TDControlFX.java index 0542ccd1..3f162249 100644 --- a/src/dataPlotsFX/TDControlFX.java +++ b/src/dataPlotsFX/TDControlFX.java @@ -398,15 +398,15 @@ public class TDControlFX extends TDControl implements UserDisplayNodeFX { @Override public void newSelectedDetectionGroup(DetectionGroupSummary detectionGroup, TDGraphFX tdGraph) { - System.out.println("New selected detection group: " + detectionGroup); +// System.out.println("New selected detection group: " + detectionGroup); tdDisplayController.getDisplayDataBlock().clearAll(); if (detectionGroup==null || detectionGroup.getDataList().size()<=0) return; - System.out.println("Add pam data: " + detectionGroup + " " + tdDisplayController.getDisplayDataBlock().countObservers()); - for (int i=0; i dataUnit){ /** - * The extra stuff here is to make sure that the plot types for a specific detectin are saved. So for example - * if viewing click spectrum then the spectrum plot is selected whenever 1) PAMGuard is opned again or 2) switching from + * The extra stuff here is to make sure that the plot types for a specific detection are saved. So for example + * if viewing click spectrum then the spectrum plot is selected whenever 1) PAMGuard is opened again or 2) switching from * one type of detection ot another e.g. whistle to click, then the click does nto revert to shwoing a waveform instead * of spectrum. */ @@ -220,7 +220,7 @@ public class DetectionGroupDisplayFX extends DetectionGroupDisplay implements U if (currentDetection!=null) { //save the current selected detection plot for the particular type of data unit. String detectionPlotName = this.getDetectionDisplay().getCurrentDataInfo().getCurrentDetectionPlot().getName(); -// System.out.println("SET CURRENT DETECTION PLOT TO USE IS: " + detectionPlotName); + //System.out.println("SET CURRENT DETECTION PLOT TO USE IS: " + detectionPlotName); detectionPlotParams.dataAxisMap.put(currentDetection.getParentDataBlock().getLongDataName(), detectionPlotName); } diff --git a/src/detectionPlotFX/DetectionPlotParams.java b/src/detectionPlotFX/DetectionPlotParams.java index 67bf3a85..f951e1c6 100644 --- a/src/detectionPlotFX/DetectionPlotParams.java +++ b/src/detectionPlotFX/DetectionPlotParams.java @@ -20,7 +20,7 @@ public class DetectionPlotParams extends UserDisplayNodeParams implements Clonea /** * */ - static final long serialVersionUID = 2L; + static final long serialVersionUID = 3L; /** * The data source for the detection plot. diff --git a/src/pamViewFX/fxGlyphs/PamSVGIcon.java b/src/pamViewFX/fxGlyphs/PamSVGIcon.java index 9f9c3b96..2df67799 100644 --- a/src/pamViewFX/fxGlyphs/PamSVGIcon.java +++ b/src/pamViewFX/fxGlyphs/PamSVGIcon.java @@ -63,8 +63,14 @@ public class PamSVGIcon { } return instance; } - + + @Deprecated public PamSVGIcon create(URL path, Color color, double lineWidth) throws Exception { + return create(path); + } + + + public PamSVGIcon create(URL path) throws Exception { // System.out.println("Create icon start"); @@ -145,7 +151,7 @@ public class PamSVGIcon { for (int ii=0; ii modelResult = getDLWorker().runModel(groupedRawData, + @SuppressWarnings("unchecked") + ArrayList modelResult = (ArrayList) getDLWorker().runModel(groupedRawData, groupedRawData.get(0).getParentDataBlock().getSampleRate(), 0); if (modelResult==null) { @@ -134,7 +135,7 @@ public abstract class StandardClassifierModel implements DLClassiferModel, PamSe * Get the sound spot worker. * @return the sound spot worker. */ - public abstract DLModelWorker getDLWorker(); + public abstract DLModelWorker getDLWorker(); /** * Get the sound spot worker. diff --git a/src/rawDeepLearningClassifier/dlClassification/animalSpot/SoundSpotUI.java b/src/rawDeepLearningClassifier/dlClassification/animalSpot/SoundSpotUI.java index 158024c1..b13b8feb 100644 --- a/src/rawDeepLearningClassifier/dlClassification/animalSpot/SoundSpotUI.java +++ b/src/rawDeepLearningClassifier/dlClassification/animalSpot/SoundSpotUI.java @@ -6,6 +6,7 @@ import java.util.List; import javax.swing.JPanel; import PamController.SettingsPane; +import javafx.scene.Node; import javafx.stage.FileChooser.ExtensionFilter; import rawDeepLearningClassifier.layoutFX.DLCLassiferModelUI; @@ -83,4 +84,10 @@ public class SoundSpotUI implements DLCLassiferModelUI { return extensionFilters; } + @Override + public Node getIcon() { + // TODO Auto-generated method stub + return null; + } + } diff --git a/src/rawDeepLearningClassifier/dlClassification/animalSpot/StandardModelPane.java b/src/rawDeepLearningClassifier/dlClassification/animalSpot/StandardModelPane.java index 21e9a8c1..231a6d3e 100644 --- a/src/rawDeepLearningClassifier/dlClassification/animalSpot/StandardModelPane.java +++ b/src/rawDeepLearningClassifier/dlClassification/animalSpot/StandardModelPane.java @@ -128,11 +128,20 @@ public abstract class StandardModelPane extends SettingsPane dlTransformParams = DLClassiferModel.getDLTransformParams(standardDLParams.dlTransfroms); standardDLParams.dlTransfromParams=dlTransformParams; - // System.out.println("KetosParams have been saved. : " + standardDLParams.dlTransfromParams); - return standardDLParams; } @@ -161,8 +159,10 @@ public abstract class ArchiveModelClassifier extends StandardClassifierModel { standardDLParams.dlTransfroms = DLTransformsFactory .makeDLTransforms((ArrayList) standardDLParams.dlTransfromParams); } - } else + } + else { standardDLParams = makeParams(); + } return true; } diff --git a/src/rawDeepLearningClassifier/dlClassification/archiveModel/ArchiveModelUI.java b/src/rawDeepLearningClassifier/dlClassification/archiveModel/ArchiveModelUI.java index 73c6a21d..27fde898 100644 --- a/src/rawDeepLearningClassifier/dlClassification/archiveModel/ArchiveModelUI.java +++ b/src/rawDeepLearningClassifier/dlClassification/archiveModel/ArchiveModelUI.java @@ -6,6 +6,7 @@ import java.util.List; import javax.swing.JPanel; import PamController.SettingsPane; +import javafx.scene.Node; import javafx.stage.FileChooser.ExtensionFilter; import rawDeepLearningClassifier.dlClassification.animalSpot.StandardModelPane; import rawDeepLearningClassifier.dlClassification.animalSpot.StandardModelParams; @@ -90,6 +91,12 @@ public class ArchiveModelUI implements DLCLassiferModelUI { this.extensionFilters = extensionFilters; } + @Override + public Node getIcon() { + // TODO Auto-generated method stub + return null; + } + } \ No newline at end of file diff --git a/src/rawDeepLearningClassifier/dlClassification/archiveModel/ArchiveModelWorker.java b/src/rawDeepLearningClassifier/dlClassification/archiveModel/ArchiveModelWorker.java index b182c700..ab78a47b 100644 --- a/src/rawDeepLearningClassifier/dlClassification/archiveModel/ArchiveModelWorker.java +++ b/src/rawDeepLearningClassifier/dlClassification/archiveModel/ArchiveModelWorker.java @@ -229,9 +229,9 @@ public class ArchiveModelWorker extends GenericModelWorker { @Override public GenericPrediction makeModelResult(float[] prob, double time) { - GenericPrediction soundSpotResult = new GenericPrediction(prob); - soundSpotResult.setAnalysisTime(time); - return soundSpotResult; + GenericPrediction prediction = new GenericPrediction(prob); + prediction.setAnalysisTime(time); + return prediction; } diff --git a/src/rawDeepLearningClassifier/dlClassification/delphinID/DelphinIDClassifier.java b/src/rawDeepLearningClassifier/dlClassification/delphinID/DelphinIDClassifier.java index 50bb3baf..375efb79 100644 --- a/src/rawDeepLearningClassifier/dlClassification/delphinID/DelphinIDClassifier.java +++ b/src/rawDeepLearningClassifier/dlClassification/delphinID/DelphinIDClassifier.java @@ -4,18 +4,14 @@ import java.io.Serializable; import java.net.URI; import java.util.ArrayList; +import org.jamdev.jdl4pam.transforms.DLTransformsFactory; +import org.jamdev.jdl4pam.transforms.DLTransfromParams; + import PamController.PamControlledUnitSettings; -import PamController.PamSettings; -import PamguardMVC.PamDataUnit; import rawDeepLearningClassifier.DLControl; -import rawDeepLearningClassifier.DLStatus; -import rawDeepLearningClassifier.dlClassification.DLClassName; import rawDeepLearningClassifier.dlClassification.DLClassiferModel; -import rawDeepLearningClassifier.dlClassification.PredictionResult; import rawDeepLearningClassifier.dlClassification.StandardClassifierModel; import rawDeepLearningClassifier.dlClassification.animalSpot.StandardModelParams; -import rawDeepLearningClassifier.dlClassification.archiveModel.ArchiveModelClassifier; -import rawDeepLearningClassifier.dlClassification.archiveModel.ArchiveModelWorker; import rawDeepLearningClassifier.dlClassification.genericModel.DLModelWorker; import rawDeepLearningClassifier.dlClassification.genericModel.GenericPrediction; import rawDeepLearningClassifier.layoutFX.DLCLassiferModelUI; @@ -28,76 +24,108 @@ import rawDeepLearningClassifier.layoutFX.DLCLassiferModelUI; * */ public class DelphinIDClassifier extends StandardClassifierModel { + + + private DelphinIDParams delphinIDParams = new DelphinIDParams(); + + + private DelphinUI delphinUI; + + + private DelphinIDWorker delphinIDWorker; + public DelphinIDClassifier(DLControl dlControl) { super(dlControl); - // TODO Auto-generated constructor stub } @Override public boolean isModelType(URI model) { - // TODO Auto-generated method stub return false; } @Override public String getName() { - // TODO Auto-generated method stub - return null; + return "delphinID"; } @Override public DLCLassiferModelUI getModelUI() { - // TODO Auto-generated method stub - return null; + if (delphinUI==null) { + delphinUI = new DelphinUI(this); + } + return delphinUI; } @Override public Serializable getDLModelSettings() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getUnitType() { - // TODO Auto-generated method stub - return null; - } - - @Override - public Serializable getSettingsReference() { - // TODO Auto-generated method stub - return null; - } - - @Override - public long getSettingsVersion() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) { - // TODO Auto-generated method stub - return false; + return delphinIDParams; } @Override public String getUnitName() { - // TODO Auto-generated method stub - return null; + return dlControl.getUnitName()+"_" + getName(); } + @Override + public String getUnitType() { + return dlControl.getUnitType()+"_" + getName(); + } + + @Override + public Serializable getSettingsReference() { + if (delphinIDParams==null) { + delphinIDParams = new DelphinIDParams(); + } + + ArrayList dlTransformParams = DLClassiferModel.getDLTransformParams(delphinIDParams.dlTransfroms); + + delphinIDParams.dlTransfromParams=dlTransformParams; + + //System.out.println("SoundSpot have been saved. : " + soundSpotParmas.classNames); + return delphinIDParams; + + } + + + @Override + public long getSettingsVersion() { + return StandardModelParams.serialVersionUID; + } + + + @Override + public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) { + DelphinIDParams newParameters = (DelphinIDParams) pamControlledUnitSettings.getSettings(); + if (newParameters!=null) { + delphinIDParams = (DelphinIDParams) newParameters.clone(); + //System.out.println("SoundSpot have been restored. : " + soundSpotParmas.classNames); + if (delphinIDParams.dlTransfromParams!=null) { + delphinIDParams.dlTransfroms = DLTransformsFactory.makeDLTransforms((ArrayList) delphinIDParams.dlTransfromParams); + } + } + else delphinIDParams = new DelphinIDParams(); + return true; + } + + + @Override public DLModelWorker getDLWorker() { - // TODO Auto-generated method stub - return null; + if (delphinIDWorker==null) { + delphinIDWorker = new DelphinIDWorker(); + } + return delphinIDWorker; } @Override - public StandardModelParams getDLParams() { - // TODO Auto-generated method stub - return null; + public DelphinIDParams getDLParams() { + return delphinIDParams; + } + + public void setDLParams(DelphinIDParams params) { + this.delphinIDParams=params; + } } \ No newline at end of file diff --git a/src/rawDeepLearningClassifier/dlClassification/delphinID/DelphinIDPane.java b/src/rawDeepLearningClassifier/dlClassification/delphinID/DelphinIDPane.java new file mode 100644 index 00000000..749f01db --- /dev/null +++ b/src/rawDeepLearningClassifier/dlClassification/delphinID/DelphinIDPane.java @@ -0,0 +1,88 @@ +package rawDeepLearningClassifier.dlClassification.delphinID; + +import PamController.SettingsPane; +import javafx.scene.Node; +import javafx.scene.control.Label; +import javafx.scene.control.Tooltip; +import javafx.scene.layout.Pane; +import javafx.scene.text.Font; +import javafx.scene.text.FontWeight; +import pamViewFX.fxNodes.PamVBox; + +/** + * Settings pane for delphin ID. + * + * @author Jamie Macaulay + * + */ +public class DelphinIDPane extends SettingsPane { + + /** + * The main pane. + */ + private Pane mainPane; + + /** + * Reference to the delphinID classifier + */ + private DelphinIDClassifier delphinUIClassifier; + + public DelphinIDPane(DelphinIDClassifier delphinUIClassifier) { + super(null); + this.delphinUIClassifier = delphinUIClassifier; + mainPane = createPane(); + } + + private Pane createPane() { + + + //font to use for title labels. + Font font= Font.font(null, FontWeight.BOLD, 11); + + Node classifierIcon; + classifierIcon = delphinUIClassifier.getModelUI().getIcon(); + + + PamVBox vBox = new PamVBox(); + vBox.setSpacing(5.); + + /**Classification thresholds etc to set.**/ + Label classiferInfoLabel2 = new Label("Decision Threshold"); + classiferInfoLabel2.setTooltip(new Tooltip("Set the minimum prediciton value for selected classes. If a prediction exceeds this value " + + "a detection will be saved.")); + classiferInfoLabel2.setFont(font); + + + vBox.getChildren().addAll(classifierIcon, classiferInfoLabel2); + + return vBox; + } + + @Override + public DelphinIDParams getParams(DelphinIDParams currParams) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setParams(DelphinIDParams input) { + // TODO Auto-generated method stub + } + + @Override + public String getName() { + return "delphinIDParams"; + } + + @Override + public Node getContentNode() { + return mainPane; + } + + @Override + public void paneInitialized() { + // TODO Auto-generated method stub + + } + +} diff --git a/src/rawDeepLearningClassifier/dlClassification/delphinID/DelphinIDWorker.java b/src/rawDeepLearningClassifier/dlClassification/delphinID/DelphinIDWorker.java index e70199d7..e4f83bd5 100644 --- a/src/rawDeepLearningClassifier/dlClassification/delphinID/DelphinIDWorker.java +++ b/src/rawDeepLearningClassifier/dlClassification/delphinID/DelphinIDWorker.java @@ -1,55 +1,74 @@ package rawDeepLearningClassifier.dlClassification.delphinID; + import java.util.ArrayList; +import org.jamdev.jdl4pam.transforms.DLTransform; import PamguardMVC.PamDataUnit; -import rawDeepLearningClassifier.DLControl; -import rawDeepLearningClassifier.dlClassification.animalSpot.StandardModelParams; -import rawDeepLearningClassifier.dlClassification.genericModel.DLModelWorker; +import rawDeepLearningClassifier.dlClassification.archiveModel.ArchiveModelWorker; +import rawDeepLearningClassifier.segmenter.GroupedRawData; -public class DelphinIDWorker extends DLModelWorker{ - @Override - public float[] runModel(float[][][] transformedDataStack) { - // TODO Auto-generated method stub - return null; - } +public class DelphinIDWorker extends ArchiveModelWorker { - @Override - public boolean isModelNull() { - // TODO Auto-generated method stub - return false; - } - - @Override - public DelphinIDPrediction makeModelResult(float[] prob, double time) { - // TODO Auto-generated method stub - return null; - } - - @Override - public void prepModel(StandardModelParams delphinIDParams, DLControl dlControl) { - // TODO Auto-generated method stub - } - - @Override - public void closeModel() { - // TODO Auto-generated method stub - - } - @Override public float[][][] dataUnits2ModelInput(ArrayList dataUnits, float sampleRate, int iChan){ - //Our data units are groups of whistles. - - - - return null; - } + ArrayList modelTransforms = getModelTransforms(); - + @SuppressWarnings("unchecked") + ArrayList whistleGroups = (ArrayList) dataUnits; + + //the number of chunks. + int numChunks = whistleGroups.size(); + + //data input into the model - a stack of spectrogram images. + float[][][] transformedDataStack = new float[numChunks][][]; +// +// //generate the spectrogram stack. +// AudioData soundData; +// double[][] transformedData2; //spec data +// double[] transformedData1; //waveform data +// for (int j=0; j extensionFilters; + + public DelphinUI(DelphinIDClassifier delphinUIClassifier) { + this.delphinUIClassifier=delphinUIClassifier; + extensionFilters = new ArrayList(); + //import the settings holder + extensionFilters.add(new ExtensionFilter("Zip Model", "*.zip")); + } + + @Override + public SettingsPane getSettingsPane() { + if (delphinIDSettings==null) { + delphinIDSettings = new DelphinIDPane(delphinUIClassifier); + } + return delphinIDSettings; + } + + @Override + public void getParams() { + DelphinIDParams params = getSettingsPane().getParams(delphinUIClassifier.getDLParams()); + delphinUIClassifier.setDLParams(params); + } + + + @Override + public void setParams() { + // System.out.println("Set model params: " + genericModelClassifier.getGenericDLParams().dlTransfromParams.size()); + getSettingsPane().setParams(delphinUIClassifier.getDLParams()); + } + + @Override + public List getModelFileExtensions() { + //this is a bit redundant because zip files + return extensionFilters; + } + + @Override + public JPanel getSidePanel() { + // TODO Auto-generated method stub + return null; + } + + @Override + public Node getIcon() { + if (icon==null) { + PamSVGIcon iconMaker= new PamSVGIcon(); + PamSVGIcon svgsprite; + try { + svgsprite = iconMaker.create(getClass().getResource("/Resources/delphinid_logo01.svg").toURI().toURL()); + icon = svgsprite.getSpriteNode(); + } catch (MalformedURLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (URISyntaxException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + return icon; + } + +} diff --git a/src/rawDeepLearningClassifier/dlClassification/genericModel/GenericModelUI.java b/src/rawDeepLearningClassifier/dlClassification/genericModel/GenericModelUI.java index dd01307e..c4f15e4f 100644 --- a/src/rawDeepLearningClassifier/dlClassification/genericModel/GenericModelUI.java +++ b/src/rawDeepLearningClassifier/dlClassification/genericModel/GenericModelUI.java @@ -9,6 +9,7 @@ import PamController.SettingsPane; import PamView.dialog.warn.WarnOnce; import PamView.dialog.warn.WarnOnceDialog; import javafx.application.Platform; +import javafx.scene.Node; import javafx.scene.control.Alert.AlertType; import javafx.stage.FileChooser.ExtensionFilter; import rawDeepLearningClassifier.dlClassification.animalSpot.StandardModelParams; @@ -88,4 +89,10 @@ public class GenericModelUI implements DLCLassiferModelUI { public List getModelFileExtensions() { return extensionFilters; } + + @Override + public Node getIcon() { + // TODO Auto-generated method stub + return null; + } } diff --git a/src/rawDeepLearningClassifier/dlClassification/ketos/KetosUI.java b/src/rawDeepLearningClassifier/dlClassification/ketos/KetosUI.java index 04b98b2b..594aa82c 100644 --- a/src/rawDeepLearningClassifier/dlClassification/ketos/KetosUI.java +++ b/src/rawDeepLearningClassifier/dlClassification/ketos/KetosUI.java @@ -6,6 +6,7 @@ import java.util.List; import javax.swing.JPanel; import PamController.SettingsPane; +import javafx.scene.Node; import javafx.stage.FileChooser.ExtensionFilter; import rawDeepLearningClassifier.dlClassification.animalSpot.StandardModelParams; import rawDeepLearningClassifier.layoutFX.DLCLassiferModelUI; @@ -76,6 +77,12 @@ public class KetosUI implements DLCLassiferModelUI { return extensionFilters; } + @Override + public Node getIcon() { + // TODO Auto-generated method stub + return null; + } + } \ No newline at end of file diff --git a/src/rawDeepLearningClassifier/dlClassification/orcaSpot/OrcaSpotClassifierUI.java b/src/rawDeepLearningClassifier/dlClassification/orcaSpot/OrcaSpotClassifierUI.java index 5314e194..fae4e0b9 100644 --- a/src/rawDeepLearningClassifier/dlClassification/orcaSpot/OrcaSpotClassifierUI.java +++ b/src/rawDeepLearningClassifier/dlClassification/orcaSpot/OrcaSpotClassifierUI.java @@ -5,6 +5,7 @@ import java.util.List; import javax.swing.SwingUtilities; import PamController.SettingsPane; +import javafx.scene.Node; import javafx.stage.FileChooser.ExtensionFilter; import rawDeepLearningClassifier.layoutFX.DLCLassiferModelUI; @@ -79,4 +80,10 @@ public class OrcaSpotClassifierUI implements DLCLassiferModelUI { return null; } + @Override + public Node getIcon() { + // TODO Auto-generated method stub + return null; + } + } diff --git a/src/rawDeepLearningClassifier/layoutFX/DLCLassiferModelUI.java b/src/rawDeepLearningClassifier/layoutFX/DLCLassiferModelUI.java index d92b943a..30a5e4ef 100644 --- a/src/rawDeepLearningClassifier/layoutFX/DLCLassiferModelUI.java +++ b/src/rawDeepLearningClassifier/layoutFX/DLCLassiferModelUI.java @@ -3,6 +3,8 @@ package rawDeepLearningClassifier.layoutFX; import java.util.List; import javax.swing.JPanel; + +import javafx.scene.Node; import javafx.stage.FileChooser.ExtensionFilter; import PamController.SettingsPane; @@ -42,5 +44,12 @@ public interface DLCLassiferModelUI { */ public JPanel getSidePanel(); + /** + * Get an icon for the model. Note that this can be null in + * which case the icon in the UI will be a label with the mdoel name. + * @return teh model icon. + */ + public Node getIcon(); + } diff --git a/src/rawDeepLearningClassifier/layoutFX/DLSettingsPane.java b/src/rawDeepLearningClassifier/layoutFX/DLSettingsPane.java index 1cc4c871..b2c8c0e4 100644 --- a/src/rawDeepLearningClassifier/layoutFX/DLSettingsPane.java +++ b/src/rawDeepLearningClassifier/layoutFX/DLSettingsPane.java @@ -380,9 +380,11 @@ public class DLSettingsPane extends SettingsPane{ * Set the classifier pane. */ protected void setClassifierPane() { + + //set the classifier Pane.class if (modelSelectPane.currentClassifierModel!=null && modelSelectPane.currentClassifierModel.getModelUI()!=null) { - + classifierPane.setCenter(modelSelectPane.currentClassifierModel.getModelUI().getSettingsPane().getContentNode()); if (modelSelectPane.currentClassifierModel!=null) {