|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwheelsunh.etc.AbstractGraphic
wheelsunh.users.AbstractShape
wheelsunh.users.Shape
wheelsunh.users.RectangularShape
wheelsunh.users.Rectangle
wheelsunh.users.InputBox
public abstract class InputBox
Abstract subclass of Rectangle including an editable text box. Subclasses must override parse() in order to handle the input.
| Field Summary | |
|---|---|
protected javax.swing.JTextArea |
_text
|
static int |
DEFAULT_BORDER_WIDTH
|
static int |
DEFAULT_WIDTH
|
| Fields inherited from class wheelsunh.users.Shape |
|---|
_c, _dp, _shape, DEFAULT_COLOR |
| Fields inherited from class wheelsunh.users.AbstractShape |
|---|
_rot |
| Constructor Summary | |
|---|---|
InputBox()
Constructs an empty InputBox in the wheelsunh.users.Frame's DrawingPanel. |
|
InputBox(java.lang.String text)
Constructs an InputBox displaying the specified String in the wheelsunh.users.Frame's DrawingPanel. |
|
InputBox(java.lang.String text,
DrawingPanel dp)
Constructs an InputBox displaying the specified String in the passed-in DrawingPanel. |
|
| Method Summary | |
|---|---|
void |
actualPaint(java.awt.Graphics2D g)
Normal users do not need to worry about this! Does the actual work to paint the text box. |
java.awt.Rectangle |
getBounds()
Returns the bounds of the text box. |
void |
hide()
Graphically hides the text box. |
protected abstract void |
parse(java.lang.String s)
This method is overridden in concrete implementations It controls what the input box does with strings entered into it |
void |
setBorderWidth(int width)
Changes the size of the border of whitespace between the text area and its frame. |
void |
setColor(java.awt.Color c)
Set the background and frame color of the TextBox. |
void |
setFillColor(java.awt.Color c)
Set the background color of the TextBox. |
void |
setLocation(java.awt.Point p)
Sets the location of the TextBox. |
void |
setRotation(int degrees)
Overridden to do nothing. |
void |
setSize(java.awt.Dimension d)
Sets the size of the TextBox. |
void |
setText(java.lang.String text)
Makes the bubble display the passed-in string. |
void |
setWidth(int width)
Sizes the TextBox to the given width, but maintains full view of the contents by adjusting the height if necessary. |
void |
show()
Graphically shows the text box. |
| Methods inherited from class wheelsunh.users.RectangularShape |
|---|
getFillColor, getFrameColor, getFrameThickness, getHeight, getLocation, getSize, getWidth, getXLocation, getYLocation, setFrameColor, setFrameThickness, setLocation, setSize |
| Methods inherited from class wheelsunh.users.Shape |
|---|
contains, getColor, getRotation, paint |
| Methods inherited from class wheelsunh.users.AbstractShape |
|---|
boundsIntersects, center, distance, getCenter, getCenterX, getCenterY, getIntersection, intersects, intersects, setCenter |
| Methods inherited from class wheelsunh.etc.AbstractGraphic |
|---|
mouseClicked, mouseDragged, mousePressed, mouseReleased |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface wheelsunh.Colorable |
|---|
getColor |
| Field Detail |
|---|
protected javax.swing.JTextArea _text
public static final int DEFAULT_WIDTH
public static final int DEFAULT_BORDER_WIDTH
| Constructor Detail |
|---|
public InputBox()
public InputBox(java.lang.String text)
text - the String to display
public InputBox(java.lang.String text,
DrawingPanel dp)
text - the String to displaydp - the DrawingPanel in which the bubble will be drawn| Method Detail |
|---|
public void setLocation(java.awt.Point p)
setLocation(int, int)
forward to setLocation(java.awt.Point), so either one
will work correctly.)
setLocation in interface LocatablesetLocation in class RectangularShapepublic void setSize(java.awt.Dimension d)
setWidth(int) to specify a width for the bubble while
maintaining view of all the text.
setSize in interface SizeablesetSize in class RectangularShapepublic void setWidth(int width)
public void show()
show in class Shapepublic void hide()
hide in class Shapepublic void setBorderWidth(int width)
public void setColor(java.awt.Color c)
setColor in interface ColorablesetColor in class RectangularShapepublic void setFillColor(java.awt.Color c)
setFillColor in interface AdvancedColorablesetFillColor in class RectangularShapepublic void setText(java.lang.String text)
public void actualPaint(java.awt.Graphics2D g)
actualPaint in class RectangularShapeg - the instance of java.awt.Graphics2D that should
be used to paint the shapepublic java.awt.Rectangle getBounds()
getBounds in class RectangularShapepublic void setRotation(int degrees)
setRotation in interface RotatablesetRotation in class Shapedegrees - the magnitude of the rotation in degreesprotected abstract void parse(java.lang.String s)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||