|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
Sprite
public class Sprite
Sprite provides support for a turtle's graphics state. This consists of stuff like current heading, current location in TurtleSpace, the set of of pixels that represent it, etc... Associated with this state are the methods to access and manipulate it, e.g., support for FORWARD, RIGHT, POS, HEADING, etc... Commands and Operators.
Sprite must extend Component so that it can use createImage() to supply TGCanvas with its Image.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
ARROW
jLogo comes with a few basic shapes (images) that the turtle may take on. |
static int |
BALL
jLogo comes with a few basic shapes (images) that the turtle may take on. |
static int |
BOX
jLogo comes with a few basic shapes (images) that the turtle may take on. |
static java.lang.String |
CLASS_NAME
Class' name as String. |
static int |
COURIER
Symbolic constant for setlabelfont() to select a fixed-width Courier font. |
static int |
COURIER_BOLD
Symbolic constant for setlabelfont() to select an emboldened fixed-width Courier font. |
static int |
COURIER_BOLD_ITALIC
Symbolic constant for setlabelfont() to select an emboldened and italicized fixed-width Courier font. |
static int |
COURIER_ITALIC
Symbolic constant for setlabelfont() to select an italicized fixed-width Courier font. |
static int |
CROSS
jLogo comes with a few basic shapes (images) that the turtle may take on. |
static int |
DIAMOND
jLogo comes with a few basic shapes (images) that the turtle may take on. |
static int |
LINECAP_BUTT
Symbolic constant for setLinecap() which selects a basic line with no endcap. |
static int |
LINECAP_ROUND
Symbolic constant for setLinecap() to which selects a rounded endcap. |
static int |
LINECAP_SQUARE
Symbolic constant for setLinecap() to which selects a squared-off endcap. |
static int |
MAX_BUILTIN_SHAPENUM
Maximum shape number that Sprite knows how to construct. |
static int |
MAX_LABEL_ASCENT
Largest supported CAPITAL letter ascent |
static int |
MAX_THROTTLE_AMT
To aid debugging and/or optimizing a grapical program it can be helpful to artificially slow down the drawing. |
static int |
NUM_FONTS
Number of fonts supported. |
static int |
SANS_SERIF
Symbolic constant for setlabelfont() to select the Sans Serif font. |
static int |
SANS_SERIF_BOLD
Symbolic constant for setlabelfont() to select an emboldened Sans Serif font. |
static int |
SANS_SERIF_BOLD_ITALIC
Symbolic constant for setlabelfont() to select an emboldened and italicized Sans Serif font. |
static int |
SANS_SERIF_ITALIC
Symbolic constant for setlabelfont() to select an italicized Sans Serif font. |
static int |
SERIF
Symbolic constant for setlabelfont() to select the Serif font. |
static int |
SERIF_BOLD
Symbolic constant for setlabelfont() to select an emboldened Serif font. |
static int |
SERIF_BOLD_ITALIC
Symbolic constant for setlabelfont() to select an emboldened and italicized Serif font. |
static int |
SERIF_ITALIC
Symbolic constant for setlabelfont() to select an italicized Serif font. |
static int |
TRIANGLE
jLogo comes with a few basic shapes (images) that the turtle may take on. |
static int |
TURTLE
jLogo comes with a few basic shapes (images) that the turtle may take on. |
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 |
Constructor Summary | |
---|---|
Sprite(TGCanvas canvas)
Instantiate the graphics sprite associated with a turtle. |
Method Summary | |
---|---|
void |
arc(double angle,
double radius)
Draws an arc of a circle, with the Sprite at the center, with the specified radius, starting at the Sprite's heading and extending clockwise through the specified angle. |
void |
arc(int angle,
int radius)
Draws an arc of a circle, with the Sprite at the center, with the specified radius, starting at the Sprite's heading and extending clockwise through the specified angle. |
void |
back(double steps)
Move this Sprite backwards along its current heading. |
void |
back(float steps)
|
void |
back(int steps)
|
void |
bk(double steps)
|
void |
bk(float steps)
Move this Sprite backwards along its current heading. |
void |
bk(int steps)
|
void |
close()
Clean up before going away. |
int[] |
colorsunder()
Return an array of the unique colors this Sprite's image is positioned over. |
int |
colorunder()
Return the color this Sprite is sitting on, -1 if there is not a current graphics canvas to draw on. |
void |
fd(double steps)
|
void |
fd(float steps)
Move this Sprite forward along its current heading. |
void |
fd(int steps)
|
void |
fill()
Fill a bounded area in the graphics image. |
void |
forward(double steps)
Move this Sprite forward along its current heading. |
void |
forward(float steps)
|
void |
forward(int steps)
|
java.awt.Image |
getImage()
Return this Sprite's Image so it can be drawn on a Canvas by a Graphics object. |
int |
getImageSideSize()
Return the size of a side of this Sprite's Image. |
int |
getLabelWidth(java.lang.String label)
Return the width of the provided String in turtle steps (pixels). |
SpritePixels |
getSpritePixels()
Return this Sprite's SpritePixels object. |
int |
getThrottleSleepAmt()
Get the amount of time (milliseconds) that drawing is suspended each time a method which visibly changes the Sprite's state is performed. |
double |
heading()
Return this Sprite's heading in degrees. |
void |
hideturtle()
Hide this Sprite; make it invisible. |
void |
home()
Move this Sprite to the center of the display. |
void |
ht()
Hide this Sprite; make it invisible. |
boolean |
ispendown()
Return the current status of the pen. |
void |
label(java.lang.String text)
Draws a String of characters onto the graphics canvas. |
void |
left(double degrees)
Rotate this Sprite counterclockwise by the specified angle, measured in degrees. |
void |
left(float degrees)
|
void |
left(int degrees)
|
void |
left(long degrees)
|
void |
lt(double degrees)
|
void |
lt(float degrees)
Rotate this Sprite counterclockwise by the specified angle, measured in degrees. |
void |
lt(int degrees)
|
void |
lt(long degrees)
|
void |
pd()
Put this Sprite's pen in the down position. |
int |
pencolor()
Return the color the pen is currently drawing in. |
void |
pendown()
Put this Sprite's pen in the down position. |
int |
pensize()
Return the width of the pen this Sprite is currently drawing with. |
void |
penup()
Put this Sprite's pen in the up position. |
TGPoint |
pos()
Return the current position of theis Sprite. |
void |
pu()
Put this Sprite's pen in the up position. |
void |
right(double degrees)
Rotate this Sprite clockwise by the specified angle, measured in degrees. |
void |
right(float degrees)
|
void |
right(int degrees)
|
void |
right(long degrees)
|
void |
rt(double degrees)
|
void |
rt(float degrees)
Rotate this Sprite clockwise by the specified angle, measured in degrees. |
void |
rt(int degrees)
|
void |
rt(long degrees)
|
void |
setCanvas(TGCanvas canvas)
Set/clear the reference to this Sprite's graphics canvas. |
void |
seth(double turtleSpaceDegrees)
|
void |
seth(float turtleSpaceDegrees)
Turns this Sprite to the specified absolute heading. |
void |
seth(int turtleSpaceDegrees)
|
void |
seth(long turtleSpaceDegrees)
|
void |
setheading(double turtleSpaceDegrees)
Turns this Sprite to the specified absolute heading. |
void |
setheading(float turtleSpaceDegrees)
|
void |
setheading(int turtleSpaceDegrees)
|
void |
setheading(long turtleSpaceDegrees)
|
void |
setlabelfont(int fontNumber)
Set the font for LABELs. |
void |
setlabelheight(int size)
Set the size of the text displayed in the graphics area. |
void |
setLinecap(int type)
Set the type of linecaps applied to the ends of lines drawn. |
void |
setpc(int logoColorNum)
Sets the color of this Sprite's pen to the supplied number. |
void |
setpencolor(int colorNum)
Sets the color of this Sprite's pen to the supplied number. |
void |
setpenpattern(int[] pattern)
Set the pattern used to draw lines. |
void |
setpensize(int width)
Sets the width of this Sprite's pen to the supplied number. |
boolean |
setshape(int shapeNum,
int[] params)
Sets the shape of this Sprite - its pixel image. |
void |
setshape(SpritePixels newSpritePixels)
Sets the shape of this Sprite - its pixel image. |
void |
setThrottleSleepAmt(int newThrottleSleepAmt)
Set the amount of time (milliseconds) that drawing is suspended each time a method which visibly changes the Sprite's state is performed. |
void |
setx(double newX)
|
void |
setx(float newX)
Move this Sprite to an absolute display position. |
void |
setx(int newX)
|
void |
setx(long newX)
|
void |
setxy(double newX,
double newY)
Move this Sprite to an absolute display position. |
void |
setxy(float newX,
float newY)
|
void |
setxy(int newX,
int newY)
|
void |
setxy(long newX,
long newY)
|
void |
setxy(TGPoint newPt)
Move this Sprite to an absolute display position. |
void |
sety(double newY)
|
void |
sety(float newY)
Move this Sprite to an absolute display position. |
void |
sety(int newY)
|
void |
sety(long newY)
|
boolean |
shownp()
Return true if this Sprite's image is being displayed on the graphics canvas, else return false. |
void |
showturtle()
Show this Sprite; make it visible. |
void |
st()
Show this Sprite; make it visible. |
void |
stamp()
Draw the current Sprite Image onto the graphics canvas. |
java.lang.String |
toString()
Return String representation of this Sprite consisting of lots of its state; to be used when debugging. |
double |
xcor()
Return this Sprite's X-coordinate |
double |
ycor()
Return this Sprite's Y-coordinate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CLASS_NAME
public static final int TURTLE
public static final int ARROW
public static final int BALL
public static final int BOX
public static final int CROSS
public static final int TRIANGLE
public static final int DIAMOND
public static final int MAX_BUILTIN_SHAPENUM
public static final int LINECAP_BUTT
public static final int LINECAP_ROUND
public static final int LINECAP_SQUARE
public static final int COURIER
public static final int COURIER_BOLD
public static final int COURIER_ITALIC
public static final int COURIER_BOLD_ITALIC
public static final int SANS_SERIF
public static final int SANS_SERIF_BOLD
public static final int SANS_SERIF_ITALIC
public static final int SANS_SERIF_BOLD_ITALIC
public static final int SERIF
public static final int SERIF_BOLD
public static final int SERIF_ITALIC
public static final int SERIF_BOLD_ITALIC
public static final int MAX_LABEL_ASCENT
public static final int MAX_THROTTLE_AMT
public static final int NUM_FONTS
Constructor Detail |
---|
public Sprite(TGCanvas canvas)
Method Detail |
---|
public void arc(double angle, double radius)
angle
- clockwise rotation from current heading (in degrees)radius
- distance from center of Sprite to the drawn arc,
to the center of the arc line if the pen width
is greater than 1.public void arc(int angle, int radius)
angle
- clockwise rotation from current heading (in degrees)radius
- distance from center of Sprite to the drawn arc,
to the center of the arc line if the pen width
is greater than 1.public void back(double steps) throws AbortException
Long name for bk(). Both spellings need to provided for compatibility.
steps
- Number of pixels (in this implementation) to take.
AbortException
bk(float)
public void back(float steps) throws AbortException
AbortException
public void back(int steps) throws AbortException
AbortException
public void bk(float steps) throws AbortException
Abbreviation for back(). Both spellings need to provided for compatibility.
steps
- Number of pixels (in this implementation) to take.
AbortException
back(double)
public void bk(int steps) throws AbortException
AbortException
public void bk(double steps) throws AbortException
AbortException
public void close()
public int[] colorsunder()
pencolor()
,
setpc(int)
,
setpencolor(int)
public int colorunder()
pencolor()
,
setpc(int)
,
setpencolor(int)
public void fill()
Perform a flood-fill operation starting at the Sprite's current position. The current pixel, and any of its neighbors that are the same color as it (and any of their neighbors that are the same color as it, etc...) are changed to the current color.
For more * information on flood-fill, see the wikipedia entry or google for it.
public void fd(float steps) throws AbortException
Abbreviation for forward(). Both spellings need to provided for compatibility.
steps
- Distance in TurtleSpace to move.
AbortException
forward(double)
public void fd(int steps) throws AbortException
AbortException
public void fd(double steps) throws AbortException
AbortException
public void forward(double steps) throws AbortException
Long name for fd(). Both spellings need to provided for compatibility.
steps
- Number of pixels (in this implementation) to take.
AbortException
fd(float)
public void forward(float steps) throws AbortException
AbortException
public void forward(int steps) throws AbortException
AbortException
public java.awt.Image getImage()
public int getImageSideSize()
getImage()
public int getLabelWidth(java.lang.String label)
label(java.lang.String)
public SpritePixels getSpritePixels()
public int getThrottleSleepAmt()
public double heading()
Logo's TurtleSpace does not match the mathematical convention of measuring angles counter-clockwise from the positive X axis. Logo defines NORTH (+Y axis) as 0 degrees and degrees increase in the clockwise direction, so East is 90 degrees, South is 180 degrees and West is 270 degrees.
seth(float)
,
setheading(double)
public void hideturtle()
Long name for ht(). Both spellings need to provided for compatibility.
ht()
,
showturtle()
,
st()
public void home() throws AbortException
Home is equivilent to setxy( 0, 0 )
AbortException
setxy(double, double)
public void ht()
Abbreviation for hideturtle(). Both spellings need to provided for compatibility.
hideturtle()
,
showturtle()
,
st()
public boolean ispendown()
pendown()
,
penup()
,
pd()
,
pu()
public void label(java.lang.String text)
The text is always drawn in the standard horizontal manner, i.e., the heading of this Sprite is ignored.
text
- characters to be drawn on the display.public void left(double degrees) throws AbortException
degrees
- Angle to change this Sprite's heading by.
AbortException
lt(float)
public void left(float degrees) throws AbortException
AbortException
public void left(int degrees) throws AbortException
AbortException
public void left(long degrees) throws AbortException
AbortException
public void lt(float degrees) throws AbortException
Abbreviation for left(). Both spellings need to provided for compatibility.
degrees
- Angle to change this Sprite's heading by.
AbortException
left(double)
public void lt(int degrees) throws AbortException
AbortException
public void lt(long degrees) throws AbortException
AbortException
public void lt(double degrees) throws AbortException
AbortException
public void pd()
When this Sprite moves, it will leave a trace from its current position to its destination (its new position).
ispendown()
,
pendown()
,
pu()
,
penup()
public int pencolor()
setpc(int)
,
setpencolor(int)
public void pendown()
When this Sprite moves, it will leave a trace from its current position to its destination (its new position).
ispendown()
,
pd()
,
pu()
,
penup()
public int pensize()
setpensize(int)
public TGPoint pos()
public void pu()
When this Sprite moves, it will leave no trace.
ispendown()
,
pd()
,
pendown()
,
penup()
public void penup()
When this Sprite moves, it will leave no trace.
ispendown()
,
pd()
,
pendown()
,
pu()
public void right(double degrees) throws AbortException
degrees
- Angle to change this Sprite's heading by.
AbortException
rt(float)
public void right(float degrees) throws AbortException
AbortException
public void right(int degrees) throws AbortException
AbortException
public void right(long degrees) throws AbortException
AbortException
public void rt(float degrees) throws AbortException
Abbreviation for right(). Both spellings need to provided for compatibility.
degrees
- Angle to change this Sprite's heading by.
AbortException
right(double)
public void rt(int degrees) throws AbortException
AbortException
public void rt(long degrees) throws AbortException
AbortException
public void rt(double degrees) throws AbortException
AbortException
public void setCanvas(TGCanvas canvas)
public void seth(float turtleSpaceDegrees) throws AbortException
Abbreviation for setheading(). Both spellings need to provided for compatibility.
turtleSpaceDegrees
- number of 1/360ths increments clockwise
from the positive Y axis.
AbortException
setheading(double)
public void seth(int turtleSpaceDegrees) throws AbortException
AbortException
public void seth(long turtleSpaceDegrees) throws AbortException
AbortException
public void seth(double turtleSpaceDegrees) throws AbortException
AbortException
public void setheading(double turtleSpaceDegrees) throws AbortException
turtleSpaceDegrees
- number of 1/360ths increments clockwise
from the positive Y axis.
AbortException
seth(float)
public void setheading(float turtleSpaceDegrees) throws AbortException
AbortException
public void setheading(int turtleSpaceDegrees) throws AbortException
AbortException
public void setheading(long turtleSpaceDegrees) throws AbortException
AbortException
public void setlabelfont(int fontNumber)
fontNumber
- an integer representing a font face
and font style.
Number Font Style ------ ---------- ----------- 0 Courier Plain 1 Courier Bold 2 Courier Italic 3 Courier Bold Italic 4 Sans Serif Plain 5 Sans Serif Bold 6 Sans Serif Italic 7 Sans Serif Bold Italic 8 Serif Plain 9 Serif Bold 10 Serif Italic 11 Serif Bold Italic
label(java.lang.String)
,
setlabelheight(int)
,
COURIER
,
COURIER_BOLD
,
COURIER_ITALIC
,
COURIER_BOLD_ITALIC
,
SANS_SERIF
,
SANS_SERIF_BOLD
,
SANS_SERIF_ITALIC
,
SANS_SERIF_BOLD_ITALIC
,
SERIF
,
SERIF_BOLD
,
SERIF_ITALIC
,
SERIF_BOLD_ITALIC
public void setlabelheight(int size)
label(java.lang.String)
public void setLinecap(int type)
type
- an integer representing a linecap
Number Linecap ------ ------- 0 BUTT 1 ROUND 2 SQUARE
arc(double, double)
,
forward(double)
,
LINECAP_BUTT
,
LINECAP_ROUND
,
LINECAP_SQUARE
public void setpc(int logoColorNum)
logoColorNum
- numbers 0-31 are:
Number Color Number Color Number Color ------ ---------- ------ ---------- ------ --------- 0 black 11 aqua 22 gold 1 blue 12 salmon 23 lightgray 2 green 13 purple 24 peru 3 cyan 14 orange 25 wheat 4 red 15 grey 26 palegreen 5 magenta 16 navy 27 lightblue 6 yellow 17 skyblue 28 khaki 7 white 18 lime 29 pink 8 brown 19 steelblue 30 lawngreen 9 light brown 20 chocolate 31 olive 10 forest 21 purple
Color numbers greater than 31 will be assumed to be RGB values with the red component in bits 8-15, the green component in bits 16-23, and the blue component in bits 24-31. The actual color used in rendering will depend on finding the best match given the color space available for a given display.
pencolor()
,
setpencolor(int)
public void setpencolor(int colorNum)
colorNum
- numbers 0-31 are:
Number Color Number Color Number Color ------ ---------- ------ ---------- ------ --------- 0 black 11 aqua 22 gold 1 blue 12 salmon 23 lightgray 2 green 13 purple 24 peru 3 cyan 14 orange 25 wheat 4 red 15 grey 26 palegreen 5 magenta 16 navy 27 lightblue 6 yellow 17 skyblue 28 khaki 7 white 18 lime 29 pink 8 brown 19 steelblue 30 lawngreen 9 light brown 20 chocolate 31 olive 10 forest 21 purpleColor numbers greater than 15 will be assumed to be RGB values with the red component in bits 8-15, the green component in bits 16-23, and the blue component in bits 24-31. The actual color used in rendering will depend on finding the best match given the color space available for a given display.
setpc(int)
public void setpenpattern(int[] pattern)
pattern
- array of draw/skip amounts. If pattern has an odd
number of elements, the last draw amount is duplicated for
the skip amount, producing an array one element larger.pendown()
,
penup()
,
pd()
,
pu()
public void setpensize(int width)
width
- small positive number; 1 (or less) results
in a single pixel line.public boolean setshape(int shapeNum, int[] params)
shapeNum
- small positive number; 0 for default
Sprite; see constants (e.g., BALL, BOX,
etc...) for other Sprite image shapes...params
- an optional int array containing sizing
information hints, e.g. radius of a ball,
width and height of a box, etc...
Number Shape Optional Size Parameters ------ -------- ------------------------ 0 Turtle 1 Arrow width, height 2 Ball diameter 3 Box width, height 4 Cross width, height 5 Triangle width, height 6 Diamond width, height
TURTLE
,
ARROW
,
BALL
,
BOX
,
CROSS
,
TRIANGLE
,
DIAMOND
public void setshape(SpritePixels newSpritePixels)
newSpritePixels
- - instance of an object extending SpritePixels
which provides an image for a Sprite.public void setThrottleSleepAmt(int newThrottleSleepAmt)
public void setx(float newX) throws AbortException
Move this Sprite horizontally to a new location specified as an X coordinate argument.
newX
- the X-coordinate of destination.
AbortException
home()
,
setxy(double, double)
,
sety(float)
public void setx(int newX) throws AbortException
AbortException
public void setx(long newX) throws AbortException
AbortException
public void setx(double newX) throws AbortException
AbortException
public void setxy(double newX, double newY) throws AbortException
Move this Sprite to the x and y coordinates provided as arguments.
newX
- the X-coordinate of destination.newY
- the Y-coordinate of destination.
AbortException
home()
,
setx(float)
,
sety(float)
public void setxy(float newX, float newY) throws AbortException
AbortException
public void setxy(int newX, int newY) throws AbortException
AbortException
public void setxy(long newX, long newY) throws AbortException
AbortException
public void setxy(TGPoint newPt) throws AbortException
Move this Sprite to the x and y coordinates provided in the TGPoint parameter.
newPt
- a TGPoint objext containing the X-coordinate
and Y-coordinate of destination.
AbortException
home()
,
setx(float)
,
sety(float)
public void sety(float newY) throws AbortException
Move this Sprite vertically to a new location specified as an Y coordinate argument.
newY
- the Y-coordinate of destination.
AbortException
home()
,
setx(float)
,
setxy(double, double)
public void sety(int newY) throws AbortException
AbortException
public void sety(long newY) throws AbortException
AbortException
public void sety(double newY) throws AbortException
AbortException
public boolean shownp()
hideturtle()
,
ht()
,
showturtle()
,
st()
public void showturtle()
Long name for st(). Both spellings need to provided for compatibility.
hideturtle()
,
ht()
,
st()
public void st()
Abbreviation for showturtle(). Both spellings need to provided for compatibility.
hideturtle()
,
ht()
,
showturtle()
public void stamp()
public java.lang.String toString()
toString
in class java.awt.Component
public double xcor()
setxy(double, double)
,
setx(float)
,
sety(float)
,
ycor()
public double ycor()
setxy(double, double)
,
setx(float)
,
sety(float)
,
xcor()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |