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

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git

commit 354b6255d9f1cea631a505d6d4a8ab85136a3f37
Author: Andrus Adamchik <[email protected]>
AuthorDate: Tue May 5 16:13:36 2026 -0400

    Modeler cleanup
---
 .../event/model/CallbackMethodListener.java        | 12 ++---
 .../modeler/event/model/DataMapListener.java       |  1 -
 .../org/apache/cayenne/modeler/ui/MainMenuBar.java |  5 ++
 .../cayenne/modeler/ui/about/AboutDialog.java      | 60 ++++++++++++----------
 4 files changed, 40 insertions(+), 38 deletions(-)

diff --git 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/model/CallbackMethodListener.java
 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/model/CallbackMethodListener.java
index 1cbab2634..c5d0a8dad 100644
--- 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/model/CallbackMethodListener.java
+++ 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/model/CallbackMethodListener.java
@@ -28,16 +28,10 @@ import java.util.EventListener;
  */
 public interface CallbackMethodListener extends EventListener {
 
-    /** Callback method changed.
-     * @param e event */
-    public void callbackMethodChanged(CallbackMethodEvent e);
+    void callbackMethodChanged(CallbackMethodEvent e);
 
-    /** Callback method has been created/added.
-     * @param e event*/
-    public void callbackMethodAdded(CallbackMethodEvent e);
+    void callbackMethodAdded(CallbackMethodEvent e);
 
-    /** Callback method has been removed.
-     * @param e event*/
-    public void callbackMethodRemoved(CallbackMethodEvent e);
+    void callbackMethodRemoved(CallbackMethodEvent e);
 }
 
diff --git 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/model/DataMapListener.java
 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/model/DataMapListener.java
index 68f120fca..30ef45f38 100644
--- 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/model/DataMapListener.java
+++ 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/model/DataMapListener.java
@@ -31,5 +31,4 @@ public interface DataMapListener extends EventListener {
     void dataMapAdded(DataMapEvent e);
 
     void dataMapRemoved(DataMapEvent e);
-
 }
diff --git 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ui/MainMenuBar.java
 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ui/MainMenuBar.java
index 6d764683a..35b6cd700 100644
--- 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ui/MainMenuBar.java
+++ 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ui/MainMenuBar.java
@@ -34,10 +34,15 @@ import java.util.List;
 class MainMenuBar extends JMenuBar {
 
     private final List<RecentFileListListener> recentFileListeners;
+    private final GlobalActions globalActions;
 
     MainMenuBar(GlobalActions globalActions) {
         this.recentFileListeners = new ArrayList<>();
+        this.globalActions = globalActions;
+        initLayout();
+    }
 
+    private void initLayout() {
         JMenu fileMenu = new JMenu("File");
         JMenu editMenu = new JMenu("Edit");
         JMenu viewMenu = new JMenu("View");
diff --git 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ui/about/AboutDialog.java
 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ui/about/AboutDialog.java
index ba7aaa76c..d849cfbea 100644
--- 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ui/about/AboutDialog.java
+++ 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ui/about/AboutDialog.java
@@ -57,16 +57,18 @@ public class AboutDialog extends AppFrame implements 
FocusListener, KeyListener,
 
     public AboutDialog(Application application) {
         super(application);
-        FlowLayout flowLayout = new FlowLayout();
-        getContentPane().setLayout(flowLayout);
-        getContentPane().setBackground(Color.WHITE);
-        this.setUndecorated(true);
-        this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+        initLayout();
+        initBindings();
+        pack();
+        setLocationRelativeTo(null);
+        setVisible(true);
+    }
 
-        addMouseListener(this);
-        addFocusListener(this);
-        addKeyListener(this);
-        setLocationRelativeTo(null); // centre on screen
+    private void initLayout() {
+        getContentPane().setLayout(new FlowLayout());
+        getContentPane().setBackground(Color.WHITE);
+        setUndecorated(true);
+        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
 
         JPanel panel = new JPanel();
         panel.setLayout(new GridBagLayout());
@@ -77,28 +79,30 @@ public class AboutDialog extends AppFrame implements 
FocusListener, KeyListener,
         panel.add(image, new GridBagConstraints());
 
         JLabel license = new JLabel();
-        final GridBagConstraints gridBagConstraints_1 = new 
GridBagConstraints();
-        gridBagConstraints_1.fill = GridBagConstraints.HORIZONTAL;
-        gridBagConstraints_1.anchor = GridBagConstraints.NORTHWEST;
-        gridBagConstraints_1.gridx = 0;
-        gridBagConstraints_1.gridy = 1;
-        gridBagConstraints_1.insets = new Insets(0, 12, 0, 0);
-        panel.add(license, gridBagConstraints_1);
+        GridBagConstraints gbc1 = new GridBagConstraints();
+        gbc1.fill = GridBagConstraints.HORIZONTAL;
+        gbc1.anchor = GridBagConstraints.NORTHWEST;
+        gbc1.gridx = 0;
+        gbc1.gridy = 1;
+        gbc1.insets = new Insets(0, 12, 0, 0);
+        panel.add(license, gbc1);
         license.setText("<html><font size='-1' 
face='Arial,Helvetica'>Available under the Apache license.</font></html>");
 
         JLabel info = new JLabel();
-        final GridBagConstraints gridBagConstraints_2 = new 
GridBagConstraints();
-        gridBagConstraints_2.fill = GridBagConstraints.HORIZONTAL;
-        gridBagConstraints_2.anchor = GridBagConstraints.NORTHWEST;
-        gridBagConstraints_2.gridx = 0;
-        gridBagConstraints_2.gridy = 2;
-        gridBagConstraints_2.insets = new Insets(6, 12, 12, 12);
-        panel.add(info, gridBagConstraints_2);
-        info.setText(getInfoString(application));
-
-        this.pack();
-        this.setLocationRelativeTo(null);
-        this.setVisible(true);
+        GridBagConstraints gbc2 = new GridBagConstraints();
+        gbc2.fill = GridBagConstraints.HORIZONTAL;
+        gbc2.anchor = GridBagConstraints.NORTHWEST;
+        gbc2.gridx = 0;
+        gbc2.gridy = 2;
+        gbc2.insets = new Insets(6, 12, 12, 12);
+        panel.add(info, gbc2);
+        info.setText(getInfoString(app()));
+    }
+
+    private void initBindings() {
+        addMouseListener(this);
+        addFocusListener(this);
+        addKeyListener(this);
     }
 
     private static String getInfoString(Application application) {

Reply via email to