Ticket #1968: 1968_im_fi_ stefan_2.patch
File 1968_im_fi_ stefan_2.patch, 49.2 KB (added by stefan, 15 years ago) |
---|
-
modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/frame/rotate/FrameRotateHaloButton.java
### Eclipse Workspace Patch 1.0 #P sophie
21 21 import org.sophie2.base.skins.Message; 22 22 import org.sophie2.base.skins.SkinElementId; 23 23 import org.sophie2.base.visual.skins.VisualElementDef; 24 import org.sophie2.main.app.commons.PageAreaMouseCapture; 24 25 import org.sophie2.main.app.commons.frame.FrameView; 25 26 import org.sophie2.main.app.commons.page.PageWorkArea; 26 27 import org.sophie2.main.app.halos.common.AppHaloUtil; … … 63 64 final FrameH frame = frameView.model().get(); 64 65 final double oldAngle = frame.getRotationAngle(); 65 66 66 PageWorkArea pwa = AppHaloUtil.getWorkArea(this);67 final PageWorkArea pwa = AppHaloUtil.getWorkArea(this); 67 68 final Scene scene = pwa.scene().get(); 68 69 final ImmMatrix sceneToParent = SceneHelper.getElementToSceneTransform(scene, 69 70 frameView.parent().get().sceneElement().get()).inverse(); … … 83 84 final ImmPoint oldControl = sceneToParent.transform(controlInScene); 84 85 85 86 final SceneVisual sceneVisual = pwa.sceneVisual().get(); 86 sceneVisual.wantedViewRect().set(sceneVisual. actualViewRect().get());87 sceneVisual.wantedViewRect().set(sceneVisual.lastViewRect().get()); 87 88 88 return new MouseCapture(0, 0, e) {89 return new PageAreaMouseCapture(0, 0, e) { 89 90 90 91 @Override 91 92 public void shouldMove(int newX, int newY) { … … 100 101 } 101 102 102 103 @Override 103 public void released() {104 public void onReleased() { 104 105 final Double angle = frame.getRotationAngle(); 105 106 setAngle(angle, true); 106 107 sceneVisual.wantedViewRect().set(null); … … 159 160 160 161 } 161 162 163 @Override 164 public PageWorkArea getWorkArea() { 165 return pwa; 166 } 167 162 168 }; 163 169 } 164 170 -
modules/org.sophie2.base.commons/src/main/java/org/sophie2/base/commons/util/position/ImmRect.java
348 348 public boolean contains(ImmPoint point) { 349 349 return this.toRectangle().contains(point.toPoint()); 350 350 } 351 352 /** 353 * Creates rectangle by given point and size. The given point is the center 354 * point for the rectangle. The size is the size of the rectangle. 355 * 356 * @param centerPoint 357 * The center of the rectangle. 358 * @param size 359 * The size of the rectangle. 360 * @return New rectangle. 361 */ 362 public static ImmRect create(ImmPoint centerPoint, ImmSize size) { 363 ImmPoint topLeft = new ImmPoint(centerPoint.getX() - size.getWidth()/2, 364 centerPoint.getY() - size.getHeight()/2); 365 ImmRect res = new ImmRect(topLeft, size); 366 367 return res; 368 } 351 369 } -
modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/PageAreaMouseCapture.java
1 package org.sophie2.main.app.commons; 2 3 import java.awt.event.MouseEvent; 4 5 import org.sophie2.base.commons.gui.MouseCapture; 6 import org.sophie2.main.app.commons.page.PageWorkArea; 7 8 /** 9 * Modified {@link MouseCapture} for {@link PageWorkArea}. 10 * 11 * @author tanya 12 */ 13 public abstract class PageAreaMouseCapture extends MouseCapture { 14 15 /** 16 * Initiates capture. 17 * @param initCompX The current X coordinate of the component. 18 * @param initCompY The current Y coordinate of the component. 19 * @param e The mouse event initiating the capture. 20 */ 21 public PageAreaMouseCapture(int initCompX, int initCompY, MouseEvent e) { 22 super(initCompX, initCompY, e); 23 getWorkArea().scrollsLocked().set(Boolean.TRUE); 24 } 25 26 @Override 27 final public void released() { 28 onReleased(); 29 getWorkArea().scrollsLocked().set(Boolean.FALSE); 30 } 31 32 /** 33 * Called when the user has released the mouse button. Should be overrided and called in the {@link #released()}. 34 */ 35 public abstract void onReleased(); 36 37 /** 38 * Returns the {@link PageWorkArea} over which the {@link MouseCapture} is performed. 39 * 40 * @return {@link PageWorkArea} 41 */ 42 public abstract PageWorkArea getWorkArea(); 43 } 44 No newline at end of file -
modules/org.sophie2.base.layout/src/test/java/org/sophie2/base/layout/model/LayoutDemo.java
1 package org.sophie2.base.layout.model; 2 3 import java.awt.BorderLayout; 4 5 import javax.swing.JDesktopPane; 6 import javax.swing.JFrame; 7 import javax.swing.JInternalFrame; 8 import javax.swing.JLayeredPane; 9 10 /** 11 * Demo for demonstrating the usage of {@link CustomLayout}. 12 * @author tanya 13 */ 14 public 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 -
modules/org.sophie2.extra.func.annotations/src/main/java/org/sophie2/extra/func/annotations/view/halos/StickyMoveHaloButton.java
17 17 import org.sophie2.base.skins.SkinElementId; 18 18 import org.sophie2.base.visual.skins.VisualElementDef; 19 19 import org.sophie2.extra.func.annotations.view.StickyView; 20 import org.sophie2.main.app.commons.PageAreaMouseCapture; 20 21 import org.sophie2.main.app.commons.page.PageWorkArea; 21 22 import org.sophie2.main.app.halos.page.element.PageElementMoveHaloButton; 22 23 … … 49 50 // lock the view rect, so that we don't have auto-scrolls while moving. 50 51 final PageWorkArea workArea = workArea().get(); 51 52 final SceneVisual sv = workArea.sceneVisual().get(); 52 sv.wantedViewRect().set(sv. actualViewRect().get());53 sv.wantedViewRect().set(sv.lastViewRect().get()); 53 54 54 55 StickyView stickyView = findParentElement(StickyHaloMenu.class).stickyView().get(); 55 56 final TimePos time = stickyView.getTime(); … … 62 63 workArea.getSel().getEditScope().sceneElement().get()).inverse(); 63 64 final ImmPoint zero = sceneToParent.transform(ImmPoint.ZERO); 64 65 65 MouseCapture result = new MouseCapture(0, 0, e) {66 MouseCapture result = new PageAreaMouseCapture(0, 0, e) { 66 67 67 68 private void releaseAction(final LocationChannel locationChannel) { 68 69 final ImmPoint newlocation = … … 95 96 } 96 97 97 98 @Override 98 public void released() {99 public void onReleased() { 99 100 sv.wantedViewRect().set(null); 100 101 releaseAction(channel); 101 102 102 } 103 103 104 104 @Override 105 105 public void shouldMove(final int newX, final int newY) { 106 106 moveAction(channel, newX, newY); 107 107 } 108 109 @Override 110 public PageWorkArea getWorkArea() { 111 return workArea; 112 } 108 113 }; 109 114 110 115 return result; -
modules/org.sophie2.base.scene/src/main/java/org/sophie2/base/scene/interfaces/Scene.java
1 1 package org.sophie2.base.scene.interfaces; 2 2 3 3 import org.sophie2.base.commons.util.ImmColor; 4 import org.sophie2.base.commons.util.position.ImmRect; 4 5 import org.sophie2.base.scene.helpers.SceneHelper; 5 6 import org.sophie2.core.prolib.impl.BaseProObject; 6 7 import org.sophie2.core.prolib.interfaces.Prop; … … 35 36 * @return property 36 37 */ 37 38 public abstract Prop<? extends SceneElement> rootElement(); 38 39 40 /** 41 * The rectangle over which the actual view rectangle will be centered. 42 * 43 * @return property 44 */ 45 public abstract RwProp<ImmRect> centeringRect(); 46 39 47 /** 40 48 * The background color of the scene. This is the infinite area that is 41 49 * outside of any object. Note that, you should usually use elements that -
modules/org.sophie2.base.scene/src/test/java/org/sophie2/base/scene/SceneDemo.java
443 443 return component; 444 444 } 445 445 446 public Prop<ImmRect> actualViewRect() {446 public RwProp<ImmRect> lastViewRect() { 447 447 return getBean().makeValueProp("actualViewRect", ImmRect.class, 448 448 ImmRect.ZERO_RECT); 449 449 } … … 471 471 472 472 public RwProp<ImmRect> minimalViewRect() { 473 473 return getBean().makeValueProp("minimalViewRect", ImmRect.class, null); 474 } 474 } 475 475 476 public RwProp<ImmRect> actualViewRectCache() { 477 return getBean().makeValueProp("actualViewRectCache", ImmRect.class, null); 478 } 476 public RwProp<ImmRect> actualViewRect() { 477 // return getBean().makeValueProp("halosBoundSize", ImmRect.class, ImmRect.ZERO_RECT); 478 return null; 479 } 480 481 // public RwProp<ImmRect> lastViewRect() { 482 // // TODO Auto-generated method stub 483 // return null; 484 // } 479 485 } 480 486 481 487 /** -
modules/org.sophie2.base.scene/src/main/java/org/sophie2/base/scene/BaseSceneVisual.java
1 1 package org.sophie2.base.scene; 2 2 3 import java.awt. Dimension;3 import java.awt.Container; 4 4 import java.util.List; 5 5 6 6 import javax.swing.JComponent; 7 import javax.swing.JScrollPane; 7 8 8 9 import org.sophie2.base.commons.util.OSUtil; 10 import org.sophie2.base.commons.util.position.ImmPoint; 9 11 import org.sophie2.base.commons.util.position.ImmRect; 12 import org.sophie2.base.commons.util.position.ImmSize; 10 13 import org.sophie2.base.dnd.SophieDragDropHandler; 11 14 import org.sophie2.base.scene.helpers.ElementHelper; 12 15 import org.sophie2.base.scene.helpers.SceneHelper; … … 69 72 SELECT_PREVIOUS_BOOK; 70 73 } 71 74 72 private static final int DEFAULT_PADDING_L = 18; 73 private static final int DEFAULT_PADDING_R = 18; 74 private static final int DEFAULT_PADDING_T = 48; 75 private static final int DEFAULT_PADDING_B = 18; 76 75 /** 76 * Default padding of the left side. 77 */ 78 public static final int DEFAULT_PADDING_L = 18; 79 /** 80 * Default padding of the right side. 81 */ 82 public static final int DEFAULT_PADDING_R = 18; 83 /** 84 * Default padding of the top side. 85 */ 86 public static final int DEFAULT_PADDING_T = 42; 87 /** 88 * Default padding of the bottom side. 89 */ 90 public static final int DEFAULT_PADDING_B = 18; 91 77 92 public RwProp<ImmRect> wantedViewRect() { 78 93 return getBean().makeValueProp("wantedViewRect", ImmRect.class, null); 79 94 } 80 95 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 89 96 @Own 90 97 public RwProp<Scene> scene() { 91 98 return getBean().makeValueProp("scene", Scene.class); 92 99 } 100 101 /** 102 * The size of the component where the scene is painted. This is the size which will be used for centering into it. 103 * 104 * @return The property. 105 */ 106 public RwProp<ImmSize> viewportSize() { 107 return getBean().makeValueProp("viewportSize", ImmSize.class, ImmSize.ZERO); 108 } 93 109 94 110 public Prop<JComponent> swingComponent() { 95 111 class swingComponent extends ResourceProperty<JComponent> { 96 112 @Override 97 113 protected JComponent create() { 98 114 JComponent res = createSwingComponent(); 115 res.setLayout(null); 116 99 117 SwingEventAdapter.registerComponent(res, 100 118 BaseSceneVisual.this, null, res); 101 119 … … 112 130 113 131 @Override 114 132 protected void setup(JComponent res) { 115 Dimension size = actualViewRect().get().getSize().toDimension(); 116 res.setSize(size); 117 res.setPreferredSize(size); 118 res.setLayout(null); 133 ImmRect bound = SceneHelper.getBoundingRect(scene().get(), 134 scene().get().rootElement().get()); 135 ImmSize preferredSize = new ImmSize(bound.getWidth() + DEFAULT_PADDING_R + DEFAULT_PADDING_L, bound.getHeight() 136 + DEFAULT_PADDING_B + DEFAULT_PADDING_T); 137 res.setPreferredSize(preferredSize.toDimension()); 119 138 res.revalidate(); 139 res.repaint(); 120 140 } 121 141 122 142 @SuppressWarnings("unused") … … 157 177 return getBean().makeProp(swingComponent.class); 158 178 } 159 179 180 181 160 182 /** 161 183 * A view rectangle, if it can not be determined automatically (such as, 162 184 * when no scene is set). 163 185 */ 164 186 protected static final ImmRect DEFAULT_VIEW_RECT = 165 187 new ImmRect(0, 0, 256, 256); 166 167 public Prop<ImmRect> actualViewRect() { 168 class actualViewRect extends AutoProperty<ImmRect> { 188 189 public RwProp<ImmRect> actualViewRect(){ 190 return getBean().makeValueProp("actualViewRect", ImmRect.class, ImmRect.ZERO_RECT); 191 } 192 193 public RwProp<ImmRect> lastViewRect(){ 194 return getBean().makeValueProp("lastViewRect", ImmRect.class, ImmRect.ZERO_RECT); 195 } 196 197 public Prop<ImmRect> minimalViewRect() { 198 class minimalViewRect extends AutoProperty<ImmRect> { 169 199 170 200 @Override 171 201 protected ImmRect compute() { … … 177 207 && scene().get().rootElement().get() != null) { 178 208 ImmRect bound = SceneHelper.getBoundingRect(scene().get(), 179 209 scene().get().rootElement().get()); 210 res = bound; 211 180 212 res = new ImmRect( 181 bound.getX() - DEFAULT_PADDING_L, 182 bound.getY() - DEFAULT_PADDING_T, 183 bound.getWidth() + DEFAULT_PADDING_R + DEFAULT_PADDING_L, 184 bound.getHeight() + DEFAULT_PADDING_B + DEFAULT_PADDING_T); 213 res.getX() - DEFAULT_PADDING_L, 214 res.getY() - DEFAULT_PADDING_T, 215 res.getWidth() + DEFAULT_PADDING_R + DEFAULT_PADDING_L, 216 res.getHeight() + DEFAULT_PADDING_B + DEFAULT_PADDING_T); 217 218 ImmRect centeringRect = scene().get().centeringRect().get(); 219 220 if (!centeringRect.equals(ImmRect.ZERO_RECT)) { 221 ImmPoint centerPoint = new ImmPoint(centeringRect.getWidth()/2, 222 centeringRect.getHeight()/2); 223 ImmRect toUnite = ImmRect.create(centerPoint, viewportSize().get()); 224 res = res.union(toUnite); 225 } else { 226 ImmRect toUnite = new ImmRect(ImmPoint.ZERO, viewportSize().get()); 227 res = res.union(toUnite); 228 } 185 229 } else { 186 230 // can not determine... 187 231 // just make something... 188 232 res = DEFAULT_VIEW_RECT; 189 233 } 190 191 // Center the actualRect on the minimalViewRect192 // wantedViewRect is set by halo mouse tracking to limit the rect,193 // so do nothing if wantedViewRect is not null194 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 }210 }211 212 234 assert res != null; 213 235 return res; 214 236 } 215 237 } 216 217 return getBean().makeProp(actualViewRect.class); 238 return getBean().makeProp(minimalViewRect.class); 218 239 } 219 240 220 241 /** 221 242 * Override this to provide logic for the creation of the Swing Component 222 243 * of this {@link SceneVisual}. … … 229 250 protected boolean computeVisible() { 230 251 return true; 231 252 } 253 254 /** 255 * Finds possible {@link JScrollPane} parent, to a specific depth 256 * @param res 257 * The starting component. 258 * @param depth 259 * The depth to which we search 260 * @return nearest {@link JScrollPane} parent, null if not. 261 */ 262 public static JScrollPane findParentScrollPane(JComponent res, int depth) { 263 Container component = res; 264 int i = 0; 265 266 while (i < depth && component != null) { 267 268 if (component instanceof JScrollPane) { 269 return (JScrollPane) component; 270 } 271 272 component = component.getParent(); 273 ++i; 274 } 275 276 return null; 277 } 232 278 } -
modules/org.sophie2.base.scene/src/main/java/org/sophie2/base/scene/helpers/SceneHelper.java
248 248 SophieLog.trace("sceneToSwing: sceneRect=" + sceneRect); 249 249 assert sceneRect != null; 250 250 // only translation... 251 ImmRect viewRect = visual. actualViewRect().get();251 ImmRect viewRect = visual.lastViewRect().get(); 252 252 assert viewRect != null; 253 253 SophieLog.trace("sceneToSwing: viewRect=" + viewRect); 254 254 ImmRect res = Position.translate(sceneRect, -viewRect.getX(), -viewRect … … 271 271 SophieLog.trace("sceneToSwing: sceneRect=" + scenePoint); 272 272 assert scenePoint != null; 273 273 // only translation... 274 ImmRect viewRect = visual. actualViewRect().get();274 ImmRect viewRect = visual.lastViewRect().get(); 275 275 assert viewRect != null; 276 276 SophieLog.trace("sceneToSwing: viewRect=" + viewRect); 277 277 ImmPoint res = scenePoint.translate(-viewRect.getX(), -viewRect.getY()); … … 291 291 */ 292 292 public static ImmRect swingToScene(SceneVisual visual, ImmRect swingRect) { 293 293 // only translation... 294 ImmRect viewRect = visual. actualViewRect().get();294 ImmRect viewRect = visual.lastViewRect().get(); 295 295 return Position.translate(swingRect, viewRect.getX(), viewRect.getY()); 296 296 } 297 297 … … 306 306 */ 307 307 public static ImmPoint swingToScene(SceneVisual visual, ImmPoint swingPoint) { 308 308 // only translation... 309 ImmRect viewRect = visual. actualViewRect().get();309 ImmRect viewRect = visual.lastViewRect().get(); 310 310 assert viewRect != null; 311 311 return swingPoint.translate(viewRect.getX(), viewRect.getY()); 312 312 } -
modules/org.sophie2.base.layout/src/main/java/org/sophie2/base/layout/model/CustomLayout.java
1 package org.sophie2.base.layout.model; 2 3 import java.awt.BorderLayout; 4 import java.awt.Component; 5 import java.awt.Container; 6 import java.awt.Dimension; 7 import java.awt.LayoutManager2; 8 import java.io.Serializable; 9 10 import javax.swing.JDesktopPane; 11 import 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 */ 26 public 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 -
modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/page/PageWorkArea.java
1 1 package org.sophie2.main.app.commons.page; 2 2 3 import java.awt.BorderLayout; 3 4 import java.util.ArrayList; 4 5 import java.util.List; 5 6 … … 10 11 import org.sophie2.base.commons.util.ImmColor; 11 12 import org.sophie2.base.commons.util.position.ImmArea; 12 13 import org.sophie2.base.commons.util.position.ImmMatrix; 14 import org.sophie2.base.commons.util.position.ImmPoint; 13 15 import org.sophie2.base.commons.util.position.ImmRect; 16 import org.sophie2.base.commons.util.position.ImmSize; 17 import org.sophie2.base.layout.model.CustomLayout; 18 import org.sophie2.base.layout.model.DocView; 14 19 import org.sophie2.base.model.book.PageH; 15 20 import org.sophie2.base.scene.SceneVisual; 16 21 import org.sophie2.base.scene.effects.ColorEffect; … … 31 36 import org.sophie2.core.prolib.impl.ResourceProperty; 32 37 import org.sophie2.core.prolib.interfaces.Prop; 33 38 import org.sophie2.core.prolib.interfaces.RwProp; 39 import org.sophie2.main.app.commons.app.AppMainWindow; 34 40 import org.sophie2.main.app.commons.book.BookDocView; 35 41 import org.sophie2.main.app.commons.book.BookView; 36 42 import org.sophie2.main.app.commons.element.ElementView; 43 import org.sophie2.main.app.commons.util.AppViewUtil; 37 44 38 45 /** 39 46 * A view, displaying the content on a page. It is responsible for selection and … … 44 51 */ 45 52 @VisualElementDef(parent = BookDocView.class, sortKey = "kkk-page-work-area") 46 53 public class PageWorkArea extends BaseVisualElement { 47 54 /** 55 * Default horizontal padding. 56 */ 57 public static final int PADDING_HORIZONTAL = 48; 58 59 /** 60 * Default padding of the top side. 61 */ 62 public static final int PADDING_VERTICAL = 62; 63 48 64 /** 49 65 * The <code>BookView</code> of the book this PageWorkArea shows. 50 66 * … … 152 168 @Override 153 169 protected Scene compute() { 154 170 assert getLastValue() == null; 171 155 172 return new BaseScene() { 156 173 157 174 @Override 158 175 protected void setupScene() { 159 176 rootElement().set(rootSceneElement().get()); 177 178 boolean isDesktopBook = !(bookView().get().getViewOptions().isShowControls()); 179 if (!isDesktopBook) { 180 ImmPoint pageLocation = ImmPoint.ZERO; 181 float zoom = bookView().get().getViewOptions().getZoom(); 182 ImmSize pageSize = bookView().get().model().get().getPageSize(); 183 pageSize = new ImmSize(pageSize.getWidth() * zoom, pageSize.getHeight() * zoom); 184 ImmRect centeringRect = new ImmRect(pageLocation, pageSize); 185 186 centeringRect().set(centeringRect); 187 } 188 160 189 topEventSource().set(PageWorkArea.this); 161 190 } 162 191 }; … … 208 237 @Override 209 238 protected void setup(JDesktopPane res) { 210 239 240 res.setLayout(new CustomLayout(new BorderLayout())); 241 211 242 JComponent sceneComp = sceneVisual().get().swingComponent().get(); 212 243 213 244 sceneComp.setLocation(0, 0); 214 245 SophieLog.debug("PageWorkArea.layeredPage: sceneComp:" + sceneComp); 215 246 216 247 res.removeAll(); 217 res.add(sceneComp, JLayeredPane.DEFAULT_LAYER); 248 res.setLayer(sceneComp, JLayeredPane.DEFAULT_LAYER); 249 250 res.add(sceneComp, BorderLayout.CENTER); 218 251 219 252 res.revalidate(); 220 253 res.repaint(); 221 254 } 222 255 223 // TODO (r4) reimplement the page-work-area centering224 256 @SuppressWarnings("unused") 225 257 @Setup 226 258 protected void setupActualSize(JLayeredPane res) { 227 228 // grab the value to set up the property sync229 ImmRect actualCache = sceneVisual().get().actualViewRect().get();230 231 259 JDesktopPane desktopPane = swingComponent().get(); 260 AppMainWindow appMainWindow = AppViewUtil.findMainWindow(PageWorkArea.this); 261 DocView parentBookView = findParentElement(BookDocView.class); 262 if (appMainWindow != null && appMainWindow.desktopDocument().get() == parentBookView) { 263 ImmRect bound = SceneHelper.getBoundingRect(scene().get(), scene().get().rootElement().get()); 264 ImmSize prefSize = new ImmSize(bound.getWidth() + PADDING_HORIZONTAL, bound.getHeight() 265 + PADDING_VERTICAL); 266 desktopPane.setPreferredSize(prefSize.toDimension()); 267 } 232 268 desktopPane.revalidate(); 233 269 desktopPane.repaint(); 234 270 } … … 427 463 } 428 464 return getBean().makeProp(selectionRisenElement.class); 429 465 } 466 467 /** 468 * Property which have True or False value depending on whether mouse capture event is started or not. 469 * <b>true</b> if mouse capture is on, <b>false</b> otherwise. 470 * 471 * @return property 472 */ 473 public RwProp<Boolean> scrollsLocked() { 474 return getBean().makeValueProp("scrollsLocked", Boolean.class, Boolean.FALSE); 475 } 430 476 } 477 No newline at end of file -
modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/page/resize/PageResizeHaloButton.java
23 23 import org.sophie2.base.visual.skins.SkinPartDef; 24 24 import org.sophie2.base.visual.skins.VisualElementDef; 25 25 import org.sophie2.core.prolib.interfaces.Prop; 26 import org.sophie2.main.app.commons.PageAreaMouseCapture; 26 27 import org.sophie2.main.app.commons.page.PageWorkArea; 27 28 import org.sophie2.main.app.halos.common.AppHaloUtil; 28 29 … … 65 66 66 67 @Override 67 68 protected MouseCapture captureClick(MouseEvent e) { 68 PageWorkArea pwa = AppHaloUtil.getWorkArea(PageResizeHaloButton.this);69 final PageWorkArea pwa = AppHaloUtil.getWorkArea(PageResizeHaloButton.this); 69 70 70 71 if(pwa !=null ){ 71 72 72 73 final SceneVisual sv = pwa.sceneVisual().get(); 73 sv.wantedViewRect().set(sv. actualViewRect().get());74 sv.wantedViewRect().set(sv.lastViewRect().get()); 74 75 75 76 final BookH book = pwa.bookView().get().model().get(); 76 77 … … 79 80 final ImmMatrix transf = SceneHelper.getElementToSceneTransform(pwa.scene().get(), pwa.rootSceneElement().get()); 80 81 81 82 ImmVector resizedSize = transf.transform(v); 82 return new MouseCapture((int) resizedSize.getPointX(), (int) resizedSize.getPointY(),83 return new PageAreaMouseCapture((int) resizedSize.getPointX(), (int) resizedSize.getPointY(), 83 84 e) { 84 85 85 86 @Override 86 public void released() {87 public void onReleased() { 87 88 sv.wantedViewRect().set(null); 88 89 89 90 90 new AutoAction(Message.create(SET_PAGE_SIZE), true) { 91 91 92 92 @Override … … 128 128 }.register(book.getAccess()); 129 129 } 130 130 131 @Override 132 public PageWorkArea getWorkArea() { 133 return pwa; 134 } 135 131 136 }; 132 137 } 133 138 return null; -
modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/page/ScenePageLogic.java
4 4 import java.util.ArrayList; 5 5 import java.util.List; 6 6 7 import org.sophie2.base.commons.gui.MouseCapture;8 7 import org.sophie2.base.commons.util.position.ImmArea; 9 8 import org.sophie2.base.commons.util.position.ImmMatrix; 10 9 import org.sophie2.base.commons.util.position.ImmPoint; … … 25 24 import org.sophie2.core.mvc.LogicR3; 26 25 import org.sophie2.core.mvc.OperationDef; 27 26 import org.sophie2.core.mvc.events.EventR3; 27 import org.sophie2.main.app.commons.PageAreaMouseCapture; 28 28 import org.sophie2.main.app.commons.app.AppMainWindow; 29 29 import org.sophie2.main.app.commons.book.BookDocView; 30 30 import org.sophie2.main.app.commons.element.ElementView; … … 120 120 121 121 MouseEvent cause = event.getCausingEvent(EventR3.class).getCausingEvent( 122 122 MouseEvent.class); 123 new MouseCapture(0, 0, cause) {123 new PageAreaMouseCapture(0, 0, cause) { 124 124 125 125 @Override 126 public void released() {126 public void onReleased() { 127 127 pwa.selectionArea().set(ImmArea.EMPTY); 128 128 } 129 129 … … 159 159 pwa.getSel().select(toSelect, false); 160 160 } 161 161 } 162 163 @Override 164 public PageWorkArea getWorkArea() { 165 return pwa; 166 } 162 167 }; 163 168 return true; 164 169 } -
modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/app/AppMainWindow.java
14 14 import org.sophie2.base.commons.util.position.ImmRect; 15 15 import org.sophie2.base.halos.HaloMenu; 16 16 import org.sophie2.base.layout.impl.DefaultMainWindow; 17 import org.sophie2.base.layout.model.CustomLayout; 17 18 import org.sophie2.base.layout.model.DocView; 18 19 import org.sophie2.base.media.MediaComposite; 19 20 import org.sophie2.base.media.MediaUtil; … … 211 212 if (hm.visible().get()) { 212 213 for (JComponent c : hm.swingComponents().get()) { 213 214 214 res.add(c, JLayeredPane.PALETTE_LAYER); 215 res.setLayer(c, JLayeredPane.PALETTE_LAYER); 216 res.add(c, CustomLayout.CUSTOM); 217 215 218 } 216 219 } 217 220 } … … 235 238 } 236 239 PageWorkArea workArea = bookDocView.workArea().get(); 237 240 238 JDesktopPane res = workArea.swingComponent().get(); 239 240 // The scene bounds 241 ImmRect bounds = workArea.sceneVisual().get().actualViewRect().get(); 242 // The bounds of visible huds 243 for (HaloMenu hm : haloMenus().get()) { 241 if (!workArea.scrollsLocked().get()) { 244 242 245 bounds = bounds.union(SceneHelper.swingToScene( 246 workArea.sceneVisual().get(), hm.activeBounds().get())); 247 } 243 JDesktopPane res = workArea.swingComponent().get(); 248 244 249 bounds = SceneHelper.sceneToSwing(workArea.sceneVisual().get(), bounds); 250 Dimension d = bounds.getSize().toDimension(); 245 // The scene bounds 246 ImmRect bounds = workArea.sceneVisual().get().minimalViewRect().get(); 247 // The bounds of visible huds 248 for (HaloMenu hm : haloMenus().get()) { 249 bounds = bounds.union(SceneHelper.swingToScene( 250 workArea.sceneVisual().get(), hm.activeBounds().get())); 251 } 252 bounds = SceneHelper.sceneToSwing(workArea.sceneVisual() 253 .get(), bounds); 251 254 252 res.setPreferredSize(d); 253 res.setSize(d); 254 res.revalidate(); 255 Dimension dim = bounds.getSize().toDimension(); 256 workArea.sceneVisual().get().actualViewRect().set( 257 new ImmRect(workArea.sceneVisual().get().minimalViewRect().get().getX(), 258 workArea.sceneVisual().get().minimalViewRect().get().getY(), dim.width, dim.height)); 259 } 255 260 } 256 257 261 } 258 262 return getBean().makeProp(haloSync.class); 259 263 } -
modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/frame/FrameLogic.java
2 2 3 3 import java.awt.event.MouseEvent; 4 4 5 import org.sophie2.base.commons.gui.MouseCapture;6 5 import org.sophie2.base.commons.util.position.ImmMatrix; 7 6 import org.sophie2.base.commons.util.position.ImmPoint; 8 7 import org.sophie2.base.commons.util.position.ImmSize; … … 26 25 import org.sophie2.core.mvc.EventFilterBuilder; 27 26 import org.sophie2.core.mvc.OperationDef; 28 27 import org.sophie2.core.mvc.events.EventR3; 28 import org.sophie2.main.app.commons.PageAreaMouseCapture; 29 29 import org.sophie2.main.app.commons.element.ElementView; 30 30 import org.sophie2.main.app.commons.element.ResizeAreaSceneElement.ResizeSubAreaElement; 31 31 import org.sophie2.main.app.commons.page.PageWorkArea; … … 57 57 final ElementView elementView = event.getSource(ElementView.class); 58 58 final ResourceAccess access = elementView.getAccess(); 59 59 60 PageWorkArea pwa = elementView.getPwa();60 final PageWorkArea pwa = elementView.getPwa(); 61 61 Mode sizeTemplateMode = ResizableElement.KEY_SIZE.getMode(access); 62 62 Mode locTemplateMode = MemberElement.KEY_LOCATION.getMode(access); 63 63 … … 78 78 // lock the view rect, so that we don't have auto-scrolls while moving. 79 79 final SceneVisual sv = pwa.sceneVisual().get(); 80 80 sv.wantedViewRect().set(sv.actualViewRect().get()); 81 81 82 82 MouseEvent cause = event.getCausingEvent(EventR3.class).getCausingEvent( 83 83 MouseEvent.class); 84 84 85 new MouseCapture(0, 0, cause) {85 new PageAreaMouseCapture(0, 0, cause) { 86 86 @Override 87 public void released() {87 public void onReleased() { 88 88 AutoAction.registerEndChange(access, Message.create(RESIZE_FRAME_FINISHED)); 89 89 90 sv.wantedViewRect().set(null); 90 91 } 91 92 … … 93 94 final ImmPoint newLocationInPage, final ImmSize newSize) { 94 95 TimePos time = elementView.getTime(); 95 96 final LocationChannel newChannel = oldChannel.setValue(time, newLocationInPage); 97 96 98 new AutoAction(Message.create(FRAME_RESIZE), false) { 97 99 @Override 98 100 public void performAuto() { … … 157 159 158 160 } 159 161 } 162 163 @Override 164 public PageWorkArea getWorkArea() { 165 return pwa; 166 } 160 167 }; 161 168 162 169 return true; -
modules/org.sophie2.base.scene/src/main/java/org/sophie2/base/scene/impl/BaseScene.java
1 1 package org.sophie2.base.scene.impl; 2 2 3 3 import org.sophie2.base.commons.util.ImmColor; 4 import org.sophie2.base.commons.util.position.ImmRect; 4 5 import org.sophie2.base.scene.interfaces.Scene; 5 6 import org.sophie2.base.scene.interfaces.SceneElement; 6 7 import org.sophie2.core.prolib.impl.ResourceProperty; … … 20 21 } 21 22 22 23 @Override 24 public RwProp<ImmRect> centeringRect() { 25 return getBean().makeValueProp("centeringRect", ImmRect.class, ImmRect.ZERO_RECT); 26 } 27 28 @Override 23 29 public RwProp<ImmColor> backgroundColor() { 24 30 return getBean().makeValueProp("backgroundColor", ImmColor.class, 25 31 ImmColor.GRAY); -
modules/org.sophie2.main.scene.simple/src/main/java/org/sophie2/main/scene/simple/SimpleSceneVisual.java
5 5 6 6 import javax.swing.JComponent; 7 7 import javax.swing.JPanel; 8 import javax.swing.JScrollPane; 8 9 9 10 import org.sophie2.base.commons.util.position.ImmRect; 11 import org.sophie2.base.commons.util.position.ImmSize; 10 12 import org.sophie2.base.scene.BaseSceneVisual; 11 13 import org.sophie2.base.scene.SceneVisual; 12 14 import org.sophie2.base.scene.helpers.SceneHelper; … … 16 18 /** 17 19 * Simple scene implementation. 18 20 * 19 * @author milo, peko, nenko, mira, gogov 21 * @author milo, peko, nenko, mira, gogov, tanya, stefan 20 22 */ 21 23 @SkinElementId("main.scene.simple.simple-scene-visual") 22 24 public class SimpleSceneVisual extends BaseSceneVisual { … … 37 39 private static final long serialVersionUID = 4801814966438437503L; 38 40 39 41 private long lastPaintTime = System.currentTimeMillis(); 40 42 43 private static final int OFFSET = 2; 44 41 45 @Override 42 46 protected void paintComponent(Graphics graphics) { 43 47 … … 53 57 SophieLog.trace("paintComponent: parent=" + getParent()); 54 58 55 59 Graphics2D g2d = (Graphics2D) graphics.create(); 56 ImmRect visRect = actualViewRect().get(); 60 //Centering the actual view rectangle. 61 62 SophieLog.debugf("\n%s\n\t%s\n\t\t%s\n\t\t\t%s", 63 this.getParent().getParent().getParent().toString(), 64 this.getParent().getParent().toString(), 65 this.getParent().toString(), this.toString()); 66 67 JScrollPane container = findParentScrollPane(this, 6); 68 69 if (container != null) { 70 viewportSize().set(new ImmSize(container.getWidth(), container.getHeight())); 71 } 72 73 ImmRect actRect = actualViewRect().get(); 74 ImmRect lstRect = lastViewRect().get(); 57 75 58 SceneHelper.paint(g2d, visRect, scene().get()); 59 76 if (container != null) { 77 if (!lstRect.equals(actRect)) { 78 if (lstRect.getY() > actRect.getY()) { 79 container.getVerticalScrollBar().setValue(0); 80 } else if (lstRect.getHeight() + OFFSET + lstRect.getY() < actRect.getHeight() + actRect.getY() 81 && lstRect.getY() <= actRect.getY()) { 82 container.getVerticalScrollBar().setValue(container.getVerticalScrollBar().getMaximum()); 83 } 84 85 if (lstRect.getX() > actRect.getX()) { 86 container.getHorizontalScrollBar().setValue(0); 87 } else if (lstRect.getWidth() + OFFSET + lstRect.getX() < actRect.getWidth() + actRect.getX() 88 && lstRect.getX() <= actRect.getX()) { 89 container.getHorizontalScrollBar().setValue(container.getHorizontalScrollBar().getMaximum()); 90 } 91 } 92 } 93 94 lastViewRect().set(actualViewRect().get()); 95 SceneHelper.paint(g2d, actualViewRect().get(), scene().get()); 60 96 SophieLog.debug("paintComponent: total paint time=" 61 97 + (System.currentTimeMillis() - startTime)); 98 62 99 } 63 100 } 64 101 } -
modules/org.sophie2.main.scene.sprites/src/main/java/org/sophie2/main/scene/sprites/SpritesSceneVisual.java
52 52 SophieLog.trace("paintComponent: parent=" + getParent()); 53 53 54 54 Graphics2D g2d = (Graphics2D) graphics.create(); 55 ImmRect visRect = actualViewRect().get();55 ImmRect visRect = lastViewRect().get(); 56 56 57 57 SceneHelper.paintSprite(g2d, visRect, scene().get()); 58 58 -
modules/org.sophie2.dev/src/main/java/org/sophie2/dev/author/FakeAuthorMain.java
114 114 SophieLog.setMinLevel("org.sophie2.base.commons.util", LogLevel.DEBUG); 115 115 SophieLog.setMinLevel("org.sophie2.base.model.resources.r4.model", LogLevel.DEBUG); 116 116 SophieLog.setMinLevel("org.sophie2.main.app.commons.book", LogLevel.DEBUG); 117 SophieLog.setMinLevel("org.sophie2.base.scene.BaseSceneVisual", LogLevel.DEBUG); 118 // SophieLog.setMinLevel("org.sophie2.main.scene.simple.SimpleSceneVisual", LogLevel.DEBUG); 119 SophieLog.setMinLevel("org.sophie2.base.layout.impl.DesktopManager", LogLevel.DEBUG); 120 121 SophieLog.setMinLevel("org.sophie2.main.app.commons.frame", LogLevel.DEBUG); 117 122 118 123 assert System.getProperty(SophieEditions.PROP_ID) == null : 119 124 "You have set edition in fake mode?" ; -
modules/org.sophie2.base.scene/src/main/java/org/sophie2/base/scene/SceneVisual.java
32 32 * @return property 33 33 */ 34 34 RwProp<ImmRect> wantedViewRect(); 35 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(); 35 54 36 /** 55 37 * The swing component displaying the scene. 56 38 * … … 72 54 * 73 55 * @return property 74 56 */ 75 Prop<ImmRect> actualViewRect(); 57 RwProp<ImmRect> lastViewRect(); 58 59 /** 60 * Minimal part of the scene that will be displayed. 61 * 62 * @return property 63 */ 64 Prop<ImmRect> minimalViewRect(); 65 66 /** 67 * Contains what the dimension of the visible part of the scene should be if 68 * we want the visible part of the scene to surround the halos. 69 * 70 * @return property 71 */ 72 RwProp<ImmRect> actualViewRect(); 76 73 } -
modules/org.sophie2.main.scene.jogl/src/main/java/org/sophie2/main/scene/jogl/JoglSceneVisual.java
64 64 public void display(GLAutoDrawable drawable) { 65 65 final GL2 gl = drawable.getGL().getGL2(); 66 66 67 SceneHelper.paint(gl, actualViewRect().get(), scene().get());67 SceneHelper.paint(gl, lastViewRect().get(), scene().get()); 68 68 } 69 69 70 70 public void reshape(GLAutoDrawable drawable, -
modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/app/DocumentsLogic.java
4 4 import org.sophie2.base.layout.impl.DefaultDocView; 5 5 import org.sophie2.base.model.resources.r4.ResourceRefR4; 6 6 import org.sophie2.base.model.resources.r4.access.ResourceAccess; 7 import org.sophie2.core.logging.SophieLog;8 7 import org.sophie2.core.modularity.SortKey; 9 8 import org.sophie2.core.mvc.EventFilterBuilder; 10 9 import org.sophie2.core.mvc.EventParams; … … 128 127 129 128 return true; 130 129 } 131 132 },133 134 135 /**136 * Handles resizing of the window by the user. Should center the page in the137 * window.138 */139 @SortKey("fff-document-resize")140 ON_RESIZE {141 142 public void defineFilter(EventFilterBuilder filter) {143 filter.setEventId(DefaultDocView.EventIds.RESIZE);144 filter.setSourceClass(DefaultDocView.class);145 }146 147 public boolean handle(EventR3 event) {148 // FIXME (R4) Reimplement page centering. This might need to go down to the layout.149 SophieLog.warn("(R4) Reimplement page centering!");150 return false;151 }152 153 130 }; 154 131 155 132 /** -
modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/frame/MainTitleBarHalo.java
46 46 import org.sophie2.core.prolib.interfaces.RwProp; 47 47 import org.sophie2.core.prolib.list.ComposingProList; 48 48 import org.sophie2.core.prolib.list.ProList; 49 import org.sophie2.main.app.commons.PageAreaMouseCapture; 49 50 import org.sophie2.main.app.commons.element.ElementView; 50 51 import org.sophie2.main.app.commons.element.GroupView; 51 52 import org.sophie2.main.app.commons.frame.FrameView; … … 260 261 */ 261 262 protected MouseCapture captureClick(MouseEvent e) { 262 263 264 final PageWorkArea pwa = workArea().get(); 265 263 266 // lock the view rect, so that we don't have auto-scrolls while moving. 264 final SceneVisual sv = workArea().get().sceneVisual().get();265 sv.wantedViewRect().set(sv. actualViewRect().get());267 final SceneVisual sv = pwa.sceneVisual().get(); 268 sv.wantedViewRect().set(sv.lastViewRect().get()); 266 269 267 270 // get the selected frame locations before start moving 268 271 ResourceRefList frameRefs = ResourceRefList.EMPTY; … … 296 299 297 300 298 301 //TODO: rewrite --milo 299 MouseCapture result = newMouseCapture(0, 0, e) {302 PageAreaMouseCapture result = new PageAreaMouseCapture(0, 0, e) { 300 303 301 304 private void releasedAction( 302 305 final ImmList<ImmPoint> oldPositions, … … 311 314 private void moveAction( 312 315 ImmList<ImmPoint> oldPositions, 313 316 ResourceRefList refs, ImmList<TimePos> times, final int newX, final int newY) { 314 317 315 318 if (currentPage().get() == null) { 316 319 return; 317 320 } … … 340 343 } 341 344 342 345 @Override 343 public void released() {346 public void onReleased() { 344 347 sv.wantedViewRect().set(null); 345 348 releasedAction(finalOldLocations, finalFrameRefs, finalTimes); 346 349 } … … 348 351 @Override 349 352 public void shouldMove(final int newX, final int newY) { 350 353 moveAction(finalOldLocations, finalFrameRefs, finalTimes, newX, newY); 354 } 351 355 356 @Override 357 public PageWorkArea getWorkArea() { 358 return pwa; 352 359 } 353 360 }; 354 361 return result;