wheelsunh.users
Class Frame

java.lang.Object
  extended by wheelsunh.users.Frame

public class Frame
extends java.lang.Object

Frame that has public methods to allow for behind-the-scenes manipulation and GUI creation. Used to create graphical programming assignments that hide actual graphics code from students. The JFrame is actually contained by the class instead of subclassed so that the frame can be updated (packed) when components are added. Not beautiful, but, if Frame were a subclass of JFrame, components added after creation through the static methods would not show up until the user resized the window.


Field Summary
static DrawingPanel _dp
           
 
Constructor Summary
Frame()
          Default Frame is 700 x 500
Frame(int w, int h)
          Drawing panel size parameters added at UNH.
 
Method Summary
static void addElementColumn(java.awt.Component component)
          Adds Component to column along right side and repacks.
static void addElementRow(java.awt.Component component)
          Adds a Component to the row at the bottom of the frame and repacks the frame so that everything shows up all pretty.
 void addKeyListener(java.awt.event.KeyListener k)
          Add KeyListener to _frame mb 7/23/2010
static int getHeight()
          getHeight() added at UNH by rdb 11/15/09
static int getWidth()
          getWidth() added at UNH by rdb 11/15/09
static void setHeight(int h)
          setHeight( int ) added at UNH
static void setSize(int w, int h)
          setSize( int, iny ) added at UNH
static void setWidth(int w)
          setWidth( int ) added at UNH
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_dp

public static DrawingPanel _dp
Constructor Detail

Frame

public Frame()
Default Frame is 700 x 500


Frame

public Frame(int w,
             int h)
Drawing panel size parameters added at UNH. 11/15/09 rdb

Method Detail

addKeyListener

public void addKeyListener(java.awt.event.KeyListener k)
Add KeyListener to _frame mb 7/23/2010


setWidth

public static void setWidth(int w)
setWidth( int ) added at UNH


setHeight

public static void setHeight(int h)
setHeight( int ) added at UNH


setSize

public static void setSize(int w,
                           int h)
setSize( int, iny ) added at UNH


getWidth

public static int getWidth()
getWidth() added at UNH by rdb 11/15/09


getHeight

public static int getHeight()
getHeight() added at UNH by rdb 11/15/09


addElementRow

public static void addElementRow(java.awt.Component component)
Adds a Component to the row at the bottom of the frame and repacks the frame so that everything shows up all pretty.


addElementColumn

public static void addElementColumn(java.awt.Component component)
Adds Component to column along right side and repacks.