Package ca.ualberta.stothard.cgview
Class CgviewHTMLDocument
java.lang.Object
ca.ualberta.stothard.cgview.CgviewHTMLDocument
- All Implemented Interfaces:
CgviewConstants
This class contains methods for constructing HTML pages that contain Cgview maps. Tags are added
to the document in the order that the various tag adding methods are called. The methods in this
class escape all supplied text to make it suitable for inclusion in an HTML document.
- Author:
- Paul Stothard
-
Field Summary
Fields inherited from interface ca.ualberta.stothard.cgview.CgviewConstants
BASES, BOUNDS_BUTTON, BOUNDS_FEATURE, BOUNDS_RULER, CENTISOMES, DECORATION_CLOCKWISE_ARROW, DECORATION_COUNTERCLOCKWISE_ARROW, DECORATION_HIDDEN, DECORATION_STANDARD, DIRECT_STRAND, INNER_LABELS_AUTO, INNER_LABELS_NO_SHOW, INNER_LABELS_SHOW, LABEL, LABEL_FORCE, LABEL_NONE, LABEL_ZOOMED, LEGEND_DRAW_ZOOMED, LEGEND_ITEM_ALIGN_CENTER, LEGEND_ITEM_ALIGN_LEFT, LEGEND_ITEM_ALIGN_RIGHT, LEGEND_LOWER_CENTER, LEGEND_LOWER_LEFT, LEGEND_LOWER_RIGHT, LEGEND_MIDDLE_CENTER, LEGEND_MIDDLE_LEFT, LEGEND_MIDDLE_LEFT_OF_CENTER, LEGEND_MIDDLE_RIGHT, LEGEND_MIDDLE_RIGHT_OF_CENTER, LEGEND_NO_DRAW_ZOOMED, LEGEND_UPPER_CENTER, LEGEND_UPPER_LEFT, LEGEND_UPPER_RIGHT, POSITIONS_AUTO, POSITIONS_NO_SHOW, POSITIONS_SHOW, REVERSE_STRAND, SWATCH_NO_SHOW, SWATCH_SHOW
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addBreak()
Adds a br tag to this CgviewHTMLDocument.void
Adds an image of a button to this CgviewHTMLDocument and links the button to another file.void
addButtonNoLink
(String imageFile, String altText) Adds an image of a button to this CgviewHTMLDocument.void
Adds body and html closing tags to this CgviewHTMLDocument.void
addHeader
(String title, String zoom, String zoomCenter, String imageFormat, Boolean useOverlib, Boolean useExternalStyleSheet) Adds header information to this CgviewHTMLDocument, including an html opening tag.void
Adds an image to this CgviewHTMLDocument.void
Adds an image to this CgviewHTMLDocument.void
addImageMap
(String imageFile, int width, int height, ArrayList labelBounds, Boolean useOverlib) Adds an image with an image map to this CgviewHTMLDocument, to implement mouseovers and hyperlinks associated with Cgview Feature objects and FeatureRange objects.void
Adds a hyperlink to this CgviewHTMLDocument.void
addSpace()
Adds a non-breaking space to this CgviewHTMLDocument.void
Adds a span closing tag to this CgviewHTMLDocument.void
Adds a span opening tag with the 'fileSize' style to this CgviewHTMLDocument.void
Adds a span opening tag with the 'note' style to this CgviewHTMLDocument.void
Adds a span opening tag with the 'validInfo' style to this CgviewHTMLDocument.void
Adds a span opening tag with the 'warning' style to this CgviewHTMLDocument.void
Adds an SVG image to this CgviewHTMLDocument.void
Adds td opening tag with center alignment to this CgviewHTMLDocument.void
Adds td closing tag to this CgviewHTMLDocument.void
Adds td opening tag with left alignment to this CgviewHTMLDocument.void
Adds td opening tag with right alignment to this CgviewHTMLDocument.void
Adds td opening tag to this CgviewHTMLDocument.void
Adds table and tbody closing tags to this CgviewHTMLDocument.void
Adds tr closing tag to this CgviewHTMLDocument.void
Adds tr opening tag to this CgviewHTMLDocument.void
addTableStart
(int width) Adds table and tbody opening tags to this CgviewHTMLDocument.void
addTableStart
(int width, int border) Adds table and tbody opening tags to this CgviewHTMLDocument.void
Adds text to this CgviewHTMLDocument.void
Adds text to this CgviewHTMLDocument stating that the document is valid XHTML 1.0 and valid CSS.Returns the contents of this CgviewHTMLDocument.
-
Constructor Details
-
CgviewHTMLDocument
public CgviewHTMLDocument()Constructs a new CgviewHTMLDocument object.
-
-
Method Details
-
addHeader
public void addHeader(String title, String zoom, String zoomCenter, String imageFormat, Boolean useOverlib, Boolean useExternalStyleSheet) Adds header information to this CgviewHTMLDocument, including an html opening tag. This method should be the first method called after a CgviewHTMLDocument is created.- Parameters:
title
- the title in the header.zoom
- the value to appear in the 'zoom' meta tag.zoomCenter
- the value to appear in the 'zoomCenter' meta tag.imageFormat
- the format of the image to which this CgviewHTMLDocument refers.useOverlib
- whether or not to use the overlib.js JavaScript library for PNG and JPG image maps.useExternalStyleSheet
- whether or not to use an external stylesheet.
-
addTableStart
public void addTableStart(int width) Adds table and tbody opening tags to this CgviewHTMLDocument.- Parameters:
width
- the width of the table in pixels.
-
addTableStart
public void addTableStart(int width, int border) Adds table and tbody opening tags to this CgviewHTMLDocument.- Parameters:
width
- the width of the table in pixels.border
- the width of the border in pixels.
-
addTableEnd
public void addTableEnd()Adds table and tbody closing tags to this CgviewHTMLDocument. -
addTableRowStart
public void addTableRowStart()Adds tr opening tag to this CgviewHTMLDocument. -
addTableRowEnd
public void addTableRowEnd()Adds tr closing tag to this CgviewHTMLDocument. -
addTableColumnStart
public void addTableColumnStart()Adds td opening tag to this CgviewHTMLDocument. -
addTableColumnCenterStart
public void addTableColumnCenterStart()Adds td opening tag with center alignment to this CgviewHTMLDocument. -
addTableColumnLeftStart
public void addTableColumnLeftStart()Adds td opening tag with left alignment to this CgviewHTMLDocument. -
addTableColumnRightStart
public void addTableColumnRightStart()Adds td opening tag with right alignment to this CgviewHTMLDocument. -
addTableColumnEnd
public void addTableColumnEnd()Adds td closing tag to this CgviewHTMLDocument. -
addValidationInfo
public void addValidationInfo()Adds text to this CgviewHTMLDocument stating that the document is valid XHTML 1.0 and valid CSS. -
addSpanNoteStart
public void addSpanNoteStart()Adds a span opening tag with the 'note' style to this CgviewHTMLDocument. -
addSpanFileSizeStart
public void addSpanFileSizeStart()Adds a span opening tag with the 'fileSize' style to this CgviewHTMLDocument. -
addSpanValidStart
public void addSpanValidStart()Adds a span opening tag with the 'validInfo' style to this CgviewHTMLDocument. -
addSpanWarningStart
public void addSpanWarningStart()Adds a span opening tag with the 'warning' style to this CgviewHTMLDocument. -
addSpanEnd
public void addSpanEnd()Adds a span closing tag to this CgviewHTMLDocument. -
addImageMap
public void addImageMap(String imageFile, int width, int height, ArrayList labelBounds, Boolean useOverlib) Adds an image with an image map to this CgviewHTMLDocument, to implement mouseovers and hyperlinks associated with Cgview Feature objects and FeatureRange objects. Image maps are used for PNG and JPG maps. SVG maps contain the mouseover and hyperlink information internally.- Parameters:
imageFile
- the image URL that the image map refers to.width
- the width of the image.height
- the height of the image.labelBounds
- an ArrayList of LabelBounds objects, obtained from a previously drawn Cgview object using theCgview.getLabelBounds()
method.useOverlib
- whether or not to use the overlib.js JavaScript library for PNG and JPG image maps.
-
addImage
Adds an image to this CgviewHTMLDocument. Use this method for adding a JPG or PNG image to a CgviewHTMLDocument. To add an SVG image useaddSVG(java.lang.String, int, int)
.- Parameters:
imageFile
- the image URL.width
- the width of the image.height
- the height of the image.
-
addImage
Adds an image to this CgviewHTMLDocument. Use this method for adding a JPG or PNG image to a CgviewHTMLDocument. To add an SVG image useaddSVG(java.lang.String, int, int)
.- Parameters:
imageFile
- the image URL.width
- the width of the image.height
- the height of the image.alt
- alternate text for the image
-
addButton
Adds an image of a button to this CgviewHTMLDocument and links the button to another file.- Parameters:
imageFile
- the button image URL.linkFile
- the URL to be linked to the button.altText
- a short description of the image.
-
addButtonNoLink
Adds an image of a button to this CgviewHTMLDocument.- Parameters:
imageFile
- the button image URL.altText
- a short description of the image.
-
addSVG
Adds an SVG image to this CgviewHTMLDocument.- Parameters:
imageFile
- the SVG image URL.width
- the width of the SVG image.height
- the height of the SVG image.
-
addBreak
public void addBreak()Adds a br tag to this CgviewHTMLDocument. -
addSpace
public void addSpace()Adds a non-breaking space to this CgviewHTMLDocument. -
addLink
Adds a hyperlink to this CgviewHTMLDocument.- Parameters:
name
- the text to appear in the link.link
- the link URL.
-
addText
Adds text to this CgviewHTMLDocument.- Parameters:
text
-
-
getContents
Returns the contents of this CgviewHTMLDocument.- Returns:
- an ArrayList of the entries in this CgviewHTMLDocument.
-