ActiveBox
Extends: module:boxes/AbstractBox.AbstractBox
Source: ActiveBox.js:52
Objects of this class are widely used in JClic activities: cells in puzzles and associations,
messages and other objects are active boxes.
The specific content, size and location of ActiveBox objects is determined by its
ActiveBoxContent member. Most ActiveBoxes have only one content, but some of them can
have a secondary or "alternative" content stored in the altContent field. This content is
used only when the alternative flag of the ActiveBox is on.
Active boxes can host video and interactive media content (specified in the mediaContent
member of the ActiveBoxContent through its hostedMediaPlayer member.
Constructor
new ActiveBox(
parent?: module:boxes/AbstractBox.AbstractBox,
container?: module:AWT.Container,
boxBase?: module:boxes/BoxBase.BoxBase,
setIdLoc?: number,
rect?: module:AWT.Rectangle,
): ActiveBoxActiveBox constructor
Parameters
parent(module:boxes/AbstractBox.AbstractBox, optional) — The AbstractBox to which this ActiveBox belongscontainer(module:AWT.Container, optional) — The container where this box is placed.boxBase(module:boxes/BoxBase.BoxBase, optional) — The object where colors, fonts, border and other graphic properties
of this box are defined.setIdLoc(number, optional) — A numeric identifier, used to locate this box in a set of sibling objects.rect(module:AWT.Rectangle, optional) — The initial bounds of the box.
Instance Methods
getCurrentContent(
): module:boxes/ActiveBoxContent.ActiveBoxContent
Returns the current content used by the box
Returns
getContent(): module:boxes/ActiveBoxContent.ActiveBoxContent
Returns the current content, creating an empty one if needed.
Returns
clear()
Clears the current content
isEquivalent(
bx: module:boxes/ActiveBox.ActiveBox,
checkCase?: boolean,
): boolean
Checks if two ActiveBox objects have equivalent content
Parameters
bx(module:boxes/ActiveBox.ActiveBox) — The ActiveBox to check against this.checkCase(boolean, optional) — Whentrue, the comparing will be case-sensitive.
Returns
boolean
isCurrentContentEquivalent(
bx: module:boxes/ActiveBox.ActiveBox,
checkCase?: boolean,
): boolean
Same functionality as isEquivalent, but comparing the current content.
Parameters
bx(module:boxes/ActiveBox.ActiveBox) — The ActiveBox to check against this.checkCase(boolean, optional) — Whentrue, the comparing will be case-sensitive.
Returns
boolean
exchangeLocation(bx: module:boxes/ActiveBox.ActiveBox)
Swaps the location of two active boxes
Parameters
bx(module:boxes/ActiveBox.ActiveBox) — The ActiveBox to swap with this one.
copyContent(bx: module:boxes/ActiveBox.ActiveBox)
Copy the content of another ActiveBox into this one
Parameters
bx(module:boxes/ActiveBox.ActiveBox) — The ActiveBox from which to take the content
exchangeContent(bx: module:boxes/ActiveBox.ActiveBox)
Exhanges the content of this ActiveBox with another one
Parameters
bx(module:boxes/ActiveBox.ActiveBox) — The ActiveBox with which to exchange the content.
setTextContent(tx: string)
Sets the text content of this ActiveBox.
Parameters
tx(string) — The text to set.
setDefaultIdAss()
Sets the default value to idAss
isAtPlace(): boolean
Checks if this ActiveBox is at its original place.
Returns
boolean
setContent(abc: ActiveBoxContent | ActiveBagContent, i: number)
Sets the ActiveBoxContent of this ActiveBox
Parameters
abc(ActiveBoxContent | ActiveBagContent) — Object containing the content to set.i(number) — Whenabcis an ActiveBagContent, this field indicates an
index in the content array.
setAltContent(
abc: ActiveBoxContent | ActiveBagContent,
i: number,
)
Sets the ActiveBoxContent that will act as an alternative content (altContent field)
of this ActiveBox,
Parameters
abc(ActiveBoxContent | ActiveBagContent) — Object containing the content to set.i(number) — Whenabcis an ActiveBagContent, this field indicates an
index in the content array.
setCurrentContent(
abc: module:boxes/ActiveBoxContent.ActiveBoxContent,
)
Sets the current content of this ActiveBox
Parameters
abc(module:boxes/ActiveBoxContent.ActiveBoxContent) — The content to set.
switchToAlt()
Puts this ActiveBox in "alternative" mode, meaning that altContent will be used instead of content
checkHostedComponent()
Checks the presence of content susceptible to be treated as HTML DOM embedded in this ActiveBox.
checkAutoStartMedia()
Checks if the call has a module:media/MediaContent.MediaContent set to autostart, and launches it when found.
updateContent(
ctx: external:CanvasRenderingContext2D,
dirtyRegion?: module:AWT.Rectangle,
)
Draws the content of this Activebox on the specified canvas context.
Parameters
ctx(external:CanvasRenderingContext2D) — The canvas rendering context used to draw the
box content.dirtyRegion(module:AWT.Rectangle, optional) — The area that must be repainted.nullrefers to the whole box.
_focusAccessibleElement(ctx: external:CanvasRenderingContext2D)
Draw focus on accessible element if needed
Parameters
ctx(external:CanvasRenderingContext2D) — The canvas rendering context used to draw the
box content.
getDescription(): string
Gets the description field of the current ActiveBoxContent
Returns
string
toString(): string
Overrides: module:boxes/AbstractBox.AbstractBox#toString
Gets a descriptive text for this ActiveBox
Returns
string
playMedia(
ps: module:JClicPlayer.JClicPlayer,
delayedActions: Array.<function()>,
)
Plays the action or media associated with this ActiveBox
Parameters
ps(module:JClicPlayer.JClicPlayer) — Usually, a JClicPlayerdelayedActions(Array.<function()>, default: null) — If set, store the the action in this array for future execution
setHostedMediaPlayer(
amp: module:media/ActiveMediaPlayer.ActiveMediaPlayer,
)
Sets the hosted media player of this ActiveBox
Parameters
amp(module:media/ActiveMediaPlayer.ActiveMediaPlayer) — The media player.
setBounds(
rect: AWT.Rectangle | number,
y?: number,
w?: number,
h?: number,
)
Sets a new size and/or dimension to this box.
Parameters
rect(AWT.Rectangle | number) — An AWT.Rectangle object, or thexcoordinate of the
upper-left corner of a new rectangle.y(number, optional) —ycoordinate of the upper-left corner of the new rectangle.w(number, optional) — Width of the new rectangle.h(number, optional) — Height of the new rectangle.
setHostedComponentBounds(sizeChanged: boolean)
Places and resizes $hostedComponent, based on the size
and position of this box.
Parameters
sizeChanged(boolean) —truewhen this ActiveBox has changed its size
buildAccessibleElement(
$canvas: external:jQuery,
$clickReceiver: external:jQuery,
$canvasGroup?: external:jQuery,
eventType?: string,
): external:jQuery
Builds a hidden buton that will act as a accessible element associated to the canvas area
of this ActiveBox.
The button will be created only when CanvasRenderingContext2D has a method named addHitRegion.
See https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Hit_regions_and_accessibility
for more information and supported browsers.
Parameters
$canvas(external:jQuery) — Thecanvaswhere thisActiveBoxwill deploy, wrapped up in a jQuery object$clickReceiver(external:jQuery) — The DOM element that will be notified when$accessibleElementis activated.$canvasGroup(external:jQuery, optional) — Optional DOM element containing the accessible element. Useful to group cells in associations. Whennull, the element belongs to $canvas.eventType(string, optional) — Type of event sent to $clickReceiver. Default isclick.
Returns
setParent(parent: module:boxes/AbstractBox.AbstractBox)
Inherited from module:boxes/AbstractBox.AbstractBox#setParent
Overrides: module:boxes/AbstractBox.AbstractBox#setParent
Setter method for parent
Parameters
parent(module:boxes/AbstractBox.AbstractBox) — The new parent of this box
getParent(): module:boxes/AbstractBox.AbstractBox
Inherited from module:boxes/AbstractBox.AbstractBox#getParent
Overrides: module:boxes/AbstractBox.AbstractBox#getParent
Gets the current parent of this box
Returns
end()
Inherited from module:boxes/AbstractBox.AbstractBox#end
Overrides: module:boxes/AbstractBox.AbstractBox#end
Finisher method
setContainer(newContainer: module:AWT.Container)
Inherited from module:boxes/AbstractBox.AbstractBox#setContainer
Overrides: module:boxes/AbstractBox.AbstractBox#setContainer
Setter method for container
Parameters
newContainer(module:AWT.Container) — The new Container assigned to this box
getContainerX(): module:AWT.Container
Inherited from module:boxes/AbstractBox.AbstractBox#getContainerX
Overrides: module:boxes/AbstractBox.AbstractBox#getContainerX
Gets the container attribute of this box, without checking its parent
Returns
getContainerResolve(): module:AWT.Container
Inherited from module:boxes/AbstractBox.AbstractBox#getContainerResolve
Overrides: module:boxes/AbstractBox.AbstractBox#getContainerResolve
Gets the container associated to this box, asking its parents when null.
Returns
invalidate(rect: module:AWT.Rectangle)
Inherited from module:boxes/AbstractBox.AbstractBox#invalidate
Overrides: module:boxes/AbstractBox.AbstractBox#invalidate
Invalidates the zone corresponding to this box in the associated module:AWT.Container, if any.
Parameters
rect(module:AWT.Rectangle) — The rectangle to be invalidated. Whennull, it's the full
container area.
setBoxBase(boxBase: module:boxes/BoxBase.BoxBase)
Inherited from module:boxes/AbstractBox.AbstractBox#setBoxBase
Overrides: module:boxes/AbstractBox.AbstractBox#setBoxBase
Sets the BoxBase of this box
Parameters
boxBase(module:boxes/BoxBase.BoxBase) — The new BoxBase
getBoxBaseResolve(): module:boxes/BoxBase.BoxBase
Inherited from module:boxes/AbstractBox.AbstractBox#getBoxBaseResolve
Overrides: module:boxes/AbstractBox.AbstractBox#getBoxBaseResolve
Gets the real BoxBase associated to this box, scanning down parent relationships.
Returns
setShape(sh: module:AWT.Shape)
Inherited from module:boxes/AbstractBox.AbstractBox#setShape
Overrides: module:boxes/AbstractBox.AbstractBox#setShape
Sets the shape used to draw the content of this box
Parameters
sh(module:AWT.Shape) — The shape to be set
getShape(): module:AWT.Shape
Inherited from module:boxes/AbstractBox.AbstractBox#getShape
Overrides: module:boxes/AbstractBox.AbstractBox#getShape
Gets the current shape used in this box
Returns
contains(p: module:AWT.Point): boolean
Inherited from module:boxes/AbstractBox.AbstractBox#contains
Check if this box contains the specified point
Parameters
p(module:AWT.Point) — The point to be checked
Returns
boolean
setBounds(
rect: AWT.Rectangle | number,
y?: number,
w?: number,
h?: number,
): module:AWT.Rectangle
Inherited from module:boxes/ActiveBox.ActiveBox#setBounds
Overrides: module:boxes/AbstractBox.AbstractBox#setBounds
Sets a new size and/or dimension to this box.
Parameters
rect(AWT.Rectangle | number) — An AWT.Rectangle object, or thexcoordinate of the
upper-left corner of a new rectangle.y(number, optional) —ycoordinate of the upper-left corner of the new rectangle.w(number, optional) — Width of the new rectangle.h(number, optional) — Height of the new rectangle.
Returns
moveTo(newPos: AWT.Point | number, y?: number)
Inherited from module:boxes/AbstractBox.AbstractBox#moveTo
Overrides: module:boxes/AbstractBox.AbstractBox#moveTo
Sets a new location for this box. In JClic this method was named setLocation
Parameters
newPos(AWT.Point | number) — A point or thexcoordinate of a new point.y(number, optional) — Theycoordinate of a new point.
moveBy(dx: number, dy: number)
Inherited from module:boxes/AbstractBox.AbstractBox#moveBy
Overrides: module:boxes/AbstractBox.AbstractBox#moveBy
Sets a new location to this box. In JClic this method was named translate.
Parameters
dx(number) — The displacement on the X axisdy(number) — The displacement on the Y axis
setSize(width: number, height: number)
Inherited from module:boxes/AbstractBox.AbstractBox#setSize
Overrides: module:boxes/AbstractBox.AbstractBox#setSize
Changes the size of this box
Parameters
width(number)height(number)
hasBorder(): boolean
Inherited from module:boxes/AbstractBox.AbstractBox#hasBorder
Overrides: module:boxes/AbstractBox.AbstractBox#hasBorder
Checks if this box has border
Returns
boolean
setBorder(newVal: boolean)
Inherited from module:boxes/AbstractBox.AbstractBox#setBorder
Overrides: module:boxes/AbstractBox.AbstractBox#setBorder
Sets/unsets a border to this box
Parameters
newVal(boolean) —trueto set a border.
isVisible(): boolean
Inherited from module:boxes/AbstractBox.AbstractBox#isVisible
Overrides: module:boxes/AbstractBox.AbstractBox#isVisible
Checks if this box is fully visible
Returns
boolean
setVisible(newVal: boolean)
Inherited from module:boxes/AbstractBox.AbstractBox#setVisible
Overrides: module:boxes/AbstractBox.AbstractBox#setVisible
Sets this box visible or invisible
Parameters
newVal(boolean) —truefor visible
setHostedComponentVisible()
Inherited from module:boxes/AbstractBox.AbstractBox#setHostedComponentVisible
Overrides: module:boxes/AbstractBox.AbstractBox#setHostedComponentVisible
Makes module:boxes/AbstractBox.AbstractBox#$hostedComponent visible or invisible, based on the value of
the AbstractBox visible flag.
isTemporaryHidden(): boolean
Inherited from module:boxes/AbstractBox.AbstractBox#isTemporaryHidden
Overrides: module:boxes/AbstractBox.AbstractBox#isTemporaryHidden
Checks if this box is temporary hidden
Returns
boolean
setTemporaryHidden(newVal: boolean)
Inherited from module:boxes/AbstractBox.AbstractBox#setTemporaryHidden
Overrides: module:boxes/AbstractBox.AbstractBox#setTemporaryHidden
Makes this box temporary hidden (newVal true) or resets its original state (newVal false)
Parameters
newVal(boolean)
isInactive(): boolean
Inherited from module:boxes/AbstractBox.AbstractBox#isInactive
Overrides: module:boxes/AbstractBox.AbstractBox#isInactive
Checks if this box is currently inactive.
Returns
boolean
setInactive(newVal: boolean)
Inherited from module:boxes/AbstractBox.AbstractBox#setInactive
Overrides: module:boxes/AbstractBox.AbstractBox#setInactive
Makes this box active (false) or inactive (true)
Parameters
newVal(boolean)
isInverted(): boolean
Inherited from module:boxes/AbstractBox.AbstractBox#isInverted
Overrides: module:boxes/AbstractBox.AbstractBox#isInverted
Checks if this box is in inverted state.
Returns
boolean
setInverted(newVal: boolean)
Inherited from module:boxes/AbstractBox.AbstractBox#setInverted
Overrides: module:boxes/AbstractBox.AbstractBox#setInverted
Puts this box in inverted mode or restores its original state.
Parameters
newVal(boolean)
isMarked(): boolean
Inherited from module:boxes/AbstractBox.AbstractBox#isMarked
Overrides: module:boxes/AbstractBox.AbstractBox#isMarked
Checks if this box is marked
Returns
boolean
setMarked(newVal: boolean)
Inherited from module:boxes/AbstractBox.AbstractBox#setMarked
Overrides: module:boxes/AbstractBox.AbstractBox#setMarked
Sets this box in marked mode, or restores its original state.
Parameters
newVal(boolean)
isFocused(): boolean
Inherited from module:boxes/AbstractBox.AbstractBox#isFocused
Overrides: module:boxes/AbstractBox.AbstractBox#isFocused
Checks if this box has the input focus
Returns
boolean
setFocused(newVal: boolean)
Inherited from module:boxes/AbstractBox.AbstractBox#setFocused
Overrides: module:boxes/AbstractBox.AbstractBox#setFocused
Sets or unsets the input focus to this box.
Parameters
newVal(boolean)
isAlternative(): boolean
Inherited from module:boxes/AbstractBox.AbstractBox#isAlternative
Overrides: module:boxes/AbstractBox.AbstractBox#isAlternative
Checks if this box is in alternative state.
Returns
boolean
setAlternative(newVal: boolean)
Inherited from module:boxes/AbstractBox.AbstractBox#setAlternative
Overrides: module:boxes/AbstractBox.AbstractBox#setAlternative
Sets this box in alternative mode, or restores its original state.
Parameters
newVal(boolean)
update(
ctx: external:CanvasRenderingContext2D,
dirtyRegion?: module:AWT.Rectangle,
)
Inherited from module:boxes/AbstractBox.AbstractBox#update
Overrides: module:boxes/AbstractBox.AbstractBox#update
Draws the content of this box on an HTML canvas element. At this level, only background
and border are painted/stroked. Derived classes should implement specific drawing tasks in
module:boxes/AbstractBox.AbstractBox#updateContent.
Parameters
ctx(external:CanvasRenderingContext2D) — The canvas rendering context used to draw the
box content.dirtyRegion(module:AWT.Rectangle, optional, default: null) — The area that must be repainted.nullrefers to the whole box.
updateContent(
ctx: external:CanvasRenderingContext2D,
dirtyRegion?: module:AWT.Rectangle,
)
Inherited from module:boxes/ActiveBox.ActiveBox#updateContent
Overrides: module:boxes/AbstractBox.AbstractBox#updateContent
Draws the content of this Activebox on the specified canvas context.
Parameters
ctx(external:CanvasRenderingContext2D) — The canvas rendering context used to draw the
box content.dirtyRegion(module:AWT.Rectangle, optional) — The area that must be repainted.nullrefers to the whole box.
drawBorder(ctx: external:CanvasRenderingContext2D)
Inherited from module:boxes/AbstractBox.AbstractBox#drawBorder
Overrides: module:boxes/AbstractBox.AbstractBox#drawBorder
Draws the box border
Parameters
ctx(external:CanvasRenderingContext2D) — The canvas rendering context where the border
will be drawn.
getBorderBounds(): module:AWT.Rectangle
Inherited from module:boxes/AbstractBox.AbstractBox#getBorderBounds
Overrides: module:boxes/AbstractBox.AbstractBox#getBorderBounds
Returns the enclosing Rectangle of this box including its border (if any)
Returns
setHostedComponent($hc: external:jQuery)
Inherited from module:boxes/AbstractBox.AbstractBox#setHostedComponent
Overrides: module:boxes/AbstractBox.AbstractBox#setHostedComponent
Sets the $hostedComponent member.
Parameters
$hc(external:jQuery) — The jQuery DOM component hosted by this box.
getHostedComponent(): external:jQuery
Inherited from module:boxes/AbstractBox.AbstractBox#getHostedComponent
Overrides: module:boxes/AbstractBox.AbstractBox#getHostedComponent
Gets the current $hostedComponent member
Returns
setHostedComponentColors()
Inherited from module:boxes/AbstractBox.AbstractBox#setHostedComponentColors
Overrides: module:boxes/AbstractBox.AbstractBox#setHostedComponentColors
Sets $hostedComponent colors and other css properties
based on the current BoxBase of this box.
setHostedComponentBorder()
Inherited from module:boxes/AbstractBox.AbstractBox#setHostedComponentBorder
Overrides: module:boxes/AbstractBox.AbstractBox#setHostedComponentBorder
Sets the $hostedComponent border, based on the current
BoxBase of this box.
setHostedComponentBounds(sizeChanged: boolean)
Inherited from module:boxes/ActiveBox.ActiveBox#setHostedComponentBounds
Overrides: module:boxes/AbstractBox.AbstractBox#setHostedComponentBounds
Places and resizes $hostedComponent, based on the size
and position of this box.
Parameters
sizeChanged(boolean) —truewhen this ActiveBox has changed its size
getBounds(): module:AWT.Rectangle
Inherited from module:AWT.Rectangle#getBounds
Overrides: module:boxes/AbstractBox.AbstractBox#getBounds
Gets the enclosing Rectangle of this Shape.
Returns
equals(r: module:AWT.Shape): boolean
Inherited from module:AWT.Rectangle#equals
Overrides: module:boxes/AbstractBox.AbstractBox#equals
Checks if two shapes are equivalent.
Parameters
r(module:AWT.Shape) — The Shape to compare against
Returns
boolean
clone(): module:AWT.Rectangle
Inherited from module:AWT.Rectangle#clone
Overrides: module:boxes/AbstractBox.AbstractBox#clone
Clones this Rectangle
Returns
scaleBy(delta: Point | Dimension): module:AWT.Rectangle
Inherited from module:AWT.Rectangle#scaleBy
Overrides: module:boxes/AbstractBox.AbstractBox#scaleBy
Multiplies the dimension of the Shape by the specified delta amount.
Parameters
Returns
grow(dx: number, dy: number): module:AWT.Rectangle
Inherited from module:AWT.Rectangle#grow
Overrides: module:boxes/AbstractBox.AbstractBox#grow
Expands the boundaries of this shape. This affects the current position and dimension.
Parameters
dx(number) — The amount to grow (or decrease) in horizontal directiondy(number) — The amount to grow (or decrease) in vertical direction
Returns
getOppositeVertex(): module:AWT.Point
Inherited from module:AWT.Rectangle#getOppositeVertex
Overrides: module:boxes/AbstractBox.AbstractBox#getOppositeVertex
Gets the module:AWT.Point corresponding to the lower-right vertex of the Rectangle.
Returns
add(shape: module:AWT.Shape): module:AWT.Rectangle
Inherited from module:AWT.Rectangle#add
Overrides: module:boxes/AbstractBox.AbstractBox#add
Adds the boundaries of another shape to the current one
Parameters
shape(module:AWT.Shape) — The module:AWT.Shape to be added
Returns
getCoords(): string
Inherited from module:AWT.Rectangle#getCoords
Overrides: module:boxes/AbstractBox.AbstractBox#getCoords
Gets a string with the co-ordinates of the upper-left and lower-right vertexs of this rectangle,
(with values rounded to int)
Returns
string
getAttributes(): object
Inherited from module:AWT.Rectangle#getAttributes
Overrides: module:boxes/AbstractBox.AbstractBox#getAttributes
Gets a object with the basic attributes needed to rebuild this instance excluding functions,
parent references, constants and also attributes retaining the default value.
The resulting object is commonly usued to serialize elements in JSON format.
Returns
object
setAttributes(data: object): module:AWT.Rectangle
Inherited from module:AWT.Rectangle#setAttributes
Overrides: module:boxes/AbstractBox.AbstractBox#setAttributes
Reads the properties of this Rectangle from a data object
Parameters
data(object) — The data object to be parsed
Returns
intersects(_r: module:AWT.Rectangle): boolean
Inherited from module:AWT.Shape#intersects
Overrides: module:boxes/AbstractBox.AbstractBox#intersects
Checks if the provided Rectangle r intersects with this shape.
Parameters
_r(module:AWT.Rectangle)
Returns
boolean
fill(
ctx: external:CanvasRenderingContext2D,
dirtyRegion?: module:AWT.Rectangle,
): external:CanvasRenderingContext2D
Inherited from module:AWT.Shape#fill
Overrides: module:boxes/AbstractBox.AbstractBox#fill
Fills the Shape with the current style in the provided HTML canvas context
Parameters
ctx(external:CanvasRenderingContext2D) — The canvas 2D rendering context where to fill this shape.dirtyRegion(module:AWT.Rectangle, optional) — The context region to be updated. Used as clipping
region when drawing.
Returns
stroke(
ctx: external:CanvasRenderingContext2D,
): external:CanvasRenderingContext2D
Inherited from module:AWT.Shape#stroke
Overrides: module:boxes/AbstractBox.AbstractBox#stroke
Draws this shape in the provided HTML canvas 2D rendering context.
Parameters
ctx(external:CanvasRenderingContext2D) — The canvas 2D rendering context where to draw the shape.
Returns
preparePath(
ctx: external:CanvasRenderingContext2D,
): external:CanvasRenderingContext2D
Inherited from module:AWT.Shape#preparePath
Overrides: module:boxes/AbstractBox.AbstractBox#preparePath
Prepares an HTML canvas 2D rendering context with a path that can be used to stroke a line,
to fill a surface or to define a clipping region.
Parameters
Returns
clip(
ctx: external:CanvasRenderingContext2D,
fillRule?: string,
): external:CanvasRenderingContext2D
Inherited from module:AWT.Shape#clip
Overrides: module:boxes/AbstractBox.AbstractBox#clip
Creates a clipping region on the specified HTML canvas 2D rendering context
Parameters
ctx(external:CanvasRenderingContext2D) — The rendering contextfillRule(string, optional, default: "'nonzero'") — Can be 'nonzero' (default when not set) or 'evenodd'
Returns
isRect(): boolean
Inherited from module:AWT.Shape#isRect
Overrides: module:boxes/AbstractBox.AbstractBox#isRect
Shorthand method for determining if a Shape is an Rectangle
Returns
boolean
contains(p: module:AWT.Point): boolean
Inherited from module:boxes/AbstractBox.AbstractBox#contains
Check if this box contains the specified point
Parameters
p(module:AWT.Point) — The point to be checked
Returns
boolean
setBounds(
rect: AWT.Rectangle | number,
y?: number,
w?: number,
h?: number,
): module:AWT.Rectangle
Inherited from module:boxes/ActiveBox.ActiveBox#setBounds
Overrides: module:boxes/AbstractBox.AbstractBox#setBounds
Sets a new size and/or dimension to this box.
Parameters
rect(AWT.Rectangle | number) — An AWT.Rectangle object, or thexcoordinate of the
upper-left corner of a new rectangle.y(number, optional) —ycoordinate of the upper-left corner of the new rectangle.w(number, optional) — Width of the new rectangle.h(number, optional) — Height of the new rectangle.
Returns
updateContent(
ctx: external:CanvasRenderingContext2D,
dirtyRegion?: module:AWT.Rectangle,
)
Inherited from module:boxes/ActiveBox.ActiveBox#updateContent
Overrides: module:boxes/AbstractBox.AbstractBox#updateContent
Draws the content of this Activebox on the specified canvas context.
Parameters
ctx(external:CanvasRenderingContext2D) — The canvas rendering context used to draw the
box content.dirtyRegion(module:AWT.Rectangle, optional) — The area that must be repainted.nullrefers to the whole box.
setHostedComponentBounds(sizeChanged: boolean)
Inherited from module:boxes/ActiveBox.ActiveBox#setHostedComponentBounds
Overrides: module:boxes/AbstractBox.AbstractBox#setHostedComponentBounds
Places and resizes $hostedComponent, based on the size
and position of this box.
Parameters
sizeChanged(boolean) —truewhen this ActiveBox has changed its size
Static Methods
createCell(
$dom: external:jQuery,
abc: module:boxes/ActiveBoxContent.ActiveBoxContent,
): module:boxes/ActiveBox.ActiveBox
Factory constructor that creates a new cell inside a JQuery DOM element.
Parameters
$dom(external:jQuery) — The DOM element that will act as a containerabc(module:boxes/ActiveBoxContent.ActiveBoxContent) — The cell's content. Must not be null and have thedimension
member initialized.
Returns
buildShape(data: object): module:AWT.Shape
Inherited from module:AWT.Shape
Builds a shape based on the provided data object.
Data should contain a 'type' member, specifying the type of shape requested ('rect', 'ellipse', 'rectangle' or 'path')
Parameters
data(object) — Specific data for this shape
Returns
Instance Fields
idOrder: number
Identifier used to set the relative position of this box in a set.
idLoc: number
Identifier used to set a relative position in the space.
idAss: number
Identifier used to establish relationships between cells of different sets (in associations)
pos0: module:AWT.Point
Backup of the original position of the cell, useful when the real position must be restored after a temporary change.
content: module:boxes/ActiveBoxContent.ActiveBoxContent
Main content of this box
altContent: module:boxes/ActiveBoxContent.ActiveBoxContent
Alternative content of this box
hostedComponent: boolean
Flag to check if this box has a 'hosted component'
hostedMediaPlayer: module:media/ActiveMediaPlayer.ActiveMediaPlayer
The media player associated to this box
isBackground: boolean
Indicates that this box is used as a background. When drawing, the clipping region must be respected.
parent: module:boxes/AbstractBox.AbstractBox
Inherited from module:boxes/AbstractBox.AbstractBox#parent
Overrides: module:boxes/AbstractBox.AbstractBox#parent
The parent AbstractBox (can be null)
container: module:AWT.Container
Inherited from module:boxes/AbstractBox.AbstractBox#container
Overrides: module:boxes/AbstractBox.AbstractBox#container
The Container to which this AbstractBox belongs
boxBase: module:boxes/BoxBase.BoxBase
Inherited from module:boxes/AbstractBox.AbstractBox#boxBase
Overrides: module:boxes/AbstractBox.AbstractBox#boxBase
The BoxBase related to this AbstractBox. When null, the parent can provide an
alternative one.
border: boolean
Inherited from module:boxes/AbstractBox.AbstractBox#border
Overrides: module:boxes/AbstractBox.AbstractBox#border
Whether this box has a border or not
shape: module:AWT.Shape
Inherited from module:boxes/AbstractBox.AbstractBox#shape
Overrides: module:boxes/AbstractBox.AbstractBox#shape
The shape of this box (the box Rectangle or a special Shape, if set)
specialShape: boolean
Inherited from module:boxes/AbstractBox.AbstractBox#specialShape
Overrides: module:boxes/AbstractBox.AbstractBox#specialShape
Whether this box has a shape that is not a rectangle
visible: boolean
Inherited from module:boxes/AbstractBox.AbstractBox#visible
Overrides: module:boxes/AbstractBox.AbstractBox#visible
Whether this box is visible or not
temporaryHidden: boolean
Inherited from module:boxes/AbstractBox.AbstractBox#temporaryHidden
Overrides: module:boxes/AbstractBox.AbstractBox#temporaryHidden
Used to temporary hide a box while other drawing operations are done
tmpTrans: boolean
Inherited from module:boxes/AbstractBox.AbstractBox#tmpTrans
Overrides: module:boxes/AbstractBox.AbstractBox#tmpTrans
Cells with this attribute will be transparent but with painted border
inactive: boolean
Inherited from module:boxes/AbstractBox.AbstractBox#inactive
Overrides: module:boxes/AbstractBox.AbstractBox#inactive
Whether this box is active or inactive
inverted: boolean
Inherited from module:boxes/AbstractBox.AbstractBox#inverted
Overrides: module:boxes/AbstractBox.AbstractBox#inverted
Whether this box must be displayed with inverted or regular colors
alternative: boolean
Inherited from module:boxes/AbstractBox.AbstractBox#alternative
Overrides: module:boxes/AbstractBox.AbstractBox#alternative
Whether this box must be displayed with alternative or regular color and font settings
marked: boolean
Inherited from module:boxes/AbstractBox.AbstractBox#marked
Overrides: module:boxes/AbstractBox.AbstractBox#marked
Whether this box is marked (selected) or not
focused: boolean
Inherited from module:boxes/AbstractBox.AbstractBox#focused
Overrides: module:boxes/AbstractBox.AbstractBox#focused
Whether this box holds the input focus
accessibleText: string
Inherited from module:boxes/AbstractBox.AbstractBox#accessibleText
Overrides: module:boxes/AbstractBox.AbstractBox#accessibleText
Text to be used in accessible contexts
role: string
Inherited from module:boxes/AbstractBox.AbstractBox#role
Overrides: module:boxes/AbstractBox.AbstractBox#role
Describes the main role of this box on the activity. Useful in wai-aria descriptions.
$accessibleElement: external:jQuery
Inherited from module:boxes/AbstractBox.AbstractBox#$accessibleElement
Overrides: module:boxes/AbstractBox.AbstractBox#$accessibleElement
DOM element used to display this cell content in wai-aria contexts
accessibleAlwaysActive: boolean
Inherited from module:boxes/AbstractBox.AbstractBox#accessibleAlwaysActive
Overrides: module:boxes/AbstractBox.AbstractBox#accessibleAlwaysActive
Flag indicating that $accessibleElement should be always active
$hostedComponent: external:jQuery
Inherited from module:boxes/AbstractBox.AbstractBox#$hostedComponent
Overrides: module:boxes/AbstractBox.AbstractBox#$hostedComponent
An external JQuery DOM element hosted by this box
type: string
Inherited from module:AWT.Rectangle#type
Overrides: module:boxes/AbstractBox.AbstractBox#type
Shape type id
dim: module:AWT.Dimension
Inherited from module:AWT.Rectangle#dim
Overrides: module:boxes/AbstractBox.AbstractBox#dim
The Dimension of the Rectangle
pos: module:AWT.Point
Inherited from module:AWT.Shape#pos
Overrides: module:boxes/AbstractBox.AbstractBox#pos
The current position of the shape