OverviewSingleDeprecated

jsx3.gui

class Heavyweight

Object
->jsx3.lang.Object
  ->jsx3.gui.Heavyweight

class Heavyweight
extends jsx3.lang.Object
GUI utility class that provides a way to display HTML content on-screen in an HTML equivalent of a heavyweight container. Instances of this class are often used to display menu lists, select lists, spyglass, and focus-rectangles. An instance of this class cannot be serialized, it is merely a run-time construct similar to an alert or input box.

Since:

3.0

Field Summary
static int
DEFAULTZINDEX
32000
Constructor Summary
void
init(strId : String, objOwner : jsx3.gui.Painted)
instance initializer
Method Summary
static jsx3.gui.Heavyweight
GO(strId : String)
Returns the instance of the heavyweight object with the given ID; to get the on-screen HTML instance call: jsx3.gui.Heavyweight.GO([id]).getRendered()
jsx3.gui.Heavyweight
addRule(intPixel : int, strPoint : String, intOff : int, strAxis : String)
adds a POSITION RULE ruleset (a simple structure/hash) to the array of position rules; Note that POSITION RULE objects are used by the show() method to determine the best possible location for a heavyweight item
jsx3.gui.Heavyweight
addXRule(objAnchor : Object | jsx3.gui.Event, strAnchorPoint : String, strPoint : String, intOff : int)
adds a POSITION RULE ruleset (X value) (a simple structure/hash) to the array of position rules; Note that POSITION RULE objects are used by the show() method to determine the best possible location for a heavyweight item
jsx3.gui.Heavyweight
addYRule(objAnchor : Object | jsx3.gui.Event, strAnchorPoint : String, strPoint : String, intOff : int)
adds a POSITION RULE ruleset (Y value) (a simple structure/hash) to the array of position rules; Note that POSITION RULE objects are used by the show() method to determine the best possible location for a heavyweight item
void
can be called if show() has been called; resets the ratio (width/total) of the VIEW to be that of [object].getRatio()
void
applyRules(strAxis : String, intSize : ?)
can be called if show() has been called; allows an existing HW window to re-apply its rules (used for complex layouts requiring a multi-pass)
void
destroy's the on-screen VIEW for the HW container AND removes any reference to the instance from the hash; Destroy() affects the MODEL and the VIEW
HTMLElement
Returns an object reference to the Browser Element parent to be used; if none specified, the browser BODY will be used
String
Returns the HTML content to display inside the HW instance on-screen
int
Returns the CSS height property (in pixels); if this value is set, it is assumed that the Heavyweight container will not have its height lessened to fit on-screen.
String
Returns the unique id for this heavyweight instance
String
Returns the overflow property for CONTENTS of the HW container; it is assumed that anytime a perfect fit cannot occur that the content will have its overflow property set to 'auto' unless specified otherwise
void
getPoint(objGUI : HTMLElement | jsx3.gui.Block | int, strPoint : String)
Returns a JavaScript object with properties: X,Y (Left and Top); relating to the 4 primary (N, S, E, W), 4 secondary (NE, SE, SW, NW), and origin (O) compass positions for O
String
getPositionRule(intIndex : int, strAxis : String)
Returns a POSITION RULE object at the given index; Note that POSITION RULE objects are JavaScript objects that implement the following 3 properties: _pixel (the on-screen point around which to pivot/place), _offset (amount to nudge the placement), _point (compass direction)
Object<String, Array>
Returns a JavaScript object array (hash).
Number
Returns the ratio (a decimal between .01 and .99) to multiply the "Rise + Run" by.
HTMLElement
Returns handle/reference to the Heavyweight Object's on-screen counterpart—basically a handle to a DHTML SPAN;
static String
Deprecated.
int
Returns the CSS width property (in pixels); if this value is set, it is assumed that the Heavyweight container will not have its width lessened to fit on-screen.
int
Returns the z-index property; assumes jsx3.gui.Heavyweight.DEFAULTZINDEX if none supplied
void
destorys the on-screen VIEW for the HW container; Hide() only affects the VIEW; this is not the same as setting visibility to "hidden", which doesn't actually destroy the VIEW
jsx3.gui.Heavyweight
Sets an object reference to the Browser Element parent to be used; if none specified, the browser BODY will be used.
jsx3.gui.Heavyweight
setHTML(strHTML : String, bRepaint : ?)
Sets the HTML content to display inside the HW instance on-screen; returns ref to self
jsx3.gui.Heavyweight
setHeight(intHeight : int)
Sets the CSS height property (in pixels); if this value is set, it is assumed that the Heavyweight container will not have its height lessened to fit on-screen.
jsx3.gui.Heavyweight
setOverflow(strOverflow : String)
Sets the overflow property for CONTENTS of the HW container; it is assumed that anytime a perfect fit cannot occur that the content will have its overflow property set to 'auto' unless specified otherwise returns reference to self to facilitate method chaining;
jsx3.gui.Heavyweight
setRatio(vntRatio : Number)
Sets the ratio (a decimal between .01 and .99) to multiply the "Rise + Run" by.
jsx3.gui.Heavyweight
setVisibility(strVisibility : String)
if the HW instance has an on-screen VIEW, this method can be used to toggle its visibility; it has no effect on the MODEL; it is most commonly used when "[object].show(false);" is called, allowing the developer to manually adjust layout before actually showing the HW instance.
void
setWidth(intWidth : int)
Sets the CSS width property (in pixels); if this value is set, it is assumed that the Heavyweight container will not have its width lessened to fit on-screen.
void
setZIndex(intZIndex : int)
Sets the CSS z-index for the object; if null, is passed, jsx3.gui.Heavyweight.DEFAULTZINDEX will be used as the default value
void
show(bDisplay : boolean)
Sets the text/HTML for the control to be displayed on-screen; returns reference to self to facilitate method chaining;
String
converts the object to a string representation more useful than the default implementation provided by the native JS engine
Methods Inherited From jsx3.lang.Object
clone, equals, eval, getClass, getInstanceOf, getInstanceOfClass, getInstanceOfPackage, instanceOf, isInstanceOf, isSubclassOf, jsxmix, jsxsuper, jsxsupermix, setInstanceOf
Field Detail

