Ticket #2494: videoPerformance_first.patch

File videoPerformance_first.patch, 28.3 KB (added by boyanl, 15 years ago)
  • modules/org.sophie2.main.app.layout/src/main/java/org/sophie2/main/app/layout/left/pages/PageStructurePalette.java

    ### Eclipse Workspace Patch 1.0
    #P sophie
     
    1010import org.sophie2.base.commons.util.ImmList; 
    1111import org.sophie2.base.commons.util.position.ImmPoint; 
    1212import org.sophie2.base.commons.util.position.ImmSize; 
    13 import org.sophie2.base.commons.util.position.Position; 
    1413import org.sophie2.base.dnd.SophieDragDropHandler; 
    1514import org.sophie2.base.layout.model.TreePalette; 
    1615import org.sophie2.base.layout.model.TreePaletteItem; 
    1716import org.sophie2.base.model.book.ElementH; 
    18 import org.sophie2.base.model.book.frame.BoundMode; 
    1917import org.sophie2.base.model.book.interfaces.ResizableElement; 
    2018import org.sophie2.base.model.book.links.Link; 
    2119import org.sophie2.base.model.book.links.LinkRule; 
     
    255253                        } 
    256254 
    257255                        if (type().get() == ItemType.DETAILS_LOCATION) { 
    258                                 ImmPoint pos = model.getLocation(BoundMode.CONTENT, 
    259                                                 Position.TOP_LEFT, element().get().getTime()); 
     256                                ImmPoint pos = element().get().contentLocation().get(); 
    260257 
    261258                                return "Frame Location : " + "( " + pos.getX() +  
    262259                                ", " + pos.getY() + " )"; 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/frame/rotate/FrameRotateHaloMenu.java

     
    4141                                if (!computeVisible()) { 
    4242                                        return ImmPoint.ZERO; 
    4343                                } 
     44                                ImmPoint frameLocation = frameView.contentLocation().get();  
     45                                 
    4446                                FrameH frame = frameView.model().get();  
    45                                 ImmPoint frameLocation = frame.getLocation(BoundMode.CONTENT, Position.TOP_LEFT,  
    46                                                 frameView.getTime());  
    47                                 ImmPoint locInParent = frame.getLocation(BoundMode.MARGIN, Position.BOTTOM_RIGHT, 
    48                                                 frameView.getTime()); 
     47                                ImmPoint locInParent = frame.getLocation(frameView.contentLocation().get(), 
     48                                                BoundMode.MARGIN, Position.BOTTOM_RIGHT); 
    4949                                ImmPoint locInFrame =  
    5050                                        locInParent.translate(-frameLocation.getX(), -frameLocation.getY()); 
    5151                                return locInFrame; 
  • modules/org.sophie2.base.model.book/src/main/java/org/sophie2/base/model/book/ElementH.java

     
    55 
    66import org.sophie2.base.commons.structures.ImmTreeList; 
    77import org.sophie2.base.commons.util.ImmList; 
    8 import org.sophie2.base.commons.util.position.ImmArea; 
    98import org.sophie2.base.commons.util.position.ImmInsets; 
    10 import org.sophie2.base.commons.util.position.ImmMatrix; 
    119import org.sophie2.base.commons.util.position.ImmPoint; 
    1210import org.sophie2.base.commons.util.position.ImmRect; 
    13 import org.sophie2.base.commons.util.position.ImmSize; 
    1411import org.sophie2.base.commons.util.position.Position; 
    1512import org.sophie2.base.media.TimePos; 
    1613import org.sophie2.base.model.book.actions.RemoveSubElementAction; 
    1714import org.sophie2.base.model.book.frame.BoundMode; 
    1815import org.sophie2.base.model.book.frame.FrameR4; 
    19 import org.sophie2.base.model.book.frame.WrappingModes; 
    2016import org.sophie2.base.model.book.interfaces.CompositeElement; 
    2117import org.sophie2.base.model.book.interfaces.MemberElement; 
    2218import org.sophie2.base.model.book.interfaces.StyledElement; 
     
    6864        public static final int Y_OFFSET = 50; 
    6965 
    7066        /** 
    71          * Calculates the bound area of this element in the selected 
    72          * {@link BoundMode} for the selected {@link TimePos}. For a simple element, 
    73          * like {@link FrameR4}, will return the area of the element itself. For a 
    74          * composite element, returns the union of all the sub-elements, considering 
    75          * rotation angles. 
    76          *  
    77          * @param boundMode 
    78          *          The mode for calculating the area. 
    79          * @param elementTime 
    80          *          The current moment for which to calculate the area. Needed, 
    81          *          since the location is time-dependent. 
    82          * @param wrapMode  
    83          *            Whether or not the area is important. Used for calculating the  
    84          *            area for the different wrapping modes of frames. When the text should  
    85          *            not go around the frame, the area of the frame is not  
    86          *            important.When wrapMode is <b>false</b>, it will be checked  
    87          *            whether or not the wrap mode of the frame is  
    88          *            {@link WrappingModes#NO_WRAP}, and if so, the area will be  
    89          *            empty. The default value is <b>true</b>. 
    90          * @return  
    91          *                      The calculated {@link ImmArea}. 
    92          */ 
    93         public ImmArea getBoundArea(BoundMode boundMode, 
    94                         TimePos elementTime, Boolean wrapMode) { 
    95  
    96                 if (!elementTime.isOn()) { 
    97                         return ImmArea.EMPTY; 
    98                 } 
    99  
    100                 ImmPoint contentLocation = getLocation(BoundMode.CONTENT, 
    101                                 Position.TOP_LEFT, elementTime); 
    102  
    103                 if (ElementUtils.isContainer(this)) { 
    104                         ImmArea area = ImmArea.EMPTY; 
    105                         for (ElementH element : getChildElements(elementTime)) { 
    106  
    107                                 // TODO (r4) consider relative locations.. --kyli 
    108                                 area = area.union(element.getBoundArea(boundMode, getSubTime(  
    109                                                 getChildRef(element), elementTime), wrapMode)); 
    110                         } 
    111                         return area.transform(ImmMatrix.IDENTITY.rotate(getRotationAngle(), 
    112                                         contentLocation.getX(), contentLocation.getY())); 
    113                 } 
    114  
    115                 ImmPoint position = getLocation(boundMode, Position.TOP_LEFT, 
    116                                 elementTime); 
    117                 ImmSize size = boundMode.getSize(getWrapSize(), getPaddingInsets(), 
    118                                 getStyleHelper().getBorderInsets(), getMarginInsets()); 
    119                 ImmArea res = new ImmArea(new ImmRect(position, size)).transform( 
    120                                 ImmMatrix.IDENTITY.rotate(getRotationAngle(), 
    121                                                 contentLocation.getX(), contentLocation.getY())); 
    122                 return res; 
    123         } 
    124  
    125         /** 
    12667         * Retrieves the currently active children of this element. This means that 
    12768         * they should have {@link ActivationChannel}s with appropriate values. 
    12869         * Useful for views. 
     
    304245        } 
    305246 
    306247        /** 
     248         * Gets the location of a specific frame position, given a content location and a mode. 
     249         * Used for optimization since it re-uses the calculated content location which is 
     250         * time-dependent. 
     251         * (The content location is the location of the point TOP_LEFT in bound mode CONTENT in a specified time)   
     252         *  
     253         * @param contentLocation 
     254         *                        - The provided content location for the element. 
     255         * @param mode 
     256         *            - {@link BoundMode} in which the point will be calculated 
     257         * @param pos 
     258         *            - {@link Position} of the point in the rectangle 
     259         * @return The location of the interesting point (pos) of the mode`s 
     260         *         rectangle. 
     261         */ 
     262        public ImmPoint getLocation(ImmPoint contentLocation, BoundMode mode, 
     263                        Position pos) { 
     264                ImmRect bounds = new ImmRect(contentLocation, getWrapSize()); 
     265 
     266                ImmPoint point = pos.getPoint(mode.getRect( 
     267                                bounds, getPaddingInsets(), 
     268                                getStyleHelper().getBorderInsets(), getMarginInsets())); 
     269                return point; 
     270        } 
     271 
     272        /** 
    307273         * Gets the location of a specific frame position in specific mode. 
    308274         *  
    309275         * @param mode 
     
    320286                LocationChannel channel = get(MemberElement.KEY_LOCATION); 
    321287                ImmPoint contentLocation = channel.getValue(localTime); 
    322288 
    323                 ImmRect bounds = new ImmRect(contentLocation, getWrapSize()); 
    324  
    325                 ImmPoint point = pos.getPoint(mode.getRect(bounds, getPaddingInsets(), 
    326                                 getStyleHelper().getBorderInsets(), getMarginInsets())); 
    327                 return point; 
     289                return getLocation(contentLocation, mode, pos); 
    328290        } 
    329291 
    330292        /** 
  • modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/element/ElementView.java

     
    1010import org.sophie2.base.commons.util.ImmList; 
    1111import org.sophie2.base.commons.util.NaiveImmList; 
    1212import org.sophie2.base.commons.util.position.ImmArea; 
     13import org.sophie2.base.commons.util.position.ImmMatrix; 
     14import org.sophie2.base.commons.util.position.ImmPoint; 
     15import org.sophie2.base.commons.util.position.ImmRect; 
     16import org.sophie2.base.commons.util.position.ImmSize; 
     17import org.sophie2.base.commons.util.position.Position; 
    1318import org.sophie2.base.media.AudioChunk; 
    1419import org.sophie2.base.media.MediaComposite; 
    1520import org.sophie2.base.media.TimePos; 
    1621import org.sophie2.base.model.book.ElementH; 
     22import org.sophie2.base.model.book.ElementH.ElementUtils; 
     23import org.sophie2.base.model.book.frame.BoundMode; 
     24import org.sophie2.base.model.book.frame.FrameR4; 
     25import org.sophie2.base.model.book.frame.WrappingModes; 
    1726import org.sophie2.base.model.book.interfaces.CompositeElement; 
     27import org.sophie2.base.model.book.interfaces.MemberElement; 
    1828import org.sophie2.base.model.book.links.Link; 
    1929import org.sophie2.base.model.book.links.LinkTrigger; 
    2030import org.sophie2.base.model.book.resource.r4.ElementR4; 
    2131import org.sophie2.base.model.book.timelines.ActivationChannel; 
     32import org.sophie2.base.model.book.timelines.LocationChannel; 
    2233import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    2334import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    2435import org.sophie2.base.model.resources.r4.model.ResourceModel; 
     
    123134                        @Override 
    124135                        protected SceneElement compute() { 
    125136                                SceneElement res = new DefaultCompositeSceneElement() { 
    126                                         @SuppressWarnings("synthetic-access") 
    127137                                        @Override 
    128138                                        protected void setupElements() { 
    129139                                                List<SceneElement> subs = subElements().get(); 
     
    352362        public BaseBookView getBookView() { 
    353363                return findParentElement(BaseBookView.class); 
    354364        } 
     365         
     366        /** 
     367         * Prop used to reduce the time dependency. Used only for optimization purposes. 
     368         *  
     369         * @return 
     370         *                      The location for the current moment in time. 
     371         */ 
     372        public Prop<ImmPoint> contentLocation() { 
     373                class contentLocation extends AutoProperty<ImmPoint> { 
    355374 
     375                        @Override 
     376                        protected ImmPoint compute() { 
     377                                return  model().get().getLocation(BoundMode.CONTENT,  
     378                                                Position.TOP_LEFT, getTime()); 
     379                        } 
     380                } 
     381                return getBean().makeProp(contentLocation.class); 
     382        } 
     383         
    356384        /** 
     385         * Prop used to reduce the time dependency. Used only for optimization purposes. 
     386         *  
     387         * @return 
     388         *                      The location for the margins area in this time. 
     389         */ 
     390        public Prop<ImmPoint> marginLocation() { 
     391                class marginLocation extends AutoProperty<ImmPoint> { 
     392 
     393                        @Override 
     394                        protected ImmPoint compute() { 
     395                                return  model().get().getLocation(contentLocation().get(), BoundMode.MARGIN, 
     396                                                Position.TOP_LEFT); 
     397                        } 
     398                } 
     399                return getBean().makeProp(marginLocation.class); 
     400        } 
     401         
     402        /** 
     403         * Prop used to reduce the time setting time. Used for optimization. 
     404         *  
     405         * @return 
     406         *              The current location channel. 
     407         */ 
     408        public Prop<LocationChannel> locationChannel() { 
     409                class locationChannel extends AutoProperty<LocationChannel> { 
     410 
     411                        @Override 
     412                        protected LocationChannel compute() { 
     413                                return model().get().get(MemberElement.KEY_LOCATION); 
     414                        } 
     415                } 
     416                return getBean().makeProp(locationChannel.class); 
     417        } 
     418         
     419        /** 
    357420         * Adds all scene elements that should be displayed as children of this view's model scene 
    358421         * element. 
    359422         *  
     
    405468         */ 
    406469        public static final ImmColor INVISIBLE_COLOR = new ImmColor(0.8f, 0.8f, 1.0f, 0.8f); 
    407470 
    408         private Prop<Boolean> isOn() { 
     471        /** 
     472         * Property used to determine whether the time phase is on. 
     473         *  
     474         * @return 
     475         *              true if the time phase is on, false otherwise. 
     476         */ 
     477        public Prop<Boolean> isOn() { 
    409478                class isOn extends AutoProperty<Boolean> { 
    410479                        @Override 
    411480                        protected Boolean compute() { 
     
    766835                 */ 
    767836                public static final int RESOURCE_REF_PARAM_INDEX = 0; 
    768837        } 
     838         
     839        /** 
     840         * Calculates the bound area of this element in the selected 
     841         * {@link BoundMode} for the selected {@link TimePos}. For a simple element, 
     842         * like {@link FrameR4}, will return the area of the element itself. For a 
     843         * composite element, returns the union of all the sub-elements, considering 
     844         * rotation angles. 
     845         *  
     846         * @param boundMode 
     847         *          The mode for calculating the area. 
     848         * @param wrapMode  
     849         *            Whether or not the area is important. Used for calculating the  
     850         *            area for the different wrapping modes of frames. When the text should  
     851         *            not go around the frame, the area of the frame is not  
     852         *            important.When wrapMode is <b>false</b>, it will be checked  
     853         *            whether or not the wrap mode of the frame is  
     854         *            {@link WrappingModes#NO_WRAP}, and if so, the area will be  
     855         *            empty. The default value is <b>true</b>. 
     856         * @return  
     857         *                      The calculated {@link ImmArea}. 
     858         */ 
     859        public ImmArea getBoundArea(BoundMode boundMode, Boolean wrapMode) { 
     860                 
     861                ElementH model = model().get(); 
     862                if (!isOn().get()) { 
     863                        return ImmArea.EMPTY; 
     864                } 
    769865 
     866                ImmPoint contentLocation = contentLocation().get(); 
     867 
     868                if (ElementUtils.isContainer(this.model().get())) { 
     869                        ImmArea area = ImmArea.EMPTY; 
     870                        for (ElementView element : elementViews().get()) { 
     871                                if (element.isOn().get()) { 
     872                                        ImmArea innerArea = element.getBoundArea(boundMode, wrapMode); 
     873                                 
     874                                        area = area.union(innerArea); 
     875                                } 
     876                        } 
     877                        return area.transform(ImmMatrix.IDENTITY.rotate(model.getRotationAngle(), 
     878                                        contentLocation.getX(), contentLocation.getY())); 
     879                } 
     880                ImmPoint position; 
     881                if (BoundMode.CONTENT.equals(boundMode)) { 
     882                        position = contentLocation; 
     883                } else if (BoundMode.MARGIN.equals(boundMode)){ 
     884                        position = marginLocation().get(); 
     885                } else { 
     886                        TimePos elementTime = getTime(); 
     887                        position = model.getLocation(boundMode, Position.TOP_LEFT, 
     888                                        elementTime); 
     889                } 
     890 
     891                ImmSize size = boundMode.getSize(model.getWrapSize(), model.getPaddingInsets(), 
     892                                model.getStyleHelper().getBorderInsets(), model.getMarginInsets()); 
     893                ImmArea res = new ImmArea(new ImmRect(position, size)).transform( 
     894                                ImmMatrix.IDENTITY.rotate(model.getRotationAngle(), 
     895                                                contentLocation.getX(), contentLocation.getY())); 
     896                return res; 
     897        } 
     898 
    770899} 
     900 No newline at end of file 
  • modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/frame/FrameView.java

     
    2626import org.sophie2.base.model.book.actions.base.SetKeyAction; 
    2727import org.sophie2.base.model.book.frame.BoundMode; 
    2828import org.sophie2.base.model.book.frame.FrameR4; 
    29 import org.sophie2.base.model.book.interfaces.MemberElement; 
     29import org.sophie2.base.model.book.frame.WrappingModes; 
    3030import org.sophie2.base.model.book.interfaces.ResourceFrame; 
    3131import org.sophie2.base.model.book.interfaces.StyledElement; 
    3232import org.sophie2.base.model.book.links.LinkTrigger; 
    33 import org.sophie2.base.model.book.timelines.LocationChannel; 
    3433import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    3534import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    3635import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     
    483482                 
    484483                return getBean().makeProp(localRectCache.class); 
    485484        } 
    486          
    487          
    488         /** 
    489          * Prop used to reduce the time dependency. Used only for optimization purposes. 
    490          *  
    491          * @return 
    492          *                      The content location for the current moment in time. 
    493          */ 
    494         private Prop<ImmPoint> contentLocation() { 
    495                 class contentLocation extends AutoProperty<ImmPoint> { 
    496485 
    497                         @Override 
    498                         protected ImmPoint compute() { 
    499                                 LocationChannel channel = model().get().get(MemberElement.KEY_LOCATION); 
    500                                  
    501                                 return channel.getValue(getTime()); 
    502                         } 
    503                 } 
    504                 return getBean().makeProp(contentLocation.class); 
    505         } 
    506          
    507486        /** 
    508487         * Gets the top-left location for the current moment in time.  
    509488         * @param mode 
     
    693672                 
    694673                return getBean().makeProp(templateKind.class); 
    695674        } 
     675         
     676         
     677        @Override 
     678        public ImmArea getBoundArea(BoundMode boundMode, Boolean wrapMode) { 
     679                if (!wrapMode) {  
     680                        if (WrappingModes.NO_WRAP.equals(model().get().get(FrameR4.KEY_WRAP))) {  
     681                                return ImmArea.EMPTY;  
     682                        }  
     683                }  
     684                return super.getBoundArea(boundMode, wrapMode); 
     685        } 
     686         
    696687} 
  • modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/page/ScenePageLogic.java

     
    151151                                        List<ElementView> toSelect = new ArrayList<ElementView>(); 
    152152 
    153153                                        for (ElementView view : elementViews) { 
    154                                                 ImmRect bounds = view.model().get().getBoundArea(BoundMode.OUT_BORDER,  
    155                                                                 view.getTime(), true).getBounds();  
     154                                                ImmRect bounds = view.getBoundArea(BoundMode.OUT_BORDER,  
     155                                                                true).getBounds();  
    156156                                                if (selRect.contains(bounds)) 
    157157                                                        if (pwa.getSel().canBeSelected(view)) { 
    158158                                                                toSelect.add(view); 
  • modules/org.sophie2.main.app.halos/src/test/java/org/sophie2/main/app/halos/frame/rotate/FrameRotateHaloButtonTest.java

     
    116116        @Test 
    117117        public void test90() { 
    118118                 
    119                 ImmArea area = this.frame.getBoundArea(BoundMode.MARGIN, this.fv.getTime(), true); 
     119                ImmArea area = this.fv.getBoundArea(BoundMode.MARGIN, true); 
    120120                int marginHeight = (int) area.getBounds().getHeight(); 
    121121                 
    122122                rotate(0, -marginHeight, -Math.PI/2, null); 
     
    128128        @Test 
    129129        public void test45() { 
    130130                 
    131                 ImmArea area = this.frame.getBoundArea(BoundMode.MARGIN, this.fv.getTime(), true); 
     131                ImmArea area = this.fv.getBoundArea(BoundMode.MARGIN, true); 
    132132                int marginHeight = (int) area.getBounds().getHeight(); 
    133133                 
    134134                rotate(0, -marginHeight/2, -Math.PI/4, null); 
     
    142142                BaseBookView bookView = this.pwa.bookView().get(); 
    143143                bookView.setViewOptions(bookView.getViewOptions().modifyZoom(0.5f)); 
    144144                                 
    145                 ImmArea area = this.frame.getBoundArea(BoundMode.MARGIN, this.fv.getTime(), true); 
     145                ImmArea area = this.fv.getBoundArea(BoundMode.MARGIN, true); 
    146146 
    147147                int marginHeight = (int) area.getBounds().getHeight(); 
    148148                rotate(0, -marginHeight/4, -Math.PI/4, null); 
     
    156156                BaseBookView bookView = this.pwa.bookView().get(); 
    157157                bookView.setViewOptions(bookView.getViewOptions().modifyZoom(2.0f)); 
    158158                 
    159                 ImmArea area = this.frame.getBoundArea(BoundMode.MARGIN, this.fv.getTime(), true); 
     159                ImmArea area = this.fv.getBoundArea(BoundMode.MARGIN, true); 
    160160                int marginHeight = (int) area.getBounds().getHeight(); 
    161161                 
    162162                rotate(0, -marginHeight, -Math.PI/4, null); 
  • modules/org.sophie2.extra.func.annotations/src/main/java/org/sophie2/extra/func/annotations/view/AudioAnnotationView.java

     
    6565 
    6666                        @Override 
    6767                        protected ImmRect compute() { 
    68                                 return model().get().getBoundArea(  
    69                                                 BoundMode.CONTENT, getTime(), true).getBounds();  
     68                                return getBoundArea(BoundMode.CONTENT, true).getBounds();  
    7069                        } 
    7170                } 
    7271                return getBean().makeProp(bounds.class); 
  • modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/page/PwaSelector.java

     
    340340         *                      True if the specified ElementView can be selected; false otherwise. 
    341341         */ 
    342342        public boolean canBeSelected(ElementView toSelect) { 
    343                 if (!toSelect.getTime().isOn()) { 
     343                if (!toSelect.isOn().get()) { 
    344344                        return false; 
    345345                } 
    346346                 
  • modules/org.sophie2.main.func.text/src/main/java/org/sophie2/main/func/text/view/TextFrameView.java

     
    33import java.util.List; 
    44 
    55import org.sophie2.base.commons.util.position.ImmArea; 
    6 import org.sophie2.base.media.TimePos; 
    76import org.sophie2.base.model.book.frame.BoundMode; 
    87import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    98import org.sophie2.base.model.text.model.ImmTextInterval; 
     
    5554         */ 
    5655        public Prop<ImmArea> wrappedArea() { 
    5756                class wrappedArea extends AutoProperty<ImmArea> { 
    58  
     57                         
    5958                        @Override 
    6059                        protected ImmArea compute() { 
    61                                 TimePos time = getTime(); 
    62                                 ImmArea resArea = model().get().getBoundArea(BoundMode.CONTENT, time, true); 
     60                                ImmArea resArea = getBoundArea(BoundMode.CONTENT, true); 
    6361                                ElementView parentView = parent().get(); 
    6462                                 
    6563                                if (parentView != null) { 
     
    7371                                                                break; 
    7472                                                        } 
    7573                                                        resArea = resArea.subtract( 
    76                                                                         nextView.model().get().getBoundArea(BoundMode.MARGIN, time, false)); 
     74                                                                        nextView.getBoundArea(BoundMode.MARGIN, false)); 
    7775                                                } 
    7876                                        } 
     77                                        return resArea;  
    7978                                } 
    80                                 return resArea; 
     79                                return ImmArea.EMPTY; 
    8180                        } 
    8281                } 
    8382                return getBean().makeProp(wrappedArea.class); 
  • modules/org.sophie2.base.model.book/src/main/java/org/sophie2/base/model/book/FrameH.java

     
    11package org.sophie2.base.model.book; 
    22 
    33import org.sophie2.base.commons.util.ImmList; 
    4 import org.sophie2.base.commons.util.position.ImmArea; 
    54import org.sophie2.base.commons.util.position.ImmInsets; 
    65import org.sophie2.base.commons.util.position.ImmPoint; 
    76import org.sophie2.base.commons.util.position.ImmSize; 
    87import org.sophie2.base.media.TimePos; 
    98import org.sophie2.base.model.book.frame.BoundMode; 
    10 import org.sophie2.base.model.book.frame.FrameR4; 
    11 import org.sophie2.base.model.book.frame.WrappingModes; 
    129import org.sophie2.base.model.book.interfaces.CompositeElement; 
    1310import org.sophie2.base.model.book.interfaces.MemberElement; 
    1411import org.sophie2.base.model.book.interfaces.ResizableElement; 
     
    196193                return ".frame.s2"; 
    197194        } 
    198195         
    199         @Override 
    200         public ImmArea getBoundArea(BoundMode boundMode, TimePos elementTime, 
    201                         Boolean wrapMode) { 
    202                 if (!wrapMode) {  
    203                                 if (WrappingModes.NO_WRAP.equals(this.get(FrameR4.KEY_WRAP))) {  
    204                                         return ImmArea.EMPTY;  
    205                                 }  
    206                 }  
    207                 return super.getBoundArea(boundMode, elementTime, wrapMode); 
    208         } 
    209  
    210196} 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/align/AlignElementsLogic.java

     
    4949 
    5050                        ImmArea bounds = ImmArea.EMPTY; 
    5151                        for (ElementView view : selected) { 
    52                                 ImmArea area = view.model().get().getBoundArea(BoundMode.CONTENT, view.getTime(), true);  
     52                                ImmArea area = view.getBoundArea(BoundMode.CONTENT, true);  
    5353                                bounds = bounds.union(area); 
    5454                        } 
    5555 
     
    6666                        for (int i = 0; i < selected.size(); ++i) { 
    6767                                if (selected.get(i).model().get().isMember()) { 
    6868                                        ElementView selectedView = selected.get(i); 
    69                                         ImmRect oldBounds = selectedView.model().get().getBoundArea(  
    70                                                         BoundMode.CONTENT, selectedView.getTime(), true).getBounds();    
     69                                        ImmRect oldBounds = selectedView.getBoundArea(  
     70                                                        BoundMode.CONTENT, true).getBounds();    
    7171                                        ImmPoint newLocation = button.calculateNewLocation(oldBounds, alignValue); 
    7272                                        oldLocations.add(selectedView.model().get().get(MemberElement.KEY_LOCATION));  
    7373                                        newLocations.add(newLocation); 
  • modules/org.sophie2.base.commons/src/main/java/org/sophie2/base/commons/util/position/ImmArea.java

     
    9090                }); 
    9191        } 
    9292 
     93        @Override 
     94        public String toString() { 
     95                return "ImmArea: " + this.area.getBounds().height + " " + this.area.getBounds().width; 
     96        } 
    9397        /** 
    9498         * Computes the union of this area and another one. 
    9599         *  
     
    279283                        return h.toHash(); 
    280284                } 
    281285        } 
     286         
     287        @Override 
     288        public int hashCode() { 
     289                final int prime = 31; 
     290                int result = 1; 
     291                result = prime * result + ((this.area == null) ? 0 : this.area.hashCode()); 
     292                return result; 
     293        } 
     294 
     295        @Override 
     296        public boolean equals(Object obj) { 
     297                if (this == obj) { 
     298                        return true; 
     299                } 
     300                if (obj == null) { 
     301                        return false; 
     302                } 
     303                if (getClass() != obj.getClass()) { 
     304                        return false; 
     305                } 
     306                ImmArea other = (ImmArea) obj; 
     307                if (this.area == null) { 
     308                        if (other.area != null) { 
     309                                return false; 
     310                        } 
     311                } else if (!this.area.equals(other.area)) { 
     312                        return false; 
     313                } 
     314                 
     315                return true; 
     316        } 
    282317} 
  • modules/org.sophie2.main.func.text/src/main/java/org/sophie2/main/func/text/view/HotTextLogic.java

     
    124124 
    125125                        Boolean forceSignificance = event.getEventParam( 
    126126                                        TextView.EventIds.FORCE_SIGNIFICANCE_PARAM_INDEX, Boolean.class); 
    127  
     127                         
    128128                        final Message description = event.getEventParam( 
    129129                                        TextView.EventIds.DESCRIPTION_PARAM_INDEX, Message.class); 
    130130 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/huds/properties/PropertiesHud.java

     
    561561                                        res = model.getLocation(BoundMode.CONTENT, 
    562562                                                        rotationPosition().get(), time); 
    563563                                         
    564                                         ImmPoint contentLoc = model.getLocation( 
    565                                                         BoundMode.CONTENT, Position.TOP_LEFT, time); 
     564                                        ImmPoint contentLoc = fv.contentLocation().get(); 
    566565                                        ImmMatrix m = ImmMatrix.IDENTITY.rotate 
    567566                                                        (model.getRotationAngle(), contentLoc.getX(), contentLoc.getY()); 
    568567                                        res = m.transform(res);