PAMGuard FX gui fix to make sure displays save to the same tab

This commit is contained in:
Jamie Mac 2024-03-29 15:39:27 +00:00
parent fb9bc63719
commit 198071e051
8 changed files with 32 additions and 27 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

@ -164,6 +164,7 @@ public class CheckWavHeadersPane extends PamBorderPane {
private int countFiles(File folder) {
if (folder == null) return 0;
int nF = 0;
File[] files = folder.listFiles(new PamAudioFileFilter());
if (files == null) return 0;

View File

@ -23,6 +23,7 @@ import PamguardMVC.PamObserverAdapter;
import PamguardMVC.PamRawDataBlock;
/**
*
* The controller for the display if the main PAMGuard GUI is in JavaFX mode.
*
* @author Jamie Macaulay

View File

@ -166,9 +166,6 @@ public class DetectionGroupDisplay extends PamBorderPane {
arrowPane.getChildren().addAll(arrowLeft, arrowRight);
BorderPane.setAlignment(arrowPane, Pos.CENTER_RIGHT);
//a label to show information of the data unit
dataLabel = new Label();

View File

@ -7,6 +7,7 @@ import PamController.PamController;
import PamController.PamSettingManager;
import PamController.PamSettings;
import PamguardMVC.PamDataBlock;
import javafx.geometry.Side;
import javafx.scene.layout.Region;
import pamViewFX.fxNodes.internalNode.PamInternalPane;
import userDisplayFX.UserDisplayControlFX;
@ -101,11 +102,17 @@ public class DetectionGroupDisplayFX extends DetectionGroupDisplay implements U
@Override
public boolean requestNodeSettingsPane() {
// TODO Auto-generated method stub
return false;
this.showSettingsPane(true);
return true;
}
private void showSettingsPane(boolean b) {
this.detectionDisplay.getHidingPane(Side.RIGHT).showHidePane(b);;
}
@Override
public void notifyModelChanged(int changeType) {
@ -175,8 +182,8 @@ public class DetectionGroupDisplayFX extends DetectionGroupDisplay implements U
return false;
}
System.out.println("DETECTION DISPLAY DATA SOURCE: " + settings.dataSource);
System.out.println("DETECTION DISPLAY DATA SOURCE: " + settings.tabName);
System.out.println("LOAD DETECTION DISPLAY DATA SOURCE: " + settings.dataSource);
System.out.println("LOAD DETECTION DISPLAY DATA SOURCE: " + settings.tabName);
this.detectionPlotParams = settings.clone();

View File

@ -244,7 +244,7 @@ public class PamGuiFX extends StackPane implements PamViewInterface {
mainTabPane.setTabStartRegion(showButtonLeft);
mainTabPane.getAddTabButton().setOnAction((value)->{
addPamTab(new TabInfo("Display " + this.getNumTabs()+1), null ,true);
addPamTab(new TabInfo("Display " + (this.getNumTabs()+1)), null ,true);
mainTabPane.layout();
});

View File

@ -359,7 +359,7 @@ public class PamGuiManagerFX implements PAMControllerGUI, PamSettings {
//add the display to the current set of tabs.
ArrayList<PamGuiTabFX> allTabs = getAllTabs();
for (int i=0; i<allTabs.size(); i++) {
if (allTabs.get(i).getText().equals(newDisplay.getDisplayParams().tabName)){
if (allTabs.get(i).getName().equals(newDisplay.getDisplayParams().tabName)){
return allTabs.get(i);
}
}
@ -383,6 +383,8 @@ public class PamGuiManagerFX implements PAMControllerGUI, PamSettings {
private void addDisplay(UserDisplayNodeFX newDisplay){
PamGuiTabFX tab;
System.out.println("ADD USER DISPLAY");
if (!newDisplay.isStaticDisplay()){
//if a non static display then add to a selected tab.
tab=getDisplayTab(newDisplay);
@ -405,6 +407,7 @@ public class PamGuiManagerFX implements PAMControllerGUI, PamSettings {
// + newDisplay.getDisplayParams().sizeY);
newDisplay.getDisplayParams().tabName=tab.getName();
System.out.println("ADD USER DISPLAY 2a " + newDisplay.getDisplayParams().tabName + " " + tab.getName() + " " + tab.getTabInfo().tabName);
newDisplay.setFrameHolder(internalFrame);
//Have to platform later this as needs some time to intitialise? 11/08/2018
@ -418,8 +421,11 @@ public class PamGuiManagerFX implements PAMControllerGUI, PamSettings {
else {
if (newDisplay.getDisplayParams()!=null) {
newDisplay.getDisplayParams().tabName=tab.getName();
System.out.println("ADD USER DISPLAY 2b " + newDisplay.getDisplayParams().tabName);
}
}
}

View File

@ -87,34 +87,25 @@ public class PamGuiTabFX extends PamTabFX {
/**
* Constructor for a new tab
* @param text. Name of tab
* @param tabInfo - info on the tab such as name
* @param pamGui - reference to the PamGuiFX the pane belongs to.
*/
public PamGuiTabFX(TabInfo tabInfo, PamGuiFX pamGui) {
super(tabInfo.tabName);
this.pamGui=pamGui;
this.tabInfo=tabInfo;
contentHolder=new PamBorderPane();
//needs to be in this order so toolbar pane sits on top of center pane.
holder=new Pane();
contentHolder.setCenter(holder);
super.setContent(contentHolder);
setPanesEditable(editable);
this(tabInfo, null, pamGui);
}
/**
* Constructor for a new tab
* @param text - Name of tab
* @param toolbar - pane which sits just below tab
* @param content - content for tab pane.
* @param tabInfo - info on the tab such as name
* @param newContent - content to display
* @param pamGui - reference to the PamGuiFX the pane belongs to.
*/
public PamGuiTabFX(TabInfo tabInfo, UserDisplayNodeFX newContent, PamGuiFX pamGui) {
super(tabInfo.tabName);
this.pamGui=pamGui;
this.tabInfo=tabInfo;
contentHolder=new PamBorderPane();
//needs to be in this order so toolbar pane sits on top of center pane.
@ -414,7 +405,9 @@ public class PamGuiTabFX extends PamTabFX {
* @return name of tabs.
*/
public String getName() {
return this.getText();
//note that this should not be getText() because
//this is not set in the parent class constructor.
return this.tabInfo.tabName;
}
/**