|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
javax.swing.JApplet
cmsc420.drawing.CanvasPlus
public class CanvasPlus
A general 2D drawing utility backed by Java AWT. CanvasPlus allows
simple 2D graphics primitives to be placed into the scene and then drawn, by
invoking the draw()
method. The coordinate system used in
CanvasPlus places (0,0) in the lower-left corner of the window.
setScaleMode(int)
). Background color can now be specified, and most
notably, the draw()
method no longer blocks execution until the
window is closed. However, users can still invoke a blocking draw method (see
drawBlocking()
).
Animation is also supported by this version of CanvasPlus in a
more sophisticated manner. By using the lookAt(int,int)
method,
users can programmatically scroll the canvas if the scale mode is fixed or
scrollable (for scaled-to-fit and fixed aspect modes, the entire canvas is
always visible within the window, so "looking at" a portion of the screen
would serve no purpose). For animation, the ideal scale mode is none. Scale
modes can be changed at any time (including while the scene is considered
live, i.e., after its draw method has been invoked but
before the window is closed).
Warning: be aware that any and all statements following
draw()
will continue to execute while the window is open,
and may take precedence. For example:
drawBlocking()
instead, which
will only return when the window is no longer open. Alternatively,
suspendUntilClosed()
can be called at any time after draw()
to prevent further execution until the window is closed. Be advised, however,
that in multi-threaded environments, other threads may still proceed.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.BaselineResizeBehavior |
Field Summary | |
---|---|
static int |
SCALE_FIT
A flag that, when specified, directs an instance of CanvasPlus to scale all coordinates to fit within the space provided by the enclosing window. |
static int |
SCALE_FIXED_ASPECT
A flag that, when specified, directs an instance of CanvasPlus to scale coordinates to fit within the space provided by the enclosing window with respect to the aspect ratio of the initial window. |
static int |
SCALE_NONE
A flag that, when specified, directs an instance of CanvasPlus not to use any scaling. |
static int |
SCALE_SCROLL
A flag that, when specified, directs an instance of CanvasPlus to display scroll bars as needed to to provide viewing access to all portions of the coordinate space. |
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 | |
---|---|
CanvasPlus()
Creates a new instance of CanvasPlus with the default title "untitled" and default width and height [512,512]. |
|
CanvasPlus(java.lang.String title)
Creates a new instance of CanvasPlus with the specified title and default width and height [512,512]. |
|
CanvasPlus(java.lang.String title,
java.awt.Dimension dim)
Creates a new instance of CanvasPlus with the specified title, width, and height. |
|
CanvasPlus(java.lang.String title,
int width,
int height)
Creates a new instance of CanvasPlus with the specified title, width, and height. |
Method Summary | |
---|---|
void |
add(Drawable2D obj)
Adds an implementor of Drawable2D into the scene depicted by this
CanvasPlus |
boolean |
addCircle(double x,
double y,
double radius,
java.awt.Color color,
boolean filled)
Adds a circle into the scene. |
boolean |
addCircle(float x,
float y,
float radius,
java.awt.Color color,
boolean filled)
Adds a circle into the scene. |
boolean |
addCross(double x,
double y,
double radius,
java.awt.Color color)
Adds an axis-aligned orthogonal cross into the scene. |
boolean |
addCross(float x,
float y,
float radius,
java.awt.Color color)
Adds an axis-aligned orthogonal cross into the scene. |
boolean |
addLine(double x1,
double y1,
double x2,
double y2,
java.awt.Color color)
Adds a line segment into the scene. |
boolean |
addLine(float x1,
float y1,
float x2,
float y2,
java.awt.Color color)
Adds a line segment into the scene. |
boolean |
addPoint(java.lang.String caption,
double x,
double y,
java.awt.Color color)
Adds a labeled point into the scene. |
boolean |
addPoint(java.lang.String caption,
float x,
float y,
java.awt.Color color)
Adds a labeled point into the scene. |
boolean |
addRectangle(double x,
double y,
double width,
double height,
java.awt.Color color,
boolean filled)
Adds a rectangle into the scene. |
boolean |
addRectangle(float x,
float y,
float width,
float height,
java.awt.Color color,
boolean filled)
Adds a rectangle into the scene. |
boolean |
addText(java.lang.String text,
int x,
int y)
Adds a text label into the scene. |
void |
clear()
Clears the map by clearing all of the shapes that are drawn when draw() is called. |
void |
dispose()
Close the applet and release all of the native resources used by this Window, its subcomponents, and all of its children. |
void |
draw()
Opens a window and displays the current scene depicted by this CanvasPlus. |
void |
draw(int scaleMode)
|
void |
drawBlocking()
Opens a window and displays the current scene depicted by this CanvasPlus, blocking all further execution until the user closes the window. |
void |
drawBlocking(int scaleMode)
|
java.awt.Color |
getBackgroundColor()
Returns the current background color of this CanvasPlus. |
java.awt.Font |
getFont()
Returns the default font in which all future text added to this CanvasPlus will be rendered. |
java.awt.Dimension |
getFrameSize()
Gets the current size of the visible window if this CanvasPlus is live. |
java.awt.geom.Point2D.Float |
getMax()
Returns the point composed of the largest X-value and the largest Y-value so far added to this CanvasPlus. |
java.awt.geom.Point2D.Float |
getMin()
Returns the point composed of the smallest X-value and the smallest Y-value so far added to this CanvasPlus. |
int |
getScaleMode()
Returns the current scale mode in use by this CanvasPlus. |
java.awt.Dimension |
getScrollableRange()
Returns the scrollable extent of this CanvasPlus. |
int |
getShapeCount()
Returns the number of graphics primitives added to this CanvasPlus. |
java.awt.Dimension |
getSize()
Returns the size of this CanvasPlus. |
void |
init()
Called by the browser or applet viewer to inform this applet that it has been loaded into the system. |
boolean |
isLive()
Indicates whether or not the scene is currently live (i.e., the drawing window is open). |
void |
lookAt(double x,
double y)
Centers the visible portion of the scene depicted by this CanvasPlus around the point given in double precision. |
void |
lookAt(float x,
float y)
Centers the visible portion of the scene depicted by this CanvasPlus around the point given in floating point precision. |
void |
lookAt(int x,
int y)
Centers the visible portion of the scene depicted by this CanvasPlus around the given point. |
void |
lookAt(java.awt.geom.Point2D.Double p)
Centers the visible portion of the scene depicted by this CanvasPlus around the specified point. |
void |
lookAt(java.awt.geom.Point2D.Float p)
Centers the visible portion of the scene depicted by this CanvasPlus around the specified point. |
boolean |
removeCircle(double x,
double y,
double radius,
java.awt.Color color,
boolean filled)
Adds a circle into the scene. |
boolean |
removeCircle(float x,
float y,
float radius,
java.awt.Color color,
boolean filled)
Adds a circle into the scene. |
boolean |
removeCross(double x,
double y,
double radius,
java.awt.Color color)
Removes an axis-aligned orthogonal cross from the scene. |
boolean |
removeCross(float x,
float y,
float radius,
java.awt.Color color)
Removes an axis-aligned orthogonal cross from the scene. |
boolean |
removeLine(double x1,
double y1,
double x2,
double y2,
java.awt.Color color)
Removes a line segment from the scene. |
boolean |
removeLine(float x1,
float y1,
float x2,
float y2,
java.awt.Color color)
Removes a line segment from the scene. |
boolean |
removePoint(java.lang.String caption,
double x,
double y,
java.awt.Color color)
Removes a labeled point from the scene. |
boolean |
removePoint(java.lang.String caption,
float x,
float y,
java.awt.Color color)
Removes a labeled point from the scene. |
boolean |
removeRectangle(double x,
double y,
double width,
double height,
java.awt.Color color,
boolean filled)
Removes a rectangle from the scene. |
boolean |
removeRectangle(float x,
float y,
float width,
float height,
java.awt.Color color,
boolean filled)
Removes a rectangle from the scene. |
boolean |
removeText(java.lang.String text,
int x,
int y)
Removes a text label from the scene. |
void |
repaint()
Causes the Swing components of this CanvasPlus to repaint themselves. |
void |
save(java.lang.String name)
Saves the current drawing pane to the file: <name>.png |
void |
setBackgroundColor(java.awt.Color color)
Sets the background color of this CanvasPlus |
void |
setBounds(float xMin,
float yMin,
float xMax,
float yMax)
|
void |
setFont(java.awt.Font f)
Sets the default font in which all future text added to this CanvasPlus will be rendered. |
void |
setFont(java.lang.String face,
int style,
int size)
Sets the default font in which all future text added to this CanvasPlus will be rendered. |
void |
setFrameSize(java.awt.Dimension newSize)
Sets the current size of the visible window if this CanvasPlus is live. |
void |
setFrameSize(int width,
int height)
Sets the current size of the visible window if this CanvasPlus is live. |
void |
setScaleMode(int scaleMode)
Sets the scale mode for this CanvasPlus. |
void |
setSize(java.awt.Dimension newSize)
Sets the size of this CanvasPlus. |
void |
setSize(int width,
int height)
Sets the size of this CanvasPlus. |
void |
start()
Called by the browser or applet viewer to inform this applet that it should start its execution. |
void |
stop()
See Applet.stop() for suggestions on overriding this
method. |
void |
suspendUntilClosed()
Causes the calling thread to perform busy-waiting until the window opened by draw() is closed. |
Methods inherited from class javax.swing.JApplet |
---|
getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update |
Methods inherited from class java.applet.Applet |
---|
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus |
Methods inherited from class java.awt.Panel |
---|
addNotify |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, requestFocus, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int SCALE_NONE
public static final int SCALE_SCROLL
public static final int SCALE_FIT
public static final int SCALE_FIXED_ASPECT
Constructor Detail |
---|
public CanvasPlus()
public CanvasPlus(java.lang.String title)
title
- the title caption of the window opened to view this canvaspublic CanvasPlus(java.lang.String title, java.awt.Dimension dim)
title
- the title caption of the window opened to view this canvasdim
- the dimensions of this CanvasPlus in screen spacepublic CanvasPlus(java.lang.String title, int width, int height)
title
- the title caption of the window opened to view this canvaswidth
- the width of this CanvasPlus in screen spaceheight
- the height of this CanvasPlus in scree spaceMethod Detail |
---|
public final void init()
Note to extenders: this method is marked final; its body contains only a call to the non-final method setup(). To override this method, override setup() instead.
init
in class java.applet.Applet
setup()
public final void start()
Note to extenders: this method is marked final; its body contains only a call to the non-final method run(). Because some browsers will not display anything in the applet body until this method exits, run() is wrapped in its own thread which will acquire a lock on this CanvasPlus, thus other threads wishing to invoke synchronized methods on this CanvasPlus will be blocked.
start
in class java.applet.Applet
run()
public void save(java.lang.String name) throws java.io.IOException
Note: The resources used by CanvasPlus
will not be cleared
until dispose()
is called.
name
- name of the png file the current drawing pane will be saved to
java.io.IOException
- problem accessing the image filepublic void clear()
draw()
is called.
public void dispose()
public void stop()
Applet.stop()
for suggestions on overriding this
method. The default implementation for CanvasPlus does
nothing. Because stop() is less crucial to successful
operation of this CanvasPlus as an applet, it is not marked
final, but in general extenders should override teardown().
stop
in class java.applet.Applet
Applet.stop()
public void draw()
drawBlocking()
.
drawBlocking()
public void draw(int scaleMode)
public void drawBlocking(int scaleMode)
public void drawBlocking()
draw()
public void suspendUntilClosed()
draw()
public void repaint()
repaint
in class java.awt.Component
public void lookAt(int x, int y)
If the current scale mode is set to SCALE_FIT or SCALE_FIXED_ASPECT, this method will have no effect since the entire scene is always visible under these scaling modes.
x
- the X coordinate of the new center of focusy
- the y-croodinate of the new center of focuspublic void lookAt(float x, float y)
x
- the X coordinate of the new center of focusy
- the y-croodinate of the new center of focuslookAt(int,int)
public void lookAt(double x, double y)
x
- the X coordinate of the new center of focusy
- the y-croodinate of the new center of focuslookAt(int,int)
public void lookAt(java.awt.geom.Point2D.Float p)
p
- the new point at which focus will be centeredlookAt(int,int)
public void lookAt(java.awt.geom.Point2D.Double p)
p
- the new point at which focus will be centeredlookAt(int,int)
public java.awt.Dimension getScrollableRange()
lookAt(int,int)
method. In general, a call to
lookAt(0,0) will scroll to the upper-left corner of the
visible area and a call to lookAt(d.width, d.height) where
d is the value returned by this function will scroll to the
lower-right corner of the visible area.
Note: this method will return unreliable values until the scene is live. In other words, before a call to draw() or drawBlocking() has been made, the value returned by this method is undefined. It will be non-null, but will most likely return a Dimension whose width and height values are one half of the current specified size for this CanvasPlus.
public boolean isLive()
public java.awt.Dimension getSize()
getSize
in class java.awt.Component
Dimension
containing the width
and height of this CanvasPlusgetFrameSize()
public void setSize(int width, int height)
setSize
in class java.awt.Component
width
- the new desired width of this CanvasPlusheight
- the new desired height of this CanvasPlussetFrameSize(int,int)
public void setSize(java.awt.Dimension newSize)
setSize
in class java.awt.Component
newSize
- the new desired dimensions of this CanvasPlussetFrameSize(int,int)
public void setBounds(float xMin, float yMin, float xMax, float yMax)
public java.awt.Dimension getFrameSize()
public void setFrameSize(int width, int height)
width
- the new desired width of the visible windowheight
- the new desired height of the visible windowpublic void setFrameSize(java.awt.Dimension newSize)
newSize
- the new desired dimensions of the visible windowpublic java.awt.geom.Point2D.Float getMax()
Point2D.Float
containing the
largest X- and Y-values present in this CanvasPluspublic java.awt.geom.Point2D.Float getMin()
Point2D.Float
containing the
smallest X- and Y-values present in this CanvasPluspublic java.awt.Font getFont()
getFont
in interface java.awt.MenuContainer
getFont
in class java.awt.Component
public void setFont(java.awt.Font f)
setFont
in class java.awt.Container
f
- the new font to be associated with this CanvasPluspublic void setFont(java.lang.String face, int style, int size)
face
- the font facestyle
- the style of the font (such as bold, italic, etc)size
- the size of the fontpublic java.awt.Color getBackgroundColor()
public void setBackgroundColor(java.awt.Color color)
color
- the new background colorpublic int getScaleMode()
public void setScaleMode(int scaleMode)
scaleMode
- the scale mode to use for this CanvasPlus
java.lang.IllegalArgumentException
- if scaleMode is not one of SCALE_NONE
,
SCALE_SCROLL
, SCALE_FIT
,
SCALE_FIXED_ASPECT
public int getShapeCount()
public void add(Drawable2D obj)
Drawable2D
into the scene depicted by this
CanvasPlus
obj
- the object to draw onto this CanvasPlus
CircularMethodInvocationException
- if obj.draw(this) invokes this methodpublic boolean addLine(float x1, float y1, float x2, float y2, java.awt.Color color)
x1
- the X coordinate of the start pointy1
- the Y coordinate of the start pointx2
- the X coordinate of the end pointy2
- the Y coordinate of the end point
true
, as per contract with queuepublic boolean addLine(double x1, double y1, double x2, double y2, java.awt.Color color)
x1
- the X coordinate of the start pointy1
- the Y coordinate of the start pointx2
- the X coordinate of the end pointy2
- the Y coordinate of the end point
true
, as per contract with queuepublic boolean removeLine(float x1, float y1, float x2, float y2, java.awt.Color color)
x1
- the X coordinate of the start pointy1
- the Y coordinate of the start pointx2
- the X coordinate of the end pointy2
- the Y coordinate of the end point
true
if the shape queue contained the shapepublic boolean removeLine(double x1, double y1, double x2, double y2, java.awt.Color color)
x1
- the X coordinate of the start pointy1
- the Y coordinate of the start pointx2
- the X coordinate of the end pointy2
- the Y coordinate of the end point
true
if the shape queue contained the shapepublic boolean addCircle(float x, float y, float radius, java.awt.Color color, boolean filled)
x
- the X coordinate of the circle's centery
- the Y coordinate of the circle's centerradius
- the circle's radiusfilled
- true if the circle is solid (filled) or
false if it is just an outline
true
, as per contract with queuepublic boolean addCircle(double x, double y, double radius, java.awt.Color color, boolean filled)
x
- the X coordinate of the circle's centery
- the Y coordinate of the circle's centerradius
- the circle's radiusfilled
- true if the circle is solid (filled) or
false if it is just an outline
true
, as per contract with queuepublic boolean removeCircle(float x, float y, float radius, java.awt.Color color, boolean filled)
x
- the X coordinate of the circle's centery
- the Y coordinate of the circle's centerradius
- the circle's radiusfilled
- true if the circle is solid (filled) or
false if it is just an outline
true
if the shape queue contained the shapepublic boolean removeCircle(double x, double y, double radius, java.awt.Color color, boolean filled)
x
- the X coordinate of the circle's centery
- the Y coordinate of the circle's centerradius
- the circle's radiusfilled
- true if the circle is solid (filled) or
false if it is just an outline
true
if the shape queue contained the shapepublic boolean addRectangle(float x, float y, float width, float height, java.awt.Color color, boolean filled)
x
- the X coordinate of the lower-left corner of the rectangley
- the Y coordinate of the lower-left corner of the rectanglewidth
- the width of the rectangleheight
- the height of the rectanglefilled
- true if the rectangle is solid (filled) or
false if it is just an outline
true
, as per contract with queuepublic boolean addRectangle(double x, double y, double width, double height, java.awt.Color color, boolean filled)
x
- the X coordinate of the lower-left corner of the rectangley
- the Y coordinate of the lower-left corner of the rectanglewidth
- the width of the rectangleheight
- the height of the rectanglefilled
- true if the rectangle is solid (filled) or
false if it is just an outline
true
, as per contract with queuepublic boolean removeRectangle(float x, float y, float width, float height, java.awt.Color color, boolean filled)
x
- the X coordinate of the lower-left corner of the rectangley
- the Y coordinate of the lower-left corner of the rectanglewidth
- the width of the rectangleheight
- the height of the rectanglefilled
- true if the rectangle is solid (filled) or
false if it is just an outline
true
if the shape queue contained the shapepublic boolean removeRectangle(double x, double y, double width, double height, java.awt.Color color, boolean filled)
x
- the X coordinate of the lower-left corner of the rectangley
- the Y coordinate of the lower-left corner of the rectanglewidth
- the width of the rectangleheight
- the height of the rectanglefilled
- true if the rectangle is solid (filled) or
false if it is just an outline
true
if the shape queue contained the shapepublic boolean addPoint(java.lang.String caption, float x, float y, java.awt.Color color)
caption
- the point's labelx
- the X coordinate of the pointy
- the Y coordinate of the point
true
, as per contract with queuepublic boolean addPoint(java.lang.String caption, double x, double y, java.awt.Color color)
caption
- the point's labelx
- the X coordinate of the pointy
- the Y coordinate of the point
true
, as per contract with queuepublic boolean removePoint(java.lang.String caption, float x, float y, java.awt.Color color)
caption
- the point's labelx
- the X coordinate of the pointy
- the Y coordinate of the point
true
if the shape queue contained the shapepublic boolean removePoint(java.lang.String caption, double x, double y, java.awt.Color color)
caption
- the point's labelx
- the X coordinate of the pointy
- the Y coordinate of the point
true
if the shape queue contained the shapepublic boolean addText(java.lang.String text, int x, int y)
text
- the text of the labelx
- the X coordinate of the upper-left corner of the texty
- the Y coordinate of the upper-left corner of the text
true
, as per contract with queuepublic boolean removeText(java.lang.String text, int x, int y)
text
- the text of the labelx
- the X coordinate of the upper-left corner of the texty
- the Y coordinate of the upper-left corner of the text
true
if the shape queue contained the shapepublic boolean addCross(float x, float y, float radius, java.awt.Color color)
x
- the X coordinate of the center of the crossy
- the Y coordinate of the center of the crossradius
- the radius of the cross (the distance from the center of the
cross to each of its four endpoints)
true
, as per contract with queuepublic boolean addCross(double x, double y, double radius, java.awt.Color color)
x
- the X coordinate of the center of the crossy
- the Y coordinate of the center of the crossradius
- the radius of the cross (the distance from the center of the
cross to each of its four endpoints)
true
, as per contract with queuepublic boolean removeCross(float x, float y, float radius, java.awt.Color color)
x
- the X coordinate of the center of the crossy
- the Y coordinate of the center of the crossradius
- the radius of the cross (the distance from the center of the
cross to each of its four endpoints)
true
if the shape queue contained the shapepublic boolean removeCross(double x, double y, double radius, java.awt.Color color)
x
- the X coordinate of the center of the crossy
- the Y coordinate of the center of the crossradius
- the radius of the cross (the distance from the center of the
cross to each of its four endpoints)
true
if the shape queue contained the shape
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |