Squeak Class Documentation category index | class index  
 
GraphMorph
  category: Morphic-Widgets
  superclass: RectangleMorph
  subclasses:

I display a graph of numbers, normalized so the full range of values just fits my height. I support a movable cursor that can be dragged with the mouse.

Implementation notes: Some operations on me may be done at sound sampling rates (e.g. 11-44 thousand times/second). To allow such high bandwidth application, certain operations that change my appearance do not immediately report a damage rectangle. Instead, a flag is set indicating that my display needs to refreshed and a step method reports the damage rectangle if that flag is set. Also, I cache a bitmap of my graph to allow the cursor to be moved without redrawing the graph.

instance methods
  accessing
  color:
cursor
cursor:
cursorAtEnd
cursorColor
cursorColor:
cursorColorAtZeroCrossing
cursorColorAtZeroCrossings:
cursorWrapped:
data
data:
dataColor
dataColor:
interpolatedValueAtCursor
lastValue
lastValue:
startIndex
startIndex:
valueAtCursor
valueAtCursor:

  change reporting
  layoutChanged

  commands
  appendValue:
centerCursor
clear
loadSineWave
loadSound:
loadSoundData:
playOnce
reverse

  drawing
  drawOn:

  events
  handlesMouseDown:
mouseMove:

  initialization
  initialize

  menu
  addCustomMenuItems:hand:
openWaveEditor
readDataFromFile

  object fileIn
  convertToCurrentVersion:refStream:

  private
  drawCursorOn:
drawDataOn:
flushCachedForm
keepIndexInView:

  script support
 

  stepping
  step

class methods
  parts bin
  descriptionForPartsBin

  scripting
  additionsToViewerCategories

instance methods
  accessing top  
 

color:

Set the receiver's color. Directly set the color if appropriate, else go by way of fillStyle


 

cursor

vacuous backstop in case it gets sent to a morph that doesn't know what to do with it


 

cursor:

vacuous backstop in case it gets sent to a morph that doesn't know what to do with it


 

cursorAtEnd


 

cursorColor


 

cursorColor:


 

cursorColorAtZeroCrossing


 

cursorColorAtZeroCrossings:


 

cursorWrapped:


 

data


 

data:


 

dataColor


 

dataColor:


 

interpolatedValueAtCursor


 

lastValue


 

lastValue:


 

startIndex


 

startIndex:


 

valueAtCursor


 

valueAtCursor:


  change reporting top  
 

layoutChanged


  commands top  
 

appendValue:


 

centerCursor

Scroll so that the cursor is as close as possible to the center of my window.


 

clear


 

loadSineWave


 

loadSound:


 

loadSoundData:


 

playOnce


 

reverse


  drawing top  
 

drawOn:


  events top  
 

handlesMouseDown:

Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?


 

mouseMove:

Handle a mouse move event. The default response is to let my eventHandler, if any, handle it.


  initialization top  
 

initialize


  menu top  
 

addCustomMenuItems:hand:

Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.


 

openWaveEditor


 

readDataFromFile


  object fileIn top  
 

convertToCurrentVersion:refStream:

subclasses should implement if they wish to convert old instances to modern ones


  private top  
 

drawCursorOn:


 

drawDataOn:


 

flushCachedForm


 

keepIndexInView:


  script support top  

  stepping top  
 

step

Make a deferred damage rectangle if I've changed. This allows applications to call methods that invalidate my display at high-bandwidth without paying the cost of doing the damage reporting on ever call; they can merely set hasChanged to true.


class methods
  parts bin top  
 

descriptionForPartsBin

If the receiver is a member of a class that would like to be represented in a parts bin, answer the name by which it should be known, and a documentation string to be provided, for example, as balloon help. When the 'nativitySelector' is sent to the 'globalReceiver', it is expected that some kind of Morph will result. The parameters used in the implementation below are for documentation purposes only!


  scripting top  
 

additionsToViewerCategories

Answer a list of (<categoryName> <list of category specs>) pairs that characterize the phrases this kind of morph wishes to add to various Viewer categories.