OverviewSingleDeprecated

jsx3.gui

class Painted

Object
->jsx3.lang.Object
  ->jsx3.app.Model
    ->jsx3.gui.Painted

All Implemented Interfaces:

jsx3.util.EventDispatcher

Direct Known Subclasses:

jsx3.gui.Block, jsx3.gui.Sound

class Painted
extends jsx3.app.Model
Abstract superclass of model objects that are painted to screen.

Since:

3.1

Constructor Summary
void
init(strName : String)
instance initializer
Method Summary
HTMLElement
gives focus to the on-screen VIEW for the element; returns a handle to the html/dhtml element as exposed by the native browser
Object<String, int>
Returns the absolute positioning of the object's on-screen view in relation to JSXROOT (whose left/top is 0/0).
String
getAttribute(strName : String)
Returns value for the custom attribute with the given name; returns null if no attribute found
Object<String, String>
Returns handle to the JavaScript Object Array containing all events for the JSX GUI object; NOTE: This object will contain zero or more JavaScript Objects with the following Properties: script, type, system
String
Returns the value of the dynamic property @strPropName; if not found, returns null
HTMLElement
Returns handle/reference to the JSX GUI Object's on-screen counterpart—basically a handle to a DHTML object such as a DIV, SPAN, etc
jsx3.gui.Painted
Deprecated. Replaced with paintChild().
protected void
A hook that subclasses of Painted may override in order to perform additional manipulation of the HTML DOM created by the paint method.
abstract String
Returns the DHTML, used for this object's on-screen VIEW
void
paintChild(objChild : jsx3.gui.Painted, bGroup : boolean, objGUI : HTMLElement, bCascadeOnly : boolean)
Paints a child of this object without repainting this entire object.
String
Iterates through children and returns concatenation of paint() method for all children.
void
recalcBox(properties : Array)
Removes the box model abstraction for a given object and its descendants.
jsx3.gui.Painted
removeAttribute(strName : String)
removes the specific custom property bound to this object; returns a reference to self (this) to facilitate method chaining
jsx3.gui.Painted
removes all events bound to this object; NOTE: The object must still be painted/repainted for its corresponding on-screen view to be likewise updated; returns a reference to self (this) to facilitate method chaining
String
Updates the view of this object by calling paint() and replacing the current view with the returned HTML.
jsx3.gui.Painted
setAttribute(strName : String, strValue : String)
Sets a property on the object that when the object is rendered on-screen, the HTML tag will be assigned the given name/value pair as a tag attribute
jsx3.gui.Painted
setDynamicProperty(strName : String, strValue : String)
assigns a dynamic property to one of this object's properties returns reference to self to facilitate method chaining;
Methods Inherited From jsx3.app.Model
adoptChild, doClone, findAncestor, findDescendants, getAncestorOfName, getAncestorOfType, getChild, getChildIndex, getChildren, getDescendantOfName, getDescendantsOfType, getFirstChild, getFirstChildOfType, getHelpId, getId, getLastChild, getLoadType, getMetaValue, getNS, getName, getNextSibling, getParent, getPersistence, getPreviousSibling, getServer, getUriResolver, insertBefore, load, loadAndCache, loadXML, onAfterAssemble, onAfterAttach, onBeforeAssemble, onChangeServer, onDestroy, onRemoveChild, onSetChild, onSetParent, removeChild, removeChildren, setChild, setHelpId, setLoadType, setMetaValue, setName, setPersistence, toString, toXML, toXMLDoc
Methods Inherited From jsx3.util.EventDispatcher
publish, subscribe, unsubscribe, unsubscribeAll
Methods Inherited From jsx3.lang.Object
clone, equals, eval, getClass, getInstanceOf, getInstanceOfClass, getInstanceOfPackage, instanceOf, isInstanceOf, isSubclassOf, jsxmix, jsxsuper, jsxsupermix, setInstanceOf
Constructor Detail

init

void init(strName : String)
instance initializer

Parameters:

strNameunique name distinguishing this object from all other JSX GUI objects in the JSX application
Method Detail

focus

HTMLElement focus()
gives focus to the on-screen VIEW for the element; returns a handle to the html/dhtml element as exposed by the native browser

Returns:

 

getAbsolutePosition

Object<String, int> getAbsolutePosition(objRoot : HTMLElement, objGUI : HTMLElement)
Returns the absolute positioning of the object's on-screen view in relation to JSXROOT (whose left/top is 0/0). Returns information as a JavaScript object with properties, L, T, W, H of @objRoot is null, the on-screen view for JSXROOT is used as the object reference

Parameters:

objRootobject reference to IE DOM object (i.e., div, span, etc); if null is passed, the first div child of JSXROOT's on-screen representation will be used
objGUIobject reference to item to get absolute position for—as opposed to this instance (useful for determining placement of html objects contained by JSX objects, but not part of the actual JSX DOM)

Returns:

