PipalOverlayEditor.mesa
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
Barth, January 28, 1988 5:34:41 pm PST
Louis Monier February 2, 1988 11:30:04 am PST
Bertrand Serlet January 31, 1988 6:42:44 pm PST
DIRECTORY Pipal, PipalEdit, PipalInt, PipalReal;
PipalOverlayEditor: CEDAR DEFINITIONS = BEGIN
Theory
Pipal overlay editor. Understands PipalInt.transformClass, PipalInt.translationClass, PipalInt.orientClass, and PipalReal.transformClass. All other objects are treated as primitives which may be pushed into if they have an edit method.
Class
overlayEditorClass: Pipal.Class;
OverlayEditor: TYPE = REF OverlayEditorRec;
OverlayEditorRec:
TYPE =
RECORD [
selected: Pipal.Objects ← NIL];
Basic Operations
Create:
PROC [overlay: Pipal.Overlay]
RETURNS [editor: PipalEdit.Editor];
Make an editor object.
Freeze:
PROC [editor: PipalEdit.Editor]
RETURNS [overlay: Pipal.Overlay];
Makes an overlay which reflects all actions since Create.
Edit:
PROC [editor: PipalEdit.Editor];
Checks that the selection set has a cardinality of one, passes through the child pointers of all classes which this editor understands, checks that the resultant object has an edit method, and then invokes it.
Errors: noSelection, multipleSelections, noEditMethod
Selection
Select:
PROC [editor: PipalEdit.Editor, exclusive:
BOOL ←
TRUE, remove:
BOOL ←
FALSE, style:
ATOM, pos1: PipalReal.Position, pos2: PipalReal.Position]
RETURNS [changedArea: Pipal.Object ←
NIL];
Commands:
name -> $Select
arguments -> ({$Add, $Exclusive}, {$Select, $Deselect}, {$Point, $Area, $Touch, $Close}, Position, Size)
resultType <- changedArea
name -> $SelectedOutlines
resultType <- selectionArea
Object Manipulation
InsertInt: PROC [editor: PipalEdit.Editor, child: Pipal.Object, position: PipalInt.Position, selectNew: BOOL ← TRUE];
InsertReal:
PROC [editor: PipalEdit.Editor, child: Pipal.Object, position: PipalReal.Position, selectNew:
BOOL ←
TRUE];
Insert the child into the overlay at the specified position.
Delete:
PROC [editor: PipalEdit.Editor]
RETURNS [changedArea: Pipal.Object ←
NIL];
Delete the selected items, empty the selection set.
Transformations
TransformInt: PROC [editor: PipalEdit.Editor, transformation: PipalInt.Transformation];
TransformReal: PROC [editor: PipalEdit.Editor, transformation: PipalReal.Transformation];
Transforms the selected set.
TranslateInt: PROC [editor: PipalEdit.Editor, vector: PipalInt.Vector];
TranslateReal: PROC [editor: PipalEdit.Editor, vector: PipalReal.Vector];
Translates the selected set.
Rotate: PROC [editor: PipalEdit.Editor];
Rotates the selected set by 90 degrees.
Mirror: PROC [editor: PipalEdit.Editor, inX: BOOL];
Mirrors the selected set.
END.