Open main menu

CDOT Wiki β

Changes

no edit summary
== Project Name ==
Porting pushStyle(), popStyle(), and boolean() Processing to Processing.js
== Project Description ==
[http://processingjs.org/ Processing.js] remains incomplete as a port of [http://processing.org/ Processing]. Among the features still to be implemented The following functions are the functions targeted:*[http://processing.org/reference/pushStyle_.html ''pushStyle()''], *[http://processing.org/reference/popStyle_.html ''popStyle()''], and *[http://processing.org/reference/boolean_.html ''boolean()'']*[http://processing. The first two functions automatically save style information for later retrieval and reuseorg/reference/strokeCap_.html ''strokeCap()'']*[http://processing.org/reference/strokeJoin_.html ''strokeJoin()'']*[http://processing.org/reference/text_.html ''text()''] (bug fix)*[http://processing.org/reference/min_.html ''min()''] (bug fix)*[http://processing.org/reference/max_.html ''max()''] (bug fix)*[http://processing.org/reference/stringEquals_.html ''String::equals()'']*[http://processing.org/reference/nf_.html ''nf()''] (bug fix)*[http://processing. The last "converts" arguments into a boolean valueorg/reference/int_.html ''int()''] (bug fix)
This project seeks to implement those three functions. The repository may be found == Resources ==*[http://github.com/mlam19/processing-js heregithub branch repository]*[http://processing-js.lighthouseapp.com/projects/41284-processingjs/overview Lighthouse issue tracking]*[https://wiki.mozilla.org/Education/Projects/ProcessingForTheWeb Processing for the Web @ Mozilla]
== Project Leader(s) ==
== Project Details ==
===pushStyle() and popStyle()===
*The number of states saved is tracked by ''pushedStates''. *''pushStyle()'' calls ''curContext.save()'' and increments ''pushedStates'' by one. ''popStyle()'' checks if there are any saved states via ''pushedStates''. If there *Excess pops are none an error notice to the console or as a JavaScript alert, in an attempt to provide similar behaviour to Processing's implementation. If there are saved states, the function calls ''curContext.restore()'' and decrements ''pushedStates'' by oneignored.
====Related Mozilla bugs====
===boolean()===
*Non-zero numeric values become ''true''
**Bytes (0's and 1's) are interpreted as numeric values.
*''null'' and ''undefine'' become ''false''.
*Boolean arguments are returned as themselves.
 
===strokeCap()===
*Modifies context.lineCap.
*ROUND -> context.lineCap="round";
*SQUARE -> context.lineCap="butt";
*PROJECT -> context.lineCap="square";
*Processing default (ROUND) set in '''''function''' init''.
*'''''function''' size'' modified to respect previous settings.
**Used to recreate context and reset settings, which overwrote the desired default.
 
===strokeJoin()===
 
===text()===
*Partially implementation missing ability to take int, float, double, and byte arguments.
*float and doubles rounded to thousandths digit.
*.5 rounds down rather than up.
 
===int()===
*JavaScript does not distinguish between bytes and ints, causing incomplete replication of Processing behaviour
*Processing's ''PApplet.parseInt(String)'' and ''PApplet.parseInt(String[])'' handles doubles-as-Strings differently. In the former, doubles are 'floored' correctly, in the latter exceptions are thrown.
 
==Things to do==
{| border="1" cellpadding="5"
|-valign="top"
!Description
!Status
!Assigned to
!Link
|-
|Test cases for ''pushStyle()'' and ''popStyle()''
|Done
|[[User:mlam19|Matthew Lam]]
|[http://matrix.senecac.on.ca/~mlam19/processingjs/pushPopTest1.html Test page]
|-
|Test cases for ''boolean()''
|Done
|[[User:mlam19|Matthew Lam]]
|[http://matrix.senecac.on.ca/~mlam19/processingjs/booleanTest1.html Test page]
|-
|Test cases for ''strokeCap()''
|Done
|[[User:mlam19|Matthew Lam]]
|[http://matrix.senecac.on.ca/~mlam19/processingjs/strokeCapTest1.html Test page]
|-
|Test cases for ''strokeJoin()''
|Done
|[[User:mlam19|Matthew Lam]]
|[http://matrix.senecac.on.ca/~mlam19/processingjs/strokeJoinTest1.html Test page]
|-
|Test cases for ''text()''
|Done
|[[User:mlam19|Matthew Lam]]
|[http://matrix.senecac.on.ca/~mlam19/processingjs/textTest1.html Test page]
|}
==Releases==
!Notes
!Resources
|-
|0.5
|''min()'', ''max()'', ''nf()'', and ''int()'' enhanced. ''String::equals()'' implemented.
|
*[http://github.com/mlam19/processing-js/commit/2b829739c5a70322e384b1103bf0313e1935d045 ''int()'' GitHub commit]
*[http://github.com/mlam19/processing-js/commit/6b5d56d6f9aa2d7e431164201b9aa8a007178d34 ''nf()'' GitHub commit]
*[http://github.com/mlam19/processing-js/commit/c29df2b8c9cd68572ca1e01196306770fab14ff8 ''String::equals()'' GitHub commit]
*[http://github.com/mlam19/processing-js/commit/541d520221006cd37df153fa656b7a657ff8025d ''min()'' and ''max()'' commit]
|-
|0.4
|''text()'' implementation enhanced.
|
*[http://github.com/mlam19/processing-js/commit/b43a4854c31c27175edd4aa885bb431a79981daa Final GitHub commit]
*[https://processing-js.lighthouseapp.com/projects/41284/tickets/191/a/382850/patch.diff Patch]
|-
|0.3
|''strokeCap()'' and ''strokeJoin()'' ported.
|[http://github.com/mlam19/processing-js/commit/e748d89186f033d33f829235b45d5ca0391be684 Final GitHub commit]
|-
|0.2
|Bug fixes for ''pushStyle()'', ''popStyle()'', and ''boolean()''. Functions now functional.
|[http://matrix.senecac.on.ca/~mlam19/processingjs/files/mlam19_procjs_0.2.diff.tar.gz Patch]
|-
|0.1
|}
== Project News ==
{| border="1" cellpadding="5"|-valign=Oct"top"!Date!Notes|-|Feb. 5, 2010|[http://wobblyretroaction.blogspot.com/2010/02/processingjs-int-and-release-05.html ''int()'' upgraded, and release 0.5 announcement]|-|Feb. 2, 2010|[http://wobblyretroaction.blogspot.com/2010/02/processingjs-nf.html ''nf()'' upgraded]|-|Jan. 31, 2010|[http://wobblyretroaction.blogspot.com/2010/01/processingjs-stringequals-or-how-i.html ''String::equals()'' completed]|-|Jan. 31, 2010|[http://wobblyretroaction.blogspot.com/2010/01/processingjs-improving-min-and-max.html ''min()'' and ''max()'' upgraded]|-|Jan. 20, 2010|[http://wobblyretroaction.blogspot.com/2010/01/dps911-project-processingjs-v04.html Release 0.4 announcement]|-|Jan. 14, 2010|[http://wobblyretroaction.blogspot.com/2010/01/2010-dps911-and-more-processingjs.html Project continuation blog]|-|Dec. 9, 2009|[http://wobblyretroaction.blogspot.com/2009/12/dps909-project-processingjs-v03.html Release 0.3 announcement].|-|Dec. 2, 2009|[http://wobblyretroaction.blogspot. com/2009/12/processingjs-strokejoin.html ''strokeJoin()'' completed].|-|Nov. 29, 2009 |[http://wobblyretroaction.blogspot.com/2009/11/processingjs- Added strokecap.html ''booleanstrokeCap()''===completed].|-|Nov. 19, 2009|[http://wobblyretroaction.blogspot.com/2009/11/dps909-project-processingjs-v02.html Release 0.2 announcement].|-|Oct. 19, 2009|[http://wobblyretroaction.blogspot.com/2009/10/dps909-project-processingjs-v01.html Release 0.1 announcement].|-|Oct. 12, 2009|[http://wobblyretroaction.blogspot.com/2009/10/boolean-for-processingjs.html Project expanded] to include ''boolean()''.===|-|Sept. 28, 2009 - Basic example working===|Basic improvements allow the rudimentary [http://processing.org/reference/pushStyle_.html Processing example] to [http://matrix.senecac.on.ca/~mlam19/processingjs/ function in Processing.js].===|-|Sept. 27, 2009 - Humble beginnings===|The [http://wobblyretroaction.blogspot.com/2009/09/processingjs-plan-to-push-and-pop.html initial project proposal] has been posted. [http://github.com/mlam19/processing-js Repository] at github created.|}
1
edit