home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / jËzyki_programowania / oberon / text / kepler.text (.txt) < prev    next >
Oberon Text  |  1977-12-31  |  16KB  |  271 lines

  1. Syntax12b.Scn.Fnt
  2. ParcElems
  3. Alloc
  4. Syntax10.Scn.Fnt
  5. Syntax24.Scn.Fnt
  6. Syntax12.Scn.Fnt
  7. KeplerElems
  8. Alloc
  9. KeplerGraphs
  10. GraphDesc
  11. KeplerGraphs
  12. StarDesc
  13. Kepler5
  14. StarDesc
  15. KeplerGraphs
  16. GraphDesc
  17. KeplerGraphs
  18. StarDesc
  19. Kepler1
  20. RectangleDesc
  21. KeplerFrames
  22. ButtonDesc
  23. Kepler1.NewRectangle
  24. Kepler5
  25. StarDesc
  26. KeplerGraphs
  27. GraphDesc
  28. KeplerGraphs
  29. StarDesc
  30. Kepler2
  31. OffsetDesc
  32. KeplerGraphs
  33. ConsDesc
  34. Kepler1
  35. RectangleDesc
  36. KeplerFrames
  37. ButtonDesc
  38. Kepler1.NewRectangle
  39. Kepler1
  40. LineDesc
  41. Kepler1.NewLine
  42. Kepler1.NewString
  43. Kepler4
  44. GalaxyDesc
  45. Kepler1
  46. HShapeDesc
  47. )*+    Kepler5
  48. StarDesc
  49. Kepler1
  50. H90ShapeDesc
  51. Kepler1
  52. CircleDesc
  53. Kepler1.NewCircle
  54. Kepler5
  55. SelStarDesc
  56. Kepler.Join
  57. Kepler.Split
  58. Kepler1.NewHShape
  59. Kepler1.NewH90Shape
  60. Kepler1
  61. TextureDesc
  62. Kepler.AlignY
  63. Kepler.AlignToGrid
  64. Kepler1
  65. EllipseDesc
  66. Kepler1.NewEllipse
  67. Kepler1
  68. StringDesc
  69. String
  70. Syntax10.Scn.Fnt
  71. Syntax10.Scn.Fnt
  72. Kepler7.NewText
  73. Kepler1
  74. AttrDesc
  75. (0, 0)
  76. Syntax10.Scn.Fnt
  77. Kepler.Reset
  78. Kepler5
  79. StarDesc2
  80. A sample palette
  81. Syntax10.Scn.Fnt
  82. Kepler.AlignX
  83. KeplerGraphs
  84. GraphDesc
  85. KeplerGraphs
  86. StarDesc
  87. Kepler5
  88. StarDesc2
  89. KeplerGraphs
  90. GraphDesc
  91. KeplerGraphs
  92. StarDesc
  93. Kepler1
  94. LineDesc
  95. Kepler5
  96. StarDesc2
  97. KeplerGraphs
  98. GraphDesc
  99. KeplerGraphs
  100. StarDesc
  101. Kepler5
  102. PlanetDesc
  103. KeplerGraphs
  104. GraphDesc
  105. KeplerGraphs
  106. StarDesc
  107. Kepler2
  108. FractionDesc
  109. KeplerGraphs
  110. ConsDesc
  111. Kepler1
  112. LineDesc
  113. Syntax8.Scn.Fnt
  114. Kepler
  115. J. Templ, 27.09.93
  116. Kepler is an experimental tool for editing two dimensional line drawings. A Kepler graph consists of a list of points (stars) and a list of objects (constellations) based on a number of stars. Direct manipulation is provided on the level of stars rather than on the level of constellations. If one moves a star, then all constellations depending on this star are moved too. Stars may be used by more than one constellation, e.g. the end point of a line may be the start point of another line (polygon). Beside points entered with the mouse, Kepler supports points (Planets) whose position depend on other points. The possibility to calculate the position of points brings a limited form of constraints into the editor. Kepler may also be used to construct graphical command interfaces by means of buttons. A button is a sensitive rectangular area, that gets control whenever a mouse click happens inside the button. Kepler tries to support both terminal based and host based display systems by giving the user the control over graphical animation of editing operations.
  117. Kepler tries to follow the Oberon conventions for mouse usage as close as possible.
  118. Mouse Buttons:
  119. primary    secondary
  120. left        set new focus point or move focus point
  121. left    middle    copy selection
  122. left    right    [activate star marked button] drag point
  123. middle        move selection
  124. middle    left    drag selection
  125. middle    right    drag origin
  126. right        extend selection
  127. right    left    delete selection
  128. right    middle    copy over
  129. left + middle + right    cancel
  130. Kepler.Open file [grid]
  131. opens a viewer and loads a graph from file. If file does not exist a new graph is opened. The optional grid argument (default = 5) specifies the mouse alignment as described in Kepler.SetGrid.
  132. Kepler.Store
  133. analogous to Edit.Store. Creates a backup file by appending the suffix ".Bak" to the file name.
  134. Kepler.Print printer [n] (* | file)
  135. prints n copies (default: n = 1) of the star marked graphics or the graphics in the specified file.
  136. Kepler.SetGrid n
  137. sets the grid (mouse alignment) of the star marked Kepler frame to n pixels. The grid is always aligned to the origin of the graph but is invariant against zooming.
  138. Kepler.SetScale n
  139. sets the scaling factor of the star marked Kepler frame to n.
  140. Meaningful numbers for n are 1, 2, 4, or 8 where 1 means 300dpi laser printer resolution and 4 is the default value.
  141. Kepler.Reset
  142. resets the origin of the star-marked Kepler graph.
  143. KeplerElems.Insert
  144. inserts an element that may contain a Kepler graph at the caret position into a text. Middle clicking the new element opens a viewer with a copy of the (initially empty) graph and sets a default mouse grid. A left mouse click focuses the element for "in-situ" editing. KeplerElems preserve the mouse grid of a graph.
  145. KeplerElems.Update
  146. calculates the new bounding box of the graph and updates the edited element.
  147. Inserting Objects
  148. To insert new objects into a graph proceed in the following two steps:
  149. 1. draw the points that define the object (focus points). Click the left mouse button to draw a new focus point. The focus may be an arbitrary number of points (e.g. 
  150.  ). Pressing the escape key removes all focus points, pressing the backspace key removes the last one. As a side effect, defining a focus point also results in acquiring  the keyboard focus.
  151. 2. execute a command that inserts the object at the focus position (e.g. Kepler1.NewRectangle which needs two focus points). An alternative way of activating the NewRectangle command is to activate a button associated with the NewRectangle command(e.g. 
  152.  in the palette below for Kepler1.NewRectangle). Mouse clicks within buttons have the following standard behaviour.
  153. primary    secondary
  154. middle        execute command
  155. middle    right    show command
  156. An alternative way to insert an object is to define a new focus point (mouse left) and interclicking the right mouse button in order to activate the star marked button, i.e. the button that is marked by the global Oberon Star marker.
  157. Note that graphical tools (e.g. the one shown below) are normal Kepler graphs, hence, they may be customized and extended to fit the user's needs.
  158. Text Captions
  159. A text caption is a single_line text displayed in a single font relative to a single point. Alignment is either base_left, base_right, base_centered or centered (0, 1, 2, 3 resp.). Text captions may be inserted into a graphics by setting a focus point and typing characters or by "copying over" the most recent text selection. Terminating a caption with TAB or CR opens a new caption with the same attributes at the next focus point. The commands Kepler1.ChangeFont and Kepler1.ChangeAlign may be used to change the corresponding attribute of the selected captions.
  160. Selecting Objects
  161. Dragging the mouse while pressing the right button defines a selection rectangle. Releasing the mouse extends the selection by all points within this area. Pressing the escape key deselects all points, right clicking a point (without dragging) toggles the selection state of this point. Right clicking within the bounding box of an object (without dragging) selects all points of the object. Selection is always performed on the level of points rather than on the level of objects. Objects are selected indirectly by selecting their defining points. Therefore, an object may be unselected, partially selected, or totally selected. Several operations (move, copy, delete) may be applied to the selection.
  162. Moving Objects
  163. Dragging the mouse while pressing the middle button defines a move vector. Releasing the mouse moves all selected points by the defined vector. Interclicking the left button results in graphical animation. Interclicking the right button (but not both) results in moving the origin of the frame by the defined vector (scrolling). The cursur keys (up, down, left, and right) may be used for moving the selection by one screen pixel.
  164. Copying Objects
  165. Defining a move vector by two focus points, interclicking the middle button and releasing the mouse copies all fully selected objects of the most recent selection and moves the copied objects by the given vector. Another way of copying is to define the move vector first, then make a selection with middle interclick and release the mouse (copyover). Objects may be copied across viewer boundaries.
  166. Deleting Objects
  167. selecting points and interclicking the left button deletes all fully selected objects. Pressing the DEL-key deletes all objects that are at least partially selected. The command Kepler.Recall may be used to undo the most recent deletion.
  168. Reusing Points
  169. existing points may be reused for other objects by making them focus points again (left mouse button). Reusing points may be useful e.g. for constructing polygons out of straight lines where the end point of a line segment is the start point of the next one. Reused focus points may be continously dragged by interclicking the right mouse button. They are marked as 
  170.  to distinct them from newly entered points (e.g. 
  171. Commands working on a set of selected points are:
  172. Kepler.Split
  173. splits all selected points that are used by more than one object.
  174. Kepler.Join
  175. takes one focus point and merges all selected points into this point.
  176. Kepler.Constellations [minstate]
  177. opens a viewer and shows all constellations with state >= minstate. Meaningful values for minstate are 0 (all), 1 (partially selected=default), or 2 (fully selected)..  For each constellation a surrogate and the type name is displayed. Kepler.Delete and Kepler.SendBack may be a applied to the selected line.
  178. Kepler.AlignX
  179. takes one focus point and aligns the selected points in the focus graph to the x coordinate of the focus point.
  180. Kepler.AlignY
  181. takes one focus point and aligns the selected points in the focus graph to the y coordinate of the focus point.
  182. Kepler.AlignToGrid
  183. aligns the selected points in the star marked viewer to grid positions.
  184. Kepler.ScalePoints
  185. takes three focus points and applies a linear transformation to the selected points such that the first focus point is invariant, and the second is moved to the third.
  186. Planets
  187. are points whose position is not defined interactively but by the result of a computation depending on the constellation of other points. A planet is automatically repositioned whenever its underlying constellation is changed. Planets may be selected (represented as 
  188. ), copied and deleted like other constellations. An example for a planet is the middle point between two points: 
  189. Available Extensions
  190. The following lists some already existing extensions together with their expected arguments where (n) means the number of focus points. Note that the module names have simply be enumerated because they are not intended to be exposed to the user (they are normally hidden behind buttons).
  191. Kepler1: some elementary constellation classes
  192.     Rectangle (2)
  193.     Texture n (2)
  194.     Triangle n (3)
  195.     Circle (2)
  196.     Ellipse (3)
  197.     Line (2)
  198.     String (1, [align] text selection)
  199.         align: 0 = left, 1 = center, 2 = right, 3 = centerXY
  200.         "Kepler1.ChangeFont fntname" may be used to change the font of selected strings.
  201.         "Kepler1.ChangeAlign align"  may be used to change the alignment of selected strings.
  202.     AttrLine width arr1 arr2 (2)
  203.         a line with given width and arrows (0 means no arrow, 1 means default arrow)
  204.         "Kepler1.ChangeAttrLine width attr1 attr2" may be used to change the attributes of selected lines.
  205.     HShape (3)
  206.     H90Shape (3)
  207. Kepler2: some planet classes
  208.     Fractions n (2)
  209.         division of a line into n equidistant parts
  210.     Offset dx dy (1)
  211.         a point that has offset dx, dy from another point
  212.     XY (2)
  213.         a point with x coordinate taken from the first focus point and y coordinate taken from the second.
  214. Kepler4: some auxiliary constelation classes
  215.     Icon (1, star marker, [text selection])
  216.         associates the marked viewer with an icon at focus position. The optional text selection specifies the
  217.         command for opening the document. A middle click opens the (closed) viewer, a middle-left click
  218.         opens the document.
  219.     Button (2, text selection)
  220.         defines a sensitive rectangular area and associates it with the selected command.
  221.         Kepler4.UpdateButton updates the marked button with the most recent text selection.
  222. Kepler5: some constellation classes useful to draw buttons in a palette
  223.     FocusStar (1)
  224.     FocusStar2 (1)
  225.     Planet (1)
  226.     SelStar (1)
  227. Kepler6: some spline classes
  228.     Bezier    (>= 4)
  229.         Bezier splines
  230.     CRSpline    (>= 4)
  231.         Cattmull-Rom splines (also known as Overhauser splines)
  232. Kepler7: a text class
  233.     Text (1, text selection)
  234.         a button representing a text. Middle clicking the text opens an auxiliary viewer to edit the text.
  235. Kepler8: some classes useful for drawing diagrams
  236.     AttrRect (2, rectTexture, lineWidth, shadowTexture, shadowWidth, cornerRadius)
  237.         a rectangle with given attributes
  238.     FilledCircle (2, texture)
  239.         a circle with given texture
  240.     RectIntersect (3)
  241.         an intersection point of a line with a rectangle
  242.     CircleIntersect (3)
  243.         an intersection point of a line with a circle
  244.     EllipseIntersect (4)
  245.         an intersection point of a line with an ellipse
  246. Kepler9: some planet classes useful for geometric constructions
  247.     CircleIntersection (4)
  248.         the cutting points between two circles
  249.     CircleLineIntersection (4)
  250.         the cutting points between a circle and a line
  251.     Extension (2)
  252.         the end point of a line with doubled length
  253.     LineIntersection (4)
  254.         the cutting point between two lines
  255.     Parallel (3)
  256.         the end point of a line parallel to another line
  257.     RightAngle (3)
  258.         the cutting point of two lines forming a right angle
  259.     Tangent (3)
  260.         the tangent points on a circle
  261. The rules for setting the focus points in the right order are
  262. - round shapes first
  263. - shapes with multiple points before single points
  264. Design Notes
  265. Kepler has been designed as an extensible application, i.e. it consists of a kernel part and a potentially unlimited number of extensions. The kernel part deals only with abstract objects and has no idea of lines, rectangles, circles, or the like. It is decomposed into three modules following the canonical decomposition of Oberon applications (KeplerGraphics, KeplerFrames, Kepler). Functionality is added by implementing concrete classes, in particular by defining subtypes of planets or constellations and thereby filling in the abstract method slots. To simplify the implementation of concrete object classes, several design decisions have been taken:
  266. 1. the constellations are not concerned with editing themself
  267. 2. drawing, erasing, printing and zooming have been unified (KeplerPorts)
  268. 3. support for generic instantiation (Files, Types)
  269. 4. max. three methods to override for a new class
  270. File: Kepler.Text
  271.