Squeak Class Documentation category index | class index  
 
Canvas
  category: Morphic-Support
  superclass: FlattenEncoder
  subclasses: FormCanvas PluggableCanvas PostscriptCanvas RemoteCanvas ColorMappingCanvas

A canvas is a two-dimensional medium on which morphs are drawn in a device-independent manner. Canvases keep track of the origin and clipping rectangle, as well as the underlying drawing medium (such as a window, pixmap, or postscript script).

Subclasses must implement (at least) the following methods:
* Drawing:
#fillOval:color:borderWidth:borderColor:
#frameAndFillRectangle:fillColor:borderWidth:borderColor:
#drawPolygon:color:borderWidth:borderColor:
#image:at:sourceRect:rule:
#stencil:at:sourceRect:rule:
#line:to:width:color:
#paragraph:bounds:color:
#text:bounds:font:color:
* Support
#clipBy:during:
#translateBy:during:
#translateBy:clippingTo:during:
#transformBy:clippingTo:during:

instance methods
  Nebraska/embeddedWorlds
  displayIsFullyUpdated
transform2By:clippingTo:during:smoothing:

  accessing
  clipRect
contentsOfArea:
contentsOfArea:into:
depth
extent
form
origin
shadowColor
shadowColor:

  converting
  asAlphaBlendingCanvas:
asShadowDrawingCanvas
asShadowDrawingCanvas:

  copying
  copy
copyClipRect:

  drawing
  fillColor:
line:to:brushForm:
line:to:color:
line:to:width:color:
line:to:width:color:dashLength:secondColor:secondDashLength:startingOffset:
line:to:width:color:stepWidth:secondWidth:secondColor:secondStepWidth:
paragraph2:bounds:color:
paragraph:bounds:color:
point:color:
render:
text:at:font:color:
text:bounds:font:color:

  drawing-general
  draw:
drawMorph:
fullDraw:
fullDrawMorph:
roundCornersOf:during:

  drawing-images
  drawImage:at:
drawImage:at:sourceRect:
paintImage:at:
paintImage:at:sourceRect:
stencil:at:color:
stencil:at:sourceRect:color:
translucentImage:at:
translucentImage:at:sourceRect:

  drawing-obsolete
  image:at:
image:at:rule:
imageWithOpaqueWhite:at:

  drawing-ovals
  fillOval:color:
fillOval:color:borderWidth:borderColor:
fillOval:fillStyle:
fillOval:fillStyle:borderWidth:borderColor:
frameOval:color:
frameOval:width:color:

  drawing-polygons
  drawPolygon:color:borderWidth:borderColor:
drawPolygon:fillStyle:
drawPolygon:fillStyle:borderWidth:borderColor:

  drawing-rectangles
  fillRectangle:color:
fillRectangle:fillStyle:
fillRectangle:fillStyle:borderStyle:
frameAndFillRectangle:fillColor:borderWidth:borderColor:
frameAndFillRectangle:fillColor:borderWidth:topLeftColor:bottomRightColor:
frameRectangle:color:
frameRectangle:width:color:

  drawing-support
  cache:using:during:
clipBy:during:
preserveStateDuring:
transformBy:clippingTo:during:
transformBy:clippingTo:during:smoothing:
translateBy:during:
translateTo:clippingTo:during:

  initialization
  finish
flush
reset

  other
  flushDisplay
forceToScreen:
translateBy:clippingTo:during:

  private
  image:at:sourceRect:rule:
image:at:sourceRect:rule:alpha:

  testing
  doesRoundedCorners
isBalloonCanvas
isShadowDrawing
isVisible:
seesNothingOutside:

class methods
  configuring
  filterSelector

instance methods
  Nebraska/embeddedWorlds top  
 

displayIsFullyUpdated


 

transform2By:clippingTo:during:smoothing:

an attempt to use #displayInterpolatedOn: instead of WarpBlt.


  accessing top  
 

clipRect

Return the currently active clipping rectangle


 

contentsOfArea:

Return the contents of the given area


 

contentsOfArea:into:

Return the contents of the given area


 

depth


 

extent

Return the physical extent of the output device


 

form


 

origin

Return the current origin for drawing operations


 

shadowColor

Return the current override color or nil if no such color exists


 

shadowColor:

Set a shadow color. If set this color overrides any client-supplied color.


  converting top  
 

asAlphaBlendingCanvas:


 

asShadowDrawingCanvas


 

asShadowDrawingCanvas:


  copying top  
 

copy

Answer another instance just like the receiver. Subclasses typically
override this method; they typically do not override shallowCopy.


 

copyClipRect:


  drawing top  
 

fillColor:

Fill the receiver with the given color.
Note: This method should be named differently since it is intended to fill the background and thus fills even if the color is transparent


 

line:to:brushForm:

Obsolete - will be removed in the future


 

line:to:color:


 

line:to:width:color:

Draw a line using the given width and color


 

line:to:width:color:dashLength:secondColor:secondDashLength:startingOffset:

Draw a line using the given width, colors and dash lengths.
Originally written by Stephan Rudlof; tweaked by Dan Ingalls
to use startingOffset for sliding offset as in 'ants' animations.
Returns the sum of the starting offset and the length of this line.


 

line:to:width:color:stepWidth:secondWidth:secondColor:secondStepWidth:

