Added metadata module icon

This commit is contained in:
Jamie Mac 2024-03-18 09:10:43 +00:00
parent 1387428a32
commit ecd04279c8
8 changed files with 68 additions and 18 deletions

View File

@ -6,7 +6,7 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk-21.0.2.13-hotspot"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/Amazon Coretto 21">
<attributes> <attributes>
<attribute name="module" value="true"/> <attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>

View File

@ -45,7 +45,6 @@ import whistlesAndMoans.AbstractWhistleDataUnit;
import fftManager.FFTDataUnit; import fftManager.FFTDataUnit;
import fftManager.PamFFTControl; import fftManager.PamFFTControl;
import group3dlocaliser.Group3DLocaliserControl; import group3dlocaliser.Group3DLocaliserControl;
import metadata.MetaDataContol;
import meygenturbine.MeygenTurbine; import meygenturbine.MeygenTurbine;
import printscreen.PrintScreenControl; import printscreen.PrintScreenControl;
import rockBlock.RockBlockControl; import rockBlock.RockBlockControl;
@ -472,6 +471,7 @@ final public class PamModel implements PamSettings {
mi.setToolTipText("Interface to Tethys Database"); mi.setToolTipText("Interface to Tethys Database");
mi.setModulesMenuGroup(utilitiesGroup); mi.setModulesMenuGroup(utilitiesGroup);
mi.setMaxNumber(1); mi.setMaxNumber(1);
//mi.addGUICompatabilityFlag(PamGUIManager.FX); //has FX enabled GUI.
mi.setHidden(SMRUEnable.isEnable() == false); mi.setHidden(SMRUEnable.isEnable() == false);
} }

View File

