search

Class myphysicslab.lab.graph.DisplayAxes

Provided By
All Implemented Interfaces

Draws linear horizontal and vertical axes within a given simulation coordinates rectangle. The simulation rectangle determines where the axes are drawn, and the numbering scale shown, see #setSimRect.

Axes are drawn with numbered tick marks. Axes are labeled with names which can be specified by #setHorizName and #setVerticalName. Axes are drawn using specified font and color, see #setColor and #setFont.

Options exist for drawing the vertical axis near the left, center, or right, and for drawing the horizontal axis near the top, center, or bottom of the screen. See #setXAxisAlignment and #setYAxisAlignment.

To keep the DisplayAxes in sync with a myphysicslab.lab.view.LabView, when doing for example pan/zoom of the LabView, you can arrange for #setSimRect to be called by an Observer. See for example myphysicslab.sims.layout.CommonControls#makeAxes which makes a myphysicslab.lab.util.GenericObserver that keeps the DisplayAxes in sync with the LabView.

new DisplayAxes( opt_simRect, opt_font, opt_color )

Parameters
opt_simRect(myphysicslab.lab.util.DoubleRect|null|undefined)

the area to draw axes for in simulation coordinates.

opt_font(string|undefined)

the Font to draw numbers and names of axes with

opt_color(string|undefined)

the Color to draw the axes with

Instance Methods

Instance Properties