Fix bugs in detection display

This commit is contained in:
Jamie Mac 2024-07-18 16:37:15 +01:00
parent aa686cac5e
commit c01e966eaf
4 changed files with 58 additions and 15 deletions

View File

@ -1,10 +1,12 @@
package PamView.symbol.modifier.swing;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Enumeration;
import javax.swing.JButton;
import javax.swing.border.EmptyBorder;
import javax.swing.tree.TreeNode;
import PamView.dialog.GenericSwingDialog;
@ -25,6 +27,10 @@ public class OptionsTreeNode implements TreeNode {
this.optionsPanel = optionsPanel;
this.leafIndex = leafIndex;
optionsButton = new JButton("more ...");
Insets insets = optionsButton.getInsets();
if (insets == null) insets = new Insets(0,0,0,0);
insets.bottom = insets.top = insets.left = 1;
optionsButton.setBorder(new EmptyBorder(insets));
optionsButton.setToolTipText("More symbol options");
optionsButton.addActionListener(new ActionListener() {

View File

@ -18,12 +18,10 @@ import javax.swing.tree.TreePath;
import PamView.dialog.DialogScrollPane;
import PamView.dialog.PamDialogPanel;
import PamView.symbol.PamSymbolChooser;
import PamView.symbol.StandardSymbolChooser;
import PamView.symbol.StandardSymbolOptions;
import PamView.symbol.modifier.SymbolModifier;
import PamView.symbol.modifier.SymbolModifierParams;
import PamguardMVC.debug.Debug;
/**
* Panel to include in a dialog with options to select and activate a variety of symbol modifiers.

View File

@ -253,6 +253,10 @@ public class PamGuiTabFX extends PamTabFX {
double r1 = 1 - r;
int smallWindows = 0;
//the padding between windows
double padding = 10;
ArrayList<PamGuiInternalPane> dw = internalPanes;
@ -268,7 +272,9 @@ public class PamGuiTabFX extends PamTabFX {
//now place windows in correct position
//large windows
double x, y, w, h = 0;
double x, y, w, h = 0.;
double pad =0.;
if (largeWindows > 0) {
x = 0;
y = 0;
@ -284,7 +290,10 @@ public class PamGuiTabFX extends PamTabFX {
if (dw.get(i).getUserDisplayNode().isMinorDisplay()== true) continue;
dw.get(i).setPaneLayout(x, y);
dw.get(i).setPaneSize(w, h);
//set the padding if the pane is not the last pane.
pad = (i== dw.size()-1) ? 0 : padding;
dw.get(i).setPaneSize(w - (horz? pad:0), h - (horz? 0:pad));
if (horz) x += w;
else y += h;
}
@ -307,7 +316,10 @@ public class PamGuiTabFX extends PamTabFX {
for (int i = 0; i < dw.size(); i++) {
if (dw.get(i).getUserDisplayNode().isMinorDisplay() == false) continue;
dw.get(i).setPaneLayout(x, y);
dw.get(i).setPaneSize(w, h);
//set the padding if the pane is not the last pane.
pad = (i== dw.size()-1) ? 0 : padding;
dw.get(i).setPaneSize(w- (horz? pad:0), h - (horz? 0:pad));
if (horz) x += w;
else y +=h;
}

View File

@ -1,6 +1,9 @@
package pamViewFX.fxPlotPanes;
import Layout.PamAxis;
import javafx.beans.binding.Bindings;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.value.ObservableValue;
import javafx.geometry.Side;
import javafx.scene.Node;
import javafx.scene.canvas.Canvas;
@ -256,13 +259,31 @@ public class PlotPane extends PamBorderPane {
PamHBox horzHolder=new PamHBox();
Pane leftPane=new Pane();
//create an observable which is the size of the axis pane if the pane is visible and otherwise
//is zero.
ObservableValue<Number> valLeft = Bindings
.when(yAxisLeftPane.visibleProperty())
.then(yAxisLeftPane.widthProperty())
.otherwise(
new SimpleDoubleProperty(0.)
);
//need both min and pref to make binding work properly;
leftPane.prefWidthProperty().bind(yAxisLeftPane.widthProperty());
leftPane.minWidthProperty().bind(yAxisLeftPane.widthProperty());
leftPane.prefWidthProperty().bind(valLeft);
leftPane.minWidthProperty().bind(valLeft);
Pane rightPane=new Pane();
rightPane.prefWidthProperty().bind(yAxisRightPane.widthProperty());
rightPane.minWidthProperty().bind(yAxisRightPane.widthProperty());
ObservableValue<Number> valRight = Bindings
.when(yAxisRightPane.visibleProperty())
.then(yAxisRightPane.widthProperty())
.otherwise(
new SimpleDoubleProperty(0.)
);
rightPane.prefWidthProperty().bind(valRight);
rightPane.minWidthProperty().bind(valRight);
horzHolder.getChildren().addAll(leftPane, axisPane, rightPane);
//axisPane.toFront(); this changes the order of children in a PamHBox.
@ -369,8 +390,8 @@ public class PlotPane extends PamBorderPane {
//holderPane.getChildren().clear();
//HACK- 05/08/2016 have to do this because there is a bug in switching children postions in a border pane.
//casues a duplicate childrne error.
//HACK- 05/08/2016 have to do this because there is a bug in switching children positions in a border pane.
//causes duplicate children error
holderPane.setRight(null);
holderPane.setLeft(null);
holderPane.setTop(null);
@ -385,24 +406,30 @@ public class PlotPane extends PamBorderPane {
else if (topBorder > 0) {
// holderPane.setTopSpace(topBorder);
}
if (bottom) {
holderPane.setBottom(bottomHolder);
}
else if (bottomBorder > 0) {
// holderPane.setBottomSpace(bottomBorder);
}
if (right) {
holderPane.setRight(yAxisRightPane) ;
yAxisRightPane.setVisible(true);
}
else if (rightBorder > 0){
// holderPane.setRightSpace(rightBorder);
else {
yAxisRightPane.setVisible(false);
}
if (left) {
holderPane.setLeft(yAxisLeftPane) ;
yAxisLeftPane.setVisible(true);
}
else if (leftBorder > 0) {
// holderPane.setLeftSpace(leftBorder);
else {
yAxisLeftPane.setVisible(false);
}
holderPane.setCenter(canvasHolder);
//bottomHolder.toBack();