Class CS10Display


public class CS10Display
extends JPanel

Provides static methods to display results of CS 10 assignments.


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
  cmc-->
Field Summary
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
  cmc-->
Method Summary
static void print(Color... color)
          Prints color values to standard output.
static void show(Color... color)
          Displays color(s).
static void showGrid(Color[][] grid)
          Displays color grid.

Method Detail

print

public static void print(Color... color)
Prints color values to standard output.

Parameters:
color - the color(s) to print. Can be a single Color, a comma-separated list of Colors, or an array of Colors.

show

public static void show(Color... color)
Displays color(s). Uses graphics display if available. Otherwise just invokes print method.

Parameters:
color - the color(s) to display. Can be a single Color, a comma-separated list of Colors, or an array of Colors.

showGrid

public static void showGrid(Color[][] grid)
Displays color grid. Only executes if graphics display is available.

Parameters:
grid - the array of colors to show - both dimensions must be <= 400.

paintComponent

public void paintComponent(Graphics g)
Called by the windowing system when showGrid is used. Do not attempt to call directly.

Overrides:
paintComponent in class JComponent
Parameters:
g - the graphics object passed by the windowing system.
cmc-->