|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uwcse.graphics.GWindow | +--InfiniteCanvas
An InfiniteCanvas
automatically scrolls left so that points can be continually added and
displayed. Clients of an InfiniteCanvas
need only be concerned about scaling in the y direction.
Whenever a shape having an x-value that would fall off the right of the current window on canvas is
added, InfiniteCanvas
autoscrolls to the left, dropping any unpaintable objects.
This class makes the assumption that x-values are generally increasing (or more specifically, that
they do not decrease to a value less than that displayed on the left hand side of the canvas.
Constructor Summary | |
InfiniteCanvas(java.lang.String name,
int width,
int height)
Sole constructor. |
Method Summary | |
boolean |
add(uwcse.graphics.Shape s)
Adds a shape to the infinite canvas at the x-coordinate specified by the shape in infinite x-space. |
boolean |
addToWindow(uwcse.graphics.Shape s)
Adds the given shape to the window in native window coordinates. |
void |
fixLabel(java.lang.String s,
java.awt.Color c)
Fixes a label somewhere convenient on the screen. |
int |
getLeftHandX()
Gets the x-value associated with the left most visible point. |
protected int |
getOriginX()
Computes the x position of the logical origin of the GWindow along x. |
void |
setLeftHandX(int x)
Sets the value of left most visible point. |
protected boolean |
useColumnarLayout()
Specifies whether to lay labels out in columns or rows. |
Methods inherited from class uwcse.graphics.GWindow |
addEventHandler, display, dispose, doRepaint, erase, getEventHandler, getImage, getImage, getImageFromFilename, getImageFromURL, getWindowHeight, getWindowWidth, intersects, main, moveAllBy, print, remove, resumeRepaints, setExitOnClose, showColorTable, startTimerEvents, stopTimerEvents, suspendRepaints, toString, version |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public InfiniteCanvas(java.lang.String name, int width, int height)
name
- of the canvaswidth
- initial widthheight
- initial heightMethod Detail |
public int getLeftHandX()
public void setLeftHandX(int x)
x
- value of the left most visible point.public boolean add(uwcse.graphics.Shape s)
add
in class uwcse.graphics.GWindow
s
- the shape to be added.
true
if the shape could be added. otherwise false.public boolean addToWindow(uwcse.graphics.Shape s)
s
- shape to add (in true GWindow coordiantes)
true
if shape could be added.protected boolean useColumnarLayout()
true
to use columns, false
for rows.public void fixLabel(java.lang.String s, java.awt.Color c)
s
- the label.protected int getOriginX()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |