From bc39d8fb1c887cb3e7aac1c0e2cb964a0f030686 Mon Sep 17 00:00:00 2001 From: Elodie Bourrec Date: Tue, 3 Nov 2020 20:41:21 +0100 Subject: [PATCH] Re activate object highlightening on image when selected in table. De-activate image move to center the obect on view. Export version 3.5 --- bin/Osp_Editor_3.5.jar | Bin 0 -> 28149263 bytes src/osp/ui/OSPE_AboutBoxPanel.java | 2 +- src/osp/ui/OSPE_VisuPanel.java | 36 ++++++++++++++++++++---------------- src/osp/utils/TableurPanel.java | 10 +++++++++- 4 files changed, 30 insertions(+), 18 deletions(-) create mode 100644 bin/Osp_Editor_3.5.jar diff --git a/bin/Osp_Editor_3.5.jar b/bin/Osp_Editor_3.5.jar new file mode 100644 index 0000000..6aede7f Binary files /dev/null and b/bin/Osp_Editor_3.5.jar differ diff --git a/src/osp/ui/OSPE_AboutBoxPanel.java b/src/osp/ui/OSPE_AboutBoxPanel.java index 8a11f14..16996fd 100755 --- a/src/osp/ui/OSPE_AboutBoxPanel.java +++ b/src/osp/ui/OSPE_AboutBoxPanel.java @@ -23,7 +23,7 @@ public class OSPE_AboutBoxPanel extends JDialog { /** Product name */ private String product = "OSP Editor"; /** Current version */ - private String version = "version 3.4 - August 2020"; + private String version = "version 3.5 - November 2020"; /** Copyright information */ private String copyright = "Copyright (c)"; /** Comments */ diff --git a/src/osp/ui/OSPE_VisuPanel.java b/src/osp/ui/OSPE_VisuPanel.java index 8c0234f..118bb62 100755 --- a/src/osp/ui/OSPE_VisuPanel.java +++ b/src/osp/ui/OSPE_VisuPanel.java @@ -3764,18 +3764,22 @@ public class OSPE_VisuPanel extends JPanel implements Observer, { objChoosen.setPointed(false); tableurPanel.razTableSelect(); - if (fov.getCurrentImage().getSelectedMask()>=0) - { - newOrig = new Point2D.Double(0.0,0.0); - newOrig = new Point2D.Double(fov.getCurrentMaskOfCurrentImage().getCenter().x, fov.getCurrentMaskOfCurrentImage().getCenter().y); - icc.userToCanvasCoords(newOrig, false); - } - else - { - // set display center at bary point - newOrig.setLocation(fov.getTheBrain().getBary().x, fov.getTheBrain().getBary().y); - icc.imageToCanvasCoords(newOrig, false); - } + + // Pb when moving the image to center on object choosen. The zoom part is not part of calculation. + // See if it's useful to have this function or not. + +// if (fov.getCurrentImage().getSelectedMask()>=0) +// { +// newOrig = new Point2D.Double(0.0,0.0); +// newOrig = new Point2D.Double(fov.getCurrentMaskOfCurrentImage().getCenter().x, fov.getCurrentMaskOfCurrentImage().getCenter().y); +// icc.userToCanvasCoords(newOrig, false); +// } +// else +// { +// // set display center at bary point +// newOrig.setLocation(fov.getTheBrain().getBary().x, fov.getTheBrain().getBary().y); +// icc.imageToCanvasCoords(newOrig, false); +// } } else objChoosen.setPointed(true); @@ -3789,11 +3793,11 @@ public class OSPE_VisuPanel extends JPanel implements Observer, } idLastObjChoosen=idObjChoosen; //System.out.println(" chg Last id "+idLastObjChoosen); - WorldCoords wc=objChoosen.getObjWorldCenter(); - newOrig = new Point2D.Double(wc.getX(), wc.getY()); - icc.worldToCanvasCoords(newOrig, false); +// WorldCoords wc=objChoosen.getObjWorldCenter(); +// newOrig = new Point2D.Double(wc.getX(), wc.getY()); +// icc.worldToCanvasCoords(newOrig, false); } - fov.getCurrentImage().setCenter(newOrig); + // fov.getCurrentImage().setCenter(newOrig); fov.getCurrentImage().update(); eraseAllObjects(); plotAllObjects(); diff --git a/src/osp/utils/TableurPanel.java b/src/osp/utils/TableurPanel.java index fe211f8..e4d16eb 100755 --- a/src/osp/utils/TableurPanel.java +++ b/src/osp/utils/TableurPanel.java @@ -98,8 +98,16 @@ public class TableurPanel extends JPanel implements Observer { public void mouseClicked(MouseEvent e) { // TODO Auto-generated method stub int a = table.getSelectedRow(); +// int colSlit=4; // slit col num in tableurModel +// int slit=99; if (a>=0) { + // try to higliht slit with object -- not in function +// String sl = table.getValueAt(a, colSlit).toString(); +// if (!sl.contentEquals("none")) +// { +// Integer.parseInt(sl); +// } getObject(a); idRow=a; table.changeSelection(a, 0, false, false); @@ -135,7 +143,7 @@ public class TableurPanel extends JPanel implements Observer { private void getObject(int rowNb) { // System.out.println("tabPan rowNb "+rowNb); -// visuPanel.setImageAtObjectPosition(rowNb); + visuPanel.setImageAtObjectPosition(rowNb); } -- libgit2 0.21.2