DEFAULTZINDEX

static int DEFAULTZINDEX
32000
Constructor Detail

init

void init(strId : String, objOwner : jsx3.gui.Painted)
instance initializer

Parameters:

strIdid to identify this HW instance among all others; this id will be used by both jsx3.gui.Heavyweight (to index it in the hash) and by the browser as the HTML tag's "id" attribute. If no ID is passed, a unique ID will be assigned by the system and is available by calling, [object].getId();
objOwner
Method Detail

GO

static jsx3.gui.Heavyweight GO(strId : String)
Returns the instance of the heavyweight object with the given ID; to get the on-screen HTML instance call: jsx3.gui.Heavyweight.GO([id]).getRendered()

Parameters:

strIdunique ID for the heavyweight instance

Returns:

 

addRule

jsx3.gui.Heavyweight addRule(intPixel : int, strPoint : String, intOff : int, strAxis : String)
adds a POSITION RULE ruleset (a simple structure/hash) to the array of position rules; Note that POSITION RULE objects are used by the show() method to determine the best possible location for a heavyweight item

Parameters:

intPixelleft position (in pixels) for the anchorpoint the heavyweight instance will try to layout in context of
strPointDefines one of the valid 9 compass points: 4 primary: (N, S, E, W); 4 secondary: (NE, SE, SW, NW); and origin: (O). Note that it is from this point (on the Heavyweight instance) that the heavyweight item will try to position itself
intOffoffset (in pixels) by which to nudge the vertical placement of the HW instance before displaying (useful for submenus, for example, where their left has a -10px offset to overlay the parent menu item)
strAxischaracter (string) representing whether the rule is for the X or Y axis. Rememeber to capitalize!

Returns:

this object (this)  

addXRule

jsx3.gui.Heavyweight addXRule(objAnchor : Object | jsx3.gui.Event, strAnchorPoint : String, strPoint : String, intOff : int)
adds a POSITION RULE ruleset (X value) (a simple structure/hash) to the array of position rules; Note that POSITION RULE objects are used by the show() method to determine the best possible location for a heavyweight item

Parameters:

objAnchorEither an event, or an on-screen HTML element
strAnchorPointREQUIRED if @objAnchor is an HTML element; when used, defines one of the valid 9 compass points: 4 primary: (N, S, E, W); 4 secondary: (NE, SE, SW, NW); and origin: (O). Note that it is from this point (on @objAnchor) that the heavyweight item will try to position itself
strPointDefines one of the valid 9 compass points: 4 primary: (N, S, E, W); 4 secondary: (NE, SE, SW, NW); and origin: (O). Note that it is from this point (on the Heavyweight instance) that the heavyweight item will try to position itself
intOffoffset (in pixels) by which to nudge the horizontal placement of the HW instance before displaying (useful for submenus, for example, where their left has a -10px offset to overlay the parent menu item)

