| java.lang.Object org.directwebremoting.proxy.io.Context jsx3.lang.Object jsx3.gui.Heavyweight
Heavyweight | public class Heavyweight extends jsx3.lang.Object (Code) | | 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.
author: Joe Walker [joe at getahead dot org] author: DRAPGEN - Dwr Reverse Ajax Proxy GENerator |
Constructor Summary | |
public | Heavyweight(Context context, String extension, ScriptProxy scriptProxy) | public | Heavyweight(String strId, jsx3.gui.Painted objOwner) instance initializer
Parameters: strId - id 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. |
Method Summary | |
public jsx3.gui.Heavyweight | GO(String strId) | public jsx3.gui.Heavyweight | addRule(int intPixel, String strPoint, int intOff, String strAxis) 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: intPixel - left position (in pixels) for the anchorpoint the heavyweight instance will try to layout in context of Parameters: strPoint - Defines one of the valid 9 compass points: 4 primary: (N, S, E, W); 4 secondary: (NE, SE, SW, NW); and origin: (O). | public jsx3.gui.Heavyweight | addXRule(jsx3.gui.Event objAnchor, String strAnchorPoint, String strPoint, int intOff) 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: objAnchor - Either an event, or an on-screen HTML element Parameters: strAnchorPoint - REQUIRED 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). | public jsx3.gui.Heavyweight | addXRule(jsx3.lang.Object objAnchor, String strAnchorPoint, String strPoint, int intOff) 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: objAnchor - Either an event, or an on-screen HTML element Parameters: strAnchorPoint - REQUIRED 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). | public jsx3.gui.Heavyweight | addYRule(jsx3.lang.Object objAnchor, String strAnchorPoint, String strPoint, int intOff) 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: objAnchor - Either an event or an on-screen HTML element Parameters: strAnchorPoint - REQUIRED 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). | public jsx3.gui.Heavyweight | addYRule(jsx3.gui.Event objAnchor, String strAnchorPoint, String strPoint, int intOff) 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: objAnchor - Either an event or an on-screen HTML element Parameters: strAnchorPoint - REQUIRED 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). | public void | applyRatio() | public void | applyRules(String strAxis, int 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: strAxis - character (string) representing whether the rule is for the X or Y axis. | public void | destroy() | public void | getDomParent(org.directwebremoting.proxy.Callback<String> callback) | public void | getHTML(org.directwebremoting.proxy.Callback<String> callback) | public void | getHeight(org.directwebremoting.proxy.Callback<Integer> callback) 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. | public void | getId(org.directwebremoting.proxy.Callback<String> callback) | public void | getOverflow(org.directwebremoting.proxy.Callback<String> callback) | public void | getPoint(int objGUI, String strPoint) | public void | getPoint(jsx3.gui.Block objGUI, String strPoint) | public void | getPoint(String objGUI, String strPoint) | public void | getPositionRule(int intIndex, String strAxis, org.directwebremoting.proxy.Callback<String> callback) 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: intIndex - the 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) Parameters: strAxis - character (string) representing whether the rule is for the X or Y axis. | public jsx3.lang.Object | getPositionRules() Returns a JavaScript object array (hash). | public T | getPositionRules(Class<T> returnType) Returns a JavaScript object array (hash). | public void | getRatio(org.directwebremoting.proxy.Callback<Integer> callback) Returns the ratio (a decimal between .01 and .99) to multiply the "Rise + Run" by. | public void | getRendered(jsx3.gui.Event objGUI, org.directwebremoting.proxy.Callback<String> callback) | public void | getRendered(String objGUI, org.directwebremoting.proxy.Callback<String> callback) | public void | getWidth(org.directwebremoting.proxy.Callback<Integer> callback) 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. | public void | getZIndex(org.directwebremoting.proxy.Callback<Integer> callback) | public void | hide() | public jsx3.gui.Heavyweight | setDomParent(String objGUI) Sets an object reference to the Browser Element parent to be used; if none specified, the browser BODY will be used. | public jsx3.gui.Heavyweight | setHTML(String strHTML, boolean bRepaint) | public jsx3.gui.Heavyweight | setHeight(int intHeight) 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. | public jsx3.gui.Heavyweight | setOverflow(String strOverflow) | public jsx3.gui.Heavyweight | setRatio(Integer vntRatio) Sets the ratio (a decimal between .01 and .99) to multiply the "Rise + Run" by. | public jsx3.gui.Heavyweight | setVisibility(String strVisibility) 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. | public void | setWidth(int intWidth) 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. | public void | setZIndex(int intZIndex) | public void | show(boolean bDisplay) |
DEFAULTZINDEX | final public static int DEFAULTZINDEX(Code) | | 32000
|
Heavyweight | public Heavyweight(Context context, String extension, ScriptProxy scriptProxy)(Code) | | All reverse ajax proxies need context to work from
Parameters: scriptProxy - The place we are writing scripts to Parameters: context - The script that got us to where we are now |
Heavyweight | public Heavyweight(String strId, jsx3.gui.Painted objOwner)(Code) | | instance initializer
Parameters: strId - id 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(); Parameters: objOwner - |
GO | public jsx3.gui.Heavyweight GO(String strId)(Code) | | 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: strId - unique ID for the heavyweight instance |
addRule | public jsx3.gui.Heavyweight addRule(int intPixel, String strPoint, int intOff, String strAxis)(Code) | | 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: intPixel - left position (in pixels) for the anchorpoint the heavyweight instance will try to layout in context of Parameters: strPoint - 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 itis from this point (on the Heavyweight instance) that the heavyweight item will try to position itself Parameters: intOff - offset (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) Parameters: strAxis - character (string) representing whether the rule is for the X or Y axis. Rememeber to capitalize! this object (this) |
addXRule | public jsx3.gui.Heavyweight addXRule(jsx3.gui.Event objAnchor, String strAnchorPoint, String strPoint, int intOff)(Code) | | 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: objAnchor - Either an event, or an on-screen HTML element Parameters: strAnchorPoint - REQUIRED 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 itis from this point (on @objAnchor) that the heavyweight item will try to position itself Parameters: strPoint - 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 itis from this point (on the Heavyweight instance) that the heavyweight item will try to position itself Parameters: intOff - offset (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) this object (this) |
addXRule | public jsx3.gui.Heavyweight addXRule(jsx3.lang.Object objAnchor, String strAnchorPoint, String strPoint, int intOff)(Code) | | 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: objAnchor - Either an event, or an on-screen HTML element Parameters: strAnchorPoint - REQUIRED 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 itis from this point (on @objAnchor) that the heavyweight item will try to position itself Parameters: strPoint - 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 itis from this point (on the Heavyweight instance) that the heavyweight item will try to position itself Parameters: intOff - offset (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) this object (this) |
addYRule | public jsx3.gui.Heavyweight addYRule(jsx3.lang.Object objAnchor, String strAnchorPoint, String strPoint, int intOff)(Code) | | 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: objAnchor - Either an event or an on-screen HTML element Parameters: strAnchorPoint - REQUIRED 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 itis from this point (on @objAnchor) that the heavyweight item will try to position itself Parameters: strPoint - 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 itis from this point (on the Heavyweight instance) that the heavyweight item will try to position itself Parameters: intOff - offset (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) this object (this) |
addYRule | public jsx3.gui.Heavyweight addYRule(jsx3.gui.Event objAnchor, String strAnchorPoint, String strPoint, int intOff)(Code) | | 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: objAnchor - Either an event or an on-screen HTML element Parameters: strAnchorPoint - REQUIRED 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 itis from this point (on @objAnchor) that the heavyweight item will try to position itself Parameters: strPoint - 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 itis from this point (on the Heavyweight instance) that the heavyweight item will try to position itself Parameters: intOff - offset (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) this object (this) |
applyRatio | public void applyRatio()(Code) | | can be called if show() has been called; resets the ratio (width/total) of the VIEW to be that of [object].getRatio()
|
applyRules | public void applyRules(String strAxis, int intSize)(Code) | | 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: strAxis - character (string) representing whether the rule is for the X or Y axis. Rememeber to capitalize! Parameters: intSize - |
destroy | public void destroy()(Code) | | 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
|
getHeight | public void getHeight(org.directwebremoting.proxy.Callback<Integer> callback)(Code) | | 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.
Parameters: callback - height (in pixels) |
getOverflow | public void getOverflow(org.directwebremoting.proxy.Callback<String> callback)(Code) | | 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
Parameters: callback - [jsx3.gui.Block.OVERFLOWSCROLL, jsx3.gui.Block.OVERFLOWHIDDEN, jsx3.gui.Block.OVERFLOWEXPAND] |
getPoint | public void getPoint(int objGUI, String strPoint)(Code) | | 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: objGUI - GUI object in the browser DOM (typically an HTML element such as a DIV or SPAN) for which to provide the X,Y for Parameters: strPoint - a character denoting one of the valid 9 compass points: 4 primary: (N, S, E, W); 4 secondary: (NE, SE, SW, NW); and origin: (O) |
getPoint | public void getPoint(jsx3.gui.Block objGUI, String strPoint)(Code) | | 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: objGUI - GUI object in the browser DOM (typically an HTML element such as a DIV or SPAN) for which to provide the X,Y for Parameters: strPoint - a character denoting one of the valid 9 compass points: 4 primary: (N, S, E, W); 4 secondary: (NE, SE, SW, NW); and origin: (O) |
getPoint | public void getPoint(String objGUI, String strPoint)(Code) | | 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: objGUI - GUI object in the browser DOM (typically an HTML element such as a DIV or SPAN) for which to provide the X,Y for Parameters: strPoint - a 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 | public void getPositionRule(int intIndex, String strAxis, org.directwebremoting.proxy.Callback<String> callback)(Code) | | 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: intIndex - the 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) Parameters: strAxis - character (string) representing whether the rule is for the X or Y axis. Rememeber to capitalize! |
getPositionRules | public jsx3.lang.Object getPositionRules()(Code) | | Returns a JavaScript object array (hash). This hash contains the Y rules and the X rules for positioning the object
|
getPositionRules | public T getPositionRules(Class<T> returnType)(Code) | | Returns a JavaScript object array (hash). This hash contains the Y rules and the X rules for positioning the object
Parameters: returnType - The expected return type |
getRatio | public void getRatio(org.directwebremoting.proxy.Callback<Integer> callback)(Code) | | 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
|
getRendered | public void getRendered(jsx3.gui.Event objGUI, org.directwebremoting.proxy.Callback<String> callback)(Code) | | Returns handle/reference to the Heavyweight Object's on-screen counterpartÑbasically a handle to a DHTML SPAN;
Parameters: objGUI - optional argument improves efficiency if provided. Parameters: callback - Browser-Native DHTML object |
getRendered | public void getRendered(String objGUI, org.directwebremoting.proxy.Callback<String> callback)(Code) | | Returns handle/reference to the Heavyweight Object's on-screen counterpartÑbasically a handle to a DHTML SPAN;
Parameters: objGUI - optional argument improves efficiency if provided. Parameters: callback - Browser-Native DHTML object |
getWidth | public void getWidth(org.directwebremoting.proxy.Callback<Integer> callback)(Code) | | 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.
Parameters: callback - width (in pixels) |
hide | public void hide()(Code) | | 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 | public jsx3.gui.Heavyweight setDomParent(String objGUI)(Code) | | 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: objGUI - HTML element in the browser this |
setHTML | public jsx3.gui.Heavyweight setHTML(String strHTML, boolean bRepaint)(Code) | | Sets the HTML content to display inside the HW instance on-screen; returns ref to self
Parameters: strHTML - HTML Parameters: bRepaint - this |
setHeight | public jsx3.gui.Heavyweight setHeight(int intHeight)(Code) | | 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: intHeight - height (in pixels) this object |
setOverflow | public jsx3.gui.Heavyweight setOverflow(String strOverflow)(Code) | | 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] this object |
setRatio | public jsx3.gui.Heavyweight setRatio(Integer vntRatio)(Code) | | 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: vntRatio - any value between .01 and .99 this |
setVisibility | public jsx3.gui.Heavyweight setVisibility(String strVisibility)(Code) | | 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] this object |
setWidth | public void setWidth(int intWidth)(Code) | | 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: intWidth - width (in pixels) |
setZIndex | public void setZIndex(int intZIndex)(Code) | | Sets the CSS z-index for the object; if null, is passed, jsx3.gui.Heavyweight.DEFAULTZINDEX will be used as the default value
Parameters: intZIndex - z-index value |
show | public void show(boolean bDisplay)(Code) | | Sets the text/HTML for the control to be displayed on-screen; returns reference to self to facilitate method chaining;
Parameters: bDisplay - true 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; |
Methods inherited from jsx3.lang.Object | public void ignoreReturn()(Code)(Java Doc)
|
|
|