|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.webSvr.virtualHosts.AlohaEarth.AEUtils
public final class AEUtils
Support for Aloha Earth virtual site.
| Field Summary | |
|---|---|
private static Name |
_GVT_CATEGORY
Category whose LocationMap entries are used by getViewLocationMapVirtualPrefix(); not null. |
private static Name |
_GVT_CATEGORY_LU_PREFIX
Lookup prefix; not null. |
static java.lang.String |
AE_SELF_RRURL
Root-relative URL to "page" at which Aloha Earth is shown. |
(package private) static DataSourceBean.AEPLinkedKey |
AEKey
Key for AE-linked data in DataSourceBean. |
static int |
BASE_2D_EARTH_MAP_HEIGHT
Height of base image (pixels). |
static java.lang.String |
BASE_2D_EARTH_MAP_RRURL
Root-relative URL or source/base 2D Earth image for clickable map. |
static int |
BASE_2D_EARTH_MAP_WIDTH
Width of base image (pixels). |
static int |
DISPLAY_2D_EARTH_MAP_HEIGHT
Display height of image to show visitor. |
static int |
DISPLAY_2D_EARTH_MAP_WIDTH
Display width of image to show visitor. |
(package private) static int |
DYN_MAP_IMG_TYPE
Type of clickable-map image that we dynamically generate. |
(package private) static ExhibitMIME.ExhibitTypeParameters |
ETP
ExhibitMIME entry for the chosen outout type. |
(package private) static int |
EXHIBIT_MARKER_RGB_COLOUR
Colour of marker to show location of exhibit on map, in RGB format. |
static int |
INITIAL_ZOOM
The initial zoom ratio as seen by a visitor. |
static int |
LABEL_CLEARANCE_PX
Label clearance (ie approximately the typical text height or 1em) in pixels; strictly positive. |
static int |
LABEL_COUNT_MAX
Maximum number of labels to show; strictly positive. |
static boolean |
LABEL_HORIZ
True if labels run horizontally, false if vertical. |
private static java.lang.String |
LABEL_HTML_POSTAMBLE
Postamble for label overlay HTML. |
private static java.lang.String |
LABEL_HTML_PREAMBLE
Preamble for label overlay HTML. |
private static boolean |
LABEL_PMDS
If true then do a "poor-man's drop-shadow" to help improve contrast. |
static int |
LABEL_TN_CLEARANCE_PX
Overlay thumbnail clearance is longest (small) thumbnail dimension. |
static java.lang.String |
MAP_SERVLET_RRURL
Full root-relative URL given for map image servlet. |
static java.lang.String |
MAPIMG_SERVLET_MOUNT_DIR
Root-relative URL to base directory on which map image servlet is mounted. |
static int |
MAX_ZOOM
Maximum zoom ratio from initial base image. |
static int |
MIN_ZOOM
Minimum zoom ratio from initial base image. |
(package private) static int |
TITLE_AREA_MARKER_RGB_COLOUR
Colour of marker to show area indicated by title, in RGB format. |
static int |
ZOOM_RATIO
Zoom ratio: what factor we zoom in/out each time; at least 2. |
| Constructor Summary | |
|---|---|
AEUtils()
|
|
| Method Summary | |
|---|---|
private static boolean |
_screenForGetViewTitle(Name prefix,
Location.Estd area)
Screens entry from Location map; returns true if usable. |
private static void |
appendLabelHTML(java.lang.StringBuilder sb,
int leftPX,
int topPX,
boolean strong,
java.lang.String labelText,
java.lang.String labelColour,
java.lang.String labelHref)
Generate HTML for one overlay label and append to given StringBuilder. |
static int |
applyZoom(int pixels,
int zoomFactor)
Apply zoom to value in pixels. |
static AlohaEarthMapCache |
getAemfb(DataSourceBean dsb)
Get the filter bean associated with the current DataSourceBean; never null. |
static java.lang.String |
getViewLocationLabels(AEParams aeps,
DataSourceBean dsb,
AlohaEarthMapCache aemfb,
boolean doThumbnails)
Create HTML label text to overlay the map; returns "" if none, never null. |
static java.util.List<Name> |
getViewLocationMapLabelPrefixes(AEParams aeps,
LocationMap lm,
AlohaEarthMapCache cache)
Gets locationMap keys for labels to add to the map; result may be empty but is never null. |
static Name |
getViewLocationMapVirtualPrefix(AEParams aeps,
LocationMap lm)
This gets a virtual prefix from the LocationMap for the current view or empty String if none suitable; never null. |
(package private) static java.awt.image.BufferedImage |
makeScaledBaseMapFragment(java.awt.Rectangle srcRect,
javax.servlet.ServletContext context)
Make scaled base image fragment given Rectangle bounding source pixels. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String AE_SELF_RRURL
public static final java.lang.String BASE_2D_EARTH_MAP_RRURL
public static final int BASE_2D_EARTH_MAP_WIDTH
public static final int BASE_2D_EARTH_MAP_HEIGHT
public static final java.lang.String MAPIMG_SERVLET_MOUNT_DIR
Note that this contains a leading and trailing '/'.
Any URI under this point will be directed to the servlet, so we can pick the "expected" suffix to avoid surprising broswers with the MIME type of the downloaded image.
Because these generated images may have to change the exhibit set or meta data may change it it not appropriate for this to be under /_static.
static final int DYN_MAP_IMG_TYPE
Good types to use are PNG and GIF (when the LZW patent expires).
static final ExhibitMIME.ExhibitTypeParameters ETP
public static final java.lang.String MAP_SERVLET_RRURL
We will append GET-style parameters to allow the appropriate zoom and shift to be applied.
public static final int ZOOM_RATIO
A value of 2 or 3 is probably good; up to 8 is probably OK.
public static int MIN_ZOOM
This is in terms of zooms in or out (changes in each dimension) by ZOOM_RATIO.
public static int MAX_ZOOM
This is in terms of zooms in or out (changes in each dimension) by ZOOM_RATIO.
This must be no less than MIN_ZOOM, and is usually positive.
Since this effectively limits the precision with which a user can select an area to view on the one hand, and yet increases the 'chunkiness' of the maximally zoomed image, is is difficult to chose an optimal value, but one that expand source pixels to no more than about 8--16 pixels on a side is probably reasonable.
public static int INITIAL_ZOOM
This is usually but not always the same as the MIN_ZOOM, but must be in the inclusive range [MIN_ZOOM, MAX_ZOOM].
public static final int DISPLAY_2D_EARTH_MAP_WIDTH
public static final int DISPLAY_2D_EARTH_MAP_HEIGHT
static final int EXHIBIT_MARKER_RGB_COLOUR
static final int TITLE_AREA_MARKER_RGB_COLOUR
private static final Name _GVT_CATEGORY
private static final Name _GVT_CATEGORY_LU_PREFIX
public static final boolean LABEL_HORIZ
public static final int LABEL_CLEARANCE_PX
public static final int LABEL_TN_CLEARANCE_PX
public static final int LABEL_COUNT_MAX
private static final java.lang.String LABEL_HTML_PREAMBLE
private static final java.lang.String LABEL_HTML_POSTAMBLE
private static final boolean LABEL_PMDS
static final DataSourceBean.AEPLinkedKey AEKey
| Constructor Detail |
|---|
public AEUtils()
| Method Detail |
|---|
public static int applyZoom(int pixels,
int zoomFactor)
This computes input * (ZOOM_RATIO ^ zoomFactor).
static java.awt.image.BufferedImage makeScaledBaseMapFragment(java.awt.Rectangle srcRect,
javax.servlet.ServletContext context)
May consume significant resources (CPU and memory), so access and concurrency should be controlled.
srcRect - as returned by AEParams.getSourceRectangleToDisplaycontext - servlet context to retrieve base image from
public static Name getViewLocationMapVirtualPrefix(AEParams aeps,
LocationMap lm)
This should always return "" at the outermost level.
This looks up places-and-sights prefixes in the given LocationMap, assuming that each such prefix is a reasonable region. This tries a number of methods to find the "best" match, in this order (excluding any "whole Earth" match:
aeps - parameters with which map to display is chosen; not nulllm - map to do lookup in; not null
private static boolean _screenForGetViewTitle(Name prefix,
Location.Estd area)
public static java.util.List<Name> getViewLocationMapLabelPrefixes(AEParams aeps,
LocationMap lm,
AlohaEarthMapCache cache)
We always try to include the title label, if available.
We then count how many uses of each prefix there are in this view, and essentially return the top LABEL_COUNT_MAX of them, but exclude any that are too close to any already selected (and maybe those that are too near an edge to be read properly).
We are only interested in items wholly contained in the current view.
public static java.lang.String getViewLocationLabels(AEParams aeps,
DataSourceBean dsb,
AlohaEarthMapCache aemfb,
boolean doThumbnails)
The first view labels may be rendered more strongly.
private static void appendLabelHTML(java.lang.StringBuilder sb,
int leftPX,
int topPX,
boolean strong,
java.lang.String labelText,
java.lang.String labelColour,
java.lang.String labelHref)
labelColour - colour for label text; null if defaultlabelHref - href for label text; null if none
public static AlohaEarthMapCache getAemfb(DataSourceBean dsb)
throws java.io.IOException
java.io.IOException
|
DHD Multimedia Gallery V1.53.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||