Returns:

this object (this)  

addYRule

jsx3.gui.Heavyweight addYRule(objAnchor : Object | jsx3.gui.Event, strAnchorPoint : String, strPoint : String, intOff : int)
adds a POSITION RULE ruleset (Y value) (a simple structure/hash) to the array of position rules; Note that POSITION RULE objects are used by the show() method to determine the best possible location for a heavyweight item

Parameters:

objAnchorEither an event or an on-screen HTML element
strAnchorPointREQUIRED if @objAnchor is an HTML element; when used, defines one of the valid 9 compass points: 4 primary: (N, S, E, W); 4 secondary: (NE, SE, SW, NW); and origin: (O). Note that it is from this point (on @objAnchor) that the heavyweight item will try to position itself
strPointDefines one of the valid 9 compass points: 4 primary: (N, S, E, W); 4 secondary: (NE, SE, SW, NW); and origin: (O). Note that it is from this point (on the Heavyweight instance) that the heavyweight item will try to position itself
intOffoffset (in pixels) by which to nudge the vertical placement of the HW instance before displaying (useful for submenus, for example, where their left has a -10px offset to overlay the parent menu item)

Returns:

this object (this)  

applyRatio

void applyRatio()
can be called if show() has been called; resets the ratio (width/total) of the VIEW to be that of [object].getRatio()

applyRules

void applyRules(strAxis : String, intSize : ?)
can be called if show() has been called; allows an existing HW window to re-apply its rules (used for complex layouts requiring a multi-pass)

Parameters:

strAxischaracter (string) representing whether the rule is for the X or Y axis. Rememeber to capitalize!
intSize

destroy

void destroy()
destroy's the on-screen VIEW for the HW container AND removes any reference to the instance from the hash; Destroy() affects the MODEL and the VIEW

getDomParent

HTMLElement getDomParent()
Returns an object reference to the Browser Element parent to be used; if none specified, the browser BODY will be used

Returns:

 

getHTML

String getHTML()
Returns the HTML content to display inside the HW instance on-screen

Returns:

 

getHeight

int getHeight()
Returns the CSS height property (in pixels); if this value is set, it is assumed that the Heavyweight container will not have its height lessened to fit on-screen.

Returns:

height (in pixels)  

getId

String getId()
Returns the unique id for this heavyweight instance

Returns:

 

getOverflow

String getOverflow()
Returns the overflow property for CONTENTS of the HW container; it is assumed that anytime a perfect fit cannot occur that the content will have its overflow property set to 'auto' unless specified otherwise

Returns:

[jsx3.gui.Block.OVERFLOWSCROLL, jsx3.gui.Block.OVERFLOWHIDDEN, jsx3.gui.Block.OVERFLOWEXPAND]  

getPoint

void getPoint(objGUI : HTMLElement | jsx3.gui.Block | int, strPoint : String)
Returns a JavaScript object with properties: X,Y (Left and Top); relating to the 4 primary (N, S, E, W), 4 secondary (NE, SE, SW, NW), and origin (O) compass positions for O

Parameters:

objGUIGUI object in the browser DOM (typically an HTML element such as a DIV or SPAN) for which to provide the X,Y for
strPointa character denoting one of the valid 9 compass points: 4 primary: (N, S, E, W); 4 secondary: (NE, SE, SW, NW); and origin: (O)

getPositionRule

String getPositionRule(intIndex : int, strAxis : String)
Returns a POSITION RULE object at the given index; Note that POSITION RULE objects are JavaScript objects that implement the following 3 properties: _pixel (the on-screen point around which to pivot/place), _offset (amount to nudge the placement), _point (compass direction)

Parameters:

intIndexthe index (in rank order of execution) of the POSITION RULEing rule set to apply (it is assumed that at least one POSITION RULE ruleset exists)
strAxischaracter (string) representing whether the rule is for the X or Y axis. Rememeber to capitalize!

Returns:

 

getPositionRules

Object<String, Array> getPositionRules()
Returns a JavaScript object array (hash). This hash contains the Y rules and the X rules for positioning the object

Returns:

 

getRatio

Number getRatio()
Returns the ratio (a decimal between .01 and .99) to multiply the "Rise + Run" by. When applied by the 'show' command during a double-pass, a width to height ratio can be established to provide a consistent L&F for the text content. For example, a value of .8 would mean that the width of the heavyweight container would represent 80% and the height would represent 20% of the total perimiter

Returns:

 

getRendered

