Changeset 140:44f93e6d9f2d
- Timestamp:
- 08/01/2008 11:49:34 AM
(5 months ago)
- Author:
- marc@f1.local
- branch:
- default
- Message:
Fix for #86
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r87 |
r140 |
|
| 80 | 80 | at.x = event.getX(); |
|---|
| 81 | 81 | at.y = event.getY(); |
|---|
| 82 | | |
|---|
| | 82 | |
|---|
| 83 | 83 | out.println(" output <"+ongoing+">"); |
|---|
| 84 | 84 | } |
|---|
| … | … | |
| 92 | 92 | |
|---|
| 93 | 93 | out.println(" delta <"+deltaX+", "+deltaY+">"); |
|---|
| 94 | | |
|---|
| | 94 | |
|---|
| 95 | 95 | at.x = event.getX(); |
|---|
| 96 | 96 | at.y = event.getY(); |
|---|
| … | … | |
| 107 | 107 | if (!isDragging) |
|---|
| 108 | 108 | return; |
|---|
| 109 | | |
|---|
| | 109 | |
|---|
| 110 | 110 | } |
|---|
| 111 | 111 | |
|---|
| r85 |
r140 |
|
| 35 | 35 | import com.thoughtworks.xstream.mapper.MapperWrapper; |
|---|
| 36 | 36 | |
|---|
| | 37 | import field.core.StandardFluidSheet; |
|---|
| 37 | 38 | import field.core.dispatch.Mixins; |
|---|
| 38 | 39 | import field.core.dispatch.VisualElement; |
|---|
| … | … | |
| 41 | 42 | import field.core.dispatch.Mixins.iMixinProxy; |
|---|
| 42 | 43 | import field.core.dispatch.iVisualElement.Rect; |
|---|
| | 44 | import field.core.dispatch.iVisualElement.VisualElementProperty; |
|---|
| 43 | 45 | import field.core.dispatch.iVisualElementOverrides.iDefaultOverride; |
|---|
| 44 | 46 | import field.core.plugins.drawing.opengl.CachedLine; |
|---|
| 45 | 47 | import field.core.plugins.drawing.opengl.CachedLineCompression; |
|---|
| | 48 | import field.core.util.FieldPyObjectAdaptor.PyVisualElement; |
|---|
| 46 | 49 | import field.core.windowing.components.iComponent; |
|---|
| 47 | 50 | import field.namespace.generic.ReflectionTools; |
|---|
| … | … | |
| 490 | 493 | public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) { |
|---|
| 491 | 494 | writer.startNode("requiredserialization"); |
|---|
| 492 | | |
|---|
| | 495 | |
|---|
| 493 | 496 | bos.reset(); |
|---|
| 494 | 497 | try{ |
|---|
| … | … | |
| 497 | 500 | oos.close(); |
|---|
| 498 | 501 | writer.setValue(new Base64().encode(bos.toByteArray())); |
|---|
| 499 | | } |
|---|
| | 502 | } |
|---|
| 500 | 503 | catch(IOException x) |
|---|
| 501 | 504 | { |
|---|
| … | … | |
| 510 | 513 | String value = reader.getValue(); |
|---|
| 511 | 514 | reader.moveUp(); |
|---|
| 512 | | |
|---|
| | 515 | |
|---|
| 513 | 516 | //Object dc = CachedLineCompression.decompress(value); |
|---|
| 514 | 517 | ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(new Base64().decode(value))); |
|---|
| 515 | 518 | Object o = ois.readObject(); |
|---|
| 516 | 519 | ois.close(); |
|---|
| 517 | | |
|---|
| | 520 | |
|---|
| 518 | 521 | return o; |
|---|
| 519 | 522 | } catch (Throwable t) { |
|---|
| … | … | |
| 581 | 584 | return false; |
|---|
| 582 | 585 | } |
|---|
| | 586 | if (e.getValue() instanceof PyVisualElement) |
|---|
| | 587 | { |
|---|
| | 588 | return checkVisualElementReference((VisualElementProperty) e.getKey(), element, (iVisualElement)((PyVisualElement)e.getValue()).__tojava__(VisualElement.class)); |
|---|
| | 589 | } |
|---|
| | 590 | if (e.getValue() instanceof iVisualElement) |
|---|
| | 591 | { |
|---|
| | 592 | return checkVisualElementReference((VisualElementProperty) e.getKey(), element, (iVisualElement)e.getValue()); |
|---|
| | 593 | } |
|---|
| 583 | 594 | return true; |
|---|
| 584 | 595 | } |
|---|
| 585 | 596 | |
|---|
| | 597 | private boolean checkVisualElementReference(VisualElementProperty p, iVisualElement inside, iVisualElement potential) { |
|---|
| | 598 | List<iVisualElement> possible = StandardFluidSheet.allVisualElements(inside); |
|---|
| | 599 | if (!possible.contains(potential)) |
|---|
| | 600 | { |
|---|
| | 601 | warnings.add("warning: property " + p+ " inside " + inside.payload().get(iVisualElement.name) + " is persistent, yet holds a cross sheet reference to " + potential.payload().get(iVisualElement.name)); |
|---|
| | 602 | return false; |
|---|
| | 603 | } |
|---|
| | 604 | return true; |
|---|
| | 605 | } |
|---|
| | 606 | |
|---|
| 586 | 607 | } |
|---|
| r126 |
r140 |
|
| 211 | 211 | dragParticipants_list.beginDrag(((FrameManipulation) to.get()).resizeType, source, ((FrameManipulation) to.get()).originalFrame, ((FrameManipulation) to.get()).modifersDown); |
|---|
| 212 | 212 | } else if (prop == frameManipulationEnd) { |
|---|
| 213 | | dragParticipants_list.endDrag(((FrameManipulation) to.get()).resizeType, source, ((FrameManipulation) to.get()).originalFrame, (((FrameManipulation) to.get()).modifersDown & 256) != 0, ((FrameManipulation) to.get()).modifersDown); |
|---|
| | 213 | |
|---|
| | 214 | dragParticipants_list.endDrag(((FrameManipulation) to.get()).resizeType, source, ((FrameManipulation) to.get()).originalFrame, (((FrameManipulation) to.get()).modifersDown) == 256, ((FrameManipulation) to.get()).modifersDown); |
|---|
| 214 | 215 | } else if (prop == iVisualElement.hasFocusLock) { |
|---|
| 215 | 216 | if (((Ref<Boolean>) to).get()) { |
|---|
| r113 |
r140 |
|
| 500 | 500 | d.deselectAll(); |
|---|
| 501 | 501 | } |
|---|
| | 502 | System.out.println(" adding to selection"); |
|---|
| 502 | 503 | for (SelectionGroup<iComponent> d : getSelectionGroups()) |
|---|
| 503 | 504 | d.addToSelection(DraggableComponent.this); |
|---|
| 504 | | |
|---|
| | 505 | |
|---|
| 505 | 506 | DraggableComponent.this.setSelected(true); |
|---|
| 506 | 507 | justSelected = true; |
|---|
| … | … | |
| 643 | 644 | if (getInside() != null) |
|---|
| 644 | 645 | getInside().requestRedisplay(); |
|---|
| 645 | | |
|---|
| | 646 | |
|---|
| 646 | 647 | for (SelectionGroup g : getMarkingGroups()) { |
|---|
| 647 | 648 | g.register(this); |
|---|
| … | … | |
| 664 | 665 | if (getInside() != null) |
|---|
| 665 | 666 | getInside().requestRedisplay(); |
|---|
| 666 | | |
|---|
| | 667 | |
|---|
| 667 | 668 | for (SelectionGroup g : getSelectionGroups()) { |
|---|
| 668 | 669 | g.register(this); |
|---|
| … | … | |
| 716 | 717 | } |
|---|
| 717 | 718 | |
|---|
| 718 | | |
|---|
| | 719 | |
|---|
| 719 | 720 | @CachedPerUpdate |
|---|
| 720 | 721 | protected List<SelectionGroup<iComponent>> getMarkingGroups() { |
|---|