|
Environment Plotter | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
EnvPlotterGUI
Environment-Based Applications:
The EnvPlotterGUI
class provides the graphical user
interface for a program that draws in an environment by placing
color blocks in its cells.
Field Summary | |
protected static java.awt.Color |
BACKGROUND_COLOR
|
protected ColorChoiceDDMenu |
backgroundColorMenu
|
protected ColorChoiceDDMenu |
drawingColorMenu
|
protected java.util.List |
drawingMethods
|
protected static int |
ENV_COLS
|
protected static int |
ENV_ROWS
|
protected EnvChoiceDialog |
envChoiceDialog
|
protected static java.awt.Color |
HIGHLIGHT_COLOR
|
protected static int |
MIN_CELL_SIZE
|
protected EnvPlotter |
plotter
|
Constructor Summary | |
EnvPlotterGUI(java.lang.String title,
int viewingWidth,
int viewingHeight,
int maxDelayMSecs,
int minDelayMsecs)
Constructs the graphical user interface for the Environment Plotter program. |
Method Summary | |
protected void |
defineContent(java.awt.Color bgColor,
int viewingWidth,
int viewingHeight,
int minCellSize)
Defines contents of main window panel. |
protected void |
draw(java.lang.String buttonLabel)
Draws according to button pressed (called by action listener). |
protected java.lang.reflect.Method |
getDrawingMethod(java.lang.String buttonLabel)
Gets the EnvPlotter drawing method associated
with the specified button label. |
protected void |
getDrawingMethods()
Builds a list of drawing methods that can be used by drawing buttons. |
protected java.awt.Component |
makeColorChooserPanel()
Provides Color tools for choosing background color and drawing color. |
protected java.awt.Component |
makeControlPanel()
Creates the control panel. |
protected java.awt.Component |
makeDrawingButtons()
Creates a panel containing the drawing buttons based on the methods provided in the EnvPlotter class. |
protected void |
newEnv()
Creates a new environment. |
protected void |
resetEnv()
Resets the environment. |
protected void |
setBackground()
Changes the background color. |
Field Detail |
protected static final int ENV_ROWS
protected static final int ENV_COLS
protected static final java.awt.Color BACKGROUND_COLOR
protected static final java.awt.Color HIGHLIGHT_COLOR
protected static final int MIN_CELL_SIZE
protected EnvChoiceDialog envChoiceDialog
protected ColorChoiceDDMenu backgroundColorMenu
protected ColorChoiceDDMenu drawingColorMenu
protected EnvPlotter plotter
protected java.util.List drawingMethods
Constructor Detail |
public EnvPlotterGUI(java.lang.String title, int viewingWidth, int viewingHeight, int maxDelayMSecs, int minDelayMsecs)
title
- frame titleviewingWidth
- the width of the viewing areaviewingHeight
- the height of the viewing areamaxDelayMsecs
- longest delay value for slider, in millisecondsminDelayMsecs
- shortest delay value for slider, in millisecondsMethod Detail |
protected void getDrawingMethods()
protected void defineContent(java.awt.Color bgColor, int viewingWidth, int viewingHeight, int minCellSize)
backgroundColor
- color to paint background of environmentviewingWidth
- the width of the viewing areaviewingHeight
- the height of the viewing areaminCellSize
- minimum environment cell side lengthprotected java.awt.Component makeControlPanel()
protected void newEnv()
protected void resetEnv()
protected java.awt.Component makeColorChooserPanel()
protected void setBackground()
protected java.awt.Component makeDrawingButtons()
protected void draw(java.lang.String buttonLabel)
buttonLabel
- the label on the button pressedprotected java.lang.reflect.Method getDrawingMethod(java.lang.String buttonLabel)
EnvPlotter
drawing method associated
with the specified button label.buttonLabel
- the label on the button pressed
|
Environment Plotter | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |