Index
All Classes and Interfaces|All Packages|Constant Field Values
A
- addKeyListener(KeyListener) - Method in class DrawingPanel
-
Adds the given event listener to respond to key events on this panel.
- addMouseListener(MouseListener) - Method in class DrawingPanel
-
Adds the given event listener to respond to mouse events on this panel.
- ANIMATED_PROPERTY - Static variable in class DrawingPanel
-
An internal constant for setting system properties; clients should not use this.
- ANIMATION_FILE_NAME - Static variable in class DrawingPanel
-
An internal constant for setting system properties; clients should not use this.
- ANTIALIAS_PROPERTY - Static variable in class DrawingPanel
-
An internal constant for setting system properties; clients should not use this.
- AUTO_ENABLE_ANIMATION_ON_SLEEP_PROPERTY - Static variable in class DrawingPanel
-
An internal constant for setting system properties; clients should not use this.
C
- clear() - Method in class DrawingPanel
-
Erases all drawn shapes/lines/colors from the panel.
D
- DEFAULT_HEIGHT - Static variable in class DrawingPanel
-
The default height of a DrawingPanel in pixels, if none is supplied at construction (400 pixels).
- DEFAULT_WIDTH - Static variable in class DrawingPanel
-
The default width of a DrawingPanel in pixels, if none is supplied at construction (500 pixels).
- DIFF_PROPERTY - Static variable in class DrawingPanel
-
An internal constant for setting system properties; clients should not use this.
- DrawingPanel - Class in Unnamed Package
-
DrawingPanel is a simplified Java drawing window class to accompany Building Java Programs textbook and associated materials.
- DrawingPanel() - Constructor for class DrawingPanel
-
Constructs a drawing panel with a default width and height enclosed in a window.
- DrawingPanel(int, int) - Constructor for class DrawingPanel
-
Constructs a drawing panel of given width and height enclosed in a window.
- DrawingPanel(File) - Constructor for class DrawingPanel
-
Constructs a drawing panel that displays the image from the given file enclosed in a window.
- DrawingPanel(String) - Constructor for class DrawingPanel
-
Constructs a drawing panel that displays the image from the given file name enclosed in a window.
- DrawingPanel.DPKeyEventHandler - Interface in Unnamed Package
-
This functional interface is provided to allow Java 8 clients to write lambda functions to handle key events that occur in a DrawingPanel.
- DrawingPanel.DPMouseEventHandler - Interface in Unnamed Package
-
This functional interface is provided to allow Java 8 clients to write lambda functions to handle mouse events that occur in a DrawingPanel.
G
- getAlpha(int) - Static method in class DrawingPanel
-
Returns the alpha (opacity) component of the given RGB pixel from 0-255.
- getBlue(int) - Static method in class DrawingPanel
-
Returns the blue component of the given RGB pixel from 0-255.
- getCounts() - Method in class DrawingPanel
-
Returns a map of counts of occurrences of calls of various drawing methods.
- getDebuggingGraphics() - Method in class DrawingPanel
-
A variation of getGraphics that returns an object that records a count for various drawing methods.
- getGraphics() - Method in class DrawingPanel
-
Obtain the Graphics object to draw on the panel.
- getGreen(int) - Static method in class DrawingPanel
-
Returns the green component of the given RGB pixel from 0-255.
- getHeight() - Method in class DrawingPanel
-
Returns the drawing panel's height in pixels.
- getPixel(int, int) - Method in class DrawingPanel
-
Returns the color of the pixel at the given x/y coordinate as a Color object.
- getPixelRGB(int, int) - Method in class DrawingPanel
-
Returns the color of the pixel at the given x/y coordinate as an RGB integer.
- getPixels() - Method in class DrawingPanel
-
Returns the colors of all pixels in this DrawingPanel as a 2-D array of Color objects.
- getPixelsRGB() - Method in class DrawingPanel
-
Returns the colors of all pixels in this DrawingPanel as a 2-D array of RGB integers.
- getRed(int) - Static method in class DrawingPanel
-
Returns the red component of the given RGB pixel from 0-255.
- getSaveFileName() - Static method in class DrawingPanel
-
Returns the file name used for saving all DrawingPanel instances.
- getSize() - Method in class DrawingPanel
-
Returns the drawing panel's pixel size (width, height) as a Dimension object.
- getWidth() - Method in class DrawingPanel
-
Returns the drawing panel's width in pixels.
- getX() - Method in class DrawingPanel
-
Returns the drawing panel's x-coordinate on the screen.
- getY() - Method in class DrawingPanel
-
Returns the drawing panel's y-coordinate on the screen.
- getZoom() - Method in class DrawingPanel
-
Returns the drawing panel's current zoom factor.
H
- HEADLESS_PROPERTY - Static variable in class DrawingPanel
-
An internal constant for setting system properties; clients should not use this.
I
- imageUpdate(Image, int, int, int, int, int) - Method in class DrawingPanel
-
Internal method; notifies the panel when images are loaded and updated.
- isAntiAliasDefault() - Static method in class DrawingPanel
-
Returns true if DrawingPanel instances should anti-alias (smooth) their graphics.
- isHeadless() - Static method in class DrawingPanel
-
Returns true if the class is in "headless" mode, meaning that it is running on a server without a graphical user interface.
L
- loadImage(File) - Method in class DrawingPanel
-
Loads an image from the given file on disk and returns it as an Image object.
- loadImage(String) - Method in class DrawingPanel
-
Loads an image from the given file on disk and returns it as an Image object.
M
- mainIsActive() - Static method in class DrawingPanel
-
Internal method; returns whether the 'main' thread is still running.
- MULTIPLE_PROPERTY - Static variable in class DrawingPanel
-
An internal constant for setting system properties; clients should not use this.
O
- onClick(DrawingPanel.DPMouseEventHandler) - Method in class DrawingPanel
-
Adds an event handler for mouse clicks.
- onDrag(DrawingPanel.DPMouseEventHandler) - Method in class DrawingPanel
-
Adds an event handler for mouse drags.
- onEnter(DrawingPanel.DPMouseEventHandler) - Method in class DrawingPanel
-
Adds an event handler for mouse enters.
- onExit(DrawingPanel.DPMouseEventHandler) - Method in class DrawingPanel
-
Adds an event handler for mouse exits.
- onKeyDown(DrawingPanel.DPKeyEventHandler) - Method in class DrawingPanel
-
Adds an event handler for key presses.
- onKeyEvent(char) - Method in interface DrawingPanel.DPKeyEventHandler
-
Called when a key event occurs involving the given key character in the drawing panel window.
- onKeyUp(DrawingPanel.DPKeyEventHandler) - Method in class DrawingPanel
-
Adds an event handler for key releases.
- onMouseClick(DrawingPanel.DPMouseEventHandler) - Method in class DrawingPanel
-
Adds an event handler for mouse clicks.
- onMouseDown(DrawingPanel.DPMouseEventHandler) - Method in class DrawingPanel
-
Adds an event handler for mouse button down events.
- onMouseDrag(DrawingPanel.DPMouseEventHandler) - Method in class DrawingPanel
-
Adds an event handler for mouse drags.
- onMouseEnter(DrawingPanel.DPMouseEventHandler) - Method in class DrawingPanel
-
Adds an event handler for mouse enters.
- onMouseEvent(int, int) - Method in interface DrawingPanel.DPMouseEventHandler
-
Called when a mouse event occurs at the given (x, y) position in the drawing panel window.
- onMouseExit(DrawingPanel.DPMouseEventHandler) - Method in class DrawingPanel
-
Adds an event handler for mouse exits.
- onMouseMove(DrawingPanel.DPMouseEventHandler) - Method in class DrawingPanel
-
Adds an event handler for mouse movement.
- onMouseUp(DrawingPanel.DPMouseEventHandler) - Method in class DrawingPanel
-
Adds an event handler for mouse button up events.
- onMove(DrawingPanel.DPMouseEventHandler) - Method in class DrawingPanel
-
Adds an event handler for mouse movement.
P
- PIXEL_ALPHA - Static variable in class DrawingPanel
-
An RGB integer representing alpha at 100% opacity (0xff000000).
- PIXEL_BLUE - Static variable in class DrawingPanel
-
An RGB integer representing 100% blue (0x000000ff).
- PIXEL_GREEN - Static variable in class DrawingPanel
-
An RGB integer representing 100% green (0x0000ff00).
- PIXEL_RED - Static variable in class DrawingPanel
-
An RGB integer representing 100% red (0x00ff0000).
S
- save(File) - Method in class DrawingPanel
-
Takes the current contents of the drawing panel and writes them to the given file.
- save(String) - Method in class DrawingPanel
-
Takes the current contents of the drawing panel and writes them to the given file.
- SAVE_PROPERTY - Static variable in class DrawingPanel
-
An internal constant for setting system properties; clients should not use this.
- saveAll() - Static method in class DrawingPanel
-
Saves every DrawingPanel instance that is active.
- saveAnimated(File) - Method in class DrawingPanel
-
Takes the current contents of the drawing panel and writes them to the given file.
- saveAnimated(String) - Method in class DrawingPanel
-
Takes the current contents of the drawing panel and writes them to the given file.
- setAlwaysOnTop(boolean) - Method in class DrawingPanel
-
Sets whether the panel will always cover other windows (default false).
- setAntiAlias(boolean) - Method in class DrawingPanel
-
Sets whether the panel should use anti-aliased / smoothed graphics (default true).
- setAntiAliasDefault(Boolean) - Static method in class DrawingPanel
-
Sets whether DrawingPanel instances should anti-alias (smooth) their pixels by default.
- setBackground(int) - Method in class DrawingPanel
-
Sets the background color of the drawing panel to be the color represented by the given RGB integer.
- setBackground(Color) - Method in class DrawingPanel
-
Sets the background color of the drawing panel to be the given color.
- setGridLines(boolean) - Method in class DrawingPanel
-
Enables or disables the drawing of grid lines on top of the image to help with debugging sizes and coordinates.
- setGridLines(boolean, int) - Method in class DrawingPanel
-
Enables or disables the drawing of grid lines on top of the image to help with debugging sizes and coordinates.
- setHeadless(Boolean) - Static method in class DrawingPanel
-
Sets the class to run in "headless" mode, with no graphical output on screen.
- setHeight(int) - Method in class DrawingPanel
-
Sets the drawing panel's height in pixels to the given value.
- setPixel(int, int, int) - Method in class DrawingPanel
-
Sets the color of the pixel at the given x/y coordinate to be the color represented by the given RGB integer.
- setPixel(int, int, Color) - Method in class DrawingPanel
-
Sets the color of the pixel at the given x/y coordinate to be the given color.
- setPixelRGB(int, int, int) - Method in class DrawingPanel
-
Sets the color of the pixel at the given x/y coordinate to be the color represented by the given RGB integer.
- setPixels(int[][]) - Method in class DrawingPanel
-
Sets the colors of all pixels in this DrawingPanel to the colors represented by the given 2-D array of RGB integers.
- setPixels(Color[][]) - Method in class DrawingPanel
-
Sets the colors of all pixels in this DrawingPanel to the colors in the given 2-D array of Color objects.
- setPixelsRGB(int[][]) - Method in class DrawingPanel
-
Sets the colors of all pixels in this DrawingPanel to the colors represented by the given 2-D array of RGB integers.
- setSaveFile(File) - Static method in class DrawingPanel
-
Sets the file to be used when saving graphical output for all DrawingPanels.
- setSaveFileName(String) - Static method in class DrawingPanel
-
Sets the filename to be used when saving graphical output for all DrawingPanels.
- setSize(int, int) - Method in class DrawingPanel
-
Sets the drawing panel's pixel size (width, height) to the given values.
- setVisible(boolean) - Method in class DrawingPanel
-
Show or hide the drawing panel on the screen.
- setWidth(int) - Method in class DrawingPanel
-
Sets the drawing panel's width in pixels to the given value.
- sleep(int) - Method in class DrawingPanel
-
Causes the program to pause for the given amount of time in milliseconds.
T
- toFront() - Method in class DrawingPanel
-
Moves the drawing panel window on top of other windows so it can be seen.
- toRgbInteger(int, int, int) - Static method in class DrawingPanel
-
Returns an RGB integer made from the given red, green, and blue components from 0-255.
- toRgbInteger(int, int, int, int) - Static method in class DrawingPanel
-
Returns an RGB integer made from the given alpha, red, green, and blue components from 0-255.
Z
- zoom(int) - Method in class DrawingPanel
-
Zooms the drawing panel in/out to the given factor.
All Classes and Interfaces|All Packages|Constant Field Values