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