|
Class: SimpleFunctionGraphView
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--SimpleFunctionGraphView
- Package:
- stx:libwidg3
- Category:
- Views-Misc
- Version:
- rev:
1.5
date: 2019/03/13 20:45:02
- user: cg
- file: SimpleFunctionGraphView.st directory: libwidg3
- module: stx stc-classLibrary: libwidg3
- Author:
- Claus Gittinger
UNDER CONSTRUCTION
displays the graph of a function.
TODO: grid & scale drawing.
accessing
-
displayModeHolder
-
return the value of the instance variable 'displayModeHolder' (automatically generated)
-
displayModeHolder: something
-
set the value of the instance variable 'displayModeHolder' (automatically generated)
-
function: aBlock
-
(comment from inherited method)
set the drawing function if it has changed.
The argument is one of:
#copy,#copyInverted,#xor,#and,#andReverse
#andInverted,#or,#orReverse,#orInverted
#invert,#clear,#set,#noop,#equiv,#nand
Notice: not all graphicMedia support all functions
-
functionHolder
-
return the value of the instance variable 'functionHolder' (automatically generated)
-
functionHolder: something
-
set the value of the instance variable 'functionHolder' (automatically generated)
-
graphColorHolder
-
return the value of the instance variable 'graphColorHolder' (automatically generated)
-
graphColorHolder: something
-
set the value of the instance variable 'graphColorHolder' (automatically generated)
-
gridColorHolder
-
return the value of the instance variable 'gridColorHolder' (automatically generated)
-
gridColorHolder: something
-
set the value of the instance variable 'gridColorHolder' (automatically generated)
-
invalidColorHolder
-
return the value of the instance variable 'invalidColorHolder' (automatically generated)
-
invalidColorHolder: something
-
set the value of the instance variable 'invalidColorHolder' (automatically generated)
-
markInvalidHolder
-
return the value of the instance variable 'markInvalidHolder' (automatically generated)
-
markInvalidHolder: something
-
set the value of the instance variable 'markInvalidHolder' (automatically generated)
-
maxXHolder
-
return the value of the instance variable 'maxXHolder' (automatically generated)
-
maxXHolder: something
-
set the value of the instance variable 'maxXHolder' (automatically generated)
-
maxYHolder
-
return the value of the instance variable 'maxYHolder' (automatically generated)
-
maxYHolder: something
-
set the value of the instance variable 'maxYHolder' (automatically generated)
-
minXHolder
-
return the value of the instance variable 'minXHolder' (automatically generated)
-
minXHolder: something
-
set the value of the instance variable 'minXHolder' (automatically generated)
-
minYHolder
-
return the value of the instance variable 'minYHolder' (automatically generated)
-
minYHolder: something
-
set the value of the instance variable 'minYHolder' (automatically generated)
-
showGridHolder
-
return the value of the instance variable 'showGridHolder' (automatically generated)
-
showGridHolder: something
-
set the value of the instance variable 'showGridHolder' (automatically generated)
-
showUnitsXHolder
-
return the value of the instance variable 'showUnitsXHolder' (automatically generated)
-
showUnitsXHolder: something
-
set the value of the instance variable 'showUnitsXHolder' (automatically generated)
-
showUnitsYHolder
-
return the value of the instance variable 'showUnitsYHolder' (automatically generated)
-
showUnitsYHolder: something
-
set the value of the instance variable 'showUnitsYHolder' (automatically generated)
-
unitColorHolder
-
return the value of the instance variable 'unitColorHolder' (automatically generated)
-
unitColorHolder: something
-
set the value of the instance variable 'unitColorHolder' (automatically generated)
change & update
-
sizeChanged: how
-
(comment from inherited method)
tell subviews that I changed size.
How is either #smaller, #larger or nil, and is used to control the order,
in which subviews are notified (possibly reducing redraw activity)
-
update: something with: someArgument from: changedObject
-
something changed - for now, do a full redraw
drawing
-
chooseGrid
-
for every centimeter on the display ...
-
computeGraph
-
compute the graph
-
redrawX: x y: y width: w height: h
-
redraw the graph
-
test: arg
-
redraw the graph
usage example(s):
|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
|
|