OverviewSingleDeprecated

jsx3.vector

class Block

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

All Implemented Interfaces:

jsx3.gui.Interactive, jsx3.util.EventDispatcher

Direct Known Subclasses:

jsx3.chart.Chart

class Block
extends jsx3.gui.Block
Defines a base class for GUI controls that implement both the cross-platform box profile painting introduced in 3.2 and the cross-platform (VML/SVG) vector painting, also introduced in 3.2.

This class should be extended by custom GUI classes that will display vector elements.

Since:

3.5

Method Summary
jsx3.vector.Tag
Instantiates and returns a new instance of jsx3.vector.Canvas.
jsx3.vector.Tag
Creates the vector tag tree that will render this GUI control.
jsx3.vector.Tag
Returns the vector canvas on which this control paints itself.
void
paintEventHandler(strEvtType : String, strMethod : String, objElm : jsx3.vector.Tag)
Renders a cross-platform vector event handler.
boolean
Updates the pre-existing vector tree of this control on, for example, a resize or repaint event.
Methods Inherited From jsx3.gui.Block
getBackground, getBackgroundColor, getBorder, getCSSOverride, getClassName, getColor, getCursor, getDimensions, getDisplay, getFontName, getFontSize, getFontWeight, getHeight, getIndex, getLeft, getMargin, getOverflow, getPadding, getRelativePosition, getTagName, getText, getTextAlign, getTip, getTop, getVisibility, getWidth, getZIndex, hideMask, paint, setBackground, setBackgroundColor, setBorder, setCSSOverride, setClassName, setColor, setCursor, setDimensions, setDisplay, setFontName, setFontSize, setFontWeight, setHeight, setIndex, setLeft, setMargin, setOverflow, setPadding, setRelativePosition, setTagName, setText, setTextAlign, setTip, setTop, setVisibility, setWidth, setZIndex, showMask
Methods Inherited From jsx3.gui.Interactive
doEvent, getCanDrag, getCanDrop, getCanMove, getCanSpy, getEvent, getEvents, getMenu, hasEvent, registerHotKey, removeEvent, removeEvents, setCanDrag, setCanDrop, setCanMove, setCanSpy, setEvent, setMenu, setSpyStyles, showSpy
Methods Inherited From jsx3.gui.Painted
focus, getAbsolutePosition, getAttribute, getAttributes, getDynamicProperty, getRendered, insertHTML, onAfterPaint, paintChild, paintChildren, recalcBox, removeAttribute, removeAttributes, repaint, setAttribute, setDynamicProperty
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
Method Detail

createCanvas

jsx3.vector.Tag createCanvas()
Instantiates and returns a new instance of jsx3.vector.Canvas. The implementation of createVector() in this class calls this method to create the base vector tag. This method may be overridden to provide a base tag of another type that Canvas.

Returns:

 

createVector

jsx3.vector.Tag createVector()
Creates the vector tag tree that will render this GUI control. Subclasses of this class should override this method to specify the manner in which they render.

The basic template for a method overriding this method is:
CustomVector.prototype.createVector = function() {
  var objCanvas = this.jsxsuper();
  // modify objCanvas, add children, etc.
  return objCanvas;
};
This method should do the work of creating and updating the vector tree to the state when it is ready to be rendered on screen, but without calling updateVector() directly.

Returns:

 

See Also:

updateVector()

getCanvas

jsx3.vector.Tag getCanvas()
Returns the vector canvas on which this control paints itself. If no canvas has already been created, then createVector() is called to create it.

Returns:

 

paintEventHandler

void paintEventHandler(strEvtType : String, strMethod : String, objElm : jsx3.vector.Tag)
Renders a cross-platform vector event handler. When an event of type strEvtType bubbles up to the HTML element rendered by objElm, the instance method of this object whose name is strMethod will be called with two parameters: the browser event wrapped in an instance of jsx3.gui.Event, and the native HTMLElement that defined the event handler.

Parameters:

strEvtTypethe event type, one of jsx3.gui.Event.CLICK, etc.
strMethodthe instance method to call on this object when the event is received.
objElmthe HTML element to which to add the event handler.

See Also:

jsx3.vector.paintEventHandler()

updateVector

boolean updateVector(objVector : jsx3.vector.Tag)
Updates the pre-existing vector tree of this control on, for example, a resize or repaint event. Methods overriding this method should return true if the update is successful or false to force the vector tree to be completely recreated with createVector().

The basic template for a method overriding this method is:
CustomVector.prototype.updateVector = function(objVector) {
  this.jsxsuper(objVector);
  // modify objCanvas, modify children, etc.
  return true;
};

Parameters:

objVectorthe root of the vector render tree.

Returns:

true if the tree could be updated inline or false if it must be recreated by calling createVector()

See Also:

createVector()