Ticket #1968: pwa-centering-deni.patch

File pwa-centering-deni.patch, 23.4 KB (added by deni, 15 years ago)
  • TabularUnified modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/book/BaseBookDocView.java

    ### Eclipse Workspace Patch 1.0
    #P sophie
     
    99import org.sophie2.base.commons.gui.CustomScrollPane; 
    1010import org.sophie2.base.commons.util.ImageUtil; 
    1111import org.sophie2.base.commons.util.ImmImage; 
     12import org.sophie2.base.commons.util.position.ImmSize; 
    1213import org.sophie2.base.layout.model.DocView; 
    1314import org.sophie2.base.media.AudioChunk; 
    1415import org.sophie2.base.media.MediaComposite; 
     
    231232                                modelSwing.removeAll(); 
    232233 
    233234                                modelSwing.setLayout(new BorderLayout()); 
    234  
     235                                 
     236                                ImmSize scrollPaneSize = null;  
     237                                 
    235238                                if (bookView().get().getViewOptions().isShowViewControls()) { 
    236239                                        modelSwing.add(viewOptionsScrollPane().get().swingComponent(), BorderLayout.NORTH); 
    237240                                        modelSwing.add(workAreaPane().get(), BorderLayout.CENTER); 
     241                         
     242//                                      scrollPaneSize = new ImmSize(workAreaPane().get().getSize()); 
     243//                                      System.out.println(scrollPaneSize); 
     244                                        workArea().get().sceneVisual().get().scrollPane().set(workAreaPane().get());             
    238245                                } else { 
    239246                                        modelSwing.add(workArea().get().swingComponent().get()); 
    240247                                } 
    
          
  • TabularUnified modules/org.sophie2.base.layout/src/test/java/org/sophie2/base/layout/model/LayoutDemo.java

     
     1package org.sophie2.base.layout.model; 
     2 
     3import java.awt.BorderLayout; 
     4 
     5import javax.swing.JDesktopPane; 
     6import javax.swing.JFrame; 
     7import javax.swing.JInternalFrame; 
     8import javax.swing.JLayeredPane; 
     9 
     10/** 
     11 * Demo for demonstrating the usage of {@link CustomLayout}. 
     12 * @author tanya 
     13 */ 
     14public class LayoutDemo { 
     15 
     16        /** 
     17         * Constructor that creates {@link JFrame}, adds a {@link JDesktopPane} with 
     18         * {@link CustomLayout} and set different layers to be with different 
     19         * layouts. 
     20         */ 
     21        public LayoutDemo() { 
     22                 
     23                JFrame frame = new JFrame(); 
     24                frame.setSize(300, 300); 
     25                frame.setVisible(true); 
     26                 
     27                JDesktopPane pane = new JDesktopPane(); 
     28                 
     29                frame.setContentPane(pane); 
     30                pane.setLayout(new CustomLayout(new BorderLayout())); 
     31                 
     32                JInternalFrame frame1 = new JInternalFrame(); 
     33                frame1.setLocation(10, 10); 
     34                frame1.setSize(90, 90); 
     35                frame1.setVisible(true); 
     36                 
     37                pane.setLayer(frame1, JLayeredPane.DEFAULT_LAYER); 
     38                 
     39                pane.add(frame1, BorderLayout.CENTER); 
     40                 
     41                JInternalFrame frame2 = new JInternalFrame(); 
     42                frame2.setLocation(110, 110); 
     43                frame2.setSize(90, 90); 
     44                frame2.setVisible(true); 
     45                 
     46                pane.setLayer(frame2, JLayeredPane.PALETTE_LAYER); 
     47                 
     48                pane.add(frame2, CustomLayout.CUSTOM); 
     49        } 
     50         
     51        /** 
     52         * The main method. 
     53         * @param args 
     54         */ 
     55        public static void main(String args[]) { 
     56                new LayoutDemo(); 
     57        } 
     58} 
     59 
    
          
  • TabularUnified modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/app/AppMainWindow.java

     
    1414import org.sophie2.base.commons.util.position.ImmRect; 
    1515import org.sophie2.base.halos.HaloMenu; 
    1616import org.sophie2.base.layout.impl.DefaultMainWindow; 
     17import org.sophie2.base.layout.model.CustomLayout; 
    1718import org.sophie2.base.layout.model.DocView; 
    1819import org.sophie2.base.media.MediaComposite; 
    1920import org.sophie2.base.media.MediaUtil; 
     
    210211                                for (HaloMenu hm : haloMenus().get()) { 
    211212                                        if (hm.visible().get()) { 
    212213                                                for (JComponent c : hm.swingComponents().get()) { 
    213  
    214                                                         res.add(c, JLayeredPane.PALETTE_LAYER); 
     214                                                        res.setLayer(c, JLayeredPane.PALETTE_LAYER);  
     215                                                        res.add(c, CustomLayout.CUSTOM);  
    215216                                                } 
    216217                                        } 
    217218                                } 
    
          
  • TabularUnified modules/org.sophie2.base.scene/src/test/java/org/sophie2/base/scene/SceneDemo.java

     
    77import javax.swing.JComponent; 
    88import javax.swing.JFrame; 
    99import javax.swing.JPanel; 
     10import javax.swing.JScrollPane; 
    1011import javax.swing.JTextPane; 
    1112import javax.swing.SwingUtilities; 
    1213 
     
    469470                                        ImmRect.ZERO_RECT); 
    470471                } 
    471472 
    472                 public RwProp<ImmRect> minimalViewRect() {  
    473                         return getBean().makeValueProp("minimalViewRect", ImmRect.class, null);  
     473                public RwProp<JScrollPane> scrollPane() { 
     474                        return getBean().makeValueProp("scrollPane", JScrollPane.class, null); 
    474475                }  
    475  
    476                 public RwProp<ImmRect> actualViewRectCache() {  
    477                         return getBean().makeValueProp("actualViewRectCache", ImmRect.class, null);  
    478                 }  
    479476        } 
    480477 
    481478        /** 
    
          
  • TabularUnified modules/org.sophie2.base.scene/src/main/java/org/sophie2/base/scene/interfaces/Scene.java

     
    11package org.sophie2.base.scene.interfaces; 
    22 
    33import org.sophie2.base.commons.util.ImmColor; 
     4import org.sophie2.base.commons.util.position.ImmRect; 
    45import org.sophie2.base.scene.helpers.SceneHelper; 
    56import org.sophie2.core.prolib.impl.BaseProObject; 
    67import org.sophie2.core.prolib.interfaces.Prop; 
     
    8182                return getBean().makeValueProp("mouseOverElement", SceneElement.class, 
    8283                                null); 
    8384        } 
     85         
     86        /**  
     87         * The rectangle over which the actual view rectangle will be centered.  
     88         *   
     89         * @return The property  
     90         */  
     91        public abstract RwProp<ImmRect> centeringRect(); 
    8492} 
     93 No newline at end of file 
    
          
  • TabularUnified modules/org.sophie2.base.scene/src/main/java/org/sophie2/base/scene/impl/BaseScene.java

     
    11package org.sophie2.base.scene.impl; 
    22 
    33import org.sophie2.base.commons.util.ImmColor; 
     4import org.sophie2.base.commons.util.position.ImmRect; 
    45import org.sophie2.base.scene.interfaces.Scene; 
    56import org.sophie2.base.scene.interfaces.SceneElement; 
    67import org.sophie2.core.prolib.impl.ResourceProperty; 
     
    6566                //Do nothing             
    6667        } 
    6768 
     69        @Override 
     70        public RwProp<ImmRect> centeringRect() { 
     71                return getBean().makeValueProp("centeringRect", ImmRect.class, ImmRect.ZERO_RECT); 
     72        } 
     73 
    6874} 
    
          
  • TabularUnified modules/org.sophie2.main.scene.simple/src/main/java/org/sophie2/main/scene/simple/SimpleSceneVisual.java

     
    77import javax.swing.JPanel; 
    88 
    99import org.sophie2.base.commons.util.position.ImmRect; 
     10import org.sophie2.base.commons.util.position.ImmSize; 
    1011import org.sophie2.base.scene.BaseSceneVisual; 
    1112import org.sophie2.base.scene.SceneVisual; 
    1213import org.sophie2.base.scene.helpers.SceneHelper; 
     
    5152                        SophieLog.trace("paintComponent: bounds=" + getBounds()); 
    5253                        SophieLog.trace("paintComponent: swing=" + toString()); 
    5354                        SophieLog.trace("paintComponent: parent=" + getParent()); 
     55                         
     56                        Graphics2D g2d = (Graphics2D) graphics.create(); 
     57                 
     58                        if (scrollPane().get() != null) { 
     59                                viewportSize().set(new ImmSize(scrollPane().get().getSize())); 
     60                        } 
    5461 
    55                         Graphics2D g2d = (Graphics2D) graphics.create(); 
    5662                        ImmRect visRect = actualViewRect().get(); 
    5763 
    5864                        SceneHelper.paint(g2d, visRect, scene().get()); 
    
          
  • TabularUnified modules/org.sophie2.base.scene/src/main/java/org/sophie2/base/scene/BaseSceneVisual.java

     
    44import java.util.List; 
    55 
    66import javax.swing.JComponent; 
     7import javax.swing.JScrollPane; 
    78 
    89import org.sophie2.base.commons.util.OSUtil; 
    910import org.sophie2.base.commons.util.position.ImmRect; 
     11import org.sophie2.base.commons.util.position.ImmSize; 
     12import org.sophie2.base.commons.util.position.Position; 
    1013import org.sophie2.base.dnd.SophieDragDropHandler; 
    1114import org.sophie2.base.scene.helpers.ElementHelper; 
    1215import org.sophie2.base.scene.helpers.SceneHelper; 
     
    7881                return getBean().makeValueProp("wantedViewRect", ImmRect.class, null); 
    7982        } 
    8083 
    81         public RwProp<ImmRect> minimalViewRect() {  
    82                 return getBean().makeValueProp("minimalViewRect", ImmRect.class, null);  
    83         }  
    84  
    85         public RwProp<ImmRect> actualViewRectCache() {  
    86                 return getBean().makeValueProp("actualViewRectCache", ImmRect.class, null);  
    87         }  
    88  
    8984        @Own 
    9085        public RwProp<Scene> scene() { 
    9186                return getBean().makeValueProp("scene", Scene.class); 
     
    9691                        @Override 
    9792                        protected JComponent create() { 
    9893                                JComponent res = createSwingComponent(); 
     94                                 
     95                                // (deni) might be necessary to  
     96                                // res.setLayout(null);  
     97                                 
    9998                                SwingEventAdapter.registerComponent(res, 
    10099                                                BaseSceneVisual.this, null, res); 
    101100 
     
    111110                        } 
    112111 
    113112                        @Override 
    114                         protected void setup(JComponent res) { 
     113                        protected void setup(JComponent res) {                           
    115114                                Dimension size = actualViewRect().get().getSize().toDimension(); 
    116115                                res.setSize(size); 
    117116                                res.setPreferredSize(size); 
     
    123122                        @Setup 
    124123                        protected void setupTooltip(JComponent res) { 
    125124                                Scene scene = scene().get(); 
    126                                 if ( scene != null) { 
     125                                if (scene != null) { 
    127126                                        SceneElement overElement = scene.mouseOverElement().get(); 
    128127                                        if (overElement != null) { 
    129128                                                res.setToolTipText(overElement.tooltip().get()); 
     
    163162         */ 
    164163        protected static final ImmRect DEFAULT_VIEW_RECT = 
    165164                new ImmRect(0, 0, 256, 256); 
     165         
     166         
    166167 
    167168        public Prop<ImmRect> actualViewRect() { 
    168169                class actualViewRect extends AutoProperty<ImmRect> { 
     
    182183                                                        bound.getY() - DEFAULT_PADDING_T,  
    183184                                                        bound.getWidth() + DEFAULT_PADDING_R + DEFAULT_PADDING_L,  
    184185                                                        bound.getHeight() + DEFAULT_PADDING_B + DEFAULT_PADDING_T); 
     186                                         
     187                                        ImmRect centeringRect = scene().get().centeringRect().get();  
     188                                         
     189                                        if (!centeringRect.equals(ImmRect.ZERO_RECT)) {  
     190                                                ImmRect toUnite = new ImmRect(Position.CENTER, centeringRect.getPoint(Position.CENTER), 
     191                                                                viewportSize().get());  
     192                                                res = res.union(toUnite);  
     193                                        } else {  
     194                                                ImmRect toUnite = new ImmRect(res.getLocation(), viewportSize().get());  
     195                                                res = res.union(toUnite);  
     196                                        } 
     197                                         
    185198                                } else { 
    186199                                        // can not determine... 
    187                                         // just make something... 
     200                                        // just do something... 
    188201                                        res = DEFAULT_VIEW_RECT; 
    189202                                } 
    190  
    191                                 // Center the actualRect on the minimalViewRect  
    192                                 // wantedViewRect is set by halo mouse tracking to limit the rect,   
    193                                 // so do nothing if wantedViewRect is not null  
    194                                 if (wantedViewRect().get() == null) {  
    195                                         ImmRect myMinimalViewRect = minimalViewRect().get();  
    196                                         if (myMinimalViewRect != null) {  
    197                                                 float xOffset = 
    198                                                         Math.max((myMinimalViewRect.getWidth() - res.getWidth()) / 2, 0);  
    199                                                 float yOffset = 
    200                                                         Math.max((myMinimalViewRect.getHeight() - res.getHeight()) / 2, 0);  
    201                                                 res = new ImmRect(res.getX() - xOffset,  
    202                                                                 res.getY() - yOffset,  
    203                                                                 Math.max(res.getWidth(), myMinimalViewRect.getWidth()),  
    204                                                                 Math.max(res.getHeight(), myMinimalViewRect.getHeight()));  
    205                                         }  
    206  
    207                                         if (!res.equals(actualViewRectCache().get())) {  
    208                                                 actualViewRectCache().set(res);  
    209                                         }  
     203                                 
     204                                if (scrollPane().get() != null) { 
     205                                        // if there will be some scrollbars,  
     206                                        // remove their width/height from the actualViewRect 
     207                                         
     208                                        int hScrollHeight = scrollPane().get().getHorizontalScrollBar().getHeight(); 
     209                                        int vScrollWidth = scrollPane().get().getVerticalScrollBar().getWidth(); 
     210                                         
     211                                        float width = res.getWidth(); 
     212                                        float height = res.getHeight();                                  
     213                                 
     214                                        if (height > viewportSize().get().getHeight() 
     215                                                        && width <= viewportSize().get().getWidth()) {  
     216                                                width -= hScrollHeight; 
     217                                        } 
     218                                         
     219                                        if (width > viewportSize().get().getWidth() 
     220                                                        && height <= viewportSize().get().getHeight()) { 
     221                                                height -= vScrollWidth; 
     222                                        } 
     223                                         
     224                                        res = new ImmRect(res.getLocation(), new ImmSize(width, height)); 
    210225                                } 
    211  
     226                                 
    212227                                assert res != null; 
    213228                                return res; 
    214229                        } 
     
    229244        protected boolean computeVisible() { 
    230245                return true; 
    231246        } 
     247         
     248        public RwProp<JScrollPane> scrollPane() { 
     249                return getBean().makeValueProp("scrollPane", JScrollPane.class, null); 
     250        } 
     251         
     252        /**  
     253         * The size of the component where the scene is painted. This is the size which will be used for centering into it.  
     254         *   
     255         * @return The property.  
     256         */  
     257        public RwProp<ImmSize> viewportSize() {  
     258                return getBean().makeValueProp("viewportSize", ImmSize.class, ImmSize.ZERO);  
     259        } 
    232260} 
    
          
  • TabularUnified modules/org.sophie2.base.layout/src/main/java/org/sophie2/base/layout/model/CustomLayout.java

     
     1package org.sophie2.base.layout.model; 
     2 
     3import java.awt.BorderLayout; 
     4import java.awt.Component; 
     5import java.awt.Container; 
     6import java.awt.Dimension; 
     7import java.awt.LayoutManager2; 
     8import java.io.Serializable; 
     9 
     10import javax.swing.JDesktopPane; 
     11import javax.swing.JLayeredPane; 
     12 
     13/** 
     14 * LayoutManager that supports adding of components with different layouts - null 
     15 * and some specific layout. An object is created with a specific 
     16 * {@link LayoutManager2}. When different components are added, they can be with 
     17 * constraint - CustomLayout.CUSTOM. This means that for laying out of these 
     18 * components will be used null layout. For all other components added, it will 
     19 * be used the given layout manager. This layout manager can be used for example 
     20 * for {@link JDesktopPane}. For example, components at 
     21 * {@link JLayeredPane#DEFAULT_LAYER} can be with {@link BorderLayout} and the 
     22 * components at {@link JLayeredPane#PALETTE_LAYER} to be with null layout. 
     23 *  
     24 * @author tanya 
     25 */ 
     26public class CustomLayout implements LayoutManager2, Serializable { 
     27 
     28        /** 
     29         * Used for serialization. 
     30         */ 
     31        private static final long serialVersionUID = 810513263396699528L; 
     32 
     33        private LayoutManager2 layoutManager; 
     34         
     35        /** 
     36         * The constraint for the objects which we want to be with null layout. 
     37         */ 
     38        public static final String CUSTOM   = "Custom"; 
     39         
     40        /** 
     41         * Constructs an object with another layout manager. The components added 
     42         * will be with null layout or will be added according 
     43         *  
     44         * @param manager 
     45         *            The manager which will be responsible for how the components 
     46         *            will be added and how will be laid out. 
     47         */ 
     48        public CustomLayout(LayoutManager2 manager) { 
     49                this.layoutManager = manager; 
     50        } 
     51         
     52        public void addLayoutComponent(Component comp, Object constraints) { 
     53                if (constraints != CUSTOM && this.layoutManager != null) { 
     54                        this.layoutManager.addLayoutComponent(comp, constraints); 
     55                } 
     56        } 
     57 
     58        public float getLayoutAlignmentX(Container target) { 
     59                if (this.layoutManager != null) { 
     60                        return this.layoutManager.getLayoutAlignmentX(target); 
     61                } 
     62 
     63                return 0f; 
     64        } 
     65 
     66        public float getLayoutAlignmentY(Container target) { 
     67                if (this.layoutManager != null) { 
     68                        return this.layoutManager.getLayoutAlignmentY(target); 
     69                } 
     70                 
     71                return 0f; 
     72        } 
     73 
     74        public void invalidateLayout(Container target) { 
     75                if (this.layoutManager != null) { 
     76                        this.layoutManager.invalidateLayout(target); 
     77                } 
     78        } 
     79 
     80        public Dimension maximumLayoutSize(Container target) { 
     81                if (this.layoutManager != null) { 
     82                        return this.layoutManager.maximumLayoutSize(target); 
     83                } 
     84                 
     85                return null; 
     86        } 
     87 
     88        public void addLayoutComponent(String name, Component comp) { 
     89                if (this.layoutManager != null) { 
     90                        this.layoutManager.addLayoutComponent(name, comp); 
     91                } 
     92        } 
     93 
     94        public void layoutContainer(Container parent) { 
     95                if (this.layoutManager != null) { 
     96                        this.layoutManager.layoutContainer(parent); 
     97                } 
     98        } 
     99 
     100        public Dimension minimumLayoutSize(Container parent) { 
     101                if (this.layoutManager != null) { 
     102                        return this.layoutManager.minimumLayoutSize(parent); 
     103                } 
     104                 
     105                return null; 
     106        } 
     107 
     108        public Dimension preferredLayoutSize(Container parent) { 
     109                if (this.layoutManager != null) { 
     110                        return this.layoutManager.preferredLayoutSize(parent); 
     111                } 
     112                 
     113                return null; 
     114        } 
     115 
     116        public void removeLayoutComponent(Component comp) { 
     117                if (this.layoutManager != null) { 
     118                        this.layoutManager.removeLayoutComponent(comp); 
     119                } 
     120        } 
     121} 
     122 No newline at end of file 
    
          
  • TabularUnified modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/page/PageWorkArea.java

     
    11package org.sophie2.main.app.commons.page; 
    22 
     3import java.awt.BorderLayout; 
    34import java.util.ArrayList; 
    45import java.util.List; 
    56 
     
    1011import org.sophie2.base.commons.util.ImmColor; 
    1112import org.sophie2.base.commons.util.position.ImmArea; 
    1213import org.sophie2.base.commons.util.position.ImmMatrix; 
     14import org.sophie2.base.commons.util.position.ImmPoint; 
    1315import org.sophie2.base.commons.util.position.ImmRect; 
     16import org.sophie2.base.commons.util.position.ImmSize; 
     17import org.sophie2.base.layout.model.CustomLayout; 
    1418import org.sophie2.base.model.book.PageH; 
    1519import org.sophie2.base.scene.SceneVisual; 
    1620import org.sophie2.base.scene.effects.ColorEffect; 
     
    189193                                        protected void setupScene() { 
    190194                                                rootElement().set(rootSceneElement().get()); 
    191195                                                topEventSource().set(PageWorkArea.this); 
     196                                                 
     197                                                // TODO: maybe should check whether it is the desktop book 
     198//                                              AppMainWindow mainWindow = AppViewUtil.findMainWindow(PageWorkArea.this); 
     199//                                              DocView desktopDocument = mainWindow.desktopDocument().get() 
     200//                                              bookView().get().parent().get() 
     201//                                              ((BaseBookDocView)mainWindow.desktopDocument().get()).bookView() 
     202//                                              boolean isDesktopBook = !(bookView().get());   
     203//                                              if (!isDesktopBook) { 
     204                                                // TODO: move in a separate setup 
     205                                                 
     206                                                ImmPoint pageLocation = ImmPoint.ZERO;  
     207                                                float zoom = bookView().get().getViewOptions().getZoom();  
     208                                                ImmSize pageSize = bookView().get().model().get().getPageSize();  
     209                                                pageSize = new ImmSize(pageSize.getWidth() * zoom, pageSize.getHeight() * zoom);  
     210                                                ImmRect centeringRect = new ImmRect(pageLocation, pageSize);  
     211 
     212                                                centeringRect().set(centeringRect);  
     213//                                              }  
    192214                                        } 
    193215                                }; 
    194216                        } 
     
    238260 
    239261                        @Override 
    240262                        protected void setup(JDesktopPane res) { 
     263                                 
     264                                res.setLayout(new CustomLayout(new BorderLayout()));  
    241265                         
    242266                                JComponent sceneComp = sceneVisual().get().swingComponent().get(); 
    243267 
     
    245269                                SophieLog.debug("PageWorkArea.layeredPage: sceneComp:" + sceneComp); 
    246270 
    247271                                res.removeAll(); 
    248                                 res.add(sceneComp, JLayeredPane.DEFAULT_LAYER); 
     272                                res.setLayer(sceneComp, JLayeredPane.DEFAULT_LAYER);  
     273                                                 
     274                                res.add(sceneComp, BorderLayout.CENTER); 
    249275 
    250276                                res.revalidate(); 
    251277                                res.repaint(); 
    252278                        } 
    253279 
    254                         // TODO (r4) reimplement the page-work-area centering 
    255280                        @SuppressWarnings("unused") 
    256281                        @Setup 
    257282                        protected void setupActualSize(JLayeredPane res) { 
    
          
  • TabularUnified modules/org.sophie2.base.scene/src/main/java/org/sophie2/base/scene/SceneVisual.java

     
    11package org.sophie2.base.scene; 
    22 
    33import javax.swing.JComponent; 
     4import javax.swing.JScrollPane; 
    45 
    56import org.sophie2.base.commons.util.position.ImmRect; 
    67import org.sophie2.base.scene.interfaces.Scene; 
     
    3334         */ 
    3435        RwProp<ImmRect> wantedViewRect(); 
    3536 
    36         /**  
    37          * The smallest rectangle this scene should have.  
    38          *   
    39          * Use this to tell the scene it should be larger than its components, for example,  
    40          * to fill out a window.  
    41          *   
    42          * @return property  
    43          */  
    44         RwProp<ImmRect> minimalViewRect();  
    45  
    46         /**  
    47          * Last known value of the actual view rect, so PageWorkArea can listen for changes  
    48          *   
    49          * Only set this value when it has actually changed  
    50          *   
    51          * @return property  
    52          */  
    53         RwProp<ImmRect> actualViewRectCache();  
    5437        /** 
    5538         * The swing component displaying the scene. 
    5639         *  
     
    7356         * @return property 
    7457         */ 
    7558        Prop<ImmRect> actualViewRect(); 
     59         
     60        /**  
     61         * The size of the component where the scene is painted. This is the size which will be used for centering into it.  
     62         *   
     63         * @return property.  
     64         */  
     65        RwProp<JScrollPane> scrollPane(); 
    7666} 
    
          
  • TabularUnified modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/app/DocumentsLogic.java

     
    77import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    88import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    99import org.sophie2.base.skins.Message; 
    10 import org.sophie2.core.logging.SophieLog; 
    1110import org.sophie2.core.modularity.SortKey; 
    1211import org.sophie2.core.mvc.EventFilterBuilder; 
    1312import org.sophie2.core.mvc.EventParams; 
     
    158157                        return true; 
    159158                } 
    160159                 
    161         }, 
    162  
    163          
    164         /** 
    165          * Handles resizing of the window by the user. Should center the page in the 
    166          * window. 
    167          */ 
    168         @SortKey("fff-document-resize") 
    169         ON_RESIZE { 
    170  
    171                 public void defineFilter(EventFilterBuilder filter) { 
    172                         filter.setEventId(DefaultDocView.EventIds.RESIZE); 
    173                         filter.setSourceClass(DefaultDocView.class); 
    174                 } 
    175  
    176                 public boolean handle(EventR3 event) { 
    177                         // FIXME (R4) Reimplement page centering. This might need to go down to the layout. 
    178                         SophieLog.warn("(R4) Reimplement page centering!"); 
    179                         return false; 
    180                 } 
    181  
    182160        }; 
    183161         
    184162        /**