|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rit.slides.Slide
public class Slide
Class Slide provides one slide. A slide consists of an array of SlideItem
s, which are displayed in ascending order of
the array indexes. A slide also contains a
ColorFill
object that tells how
to color the slide's background. A slide also contains the left, top, right,
and bottom coordinates of the rectangular region within which the slide items
are to be displayed.
Field Summary | |
---|---|
static ColorFill |
NORMAL_BACKGROUND
The normal slide background color (white). |
static double |
NORMAL_HEIGHT
The normal slide height (612, or 8.5"). |
static double |
NORMAL_WIDTH
The normal slide width (816, or 11.33"). |
Constructor Summary | |
---|---|
Slide()
Construct a new slide with no slide items. |
|
Slide(Collection items)
Construct a new slide with the given slide items. |
|
Slide(Collection items,
ColorFill background)
Construct a new slide with the given slide items and background color. |
|
Slide(Collection items,
ColorFill background,
double left,
double top,
double width,
double height)
Construct a new slide with the given slide items, background color, and display region. |
|
Slide(SlideItem[] items)
Construct a new slide with the given slide items. |
|
Slide(SlideItem[] items,
ColorFill background)
Construct a new slide with the given slide items and background color. |
|
Slide(SlideItem[] items,
ColorFill background,
double left,
double top,
double width,
double height)
Construct a new slide with the given slide items, background color, and display region. |
Method Summary | |
---|---|
ColorFill |
getBackground()
Returns this slide's background color. |
double |
getBottom()
Returns the bottom coordinate of this slide's display region. |
double |
getHeight()
Returns the height of this slide's display region. |
SlideItem |
getItem(int i)
Returns the slide item at the given index in this slide. |
double |
getLeft()
Returns the left coordinate of this slide's display region. |
int |
getLength()
Returns the number of slide items in this slide. |
double |
getRight()
Returns the right coordinate of this slide's display region. |
double |
getTop()
Returns the top coordinate of this slide's display region. |
double |
getWidth()
Returns the width of this slide's display region. |
void |
readExternal(ObjectInput in)
Read this slide from the given object input stream. |
void |
writeExternal(ObjectOutput out)
Write this slide 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_WIDTH
public static final double NORMAL_HEIGHT
public static final ColorFill NORMAL_BACKGROUND
Constructor Detail |
---|
public Slide()
public Slide(Collection items)
The slide items are obtained by iterating over items. The order of the slide items returned by the iterator is the order of the slide items for this slide.
items
- Collection of slide items.
NullPointerException
- (unchecked exception) Thrown if items or any element thereof
is null.
ClassCastException
- (unchecked exception) Thrown if any item in items is not of
type
SlideItem
.public Slide(Collection items, ColorFill background)
The slide items are obtained by iterating over items. The order of the slide items returned by the iterator is the order of the slide items for this slide.
items
- Collection of slide items.background
- Background color, or null for no background.
NullPointerException
- (unchecked exception) Thrown if items or any element thereof
is null.
ClassCastException
- (unchecked exception) Thrown if any item in items is not of
type
SlideItem
.public Slide(Collection items, ColorFill background, double left, double top, double width, double height)
The slide items are obtained by iterating over items. The order of the slide items returned by the iterator is the order of the slide items for this slide.
items
- Collection of slide items.background
- Background color, or null for no background.left
- Left coordinate of display region.top
- Top coordinate of display region.width
- Width of display region.height
- Height of display region.
NullPointerException
- (unchecked exception) Thrown if items or any element thereof
is null.
ClassCastException
- (unchecked exception) Thrown if any item in items is not of
type
SlideItem
.
IllegalArgumentException
- (unchecked exception) Thrown if width <= 0 or
height <= 0.public Slide(SlideItem[] items)
items
- Array of slide items.
NullPointerException
- (unchecked exception) Thrown if items or any element thereof
is null.public Slide(SlideItem[] items, ColorFill background)
items
- Array of slide items.background
- Background color, or null for no background.
NullPointerException
- (unchecked exception) Thrown if items or any element thereof
is null.public Slide(SlideItem[] items, ColorFill background, double left, double top, double width, double height)
items
- Array of slide items.background
- Background color, or null for no background.left
- Left coordinate of display region.top
- Top coordinate of display region.width
- Width of display region.height
- Height of display region.
NullPointerException
- (unchecked exception) Thrown if items or any element thereof
is null.
IllegalArgumentException
- (unchecked exception) Thrown if width <= 0 or
height <= 0.Method Detail |
---|
public int getLength()
public SlideItem getItem(int i)
i
- Index in the range 0 .. getLength()-1.
ArrayIndexOutOfBoundsException
- (unchecked exception) Thrown if i is not in the range
0 .. getLength()-1.public ColorFill getBackground()
public double getLeft()
public double getTop()
public double getRight()
public double getBottom()
public double getWidth()
public double getHeight()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
out
- Object output stream.
IOException
- Thrown if an I/O error occurred.public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
in
- Object input stream.
IOException
- Thrown if an I/O error occurred.
ClassNotFoundException
- Thrown if a class needed to deserialize this slide cannot be found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |