eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'SimpleFunctionGraphView':

Home

everywhere
www.exept.de
for:
[back]

Class: SimpleFunctionGraphView


Inheritance:

   Object
   |
   +--GraphicsContext
      |
      +--DeviceGraphicsContext
         |
         +--GraphicsMedium
            |
            +--DisplaySurface
               |
               +--SimpleView
                  |
                  +--View
                     |
                     +--SimpleFunctionGraphView

Package:
stx:libwidg3
Category:
Views-Misc
Version:
rev: 1.2 date: 1997/10/30 01:24:30
user: cg
file: SimpleFunctionGraphView.st directory: libwidg3
module: stx stc-classLibrary: libwidg3
Author:
Claus Gittinger

Description:


UNDER CONSTRUCTION

displays the graph of a function.
TODO: grid & scale drawing.


Instance protocol:

accessing
o  displayModeHolder
return the value of the instance variable 'displayModeHolder' (automatically generated)

o  displayModeHolder: something
set the value of the instance variable 'displayModeHolder' (automatically generated)

o  function: aBlock

o  functionHolder
return the value of the instance variable 'functionHolder' (automatically generated)

o  functionHolder: something
set the value of the instance variable 'functionHolder' (automatically generated)

o  graphColorHolder
return the value of the instance variable 'graphColorHolder' (automatically generated)

o  graphColorHolder: something
set the value of the instance variable 'graphColorHolder' (automatically generated)

o  gridColorHolder
return the value of the instance variable 'gridColorHolder' (automatically generated)

o  gridColorHolder: something
set the value of the instance variable 'gridColorHolder' (automatically generated)

o  invalidColorHolder
return the value of the instance variable 'invalidColorHolder' (automatically generated)

o  invalidColorHolder: something
set the value of the instance variable 'invalidColorHolder' (automatically generated)

o  markInvalidHolder
return the value of the instance variable 'markInvalidHolder' (automatically generated)

o  markInvalidHolder: something
set the value of the instance variable 'markInvalidHolder' (automatically generated)

o  maxXHolder
return the value of the instance variable 'maxXHolder' (automatically generated)

o  maxXHolder: something
set the value of the instance variable 'maxXHolder' (automatically generated)

o  maxYHolder
return the value of the instance variable 'maxYHolder' (automatically generated)

o  maxYHolder: something
set the value of the instance variable 'maxYHolder' (automatically generated)

o  minXHolder
return the value of the instance variable 'minXHolder' (automatically generated)

o  minXHolder: something
set the value of the instance variable 'minXHolder' (automatically generated)

o  minYHolder
return the value of the instance variable 'minYHolder' (automatically generated)

o  minYHolder: something
set the value of the instance variable 'minYHolder' (automatically generated)

o  showGridHolder
return the value of the instance variable 'showGridHolder' (automatically generated)

o  showGridHolder: something
set the value of the instance variable 'showGridHolder' (automatically generated)

o  showUnitsXHolder
return the value of the instance variable 'showUnitsXHolder' (automatically generated)

o  showUnitsXHolder: something
set the value of the instance variable 'showUnitsXHolder' (automatically generated)

o  showUnitsYHolder
return the value of the instance variable 'showUnitsYHolder' (automatically generated)

o  showUnitsYHolder: something
set the value of the instance variable 'showUnitsYHolder' (automatically generated)

o  unitColorHolder
return the value of the instance variable 'unitColorHolder' (automatically generated)

o  unitColorHolder: something
set the value of the instance variable 'unitColorHolder' (automatically generated)

change & update
o  sizeChanged: how

o  update: something with: someArgument from: changedObject
something changed - for now, do a full redraw

drawing
o  chooseGrid

o  computeGraph
compute the graph

o  redrawX: x y: y width: w height: h
redraw the graph

o  test: arg
redraw the graph


Examples:



        |top graphView|

        top := StandardSystemView extent:300@300.
        graphView := SimpleFunctionGraphView origin:0.0@0.0 corner:1.0@1.0 in:top.

        graphView minXHolder:(-5 asValue).
        graphView maxXHolder:(5 asValue).
        graphView minYHolder:(-2 asValue).
        graphView maxYHolder:(2 asValue).

        graphView function:[:x | x sin].

        top open.


        |top graphView|

        top := StandardSystemView extent:300@300.
        graphView := SimpleFunctionGraphView origin:0.0@0.0 corner:1.0@1.0 in:top.

        graphView graphColorHolder:(Color white).
        graphView backgroundColor:Color black.
        graphView minXHolder:(-5 asValue).
        graphView maxXHolder:(5 asValue).
        graphView minYHolder:(-2 asValue).
        graphView maxYHolder:(2 asValue).

        graphView function:[:x | x sin].

        top open.


        |top graphView minX maxX|

        top := StandardSystemView extent:300@300.
        graphView := SimpleFunctionGraphView origin:0.0@0.0 corner:1.0@1.0 in:top.

        graphView graphColorHolder:(Color white).
        graphView backgroundColor:Color black.
        graphView minXHolder:(minX := -5 asValue).
        graphView maxXHolder:(maxX := 5 asValue).
        graphView minYHolder:(-2 asValue).
        graphView maxYHolder:(2 asValue).

        graphView function:[:x | x sin].

        top openAndWait.

        [
            [top realized] whileTrue:[
                Delay waitForSeconds:0.05.
                minX value:(minX value + 0.1).
                maxX value:(maxX value + 0.1).
            ]
        ] fork
                


        |top graphView functionList|

        functionList := OrderedCollection new.
        functionList add:[:x | x].
        functionList add:[:x | x * x].
        functionList add:[:x | x sqrt].
        functionList add:[:x | x sin].
        functionList add:[:x | x cos].
        functionList add:[:x | x tan].
        functionList add:[:x | x log].
        functionList add:[:x | 0].

        top := StandardSystemView extent:300@300.
        graphView := SimpleFunctionGraphView origin:0.0@0.0 corner:1.0@1.0 in:top.

        graphView graphColorHolder:(Color white).
        graphView backgroundColor:Color black.
        graphView minXHolder:(-5 asValue).
        graphView maxXHolder:(5 asValue).
        graphView minYHolder:(-2 asValue).
        graphView maxYHolder:(2 asValue).
        graphView displayModeHolder:(#lineMode asValue).

        graphView function:(functionList last).

        top openAndWait.

        [
            [top realized] whileTrue:[
                functionList do:[:funcBlock |
                    Delay waitForSeconds:1.
                    graphView displayModeHolder value:#dotMode.
                    Delay waitForSeconds:1.
                    graphView displayModeHolder value:#lineMode.
                    Delay waitForSeconds:1.
                    graphView displayModeHolder value:#dotMode.

                    Delay waitForSeconds:1.
                    graphView displayModeHolder value:#lineMode.
                    graphView functionHolder value:funcBlock.
                ]
            ]
        ] fork



ST/X 6.1.1; WebServer 1.620 at exept:8081; Tue, 22 May 2012 22:11:01 GMT