@ -1,5 +1,8 @@
package dataMap.layoutFX; package dataMap.layoutFX;
import java.awt.Dimension;
import PamController.PamController;
import PamController.PamControllerInterface; import PamController.PamControllerInterface;
import dataMap.DataMapControl; import dataMap.DataMapControl;
import javafx.application.Platform; import javafx.application.Platform;
@ -31,7 +34,7 @@ import userDisplayFX.UserDisplayNodeParams;
*/ */
public class DataMapPaneFX extends PamBorderPane implements UserDisplayNodeFX { public class DataMapPaneFX extends PamBorderPane implements UserDisplayNodeFX {
private static final double HIDE_PANE_WIDTH = 500; private static final double HIDE_PANE_WIDTH = 400;
/** /**
* Reference to the data map control. * Reference to the data map control.
@ -43,6 +46,9 @@ public class DataMapPaneFX extends PamBorderPane implements UserDisplayNodeFX {
*/ */
public ScrollingDataPaneFX scrollingDataPanel; public ScrollingDataPaneFX scrollingDataPanel;
private Dimension graphDimension;
private SummaryPaneFX summaryPane; private SummaryPaneFX summaryPane;
/** /**
@ -60,11 +66,13 @@ public class DataMapPaneFX extends PamBorderPane implements UserDisplayNodeFX {
*/ */
private ScalePaneFX scalePane; private ScalePaneFX scalePane;
/**
* The settings pane.
*/
private PamVBox settingsPane; private PamVBox settingsPane;
/**
* Axis which shows the current dates
*/
private PamDateAxis dateAxis;
public DataMapPaneFX(DataMapControl dataMapControl){ public DataMapPaneFX(DataMapControl dataMapControl){
this.dataMapControl=dataMapControl; this.dataMapControl=dataMapControl;
createDataMapPaneFX(); createDataMapPaneFX();
@ -119,7 +127,12 @@ public class DataMapPaneFX extends PamBorderPane implements UserDisplayNodeFX {
StackPane stackPane = new StackPane(); StackPane stackPane = new StackPane();
stackPane.getChildren().addAll(scrollingDataPanel, hidingSummaryPane, showButton); stackPane.getChildren().addAll(scrollingDataPanel, hidingSummaryPane, showButton);
dateAxis = new PamDateAxis();
dateAxis.setMinHeight(50);
dateAxis.prefWidthProperty().bind(scrollingDataPanel.widthProperty());
this.setTop(dateAxis);
this.setCenter(stackPane); this.setCenter(stackPane);
} }
@ -146,7 +159,7 @@ public class DataMapPaneFX extends PamBorderPane implements UserDisplayNodeFX {
*/ */
private void setGraphDimensions() { private void setGraphDimensions() {
long totalLength = dataMapControl.getLastTime() - dataMapControl.getFirstTime(); long totalLength = dataMapControl.getLastTime() - dataMapControl.getFirstTime();
//graphDimension = new Dimension(2000, 100); graphDimension = new Dimension(2000, 100);
} }
public void repaintAll() { public void repaintAll() {
@ -261,7 +274,6 @@ public class DataMapPaneFX extends PamBorderPane implements UserDisplayNodeFX {
* @param timeEnd - the end of loaded data in millis. * @param timeEnd - the end of loaded data in millis.
*/ */
public void selectedDataTime(Long timeStart, Long timeEnd) { public void selectedDataTime(Long timeStart, Long timeEnd) {
System.out.println("SELECTED DATA TIME: " + timeStart + " " + timeEnd);
summaryPane.setSelectedDataTime(timeStart, timeEnd); summaryPane.setSelectedDataTime(timeStart, timeEnd);
} }

View File

@ -12,20 +12,15 @@ import javafx.geometry.Side;
import javafx.scene.Node; import javafx.scene.Node;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.control.ScrollBar; import javafx.scene.control.ScrollBar;
import javafx.scene.control.ScrollPane.ScrollBarPolicy;
import javafx.scene.paint.Color; import javafx.scene.paint.Color;
import javafx.scene.text.Text;
import javafx.util.Duration; import javafx.util.Duration;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import dataMap.DataMapControl; import dataMap.DataMapControl;
import pamViewFX.fxGlyphs.PamGlyphDude;
import pamViewFX.fxNodes.PamBorderPane; import pamViewFX.fxNodes.PamBorderPane;
import pamViewFX.fxNodes.PamButton;
import pamViewFX.fxNodes.PamColorsFX; import pamViewFX.fxNodes.PamColorsFX;
import pamViewFX.fxNodes.PamScrollPane; import pamViewFX.fxNodes.PamScrollPane;
import pamViewFX.fxNodes.PamVBox; import pamViewFX.fxNodes.PamVBox;
import pamViewFX.fxNodes.pamAxis.PamDateAxis; import pamViewFX.fxNodes.pamAxis.PamDateAxis;
import pamViewFX.fxNodes.sashPane.SashPane;
public class ScrollingDataPaneFX extends PamBorderPane { public class ScrollingDataPaneFX extends PamBorderPane {

View File

@ -637,6 +637,14 @@ public class ModuleConnectionNode extends StandardConnectionNode implements PAMC
removeConnectionPlug(getConnectionPlugs().get(i),false); removeConnectionPlug(getConnectionPlugs().get(i),false);
} }
} }
Tooltip tooltip = ModuleToolTipFactory.getToolTip(pamControlledUnit);
if (tooltip!=null) {
Tooltip. install(this, tooltip);
}
} }
if (pamControlledUnit.getPamModuleInfo()!=null) { if (pamControlledUnit.getPamModuleInfo()!=null) {

View File

@ -36,7 +36,7 @@ public class ModuleIconFactory {
public enum ModuleIcon { public enum ModuleIcon {
DATAMAP, NMEA, GPS, MAP, SOUND_AQ, SOUND_OUTPUT, FFT, FILTER, CLICK, CLICK_TRAIN, RECORDER, WHISTLE_MOAN, DATAMAP, NMEA, GPS, MAP, SOUND_AQ, SOUND_OUTPUT, FFT, FILTER, CLICK, CLICK_TRAIN, RECORDER, WHISTLE_MOAN,
NOISE_BAND, NOISE_FILT, DATABASE, BINARY, TIME_DISPLAY, DETECTION_DISPLAY, ARRAY, DEEP_LEARNING, MATCHED_CLICK_CLASSIFIER, NOISE_BAND, NOISE_FILT, DATABASE, BINARY, TIME_DISPLAY, DETECTION_DISPLAY, ARRAY, DEEP_LEARNING, MATCHED_CLICK_CLASSIFIER,
DECIMATOR, CPOD DECIMATOR, CPOD, TETHYS
} }
/** /**
@ -130,14 +130,14 @@ public class ModuleIconFactory {
case CPOD: case CPOD:
iconNode = new Label("CPOD"); //TEMP iconNode = new Label("CPOD"); //TEMP
break; break;
case TETHYS:
iconNode = PamGlyphDude.createModuleIcon("file-codemeta");
break;
default: default:
break; break;
} }
long time2 = System.currentTimeMillis(); long time2 = System.currentTimeMillis();
//System.out.println("GET MODULE ICON: " + icon + " load time: " + (time2-time1));
return iconNode; return iconNode;
}; };
@ -215,6 +215,7 @@ public class ModuleIconFactory {
* @return the module icon enum * @return the module icon enum
*/ */
public ModuleIcon getModuleIcon(String className) { public ModuleIcon getModuleIcon(String className) {
System.out.println("Get module icon: " + className);
ModuleIcon icon = null; ModuleIcon icon = null;
switch (className) { switch (className) {
case "Acquisition.AcquisitionControl": case "Acquisition.AcquisitionControl":
@ -268,6 +269,9 @@ public class ModuleIconFactory {
case "cpod.CPODControl2": case "cpod.CPODControl2":
icon=ModuleIcon.CPOD; icon=ModuleIcon.CPOD;
break; break;
case "MetaDataControl":
icon = ModuleIcon.TETHYS;
break;
} }
return icon; return icon;
} }

View File

@ -0,0 +1,16 @@
package dataModelFX.connectionNodes;
import PamController.PamControlledUnit;
import javafx.scene.control.Tooltip;
public class ModuleToolTipFactory {
public static Tooltip getToolTip(PamControlledUnit pamControlledUnit) {
if (pamControlledUnit.getPamModuleInfo()==null) return null;
return new Tooltip(pamControlledUnit.getPamModuleInfo().getToolTipText());
}
}

View File

@ -7,11 +7,13 @@ import java.io.Serializable;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JMenuItem; import javax.swing.JMenuItem;
import Array.ArrayManager;
import PamController.PamControlledUnit; import PamController.PamControlledUnit;
import PamController.PamControlledUnitSettings; import PamController.PamControlledUnitSettings;
import PamController.PamController; import PamController.PamController;
import PamController.PamSettingManager; import PamController.PamSettingManager;
import PamController.PamSettings; import PamController.PamSettings;
import PamModel.PamModuleInfo;
import metadata.swing.MetaDataDialog; import metadata.swing.MetaDataDialog;
/** /**
@ -44,12 +46,25 @@ public class MetaDataContol extends PamControlledUnit implements PamSettings {
public static MetaDataContol getMetaDataControl() { public static MetaDataContol getMetaDataControl() {
if (singleInstance == null) { if (singleInstance == null) {
singleInstance = new MetaDataContol(unitType); singleInstance = new MetaDataContol(unitType);
singleInstance.addModuleInfo(); //needed for FX
// add this line to add it to the main modules list. Then it will get menu's, etc. // add this line to add it to the main modules list. Then it will get menu's, etc.
PamController.getInstance().addControlledUnit(singleInstance); PamController.getInstance().addControlledUnit(singleInstance);
} }
return singleInstance; return singleInstance;
} }
/**
* Add module info to the array manager. Need to do this to add icon which is used in data model.
*/
private void addModuleInfo(){
//need to add module info due to fact array manager is a special case
PamModuleInfo arrayModuleInfo=new PamModuleInfo("MetaDataControl", "Meta Data MANAGER", MetaDataContol.class);
arrayModuleInfo.setCoreModule(true);
arrayModuleInfo.setToolTipText("Meta data manager");
this.setPamModuleInfo(arrayModuleInfo);
}
/** /**
* Get PAMGuard Metadata. This contains a nilus Deployment object wrapped up * Get PAMGuard Metadata. This contains a nilus Deployment object wrapped up
* so that it can be serialised into other PAMGuard settings. * so that it can be serialised into other PAMGuard settings.