Squeak Class Documentation category index | class index  
 
Path
  category: ST80-Paths
  superclass: DisplayObject
  subclasses: Spline CurveFitter Line LinearFit Arc

I am the abstract superclass of the Graphic spatial primitives. I represent an ordered sequence of Points. Spatial primitives are used to generate "trajectories" such as lines and circles.

instance methods
  accessing
  at:
at:put:
first
firstPoint
firstPoint:
form
form:
last
offset
secondPoint
secondPoint:
size
thirdPoint
thirdPoint:

  adding
  add:

  display box access
  computeBoundingBox

  displaying
  displayOn:at:clippingBox:rule:fillColor:
displayOn:transformation:clippingBox:rule:fillColor:

  enumerating
  collect:
select:

  private
  initializeCollectionOfPoints
initializeCollectionOfPoints:

  removing
  removeAllSuchThat:

  testing
  isEmpty

  transforming
  scaleBy:
translateBy:

class methods
  examples
  example

  instance creation
  new
new:

instance methods
  accessing top  
 

at:

Answer the point on the receiver's path at position index.


 

at:put:

Store the argument, aPoint, as the point on the receiver's path at position
index.


 

first

Answer the first point on the receiver's path; included to correspond to
OrderedCollection protocol.


 

firstPoint

Answer the first point on the receiver's path.


 

firstPoint:

Replace the first element of the receiver with the new value aPoint.
Answer the argument aPoint.


 

form

Answer the receiver's form, or, if form is nil, then answer a 1 x 1 black
form (a black dot).


 

form:

Make the argument, aForm, be the receiver's form.


 

last

Answer the last point on the receiver's path; included to correspond to
OrderedCollection protocol.


 

offset

There are basically two kinds of display objects in the system: those
that, when asked to transform themselves, create a new object; and those
that side effect themselves by maintaining a record of the transformation
request (typically an offset). Path, like Rectangle and Point, is a display
object of the first kind.


 

secondPoint

Answer the second element of the receiver.


 

secondPoint:

Replace the second element of the receiver with the new value aPoint.
Answer the argument aPoint.


 

size

Answer the length of the receiver.


 

thirdPoint

Answer the third element of the receiver.


 

thirdPoint:

Replace the third element of the receiver with the new value aPoint.
Answer the argument aPoint.


  adding top  
 

add:

Include aPoint as one of the receiver's elements.


  display box access top  
 

computeBoundingBox

Refer to the comment in DisplayObject|computeBoundingBox.


  displaying top  
 

displayOn:at:clippingBox:rule:fillColor:

Display this Path--offset by aPoint, clipped by clipRect and the form
associated with this Path will be displayedr according to one of the sixteen
functions of two logical variables (rule). Also the source form will be first
anded with aForm as a mask. Does not effect the state of the Path


 

displayOn:transformation:clippingBox:rule:fillColor:

Displays this path, translated and scaled by aTransformation. Get the
scaled and translated Path.


  enumerating top  
 

collect:

Evaluate aBlock with each of the receiver's elements as the argument.
Collect the resulting values into a path that is like the receiver. Answer
the new path.


 

select:

Evaluate aBlock with each of the receiver's elements as the argument.
Collect into a new path like the receiver only those elements for which
aBlock evaluates to true. Answer the new path.


  private top  
 

initializeCollectionOfPoints


 

initializeCollectionOfPoints:


  removing top  
 

removeAllSuchThat:

Evaluate aBlock for each element of the receiver.
Remove each element for which aBlock evaluates to true.


  testing top  
 

isEmpty


  transforming top  
 

scaleBy:

Answers a new Path scaled by aPoint. Does not affect the current data in
this Path.


 

translateBy:

Answers a new Path whose elements are translated by aPoint. Does not
affect the elements of this Path.


class methods
  examples top  
 

example

Creates a Path from mousePoints and displays it several ways on the display screen. Messes up the display. For learning about class Path, just select the code below and execute it to create a path and see it redisplayed in another place on the screen. Each path displays using a different form. A path is indicated by pressing the red mouse button in a sequence; press any other mouse button to terminate.


  instance creation top  
 

new

Answer a new instance of the receiver (which is a class) with no indexable variables. Fail if the class is indexable.


 

new:

Answer an instance of this class with the number of indexable
variables specified by the argument, sizeRequested.