HTMLElement getRendered(objGUI : jsx3.gui.Event | HTMLElement | HTMLDocument)
Returns handle/reference to the Heavyweight Object's on-screen counterpart—basically a handle to a DHTML SPAN;

Parameters:

objGUIoptional argument improves efficiency if provided.

Returns:

Browser-Native DHTML object  

getVersion

static String getVersion()
Deprecated.
Returns the release/build for the class (i.e., "2.2.00")

Returns:

 

getWidth

int getWidth()
Returns the CSS width property (in pixels); if this value is set, it is assumed that the Heavyweight container will not have its width lessened to fit on-screen.

Returns:

width (in pixels)  

getZIndex

int getZIndex()
Returns the z-index property; assumes jsx3.gui.Heavyweight.DEFAULTZINDEX if none supplied

Returns:

 

hide

void hide()
destorys the on-screen VIEW for the HW container; Hide() only affects the VIEW; this is not the same as setting visibility to "hidden", which doesn't actually destroy the VIEW

setDomParent

jsx3.gui.Heavyweight setDomParent(objGUI : HTMLElement)
Sets an object reference to the Browser Element parent to be used; if none specified, the browser BODY will be used. Note that this method must be called before setting any point rules for the hW instance, so those functions know the true origin from which to calculate left/top positions; returns ref to self

Parameters:

objGUIHTML element in the browser

Returns:

this  

setHTML

jsx3.gui.Heavyweight setHTML(strHTML : String, bRepaint : ?)
Sets the HTML content to display inside the HW instance on-screen; returns ref to self

Parameters:

strHTMLHTML
bRepaint

Returns:

this  

setHeight

jsx3.gui.Heavyweight setHeight(intHeight : int)
Sets the CSS height property (in pixels); if this value is set, it is assumed that the Heavyweight container will not have its height lessened to fit on-screen. returns reference to self to facilitate method chaining;

Parameters:

intHeightheight (in pixels)

Returns:

this object  

setOverflow

jsx3.gui.Heavyweight setOverflow(strOverflow : String)
Sets the overflow property for CONTENTS of the HW container; it is assumed that anytime a perfect fit cannot occur that the content will have its overflow property set to 'auto' unless specified otherwise returns reference to self to facilitate method chaining;

Parameters:

strOverflow[jsx3.gui.Block.OVERFLOWSCROLL, jsx3.gui.Block.OVERFLOWHIDDEN, jsx3.gui.Block.OVERFLOWEXPAND]

Returns:

this object  

setRatio

jsx3.gui.Heavyweight setRatio(vntRatio : Number)
Sets the ratio (a decimal between .01 and .99) to multiply the "Rise + Run" by. When applied by the 'show' command during a double-pass, a width to height ratio can be established to provide a consistent L&F for the text content. For example, a value of .8 would mean that the width of the heavyweight container would represent 80% and the height would represent 20% of the total perimiter; returns a ref to self

Parameters:

vntRatioany value between .01 and .99

Returns:

this  

setVisibility

jsx3.gui.Heavyweight setVisibility(strVisibility : String)
if the HW instance has an on-screen VIEW, this method can be used to toggle its visibility; it has no effect on the MODEL; it is most commonly used when "[object].show(false);" is called, allowing the developer to manually adjust layout before actually showing the HW instance. returns a ref to self for method chaining

Parameters:

strVisibility[jsx3.gui.Block.VISIBILITYVISIBLE, jsx3.gui.Block.VISIBILITYHIDDEN]

Returns:

this object  

setWidth

void setWidth(intWidth : int)
Sets the CSS width property (in pixels); if this value is set, it is assumed that the Heavyweight container will not have its width lessened to fit on-screen.

Parameters:

intWidthwidth (in pixels)

setZIndex

void setZIndex(intZIndex : int)
Sets the CSS z-index for the object; if null, is passed, jsx3.gui.Heavyweight.DEFAULTZINDEX will be used as the default value

Parameters:

intZIndexz-index value

show

void show(bDisplay : boolean)
Sets the text/HTML for the control to be displayed on-screen; returns reference to self to facilitate method chaining;

Parameters:

bDisplaytrue if null; if true, the heavyweight container is positioned and displayed immediately; if false, the container is painted on-screen, but its CSS 'visibility' property is set to 'hidden', allowing the developer to adjust as needed (via 2-pass, etc) before actually displaying;

toString

String toString()
converts the object to a string representation more useful than the default implementation provided by the native JS engine

Returns:

object profile as a string  

Overrides:

toString in jsx3.lang.Object