Class GArc

GObject
  extended by GFillableObject
      extended by GArc

The GArc class is a graphical object whose appearance consists of an arc. If unfilled, the arc is simply a portion of the circumference of an ellipse; if filled, the arc is a pie-shaped wedge connected to the center of the figure.


Constructor Summary
GArc(width, height, start, sweep)
Creates a new GArc object consisting of an elliptical arc located at the point (0, 0).
GArc(x, y, width, height, start, sweep)
Creates a new GArc object consisting of an elliptical arc inscribed in the rectangle with the specified bounds.
 
Method Summary
getEndPoint()
Returns the point at which the arc ends.
getFrameRectangle()
Returns the bounds of the GRectangle in which this arc is inscribed.
getStartAngle()
Returns the starting angle for this GArc object.
getStartPoint()
Returns the point at which the arc starts.
getSweepAngle()
Returns the sweep angle for this GArc object.
setStartAngle(theta)
Sets the starting angle for this GArc object.
setSweepAngle(sweep)
Sets the sweep angle for this GArc object.
 
Inherited Method Summary
contains(x, y)
Checks to see whether a point is inside the object.
getBounds()
Returns the bounding box for this object.
getColor()
Returns the color used to display this object.
getFillColor()
Returns the color used to display the filled region of this object.
getHeight()
Returns the height of this object, which is defined to be the height of the bounding box.
getLocation()
Returns the location of this object as a GPoint.
getSize()
Returns the size of the bounding box for this object.
getWidth()
Returns the width of this object, which is defined to be the width of the bounding box.
getX()
Returns the x-coordinate of the object.
getY()
Returns the y-coordinate of the object.
isVisible()
Checks to see whether this object is visible.
isFilled()
Returns whether this object is filled.
move(dx, dy)
Moves the object on the screen using the displacements dx and dy.
movePolar(r, theta)
Moves the object using displacements given in polar coordinates.
scale(sf)
Scales the object on the screen by the scale factor sf, which applies in both dimensions.
sendBackward()
Moves this object one step toward the back in the z dimension.
sendForward()
Moves this object one step toward the front in the z dimension.
sendToBack()
Moves this object to the back of the display in the z dimension.
sendToFront()
Moves this object to the front of the display in the z dimension.
setColor(color)
Sets the color used to display this object.
setFillColor(color)
Sets the color used to display the filled region of this object.
setFilled(flag)
Sets whether this object is filled.
setLocation(x, y)
Sets the location of this object to the point (x, y).
setVisible(flag)
Sets whether this object is visible.
 

Constructor Detail

GArc(width, height, start, sweep)

Creates a new GArc object consisting of an elliptical arc located at the point (0, 0). For complete descriptions of the other parameters, see the entry for the GArc constructor that includes explicit x and y parameters.
Usage: garc = GArc(width, height, start, sweep) 
Parameters: 
width  The width of the rectangle in which the arc is inscribed
height  The height of the rectangle in which the arc is inscribed
start  The angle at which the arc begins measured in degrees counterclockwise from the +x axis
sweep  The extent of the arc, measured in degrees counterclockwise
 


GArc(x, y, width, height, start, sweep)

Creates a new GArc object consisting of an elliptical arc inscribed in the rectangle with the specified bounds. The start parameter indicates the angle at which the arc begins and is measured in degrees counterclockwise from the +x axis. Thus, a start angle of 0 indicates an arc that begins along the line running eastward from the center (the 3:00 o’clock position), a start angle of 135 begins along the line running northwest, and a start angle of -90 begins along the line running south (the 6:00 o’clock position). The sweep parameter indicates the extent of the arc and is also measured in degrees counterclockwise. A sweep angle of 90 defines a quarter circle extending counterclockwise from the start angle, and a sweep angle of -180 defines a semicircle extending clockwise.
Usage: garc = GArc(x, y, width, height, start, sweep) 
Parameters: 
 The x-coordinate for the rectangle in which the arc is inscribed
 The y-coordinate for the rectangle in which the arc is inscribed
width  The width of the rectangle in which the arc is inscribed
height  The height of the rectangle in which the arc is inscribed
start  The angle at which the arc begins measured in degrees counterclockwise from the +x axis
sweep  The extent of the arc, measured in degrees counterclockwise
 

Method Detail

getEndPoint()

Returns the point at which the arc ends.
Usage: pt = garc.getEndPoint() 
Returns: The point at which the arc ends
 


getFrameRectangle()

Returns the bounds of the GRectangle in which this arc is inscribed. Note that this is usually different from the bounding box returned by getBounds, which returns the bounding box in which the displayed portion of the arc is contained.
Usage: bounds = garc.getFrameRectangle() 
Returns: The GRectangle in which this arc is inscribed
 


getStartAngle()

Returns the starting angle for this GArc object.
Usage: start = garc.getStartAngle() 
Returns: The starting angle for this arc
 


getStartPoint()

Returns the point at which the arc starts.
Usage: pt = garc.getStartPoint() 
Returns: The point at which the arc starts
 


getSweepAngle()

Returns the sweep angle for this GArc object.
Usage: sweep = garc.getSweepAngle() 
Returns: The sweep angle for this arc
 


setFrameRectangle(x, y, width, height)

Changes the arc bounds to the specified values.
Usage: garc.setFrameRectangle(x, y, width, height) 
Parameters: 
 The x-coordinate for the rectangle in which the arc is inscribed
 The y-coordinate for the rectangle in which the arc is inscribed
width  The width of the rectangle in which the arc is inscribed
height  The height of the rectangle in which the arc is inscribed
 


setStartAngle(theta)

Sets the starting angle for this GArc object.
Usage: garc.setStartAngle(start) 
Parameter: 
start  The new starting angle
 


setSweepAngle(sweep)

Sets the sweep angle for this GArc object.
Usage: garc.setSweepAngle(sweep) 
Parameter: 
sweep  The new sweep angle