This is an automated email from the ASF dual-hosted git repository.

hansva pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hop.git


The following commit(s) were added to refs/heads/master by this push:
     new 97f6029e07 HOP-4604 - Fix missing navigation window for workflows 
execution viewer - Fix Keyboard shortcut in workflows execution viewer - Double 
keyboard shortcut for zoom in '+' or '=' - Double keyboard shortcut for zoom 
100% '0' or SWT.KEYPAD_0 - Double keyboard shortcut zoom fit to screen '*' or 
SWT.KEYPAD_MULTIPLY - Fix tooltip
     new b80eff6903 Merge pull request #1837 from nadment/HOP-4604
97f6029e07 is described below

commit 97f6029e071ae6661e09b305f22378cc2410d82c
Author: Nicolas Adment <[email protected]>
AuthorDate: Sat Nov 26 22:38:00 2022 +0100

    HOP-4604
    - Fix missing navigation window for workflows execution viewer
    - Fix Keyboard shortcut in workflows execution viewer
    - Double keyboard shortcut for zoom in '+' or '='
    - Double keyboard shortcut for zoom 100% '0' or SWT.KEYPAD_0
    - Double keyboard shortcut zoom fit to screen '*' or SWT.KEYPAD_MULTIPLY
    - Fix tooltip
---
 .../dummy/messages/messages_pt_BR.properties       |  0
 .../hopgui/file/pipeline/HopGuiPipelineGraph.java  |  3 ++-
 .../hopgui/file/workflow/HopGuiWorkflowGraph.java  |  3 ++-
 .../perspective/execution/DragViewZoomBase.java    | 26 ++++++++++++++++++----
 .../execution/PipelineExecutionViewer.java         | 11 +--------
 .../execution/WorkflowExecutionViewer.java         | 11 +++++++--
 .../hop/ui/hopgui/shared/BaseExecutionViewer.java  |  8 +------
 .../workflow/messages/messages_en_US.properties    |  2 +-
 8 files changed, 38 insertions(+), 26 deletions(-)

diff --git 
a/ui/src/main/resources/org/apache/hop/pipeline/transforms/dummy/messages/messages_pt_BR.properties
 
b/engine/src/main/resources/org/apache/hop/pipeline/transforms/dummy/messages/messages_pt_BR.properties
similarity index 100%
rename from 
ui/src/main/resources/org/apache/hop/pipeline/transforms/dummy/messages/messages_pt_BR.properties
rename to 
engine/src/main/resources/org/apache/hop/pipeline/transforms/dummy/messages/messages_pt_BR.properties
diff --git 
a/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java
 
b/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java
index 052e70fa72..ae5610ddea 100644
--- 
a/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java
+++ 
b/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java
@@ -1820,7 +1820,8 @@ public class HopGuiPipelineGraph extends 
HopGuiAbstractGraph
   public void zoomOut() {
     super.zoomOut();
   }
-
+  
+  @Override
   @GuiToolbarElement(
       root = GUI_PLUGIN_TOOLBAR_PARENT_ID,
       id = TOOLBAR_ITEM_ZOOM_TO_FIT,
diff --git 
a/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java
 
b/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java
index 534942cb59..1614d76601 100644
--- 
a/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java
+++ 
b/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java
@@ -1423,10 +1423,11 @@ public class HopGuiWorkflowGraph extends 
HopGuiAbstractGraph
     super.zoom100Percent();
   }
 
+  @Override
   @GuiToolbarElement(
       root = GUI_PLUGIN_TOOLBAR_PARENT_ID,
       id = TOOLBAR_ITEM_ZOOM_TO_FIT,
-      toolTip = "i18n::HopGuiPipelineGraph.GuiAction.ZoomFitToScreen.Tooltip",
+      toolTip = "i18n::HopGuiWorkflowGraph.GuiAction.ZoomFitToScreen.Tooltip",
       type = GuiToolbarElementType.BUTTON,
       image = "ui/images/zoom-fit.svg")
   public void zoomFitToScreen() {
diff --git 
a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/DragViewZoomBase.java
 
b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/DragViewZoomBase.java
index d233e52279..16f57751ad 100644
--- 
a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/DragViewZoomBase.java
+++ 
b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/DragViewZoomBase.java
@@ -100,7 +100,7 @@ public abstract class DragViewZoomBase extends Composite {
     redraw();
   }
 
-  @GuiKeyboardShortcut(control = true, key = '=')
+  @GuiKeyboardShortcut(control = true, key = '+')
   public void zoomIn() {
     magnification += 0.1f;
     // Minimum 1000%
@@ -111,6 +111,12 @@ public abstract class DragViewZoomBase extends Composite {
     redraw();
   }
 
+  // Double keyboard shortcut zoom in '+' or '='
+  @GuiKeyboardShortcut(control = true, key = '=')
+  public void zoomIn2() {
+    zoomIn();
+  }
+  
   @GuiKeyboardShortcut(control = true, key = '-')
   public void zoomOut() {
     magnification -= 0.1f;
@@ -122,14 +128,20 @@ public abstract class DragViewZoomBase extends Composite {
     redraw();
   }
 
-  @GuiKeyboardShortcut(control = true, key = '0')
+  @GuiKeyboardShortcut(control = true, key = '0' )
   public void zoom100Percent() {
     magnification = 1.0f;
     setZoomLabel();
     redraw();
   }
-
-  @GuiKeyboardShortcut(control = true, key = ']')
+  
+  // Double keyboard shortcut zoom 100% '0' or keypad 0
+  @GuiKeyboardShortcut(control = true, key = SWT.KEYPAD_0 )
+  public void zoom100Percent2() {
+    zoom100Percent();
+  }
+  
+  @GuiKeyboardShortcut(control = true, key = '*')
   public void zoomFitToScreen() {
     if (maximum.x <= 0 || maximum.y <= 0) {
       return;
@@ -155,6 +167,12 @@ public abstract class DragViewZoomBase extends Composite {
     canvas.redraw();
   }
 
+  // Double keyboard shortcut zoom fit to screen '*' or keypad *
+  @GuiKeyboardShortcut(control = true, key = SWT.KEYPAD_MULTIPLY )
+  public void zoomFitToScreen2() {
+    zoomFitToScreen();
+  }
+  
   /**
    * There are 2 ways to drag the view-port around. One way is to use the 
navigation rectangle at
    * the bottom. The other way is to click-drag the background.
diff --git 
a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/PipelineExecutionViewer.java
 
b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/PipelineExecutionViewer.java
index 7110b455dd..f79fb9c2ea 100644
--- 
a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/PipelineExecutionViewer.java
+++ 
b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/PipelineExecutionViewer.java
@@ -116,7 +116,7 @@ import java.util.Set;
 
 @GuiPlugin
 public class PipelineExecutionViewer extends BaseExecutionViewer
-    implements IExecutionViewer, PaintListener, MouseListener, KeyListener {
+    implements IExecutionViewer, PaintListener, MouseListener {
   private static final Class<?> PKG = PipelineExecutionViewer.class; // For 
Translator
 
   public static final String GUI_PLUGIN_TOOLBAR_PARENT_ID = 
"PipelineExecutionViewer-Toolbar";
@@ -128,11 +128,9 @@ public class PipelineExecutionViewer extends 
BaseExecutionViewer
       "PipelineExecutionViewer-ToolBar-10600-Zoom-Fit-To-Screen";
   public static final String TOOLBAR_ITEM_TO_EDITOR =
       "PipelineExecutionViewer-Toolbar-11100-GoToEditor";
-
   public static final String TOOLBAR_ITEM_DRILL_DOWN =
       "PipelineExecutionViewer-Toolbar-11200-DrillDown";
   public static final String TOOLBAR_ITEM_GO_UP = 
"PipelineExecutionViewer-Toolbar-11300-GoUp";
-
   public static final String TOOLBAR_ITEM_VIEW_EXECUTOR =
       "PipelineExecutionViewer-Toolbar-12000-ViewExecutor";
   public static final String TOOLBAR_ITEM_VIEW_METADATA =
@@ -223,7 +221,6 @@ public class PipelineExecutionViewer extends 
BaseExecutionViewer
     if (!EnvironmentUtils.getInstance().isWeb()) {
       canvas.addMouseMoveListener(this);
     }
-    canvas.addKeyListener(this);
 
     // The execution information tabs at the bottom
     //
@@ -1213,12 +1210,6 @@ public class PipelineExecutionViewer extends 
BaseExecutionViewer
     super.viewMetadata(execution);
   }
 
-  @Override
-  public void keyPressed(KeyEvent keyEvent) {}
-
-  @Override
-  public void keyReleased(KeyEvent keyEvent) {}
-
   @Override
   public String getActiveId() {
     if (selectedTransform != null) {
diff --git 
a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/WorkflowExecutionViewer.java
 
b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/WorkflowExecutionViewer.java
index bd3b6d49a9..246737ff4f 100644
--- 
a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/WorkflowExecutionViewer.java
+++ 
b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/WorkflowExecutionViewer.java
@@ -119,7 +119,6 @@ public class WorkflowExecutionViewer extends 
BaseExecutionViewer
       "WorkflowExecutionViewer-ToolBar-10500-Zoom-Level";
   public static final String TOOLBAR_ITEM_ZOOM_FIT_TO_SCREEN =
       "WorkflowExecutionViewer-ToolBar-10600-Zoom-Fit-To-Screen";
-
   public static final String TOOLBAR_ITEM_TO_EDITOR =
       "WorkflowExecutionViewer-Toolbar-11100-GoToEditor";
   public static final String TOOLBAR_ITEM_DRILL_DOWN =
@@ -161,6 +160,10 @@ public class WorkflowExecutionViewer extends 
BaseExecutionViewer
 
     actionExecutions = new HashMap<>();
 
+    // Calculate the pipeline size only once since the metadata is read-only
+    //
+    this.maximum = workflowMeta.getMaximum();
+    
     addWidgets();
   }
 
@@ -210,7 +213,6 @@ public class WorkflowExecutionViewer extends 
BaseExecutionViewer
     canvas.setLayoutData(fdCanvas);
     canvas.addPaintListener(this);
     canvas.addMouseListener(this);
-    canvas.addKeyListener(this);
     if (!EnvironmentUtils.getInstance().isWeb()) {
       canvas.addMouseMoveListener(this);
     }
@@ -227,6 +229,11 @@ public class WorkflowExecutionViewer extends 
BaseExecutionViewer
 
     refresh();
 
+    // Add keyboard listeners from the main GUI and this class (toolbar etc) 
to the canvas. That's
+    // where the focus should be
+    //
+    hopGui.replaceKeyboardShortcutListeners(this);
+    
     tabFolder.setSelection(0);
     sash.setWeights(60, 40);
   }
diff --git 
a/ui/src/main/java/org/apache/hop/ui/hopgui/shared/BaseExecutionViewer.java 
b/ui/src/main/java/org/apache/hop/ui/hopgui/shared/BaseExecutionViewer.java
index 2f57d7d676..4cfdc54dd0 100644
--- a/ui/src/main/java/org/apache/hop/ui/hopgui/shared/BaseExecutionViewer.java
+++ b/ui/src/main/java/org/apache/hop/ui/hopgui/shared/BaseExecutionViewer.java
@@ -57,7 +57,7 @@ import java.util.List;
 import java.util.Map;
 
 public abstract class BaseExecutionViewer extends DragViewZoomBase
-    implements KeyListener, MouseListener, MouseMoveListener {
+    implements MouseListener, MouseMoveListener {
 
   public static final String STRING_STATE_STALE = "Stale";
 
@@ -138,12 +138,6 @@ public abstract class BaseExecutionViewer extends 
DragViewZoomBase
 
   public abstract void drillDownOnLocation(Point location);
 
-  @Override
-  public void keyPressed(KeyEvent keyEvent) {}
-
-  @Override
-  public void keyReleased(KeyEvent keyEvent) {}
-
   @Override
   public void mouseDoubleClick(MouseEvent mouseEvent) {
     drillDownOnLocation(screen2real(mouseEvent.x, mouseEvent.y));
diff --git 
a/ui/src/main/resources/org/apache/hop/ui/hopgui/file/workflow/messages/messages_en_US.properties
 
b/ui/src/main/resources/org/apache/hop/ui/hopgui/file/workflow/messages/messages_en_US.properties
index b802340579..7048ec1056 100644
--- 
a/ui/src/main/resources/org/apache/hop/ui/hopgui/file/workflow/messages/messages_en_US.properties
+++ 
b/ui/src/main/resources/org/apache/hop/ui/hopgui/file/workflow/messages/messages_en_US.properties
@@ -78,6 +78,7 @@ HopGuiWorkflowGraph.GuiAction.Zoom100.Tooltip=Zoom to 100%
 HopGuiWorkflowGraph.GuiAction.ZoomIn.Tooltip=Zoom in 10%
 HopGuiWorkflowGraph.GuiAction.ZoomInOut.Tooltip=Zoom in or out
 HopGuiWorkflowGraph.GuiAction.ZoomOut.Tooltip=Zoom out 10%
+HopGuiWorkflowGraph.GuiAction.ZoomFitToScreen.Tooltip=Zoom to fit screen size
 HopGuiWorkflowGraph.NewWorkflowBackgroundMessage=Left click or tap anywhere to 
start.
 HopGuiWorkflowGraph.OpenReferencedObject.Selection.Message=Select the 
referenced file to open:
 HopGuiWorkflowGraph.OpenReferencedObject.Selection.Title=Open referenced file
@@ -85,7 +86,6 @@ HopGuiWorkflowGraph.SaveFile.Dialog.Header=Save File?
 HopGuiWorkflowGraph.SaveFile.Dialog.Message=Do you want to save file ''{0}'' 
before closing?
 PipelineGraph.RunningFile.Dialog.Header=Running file!
 PipelineGraph.RunningFile.Dialog.Message=Workflow ''{0}'' is still running.  
Do you want to stop it before closing?\n\nYes: stop the workflow.\nNo: keep it 
running until the GUI stops.\nCancel: don't close the file.\n
-
 HopWorkflowFileType.ErrorDialog.NewWorkflowCreation.Header=Error
 HopWorkflowFileType.ErrorDialog.NewWorkflowCreation.Message=Error creating new 
workflow
 HopWorkflowFileType.GuiAction.Workflow.Name=Workflow

Reply via email to