Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe

Commits:

2 changed files:

Changes:

  • client/src/main/java/fr/ird/observe/client/ui/ObserveMainUIInitializer.java
    ... ... @@ -27,6 +27,7 @@ import fr.ird.observe.client.configuration.ClientConfig;
    27 27
     import fr.ird.observe.client.db.ClientDataContext;
    
    28 28
     import fr.ird.observe.client.db.ObserveSwingDataSource;
    
    29 29
     import fr.ird.observe.client.ui.actions.UIActionSupport;
    
    30
    +import fr.ird.observe.client.ui.actions.main.global.ChangeFocusGlobalUIAction;
    
    30 31
     import fr.ird.observe.client.ui.content.ContentUI;
    
    31 32
     import fr.ird.observe.client.ui.content.ContentUIManager;
    
    32 33
     import fr.ird.observe.client.ui.content.ObserveActionMap;
    
    ... ... @@ -441,36 +442,12 @@ public class ObserveMainUIInitializer {
    441 442
             init(ui.getNavigationUI().getTree());
    
    442 443
     
    
    443 444
             ui.getNavigationView().setRightDecoration(ui.getNavigationUI().getToolbar());
    
    444
    -//        ui.getNavigationView().addComponentListener(new ComponentAdapter() {
    
    445
    -//
    
    446
    -//            @Override
    
    447
    -//            public void componentResized(ComponentEvent e) {
    
    448
    -//
    
    449
    -//                JComponent source = (JComponent) e.getSource();
    
    450
    -//
    
    451
    -//                NavigationTreeHeader actions = ui.getNavigationUI();
    
    452
    -//
    
    453
    -//                Dimension preferredLayoutSize = actions.getLayout().preferredLayoutSize(actions);
    
    454
    -//
    
    455
    -//                Dimension showLonglineSize = actions.getShowLongline().getSize();
    
    456
    -//                Dimension showSeineSize = actions.getShowSeine().getSize();
    
    457
    -//                Dimension showReferential = actions.getShowReferential().getSize();
    
    458
    -//                Dimension showEmpty = actions.getShowEmptyProgram().getSize();
    
    459
    -//                int minWidth = 18 + (int) Math.max(showLonglineSize.getWidth() + showSeineSize.getWidth(), showReferential.getWidth() + showEmpty.getWidth());
    
    460
    -//                source.setMinimumSize(new Dimension(minWidth, (int) source.getSize().getHeight()));
    
    461
    -//                log.debug("Header resized to minumun: " + source.getMinimumSize());
    
    462
    -//
    
    463
    -//                int maxWidth = ui.getNavigationView().getWidth() - 10;
    
    464
    -//
    
    465
    -//                int currentWidth = (int) preferredLayoutSize.getWidth();
    
    466
    -//                int height = 32;
    
    467
    -//                if (currentWidth > maxWidth) {
    
    468
    -//                    height += 32;
    
    469
    -//                }
    
    470
    -//                actions.setPreferredSize(new Dimension(maxWidth, height));
    
    471
    -//
    
    472
    -//            }
    
    473
    -//        });
    
    445
    +        ChangeFocusGlobalUIAction action = (ChangeFocusGlobalUIAction) Objects.requireNonNull(actionMap.get(ChangeFocusGlobalUIAction.ACTION_NAME));
    
    446
    +
    
    447
    +        // register this action since there is no editor on which attach this action
    
    448
    +        ui.getRootPane().getActionMap().put(ChangeFocusGlobalUIAction.ACTION_NAME, action);
    
    449
    +        ui.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(action.getAcceleratorKey(), ChangeFocusGlobalUIAction.ACTION_NAME);
    
    450
    +
    
    474 451
         }
    
    475 452
     
    
    476 453
         protected void init(ObserveActionMap actionMap, AbstractButton editor) {
    

  • client/src/main/java/fr/ird/observe/client/ui/util/ObserveBlockingLayerUI.java
    ... ... @@ -22,25 +22,12 @@ package fr.ird.observe.client.ui.util;
    22 22
      * #L%
    
    23 23
      */
    
    24 24
     
    
    25
    -import com.google.common.collect.ImmutableSet;
    
    26
    -import fr.ird.observe.client.ObserveSwingApplicationContext;
    
    27
    -import fr.ird.observe.client.ui.actions.UIActionSupport;
    
    28
    -import java.awt.event.ActionEvent;
    
    29
    -import java.awt.event.KeyEvent;
    
    30
    -import java.awt.event.MouseEvent;
    
    31
    -import java.awt.event.MouseWheelEvent;
    
    32
    -import java.util.Set;
    
    33
    -import javax.swing.Action;
    
    34
    -import javax.swing.ActionMap;
    
    35
    -import javax.swing.InputMap;
    
    36
    -import javax.swing.JComponent;
    
    37
    -import javax.swing.KeyStroke;
    
    38
    -import javax.swing.SwingUtilities;
    
    39
    -import org.apache.commons.logging.Log;
    
    40
    -import org.apache.commons.logging.LogFactory;
    
    41 25
     import org.jdesktop.jxlayer.JXLayer;
    
    42 26
     import org.nuiton.jaxx.runtime.swing.BlockingLayerUI;
    
    43 27
     
    
    28
    +import javax.swing.JComponent;
    
    29
    +import java.awt.event.MouseWheelEvent;
    
    30
    +
    
    44 31
     /**
    
    45 32
      * Created on 09/11/16.
    
    46 33
      *