org.gicentre.utils.multisketch
Class Slide

java.lang.Object
  extended by org.gicentre.utils.multisketch.Slide

public class Slide
extends java.lang.Object

Class to represent a presentation slide for use in a slide show.

Version:
3.3, 1st August, 2011.
Author:
Jo Wood, giCentre, City University London.

Constructor Summary
Slide(processing.core.PFont font)
          Creates a slide that uses the given default font.
Slide(processing.core.PFont font, int size, int colour)
          Creates a slide that uses the given default values for font, size and colour.
Slide(processing.core.PFont font, int size, int colour, int hAlignment)
          Creates a slide that uses the given default values for font, size, colour and horizontal alignment.
Slide(processing.core.PFont font, int size, int colour, int hAlignment, int vAlignment)
          Creates a slide that uses the given default values for font, size, colour and alignment.
 
Method Summary
 void addImage(processing.core.PImage image)
          Adds an image to the slide with the default horizontal alignment.
 void addImage(processing.core.PImage image, int width, int height)
          Adds an image with the given dimensions to the slide with the default horizontal alignment.
 void addImage(processing.core.PImage image, int width, int height, int hAlign)
          Adds an image with the given dimensions to the slide with the given horizontal alignment.
 void addLine(java.lang.String text)
          Adds a line of text to the slide to be displayed using the default font, size, colour and alignment.
 void addLine(java.lang.String text, processing.core.PFont font)
          Adds a line of text to the slide using the given font.
 void addLine(java.lang.String text, processing.core.PFont font, int fontSize)
          Adds a line of text to the slide using the given font and size.
 void addLine(java.lang.String text, processing.core.PFont font, int fontSize, int colour)
          Adds a line of text to the slide using the given font, size and colour.
 void addLine(java.lang.String text, processing.core.PFont font, int fontSize, int colour, int hAlign)
          Adds a line of text to the slide using the given font, size, colour and horizontal alignment.
 void draw(processing.core.PApplet aContext)
          Draws the contents of the slide.
 void setBorder(int top, int bottom, int left, int right)
          Sets the borders around the slide.
 void setLeading(int leading)
          Sets the leading (vertical gap) between items on the slide.
 java.lang.String toString()
          Provides a textual description of the contents of this slide.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Slide

public Slide(processing.core.PFont font)
Creates a slide that uses the given default font. Size is assumed to be 36 pixels high, colour assumed to be grey and alignment centred on the page.

Parameters:
font - Default font used to display text.

Slide

public Slide(processing.core.PFont font,
             int size,
             int colour)
Creates a slide that uses the given default values for font, size and colour. Alignment is assumed to be centred on page.

Parameters:
font - Default font used to display text.
size - Default font size used to display text.
colour - Default colour used to display text.

Slide

public Slide(processing.core.PFont font,
             int size,
             int colour,
             int hAlignment)
Creates a slide that uses the given default values for font, size, colour and horizontal alignment. Vertical alignment is assumed to be centred on page.

Parameters:
font - Default font used to display text.
size - Default font size used to display text.
colour - Default colour used to display text.
hAlignment - Default horizontal alignment to use to display text. Assumes Processing's LEFT, CENTER and RIGHT constants.

Slide

public Slide(processing.core.PFont font,
             int size,
             int colour,
             int hAlignment,
             int vAlignment)
Creates a slide that uses the given default values for font, size, colour and alignment.

Parameters:
font - Default font used to display text.
size - Default font size used to display text.
colour - Default colour used to display text.
hAlignment - Default horizontal alignment to use to display text. Assumes Processing's LEFT, CENTER and RIGHT constants.
vAlignment - Vertical alignment to use to display text. Assumes Processing's TOP, CENTER and BOTTOM constants.
Method Detail

draw

public void draw(processing.core.PApplet aContext)
Draws the contents of the slide.

Parameters:
aContext - Applet context in which to draw.

setBorder

public void setBorder(int top,
                      int bottom,
                      int left,
                      int right)
Sets the borders around the slide.

Parameters:
top - Top border in pixels.
bottom - bottom border in pixels.
left - Left hand border in pixels.
right - Right hand border in pixels.

setLeading

public void setLeading(int leading)
Sets the leading (vertical gap) between items on the slide.

Parameters:
leading - Leading height in pixels.

addLine

public void addLine(java.lang.String text)
Adds a line of text to the slide to be displayed using the default font, size, colour and alignment.

Parameters:
text - The text to add to the slide.

addLine

public void addLine(java.lang.String text,
                    processing.core.PFont font)
Adds a line of text to the slide using the given font. Text will be displayed in the default colour at the default size and with the default alignment.

Parameters:
font - Font used to display this line of text.
text - The text to add to the slide.

addLine

public void addLine(java.lang.String text,
                    processing.core.PFont font,
                    int fontSize)
Adds a line of text to the slide using the given font and size. Text will be displayed in the default colour and alignment.

Parameters:
font - Font used to display this line of text.
text - The text to add to the slide.
fontSize - Size of font in pixels.

addLine

public void addLine(java.lang.String text,
                    processing.core.PFont font,
                    int fontSize,
                    int colour)
Adds a line of text to the slide using the given font, size and colour. Text will be displayed using the default alignment.

Parameters:
font - Font used to display this line of text.
text - The text to add to the slide.
fontSize - Size of font in pixels.
colour - Colour in which to display text.

addLine

public void addLine(java.lang.String text,
                    processing.core.PFont font,
                    int fontSize,
                    int colour,
                    int hAlign)
Adds a line of text to the slide using the given font, size, colour and horizontal alignment.

Parameters:
font - Font used to display this line of text.
text - The text to add to the slide.
fontSize - Size of font in pixels.
colour - Colour in which to display text.
hAlign - Horizontal text alignment to use. Assumes Processing's LEFT, CENTER and RIGHT constants.

addImage

public void addImage(processing.core.PImage image)
Adds an image to the slide with the default horizontal alignment. The image's natural dimensions are used for the display size.

Parameters:
image - Image to display in slide.

addImage

public void addImage(processing.core.PImage image,
                     int width,
                     int height)
Adds an image with the given dimensions to the slide with the default horizontal alignment. If a width and height are both zero, the image's natural dimensions will be used for display. If only one of width and height is zero, the other dimension is used and the image's aspect ratio is preserved. If both values are non-zero, the image will be displayed using those values.

Parameters:
image - Image to display in slide.
width - Width at which to display image.
height - Height at which to display image.

addImage

public void addImage(processing.core.PImage image,
                     int width,
                     int height,
                     int hAlign)
Adds an image with the given dimensions to the slide with the given horizontal alignment. If a width and height are both zero, the image's natural dimensions will be used for display. If only one of width and height is zero, the other dimension is used and the image's aspect ratio is preserved. If both values are non-zero, the image will be displayed using those values.

Parameters:
image - Image to display in slide.
width - Width at which to display image.
height - Height at which to display image.
hAlign - Horizontal image alignment to use. Assumes Processing's LEFT, CENTER and RIGHT constants.

toString

public java.lang.String toString()
Provides a textual description of the contents of this slide.

Overrides:
toString in class java.lang.Object
Returns:
Text to be shown in slide.


giCentre Utilities V.3.3, API documentation generated 6th April, 2013