Class ZoomPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----ZoomPanel

public class ZoomPanel
extends Panel
A subclass of Canvas that provides a detailed view of drawing visualization.


Variable Index

 o CIRCLE_MODE
 o GRAB_RADIUS
 o LINE_MODE

Constructor Index

 o ZoomPanel()
Construct a ZoomPanel.

Method Index

 o canvasSizeNotify()
Called whenever the canvas size is set.
 o create()
Creates and installs the subcomponents of ZoomPanel.
 o drawPrimitive(Point, Point)
Draw a reconing primitive (line or circle) based on the two inputs.
 o drawString(String, int, int)
Draws the specified string at the specified MainCanvas coordinates.
 o handleEvent(Event)
Process the scrollbar events.
 o minimumSize()
Returns the minimum size of ZoomPanel.
 o paint(Graphics)
Paints the canvas including the cartesian grid and any rendered pixels.
 o paintComponents(Graphics)
Paints the subcomponents of this panel.
 o preferredSize()
Returns the preferred size of ZoomPanel.
 o redrawPixels()
Redraw all the currently active pixels.
 o reformat()
Reformats the background grid on the canvas when sizes are changed.
 o repaint()
Repaint the canvas.
 o resetDrawing()
Remove all drawn pixels from the MainCanvas.
 o setCircleMode()
Set the primitive drawing mode to CIRCLE_MODE.
 o setCircleValues(Point, Point)
Set circle parameters c (center) and r (radius) in CIRCLE_MODE.
 o setLineEndPoints(Point, Point)
Set the line endpoints p1 and p2 in LINE_MODE.
 o setLineMode()
Set the primitive drawing mode to LINE_MODE.
 o setRes(int)
Set the pixel resolution size.
 o update(Graphics)
Overrides the superclass paint() to eliminate clearing the canvas before repainting.
 o writePixel(Point, float, boolean)
Write a pixel of the specified color at the specified location.

Variables

 o LINE_MODE
 public static final int LINE_MODE
 o CIRCLE_MODE
 public static final int CIRCLE_MODE
 o GRAB_RADIUS
 public static final int GRAB_RADIUS

Constructors

 o ZoomPanel
 public ZoomPanel()
Construct a ZoomPanel.

Methods

 o paintComponents
 public void paintComponents(Graphics g)
Paints the subcomponents of this panel.

Overrides:
paintComponents in class Container
 o paint
 public void paint(Graphics g)
Paints the canvas including the cartesian grid and any rendered pixels.

Overrides:
paint in class Container
 o update
 public void update(Graphics g)
Overrides the superclass paint() to eliminate clearing the canvas before repainting.

Overrides:
update in class Component
 o repaint
 public void repaint()
Repaint the canvas.

Overrides:
repaint in class Component
 o handleEvent
 public boolean handleEvent(Event event)
Process the scrollbar events.

Overrides:
handleEvent in class Component
 o canvasSizeNotify
 public void canvasSizeNotify()
Called whenever the canvas size is set.

 o create
 public void create()
Creates and installs the subcomponents of ZoomPanel.

 o reformat
 public void reformat()
Reformats the background grid on the canvas when sizes are changed.

 o drawPrimitive
 public void drawPrimitive(Point p1,
                           Point p2)
Draw a reconing primitive (line or circle) based on the two inputs.

 o drawString
 public void drawString(String str,
                        int x,
                        int y)
Draws the specified string at the specified MainCanvas coordinates.

 o setLineMode
 public void setLineMode()
Set the primitive drawing mode to LINE_MODE.

 o setCircleMode
 public void setCircleMode()
Set the primitive drawing mode to CIRCLE_MODE.

 o setLineEndPoints
 public void setLineEndPoints(Point p1,
                              Point p2)
Set the line endpoints p1 and p2 in LINE_MODE.

 o setCircleValues
 public void setCircleValues(Point p1,
                             Point p2)
Set circle parameters c (center) and r (radius) in CIRCLE_MODE.

 o writePixel
 public void writePixel(Point p,
                        float value,
                        boolean repaint)
Write a pixel of the specified color at the specified location. 'c' controls re-centering of the canvas when the specified pixel is off the canvas.

 o resetDrawing
 public void resetDrawing()
Remove all drawn pixels from the MainCanvas.

 o preferredSize
 public Dimension preferredSize()
Returns the preferred size of ZoomPanel.

Overrides:
preferredSize in class Container
 o minimumSize
 public Dimension minimumSize()
Returns the minimum size of ZoomPanel.

Overrides:
minimumSize in class Container
 o setRes
 public void setRes(int res)
Set the pixel resolution size.

 o redrawPixels
 public void redrawPixels()
Redraw all the currently active pixels.