|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rit.draw.item.Bullet
public class Bullet
Class Bullet provides various kinds of bullets that can be added to a Text item. The bullet is always added to the left of the text item, with a specified distance from the left side of the bullet to the left side of the text item.
| Field Summary | |
|---|---|
static Bullet |
CIRCLE
A bullet in the shape of a medium sized circle, offset the normal offset (36.0, or 1/2 inch) from the text item. |
static Bullet |
DOT
A bullet in the shape of a medium sized dot, offset the normal offset (36.0, or 1/2 inch) from the text item. |
static Bullet |
NONE
A nonexistent bullet. |
static double |
NORMAL_OFFSET
The normal bullet offset, 36.0 (1/2 inch). |
| Constructor Summary | |
|---|---|
Bullet()
Construct a new nonexistent bullet. |
|
Bullet(Bullet theBullet)
Construct a new bullet of the same kind as the given bullet, but with the default offset. |
|
| Method Summary | |
|---|---|
static double |
defaultOffset()
Returns the default offset for bullets. |
static void |
defaultOffset(double theOffset)
Set the default offset for bullets. |
void |
draw(Graphics2D g2d,
double ascent,
double x,
double y)
Draw this bullet in the given graphics context. |
double |
offset()
Returns this bullet's offset. |
Bullet |
offset(double theOffset)
Set this bullet's offset. |
void |
readExternal(ObjectInput in)
Read this bullet from the given object input stream. |
void |
writeExternal(ObjectOutput out)
Write this bullet to the given object output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double NORMAL_OFFSET
public static final Bullet NONE
public static final Bullet DOT
public static final Bullet CIRCLE
| Constructor Detail |
|---|
public Bullet()
public Bullet(Bullet theBullet)
theBullet - Bullet.
NullPointerException - (unchecked exception) Thrown if theBullet is null.| Method Detail |
|---|
public static double defaultOffset()
public static void defaultOffset(double theOffset)
theOffset - Default offset.
IllegalArgumentException - (unchecked exception) Thrown if theOffset is less than 0.public double offset()
public Bullet offset(double theOffset)
theOffset - Offset.
IllegalArgumentException - (unchecked exception) Thrown if theOffset is less than 0.
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface Externalizableout - Object output stream.
IOException - Thrown if an I/O error occurred.
public void readExternal(ObjectInput in)
throws IOException
readExternal in interface Externalizablein - Object input stream.
IOException - Thrown if an I/O error occurred.
public void draw(Graphics2D g2d,
double ascent,
double x,
double y)
g2d - 2-D graphics context.ascent - Text font ascent.x - X coordinate of the left end of the text baseline.y - Y coordinate of the left end of the text baseline.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||