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"/>
</attributes>
</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>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/>

View File

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

View File

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

View File

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

View File

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

View File

@ -36,7 +36,7 @@ public class ModuleIconFactory {
public enum ModuleIcon {
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,
DECIMATOR, CPOD
DECIMATOR, CPOD, TETHYS
}
/**
@ -130,14 +130,14 @@ public class ModuleIconFactory {
case CPOD:
iconNode = new Label("CPOD"); //TEMP
break;
case TETHYS:
iconNode = PamGlyphDude.createModuleIcon("file-codemeta");
break;
default:
break;
}
long time2 = System.currentTimeMillis();
//System.out.println("GET MODULE ICON: " + icon + " load time: " + (time2-time1));
return iconNode;
};
@ -215,6 +215,7 @@ public class ModuleIconFactory {
* @return the module icon enum
*/
public ModuleIcon getModuleIcon(String className) {
System.out.println("Get module icon: " + className);
ModuleIcon icon = null;
switch (className) {
case "Acquisition.AcquisitionControl":
@ -268,6 +269,9 @@ public class ModuleIconFactory {
case "cpod.CPODControl2":
icon=ModuleIcon.CPOD;
break;
case "MetaDataControl":
icon = ModuleIcon.TETHYS;
break;
}
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.JMenuItem;
import Array.ArrayManager;
import PamController.PamControlledUnit;
import PamController.PamControlledUnitSettings;
import PamController.PamController;
import PamController.PamSettingManager;
import PamController.PamSettings;
import PamModel.PamModuleInfo;
import metadata.swing.MetaDataDialog;
/**
@ -44,12 +46,25 @@ public class MetaDataContol extends PamControlledUnit implements PamSettings {
public static MetaDataContol getMetaDataControl() {
if (singleInstance == null) {
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.
PamController.getInstance().addControlledUnit(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
* so that it can be serialised into other PAMGuard settings.