org.hd.d.pg2k.webSvr.util
Class PageSkinUtils

java.lang.Object
  extended by org.hd.d.pg2k.webSvr.util.PageSkinUtils

public final class PageSkinUtils
extends java.lang.Object

A utilities class to support page skins. Many skin-specific overrides from the default values are accessed from the page-level (PageContext) properties via constants and methods here.

Default skin/UI methods are also defined here.


Field Summary
private static java.lang.String _gABC_PROP_NAME
          Attribute in PageContext used to hold non-default alternate background colour.
static java.lang.String GENERIC_ABG_COLOUR
          Main background colour for architrave headings for catalogue and other generic pages.
static java.lang.String GENERIC_ABG_COLOUR_QUOTED
          Quoted (if necessary) version of GENERIC_ABG_COLOUR for HTML attributes; computed once per run.
static java.lang.String GENERIC_AH_COLOUR
          Main text colour for architrave headings for catalogue and other generic pages.
static java.lang.String GENERIC_AH_COLOUR_QUOTED
          Quoted (if necessary) version of GENERIC_AH_COLOUR for HTML attributes; computed once per run.
static java.lang.String GENERIC_BG_COLOUR
          Main background colour for catalogue and other generic pages.
static java.lang.String GENERIC_BG_COLOUR_QUOTED
          Quoted (if necessary) version of GENERIC_BG_COLOUR for HTML attributes; computed once per run.
static int GENERIC_TABLE_COLS
          Columns in table for "generic"/default skin.
static int GENERIC_TN_BORDER_WIDTH_PIXELS
          Width of chisled border for thumbnails in generic layout.
static int GENERIC_WIDTH_PX
          Nominal generic page width (pixels).
static int MAX_LIGHTBOX_WIDTH_PX
          Max width of a contact-strip / lightbox section on a normal page in pixels; strictly positive.
static int TOWER_COL_WIDTH_PX
          Width of a tower column containing skyscraper ads, in pixels; strictly positive.
 
Constructor Summary
private PageSkinUtils()
          Prevent creation of an instance.
 
Method Summary
static java.lang.String getAltBgColour(javax.servlet.http.HttpServletRequest request)
          Gets the alternate background colour for the current skin for the current request; never null.
static void setAltBgColour(javax.servlet.http.HttpServletRequest request, java.lang.String colour)
          Sets the alternate background colour for the current skin for the current request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GENERIC_BG_COLOUR

public static final java.lang.String GENERIC_BG_COLOUR
Main background colour for catalogue and other generic pages.

See Also:
Constant Field Values

GENERIC_BG_COLOUR_QUOTED

public static final java.lang.String GENERIC_BG_COLOUR_QUOTED
Quoted (if necessary) version of GENERIC_BG_COLOUR for HTML attributes; computed once per run.

See Also:
Constant Field Values

GENERIC_AH_COLOUR

public static final java.lang.String GENERIC_AH_COLOUR
Main text colour for architrave headings for catalogue and other generic pages.

See Also:
Constant Field Values

GENERIC_AH_COLOUR_QUOTED

public static final java.lang.String GENERIC_AH_COLOUR_QUOTED
Quoted (if necessary) version of GENERIC_AH_COLOUR for HTML attributes; computed once per run.

See Also:
Constant Field Values

GENERIC_ABG_COLOUR

public static final java.lang.String GENERIC_ABG_COLOUR
Main background colour for architrave headings for catalogue and other generic pages.

See Also:
Constant Field Values

GENERIC_ABG_COLOUR_QUOTED

public static final java.lang.String GENERIC_ABG_COLOUR_QUOTED
Quoted (if necessary) version of GENERIC_ABG_COLOUR for HTML attributes; computed once per run.

See Also:
Constant Field Values

GENERIC_TABLE_COLS

public static final int GENERIC_TABLE_COLS
Columns in table for "generic"/default skin.

See Also:
Constant Field Values

GENERIC_TN_BORDER_WIDTH_PIXELS

public static final int GENERIC_TN_BORDER_WIDTH_PIXELS
Width of chisled border for thumbnails in generic layout.

See Also:
Constant Field Values

GENERIC_WIDTH_PX

public static final int GENERIC_WIDTH_PX
Nominal generic page width (pixels). Up to 2003/02/19 was 600 as per http://news.bbc.co.uk/ but since then, we too have increased to (just under) 800 with the aim of avoiding horizontal scrolling on an actual 800-pixel screen.

See Also:
Constant Field Values

MAX_LIGHTBOX_WIDTH_PX

public static final int MAX_LIGHTBOX_WIDTH_PX
Max width of a contact-strip / lightbox section on a normal page in pixels; strictly positive. Defaults to a little short of the full available width...

See Also:
Constant Field Values

TOWER_COL_WIDTH_PX

public static final int TOWER_COL_WIDTH_PX
Width of a tower column containing skyscraper ads, in pixels; strictly positive. Since tower ads are typically 120 or 160 pixels, this should usually be 160 + padding.

See Also:
Constant Field Values

_gABC_PROP_NAME

private static final java.lang.String _gABC_PROP_NAME
Attribute in PageContext used to hold non-default alternate background colour. Essentially private to getAltBgColour() and setAltBgColour().

See Also:
Constant Field Values
Constructor Detail

PageSkinUtils

private PageSkinUtils()
Prevent creation of an instance.

Method Detail

setAltBgColour

public static void setAltBgColour(javax.servlet.http.HttpServletRequest request,
                                  java.lang.String colour)
Sets the alternate background colour for the current skin for the current request. Must be a value unquoted HTML colour name or value, eg white or #fffff.

The colour passed can be null to restore the default value, ie remove any override.


getAltBgColour

public static java.lang.String getAltBgColour(javax.servlet.http.HttpServletRequest request)
Gets the alternate background colour for the current skin for the current request; never null. This gets an unquoted HTML colour name or value, eg white or #fffff.

This may need to be quoted to be used as an attribute value.

This defaults to the normal value, but can be overridden for the current JSP page (in the PageContext) with a call to setAltBgColour().


DHD Multimedia Gallery V1.57.21

Copyright (c) 1996-2011, Damon Hart-Davis. All rights reserved.