Skip to Main Content
Class DistLinePanel

Class DistLinePanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----Plane
                           |
                           +----DistLinePanel

public class DistLinePanel
extends Plane
A class which shows a piece of a real line for the graphical display and entry of axis distances.

Author:
Jonathan A. Poritz

Variable Index

 o CX
The abstract x-coordinate of the left side of the axis distance display.
 o CY
The abstract y-coordinate of the upper edge of the axis distance display.
 o inputpanel
A reference to the containing inputpanel.
 o previ
The location of a mousedown in this plane, to compute the extent of a drag that may occur; in pixel coordinates.
 o SX
The width, in abstract units, of the axis distance display.
 o SY
The height, in abstract units, of the axis distance display.
 o X
The width, in pixels, of the axis distance display.
 o Y
The height, in pixels, of the axis distance display.

Constructor Index

 o DistLinePanel(InputPanel)
Constructor for DistLinePanels.

Method Index

 o paint(Graphics)
Paint the DistLinePanel, by painting the parent Plane, putting a mark at the currently selected axis distance and making tickmarks.
 o zoom(double)
Scales the size of the visible window onto the line of axis distances

Variables

 o inputpanel
 public InputPanel inputpanel
A reference to the containing inputpanel.

See Also:
inputpanel
 o previ
 protected int previ[]
The location of a mousedown in this plane, to compute the extent of a drag that may occur; in pixel coordinates.

 o CX
 public static final double CX
The abstract x-coordinate of the left side of the axis distance display.

 o CY
 public static final double CY
The abstract y-coordinate of the upper edge of the axis distance display.

 o SX
 public static final double SX
The width, in abstract units, of the axis distance display.

 o SY
 public static final double SY
The height, in abstract units, of the axis distance display.

 o X
 public static final int X
The width, in pixels, of the axis distance display. Good defaults are:
    25
    for small screens, and
    50
    for large screens

 o Y
 public static final int Y
The height, in pixels, of the axis distance display. Good defaults are:
    200
    for small screens, and
    300
    for large screens

Constructors

 o DistLinePanel
 public DistLinePanel(InputPanel nptpnl)
Constructor for DistLinePanels.

Parameters:
nptpnl - the ambient inputpanel

Methods

 o paint
 public void paint(Graphics g)
Paint the DistLinePanel, by painting the parent Plane, putting a mark at the currently selected axis distance and making tickmarks.

Parameters:
g - the Graphics object upon which to paint the DistLinePanel
Overrides:
paint in class Plane
 o zoom
 public void zoom(double factor)
Scales the size of the visible window onto the line of axis distances

Parameters:
factor - the scaling factor, can be any positive number