@@ -960,20 +960,18 @@ else if (e.isShiftDown()) // update gamma
960960 UpdateAll ();
961961 }
962962 else {
963+ boolean lock_aspect = e .isControlDown (); // orthogonal Zoom
964+ boolean was_locked = otherCanvas2 .AspectLocked .getState ();
965+
966+ if (lock_aspect )
967+ otherCanvas2 .AspectLocked .setState (true );
968+
963969 if (e .getWheelRotation () < 0 ) {
964970 ChangeZoom (1.125 );
965971 } else {
966972 ChangeZoom (1.0 / 1.125 );
967973 }
968- if (e .isControlDown ())// orthogonal Zoom
969- if (e .getWheelRotation () < 0 )
970- {
971- ChangeOrthoZoom (1.125 );
972- }
973- else
974- {
975- ChangeOrthoZoom (1.0 / 1.125 );
976- }
974+ otherCanvas2 .AspectLocked .setState (was_locked );
977975 }
978976}
979977
@@ -1363,7 +1361,17 @@ public void keyPressed(KeyEvent e) {
13631361 {
13641362 myChar = '°' ;
13651363 }
1366-
1364+
1365+ if (KeyEvent .VK_F2 == e .getKeyCode ())
1366+ {
1367+ myChar = '^' ;
1368+ }
1369+
1370+ if (KeyEvent .VK_F1 == e .getKeyCode ())
1371+ {
1372+ myChar = '?' ;
1373+ }
1374+
13671375 int elem =my3ddata .ActiveElement ,t =my3ddata .ActiveTime ;
13681376
13691377 ImageCanvas PreferredCanvas =null ;
@@ -1594,6 +1602,13 @@ public void ExportValues() {
15941602 // return myplot;
15951603 }
15961604
1605+ public boolean checkProceed (String txt ) { // calls a user dialog to see if the user really wants to proceed
1606+ AGenericDialog question = new AGenericDialog ("Warning!" );
1607+ question .addMessage (txt + " modifies the data.\n Do you really want to proceed?" );
1608+ question .showDialog ();
1609+ return ! question .wasCanceled ();
1610+ }
1611+
15971612
15981613public void ProcessKey (char myChar ) {
15991614 switch (myChar ) {
@@ -1604,8 +1619,9 @@ public void ProcessKey(char myChar) {
16041619 centerCursor ();
16051620 return ;
16061621 case 'D' :
1607- my3ddata .DeleteActElement ();
1608- UpdateAllPanels ();
1622+ if (checkProceed ("Delete Element" ))
1623+ my3ddata .DeleteActElement ();
1624+ UpdateAllPanels ();
16091625 return ;
16101626 case 'f' : // upcast datatype to float
16111627 my3ddata .CloneFloat ();
@@ -1616,23 +1632,27 @@ public void ProcessKey(char myChar) {
16161632 UpdateAllPanels ();
16171633 return ;
16181634 case '+' :
1619- my3ddata .AddMarkedElement (); // Adds the gate element to the active element
1635+ if (checkProceed ("AddMarkedElement" ))
1636+ my3ddata .AddMarkedElement (); // Adds the gate element to the active element
16201637 UpdateAllPanels ();
16211638 return ;
16221639 case '_' :
16231640 my3ddata .AdjustOffsetToROIMean (); // Subtracts the gate element from the active element
16241641 UpdateAllPanels ();
16251642 return ;
16261643 case '-' :
1627- my3ddata .SubMarkedElement (); // Subtracts the gate element from the active element
1644+ if (checkProceed ("SubtractMarkedElement" ))
1645+ my3ddata .SubMarkedElement (); // Subtracts the gate element from the active element
16281646 UpdateAllPanels ();
16291647 return ;
16301648 case '*' :
1631- my3ddata .MulMarkedElement (); // Multiplies the gate element with the active element
1649+ if (checkProceed ("MultiplyMarkedElement" ))
1650+ my3ddata .MulMarkedElement (); // Multiplies the gate element with the active element
16321651 UpdateAllPanels ();
16331652 return ;
16341653 case '/' :
1635- my3ddata .DivMarkedElement (); // Multiplies the gate element with the active element
1654+ if (checkProceed ("DivideMarkedElement" ))
1655+ my3ddata .DivMarkedElement (); // Multiplies the gate element with the active element
16361656 UpdateAllPanels ();
16371657 return ;
16381658 case 'e' : // advance one element cyclicly
@@ -1837,31 +1857,31 @@ public void ProcessKey(char myChar) {
18371857 AspectLocked .setState (! AspectLocked .getState ());
18381858 return ;
18391859 case '#' :
1840- my3ddata .SubtractTrackedSpot ();
1860+ my3ddata .SubtractTrackedSpot ();
18411861 my3ddata .InvalidateProjs (-1 ); // all projections are invalid
18421862 my3ddata .InvalidateSlices ();
1843- UpdateAll ();
1863+ UpdateAll ();
18441864 return ;
18451865 case 's' :
18461866 AlternateViewer xx =new AlternateViewer (applet ); // clone the data and open a new viewer
18471867 My3DData nd =new My3DData (my3ddata );
18481868 xx .Assign3DData (applet , null , nd );
1849- UpdateAll ();
1869+ UpdateAll ();
18501870 return ;
18511871 case 'P' :
1852- my3ddata .ToggleProj (DimNr ,false );
1853- label .CoordsChanged ();
1854- UpdateAll ();
1872+ my3ddata .ToggleProj (DimNr ,false );
1873+ label .CoordsChanged ();
1874+ UpdateAll ();
18551875 return ;
18561876 case 'p' :
1857- my3ddata .ToggleProj (DimNr ,true );
1858- UpdateAll ();
1877+ my3ddata .ToggleProj (DimNr ,true );
1878+ UpdateAll ();
18591879 return ;
18601880 case '^' :
1861- my3ddata .ActElement ().AdvanceReadMode ();
1862- my3ddata .InvalidateSlices ();
1863- my3ddata .InvalidateProjs (-1 );
1864- UpdateAll ();
1881+ my3ddata .ActElement ().AdvanceReadMode ();
1882+ my3ddata .InvalidateSlices ();
1883+ my3ddata .InvalidateProjs (-1 );
1884+ UpdateAll ();
18651885 return ;
18661886 case 'S' :
18671887 if (! myPanel .ROIstarted && ! LineROIStarted ) // otherwise the user has to finish the ROI first
@@ -1988,9 +2008,9 @@ public void ProcessKey(char myChar) {
19882008 //return ;
19892009 case '!' : // transfers the colormap threshold to data threshold
19902010 // my3ddata.addLThresh(0.02);
1991- my3ddata .CThreshToValThresh (-1 ,0.0 ,1.0 );
1992- UpdateAll ();
1993- return ;
2011+ my3ddata .CThreshToValThresh (-1 ,0.0 ,1.0 );
2012+ UpdateAll ();
2013+ return ;
19942014 case '1' :
19952015 if (my3ddata .GateActive && (my3ddata .GateElem == my3ddata .GateElem ))
19962016 {
0 commit comments