|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JLabel
|
+--canvas.StringComponent
Allows text labels to be added to a DrawingPane
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JLabel |
JLabel.AccessibleJLabel |
| Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
int |
fontSize
|
String |
text
|
| Fields inherited from class javax.swing.JLabel |
labelFor |
| 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 javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
StringComponent(double x,
double y,
String text,
canvas.DrawingGrid dg)
|
|
StringComponent(int x,
int y,
String text)
Creates a StringComponent at the given position that is just large enough for the given text. |
|
StringComponent(String text)
Creates a StringComponent that is initially positioned at 0,0. |
|
StringComponent(String text,
canvas.DrawingGrid dg)
|
|
| Method Summary | |
canvas.DrawingPane |
getDrawingPane()
Returns the DrawingPane that this StringComponent has been added to. |
void |
moveTo(double x,
double y)
Moves the component to the desired location. |
void |
moveTo(double x,
double y,
canvas.DrawingGrid dg)
|
void |
redraw()
Calls Component.repaint() in a thread-safe way. |
void |
resizeTo(double x,
double y)
Resizes the component to the desired size. |
void |
resizeTo(double x,
double y,
canvas.DrawingGrid dg)
|
void |
setFeedbackText(String text)
If possible, sets the text at the bottom of the window that this component is displayed in. |
void |
setFontColor(Color color)
Sets the Color of the StringComponent to be the given color |
void |
setFontSize(int size)
Sets the Size of the StringComponent's Font |
void |
setText(String text)
Changes the text of the component and updates the size of the component to fit it. |
void |
smoothMove(double x,
double y,
int milliseconds)
Smoothly moves this component to the given coordinates over the time interval given. |
void |
smoothMove(double x,
double y,
int milliseconds,
canvas.DrawingGrid dg)
|
void |
smoothResize(double width,
double height,
int milliseconds)
Smoothly resizes this component to the given dimensions over the time interval given. |
void |
smoothResize(double width,
double height,
int milliseconds,
canvas.DrawingGrid dg)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface canvas.CanvasComponent |
getHeight, getWidth |
| Field Detail |
public int fontSize
public String text
| Constructor Detail |
public StringComponent(String text)
public StringComponent(String text,
canvas.DrawingGrid dg)
public StringComponent(int x,
int y,
String text)
x - the x coordinate of the upper left cornery - the y coordinate of the upper left cornertext - the 'String' to be displayed
public StringComponent(double x,
double y,
String text,
canvas.DrawingGrid dg)
| Method Detail |
public void moveTo(double x,
double y)
moveTo in interface CanvasComponent
public void moveTo(double x,
double y,
canvas.DrawingGrid dg)
public void resizeTo(double x,
double y)
resizeTo in interface CanvasComponent
public void resizeTo(double x,
double y,
canvas.DrawingGrid dg)
public void setFeedbackText(String text)
CanvasComponent
setFeedbackText in interface CanvasComponent
public void smoothResize(double width,
double height,
int milliseconds,
canvas.DrawingGrid dg)
public void smoothResize(double width,
double height,
int milliseconds)
CanvasComponent
smoothResize in interface CanvasComponent
public void smoothMove(double x,
double y,
int milliseconds,
canvas.DrawingGrid dg)
public void smoothMove(double x,
double y,
int milliseconds)
CanvasComponent
smoothMove in interface CanvasComponentpublic void redraw()
CanvasComponentComponent.repaint() in a thread-safe way.
The component is re-drawn on the screen. This is especially useful for PictureComponent objects.
redraw in interface CanvasComponentpublic void setText(String text)
setText in class JLabeltext - the new textpublic void setFontSize(int size)
size - the size of the fontpublic void setFontColor(Color color)
public canvas.DrawingPane getDrawingPane()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||