Draw a line using the given width, colors and steps; both steps can
have different stepWidths (firstStep, secondStep), draw widths and
colors.


 

paragraph2:bounds:color:


 

paragraph:bounds:color:

Draw the given paragraph


 

point:color:

Obsolete - will be removed in the future


 

render:

Do some 3D operations with the object if possible


 

text:at:font:color:


 

text:bounds:font:color:

Draw the given string in the given font and color clipped to the given rectangle. If the font is nil, the default font is used.


  drawing-general top  
 

draw:


 

drawMorph:


 

fullDraw:


 

fullDrawMorph:


 

roundCornersOf:during:


  drawing-images top  
 

drawImage:at:

Draw the given Form, which is assumed to be a Form or ColorForm


 

drawImage:at:sourceRect:

Draw the given form.


 

paintImage:at:

Draw the given Form, which is assumed to be a Form or ColorForm following the convention that zero is the transparent pixel value.


 

paintImage:at:sourceRect:

Draw the given Form, which is assumed to be a Form or ColorForm following the convention that zero is the transparent pixel value.


 

stencil:at:color:

Flood this canvas with aColor wherever stencilForm has non-zero pixels


 

stencil:at:sourceRect:color:

Flood this canvas with aColor wherever stencilForm has non-zero pixels


 

translucentImage:at:

Draw a translucent image using the best available way of representing translucency.


 

translucentImage:at:sourceRect:

Draw a translucent image using the best available way of representing translucency.
Note: This will be fixed in the future.


  drawing-obsolete top  
 

image:at:

Note: This protocol is deprecated. Use #paintImage: instead.


 

image:at:rule:

Note: This protocol is deprecated. Use one of the explicit image drawing messages (#paintImage, #drawImage) instead.


 

imageWithOpaqueWhite:at:

Note: This protocol is deprecated. Use #drawImage: instead


  drawing-ovals top  
 

fillOval:color:


 

fillOval:color:borderWidth:borderColor:

Fill the given oval.


 

fillOval:fillStyle:

Fill the given oval.


 

fillOval:fillStyle:borderWidth:borderColor:

Fill the given oval.
Note: The default implementation does not recognize any enhanced fill styles


 

frameOval:color:


 

frameOval:width:color:


  drawing-polygons top  
 

drawPolygon:color:borderWidth:borderColor:

Draw the given polygon.


 

drawPolygon:fillStyle:

Fill the given polygon.


 

drawPolygon:fillStyle:borderWidth:borderColor:

Fill the given polygon.
Note: The default implementation does not recognize any enhanced fill styles


  drawing-rectangles top  
 

fillRectangle:color:

Fill the rectangle using the given color


 

fillRectangle:fillStyle:

Fill the given rectangle.
Note: The default implementation does not recognize any enhanced fill styles


 

fillRectangle:fillStyle:borderStyle:

Fill the given rectangle.


 

frameAndFillRectangle:fillColor:borderWidth:borderColor:

Draw the rectangle using the given attributes


 

frameAndFillRectangle:fillColor:borderWidth:topLeftColor:bottomRightColor:

Draw the rectangle using the given attributes.
Note: This is a *very* simple implementation


 

frameRectangle:color:


 

frameRectangle:width:color:


  drawing-support top  
 

cache:using:during:

Cache the execution of aBlock by the given cache.
Note: At some point we may want to actually *create* the cache here;
for now we're only using it.


 

clipBy:during:

Set a clipping rectangle active only during the execution of aBlock.
Note: In the future we may want to have more general clip shapes - not just rectangles


 

preserveStateDuring:

Preserve the full canvas state during the execution of aBlock


 

transformBy:clippingTo:during:

Transform the receiver by the given display transformation during the execution of aBlock. The given clip rectangle defines the *global* (e.g., outer) rectangle against which the receiver should clip (which would be equivalent to 'self clipRect: aClipRect; transformBy: aDisplayTransform').


 

transformBy:clippingTo:during:smoothing:

Transform the receiver by the given display transformation during the execution of aBlock. The given clip rectangle defines the *global* (e.g., outer) rectangle against which the receiver should clip (which would be equivalent to 'self clipRect: aClipRect; transformBy: aDisplayTransform').


 

translateBy:during:

Set a translation only during the execution of aBlock.


 

translateTo:clippingTo:during:

Set a new origin and clipping rectangle only during the execution of aBlock.


  initialization top  
 

finish

If there are any pending operations on the receiver complete them. Do not return before all modifications have taken effect.


 

flush


 

reset

Reset the canvas.


  other top  
 

flushDisplay

Dummy .


 

forceToScreen:

dummy


 

translateBy:clippingTo:during:


  private top  
 

image:at:sourceRect:rule:

Note: The public use of this protocol is deprecated. It will become private. Nobody in the outside world must assume that a thing like a combination rule has any specific effect.


 

image:at:sourceRect:rule:alpha:

Privately used for blending forms w/ constant alpha. Fall back to simpler case by defaul.


  testing top  
 

doesRoundedCorners


 

isBalloonCanvas


 

isShadowDrawing


 

isVisible:

Return true if the given rectangle is (partially) visible


 

seesNothingOutside:

Return true if this canvas will not touch anything outside aRectangle


class methods
  configuring top  
 

filterSelector