This class represents the model from which any particular View of a graph is constructed. More...

Public Member Functions | |
| Model () | |
| Constructor. | |
| void | add (Element element) |
| Add an element to the list. | |
| void | reset (Locus locus) |
| Set a unique Locus in the list. | |
| void | draw (View view, java.awt.Graphics2D graphics2d) |
| Draw the model on the view using the graphics object supplied. | |
| void | updatePaths () |
| Update paths in Locus objects. | |
Protected Attributes | |
| java.util.LinkedList< Element > | elements |
| The list of elements to be drawn. | |
Package Functions | |
| Axis | getXAxis () |
| Get the x axis. | |
| Axis | getYAxis () |
| Get the y axis. | |
Private Attributes | |
| HAxis | xAxis |
| An x axis. | |
| VAxis | yAxis |
| A y axis. | |
This class represents the model from which any particular View of a graph is constructed.
We use the model/view architecture so that we can export graph pictures in a variety of formats.
| jscicalc.graph.Model.Model | ( | ) |
Constructor.
References jscicalc.graph.Model.elements, jscicalc.graph.Model.xAxis, and jscicalc.graph.Model.yAxis.
| void jscicalc.graph.Model.add | ( | Element | element | ) |
Add an element to the list.
| element | The element to add |
References jscicalc.graph.Model.elements.
| void jscicalc.graph.Model.draw | ( | View | view, | |
| java.awt.Graphics2D | graphics2d | |||
| ) |
Draw the model on the view using the graphics object supplied.
| view | A view | |
| graphics2d | A graphics context |
References jscicalc.graph.Model.elements.
Referenced by jscicalc.graph.View.paintComponent().
| Axis jscicalc.graph.Model.getXAxis | ( | ) | [package] |
Get the x axis.
References jscicalc.graph.Model.xAxis.
Referenced by jscicalc.graph.Menu.Menu().
| Axis jscicalc.graph.Model.getYAxis | ( | ) | [package] |
Get the y axis.
References jscicalc.graph.Model.yAxis.
Referenced by jscicalc.graph.Menu.Menu().
| void jscicalc.graph.Model.reset | ( | Locus | locus | ) |
Set a unique Locus in the list.
| locus | The element to add |
References jscicalc.graph.Model.elements, jscicalc.graph.Model.xAxis, and jscicalc.graph.Model.yAxis.
Referenced by jscicalc.graph.Graph.setLocus().
| void jscicalc.graph.Model.updatePaths | ( | ) |
Update paths in Locus objects.
References jscicalc.graph.Model.elements, and jscicalc.graph.Locus.updatePath().
Referenced by jscicalc.graph.View.paintComponent().
java.util.LinkedList<Element> jscicalc.graph.Model.elements [protected] |
The list of elements to be drawn.
Referenced by jscicalc.graph.Model.add(), jscicalc.graph.Model.draw(), jscicalc.graph.Model.Model(), jscicalc.graph.Model.reset(), and jscicalc.graph.Model.updatePaths().
HAxis jscicalc.graph.Model.xAxis [private] |
An x axis.
Referenced by jscicalc.graph.Model.getXAxis(), jscicalc.graph.Model.Model(), and jscicalc.graph.Model.reset().
VAxis jscicalc.graph.Model.yAxis [private] |
A y axis.
Referenced by jscicalc.graph.Model.getYAxis(), jscicalc.graph.Model.Model(), and jscicalc.graph.Model.reset().
1.7.1