JScript object with properties: L, T, W, H (corresponding to left, top width, height)  

getAttribute

String getAttribute(strName : String)
Returns value for the custom attribute with the given name; returns null if no attribute found

Parameters:

strNamethe name of the property/attribute

Returns:

 

getAttributes

Object<String, String> getAttributes()
Returns handle to the JavaScript Object Array containing all events for the JSX GUI object; NOTE: This object will contain zero or more JavaScript Objects with the following Properties: script, type, system

Returns:

 

getDynamicProperty

String getDynamicProperty(strName : String)
Returns the value of the dynamic property @strPropName; if not found, returns null

Parameters:

strNameproperty on this GUI object that will now use a dynamic property (e.g., 'jsxleft','jsxtop','jsxheight',etc.);

Returns:

value of the property  

getRendered

HTMLElement getRendered(objGUI : Object | jsx3.gui.Event)
Returns handle/reference to the JSX GUI Object's on-screen counterpart—basically a handle to a DHTML object such as a DIV, SPAN, etc

Parameters:

objGUIeither the HTML document containing the rendered object or an HTML element in that document. This argument is optional but improves the efficiency of this method if provided.

Returns:

IE DHTML object  

insertHTML

jsx3.gui.Painted insertHTML(objChild : jsx3.gui.Painted)
Deprecated. Replaced with paintChild().
Paints a child of this object without repainting this entire object. The child is inserted into the view of this object as the last child object, regardless of its actual position relative to other children. This method has no effect if this object is not currently painted.

Parameters:

objChildthe child object to paint.

Returns:

this object. 

See Also:

paintChild()

onAfterPaint

protected void onAfterPaint(objGUI : HTMLElement)
A hook that subclasses of Painted may override in order to perform additional manipulation of the HTML DOM created by the paint method. The order of steps follows. All steps occur in a single browser thread so that the screen does not update between steps 2 and 3.
  1. The paint() method of this object is called.
  2. The result of the paint() method is inserted into the HTML DOM.
  3. The onAfterPaint() method of this object is called, passing in the newly inserted root HTML element.

Parameters:

objGUIthe rendered HTML element representing this object.

Since:

3.4

paint

abstract String paint()
Returns the DHTML, used for this object's on-screen VIEW

Returns:

DHTML  

paintChild

void paintChild(objChild : jsx3.gui.Painted, bGroup : boolean, objGUI : HTMLElement, bCascadeOnly : boolean)
Paints a child of this object without repainting this entire object. The child is inserted into the view of this object as the last child object, regardless of its actual position relative to other children. This method has no effect if this object is not currently painted.

Parameters:

objChildthe child object to paint.
bGrouptrue if this method is being called iteratively over a collection of children. This parameter will only be false on the final call in the iteration.
objGUI
bCascadeOnly

paintChildren

String paintChildren(c : Array<jsx3.gui.Painted>)
Iterates through children and returns concatenation of paint() method for all children.

Parameters:

cthe children to paint. If not provided this.getChildren() is used.

Returns:

DHTML  

recalcBox

void recalcBox(properties : Array)
Removes the box model abstraction for a given object and its descendants. This effectively resets the box profiler, so dimensions can be recalculated as if the object was just broought into the visual DOM.

Parameters:

propertiesWill designate by name, those properties that should be updated on the object's VIEW (without requiring the MODEL to repaint), including one or more of the following: padding, margin, border

removeAttribute

jsx3.gui.Painted removeAttribute(strName : String)
removes the specific custom property bound to this object; returns a reference to self (this) to facilitate method chaining

Parameters:

strNamethe name of the custom property to remove

Returns:

this object  

removeAttributes

jsx3.gui.Painted removeAttributes()
removes all events bound to this object; NOTE: The object must still be painted/repainted for its corresponding on-screen view to be likewise updated; returns a reference to self (this) to facilitate method chaining

Returns:

this object  

repaint

String repaint()
Updates the view of this object by calling paint() and replacing the current view with the returned HTML. This method has no effect if this object is not currently displayed.

Returns:

the result of calling paint() or null if this object is not displayed. 

See Also:

paint()

setAttribute

jsx3.gui.Painted setAttribute(strName : String, strValue : String)
Sets a property on the object that when the object is rendered on-screen, the HTML tag will be assigned the given name/value pair as a tag attribute

Parameters:

strNamethe name of the property/attribute
strValuethe value for the property; may not contain double-quotes; escape via jsx3.util.strEscapeHTML if necessary or use combinations of single-quotes and escaped single-quotes

Returns:

this object (this)  

setDynamicProperty

jsx3.gui.Painted setDynamicProperty(strName : String, strValue : String)
assigns a dynamic property to one of this object's properties returns reference to self to facilitate method chaining;

Parameters:

strNameproperty on this GUI object that will now use a dynamic property (e.g., 'jsxleft','jsxtop','jsxheight',etc.);
strValuename of a dynamic style, whose value will be used

Returns:

this object