Squeak Class Documentation category index | class index  
 
ComplexBorder
  category: Morphic-Borders
  superclass: SimpleBorder
  subclasses:

poly _ polygon250

baseColor _ Color blue twiceLighter.
border _ (ComplexBorder framed: 10) baseColor: poly color.
border frameRectangle: ((100@100 extent: 200@200) insetBy: -5) on: Display getCanvas.
baseColor _ Color red twiceLighter.
border _ (ComplexBorder framed: 10) baseColor: baseColor.
border drawPolygon: {100@100. 300@100. 300@300. 100@300} on: Display getCanvas.

border drawPolyPatchFrom: 100@200 via: 100@100 via: 200@100 to: 200@200 on: Display getCanvas.
border drawPolyPatchFrom: 100@100 via: 200@100 via: 200@200 to: 100@200 on: Display getCanvas.
border drawPolyPatchFrom: 200@100 via: 200@200 via: 100@200 to: 100@100 on: Display getCanvas.
border drawPolyPatchFrom: 200@200 via: 100@200 via: 100@100 to: 200@100 on: Display getCanvas.

border _ (ComplexBorder raised: 10) baseColor: poly color.
border drawPolygon: poly getVertices on: Display getCanvas

360 / 16.0 22.5
points _ (0 to: 15) collect:[:i| (Point r: 100 degrees: i*22.5) + 200].
Display getCanvas fillOval: (100@100 extent: 200@200) color: baseColor.
border drawPolygon: points on: Display getCanvas.

-1 to: points size + 1 do:[:i|
border drawPolyPatchFrom: (points atWrap: i) via: (points atWrap: i+1) via: (points atWrap: i+2) to: (points atWrap: i+3) on: Display getCanvas.
].

Display getCanvas fillOval: (100@100 extent: 200@200) color: baseColor.
0 to: 36 do:[:i|
border drawLineFrom: (Point r: 100 degrees: i*10) + 200 to: (Point r: 100 degrees: i+1*10) + 200
on: Display getCanvas.
].
drawPolygon:
Point r: 1.0 degrees: 10
MessageTally spyOn:[
Display deferUpdates: true.
t1 _ [1 to: 1000 do:[:i|
border drawLineFrom: (100@100) to: (300@100) on: Display getCanvas.
border drawLineFrom: (300@100) to: (300@300) on: Display getCanvas.
border drawLineFrom: (300@300) to: (100@300) on: Display getCanvas.
border drawLineFrom: (100@300) to: (100@100) on: Display getCanvas]] timeToRun.
Display deferUpdates: false.
].

MessageTally spyOn:[
Display deferUpdates: true.
t2 _ [1 to: 1000 do:[:i|
border drawLine2From: (100@100) to: (300@100) on: Display getCanvas.
border drawLine2From: (300@100) to: (300@300) on: Display getCanvas.
border drawLine2From: (300@300) to: (100@300) on: Display getCanvas.
border drawLine2From: (100@300) to: (100@100) on: Display getCanvas]] timeToRun.
Display deferUpdates: false.
].

instance methods
  accessing
  colors
style
style:
widthForRounding

  color tracking
  trackColorFrom:

  drawing
  drawLineFrom:to:on:
drawPolyPatchFrom:to:on:usingEnds:
framePolygon2:on:
framePolygon:on:
frameRectangle:on:

  initialize
  releaseCachedState

  private
  colorsForDirection:
computeAltFramedColors
computeAltInsetColors
computeAltRaisedColors
computeColors
computeFramedColors
computeInsetColors
computeRaisedColors
fillStyleForDirection:
intersectFrom:with:to:with:

  testing
  isComplex

class methods
  instance creation
  style:

instance methods
  accessing top  
 

colors


 

style


 

style:


 

widthForRounding


  color tracking top  
 

trackColorFrom:

If necessary, update our color to reflect a change in aMorphs color


  drawing top  
 

drawLineFrom:to:on:

Here we're using the balloon engine since this is much faster than BitBlt w/ brushes.


 

drawPolyPatchFrom:to:on:usingEnds:


 

framePolygon2:on:


 

framePolygon:on:

Frame the given rectangle on aCanvas


 

frameRectangle:on:

Note: This uses BitBlt since it's roughly a factor of two faster for rectangles


  initialize top  
 

releaseCachedState

Release any associated cached state


  private top  
 

colorsForDirection:

Return an array of colors describing the receiver in the given direction


 

computeAltFramedColors


 

computeAltInsetColors


 

computeAltRaisedColors


 

computeColors


 

computeFramedColors


 

computeInsetColors


 

computeRaisedColors


 

fillStyleForDirection:

Fill the given form describing the receiver's look at a particular direction


 

intersectFrom:with:to:with:

Compute the intersection of two lines. Return nil if either
* the intersection does not exist, or
* the intersection is 'before' startPt, or
* the intersection is 'after' endPt


  testing top  
 

isComplex


class methods
  instance creation top  
 

style: