Changeset 439


Ignore:
Timestamp:
10/19/15 14:15:14 (8 years ago)
Author:
sz
Message:
  • added FunctionReference? class
  • separate "Framsticks Theater" and "Command line interface" contexts
Location:
java/FramclipsePlugin/src/main/resources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • java/FramclipsePlugin/src/main/resources/framscontext.xml

    r193 r439  
    4343    <objects context="properties file"/>
    4444    <code object="show" member="code">
     45      <context name="Framsticks Theater"/>
    4546      <context name="Command line interface"/>
    4647      <context name="Experiment definition"/>
     
    5960
    6061  <file pattern="*.ini" label="Framsticks startup scripts">
     62    <script context="Framsticks Theater"/>
    6163    <script context="Command line interface"/>
    6264    <script context="Global context"/>
  • java/FramclipsePlugin/src/main/resources/framscript.xml

    r436 r439  
    640640                        </arguments>
    641641                </element>
     642        </type>
     643        <type name="FunctionReference" context="Global context">
     644<description><![CDATA[Function reference objects are created using the 'function' operator, the referenced function can be called using the 'call' operator:
     645
     646        function abc(a,b)
     647        { return a+b; }
     648
     649        var f=function abc;
     650        Simulator.print(typeof(f)); //"FunctionReference"
     651        Simulator.print(call(f)(123,321)); //444]]></description>
    642652        </type>
    643653        <type name="GenePool" context="Global context">
     
    49874997                <element name="new" function="true" type="Vector"><arguments/></element>
    49884998                <element name="sort" function="true" type="void" flags="256">
    4989                         <description><![CDATA[comparator can be null, giving the "natural" sorting order (depending on element type), otherwise it must be a function reference obtained by the "function FUNCTIONNAME" operator.
     4999                        <description><![CDATA[comparator can be null, giving the "natural" sorting order (depending on element type), otherwise it must be a function reference obtained from the 'function' operator.
    49905000
    49915001Example:
     
    49945004v.sort(function compareLastDigit);]]></description>
    49955005                        <arguments>
    4996                                 <argument name="comparator" type="Object"/>
     5006                                <argument name="comparator" type="FunctionReference"/>
    49975007                        </arguments>
    49985008                </element>
     
    63116321                <element name="msgtype" type="integer" min="0" max="1"/>
    63126322        </type>
    6313         <type name="CreatureCharts" context="Command line interface">
     6323        <type name="RowFormat" context="Command line interface">
     6324<description><![CDATA[Used for creating simple listings of objects (in command line applications). There is only one shared RowFormat object. In order to use RowFormat you should first configure it, by adding column definitions (prepare or addColumn), i.e. defining column names and widths. Then, the "format" method can be invoked on a number of objects (of the same class) returning the formatted rows of the table.
     6325
     6326Example:
     6327RowFormat.clear();
     6328RowFormat.prepare(Genotype.*,"name/20,strsiz/5,nnsiz/5,fit/6");
     6329CLI.println(RowFormat.format(Genotype.*));]]></description>
     6330                <element name="prepare" function="true" type="void">
     6331                        <description><![CDATA[Adds a number of columns, described as FIELD_NAME/WIDTH, columns are separated by "," (comma). Existing column definitions are not removed. Usually you will need to call "clear()" before "prepare".]]></description>
     6332                        <arguments>
     6333                                <argument name="Object" type="Object"/>
     6334                                <argument name="Column Descriptions" type="string"/>
     6335                        </arguments>
     6336                </element>
     6337                <element name="format" function="true" type="string">
     6338                        <description><![CDATA[Returns the formatted string taking data from the supplied object.]]></description>
     6339                        <arguments>
     6340                                <argument name="Object" type="Object"/>
     6341                        </arguments>
     6342                </element>
     6343                <element name="clear" function="true" type="void">
     6344                        <description><![CDATA[Remove all existing column definitions.]]></description>
     6345<arguments/></element>
     6346                <element name="addColumn" function="true" type="void">
     6347                        <description><![CDATA[Low level call, adds a single column. "prepare" is better.]]></description>
     6348                        <arguments>
     6349                                <argument name="Field#" type="integer"/>
     6350                                <argument name="Column width" type="integer"/>
     6351                        </arguments>
     6352                </element>
     6353                <element name="fillchar" type="string">
     6354                        <description><![CDATA[The characted used for padding the columns contents]]></description>
     6355                </element>
     6356                <element name="fieldsep" type="string">
     6357                        <description><![CDATA[The character used for separating columns]]></description>
     6358                </element>
     6359                <element name="header" type="string" flags="1">
     6360                        <description><![CDATA[Contains the field names with the same formatting applied (i.e. with fill and separators)]]></description>
     6361                </element>
     6362        </type>
     6363        <type name="CreatureCharts" context="Framsticks Theater">
    63146364<description><![CDATA[Manages charts for monitoring creatures performance.
    63156365This class has no corresponding static object. If you want to use it, you have to create an object or get a reference to the existing object.]]></description>
     
    63326382                <element name="creature" type="untyped" flags="290"/>
    63336383        </type>
    6334         <type name="CreatureSelection" context="Command line interface">
     6384        <type name="CreatureSelection" context="Framsticks Theater">
    63356385                <element name="count" type="integer" flags="1"/>
    63366386                <element name="get" function="true" type="Creature">
     
    63516401                <element name="clear" function="true" type="void"><arguments/></element>
    63526402        </type>
    6353         <type name="DynaChart" context="Command line interface">
     6403        <type name="DynaChart" context="Framsticks Theater">
    63546404<description><![CDATA[Line chart (visual object). Can be used as the client object in the Window.]]></description>
    63556405                <element name="new" function="true" type="DynaChart" flags="32"><arguments/></element>
     
    63606410                <element name="xscale" type="integer" min="1" max="20" flags="288"/>
    63616411        </type>
    6362         <type name="DynaChart2D" context="Command line interface">
     6412        <type name="DynaChart2D" context="Framsticks Theater">
    63636413<description><![CDATA[2D Line chart (visual object). Can be used as the client object in the Window.]]></description>
    63646414                <element name="new" function="true" type="DynaChart2D" flags="32"><arguments/></element>
     
    63756425                </element>
    63766426        </type>
    6377         <type name="GLDisplay" context="Command line interface">
     6427        <type name="GLDisplay" context="Framsticks Theater">
    63786428<description><![CDATA[OpenGL display for the Framsticks Theater application.]]></description>
    63796429                <element name="simsteps" type="integer" min="0" max="999999" default="0">
     
    64656515                </element>
    64666516        </type>
    6467         <type name="GUI" context="Command line interface">
     6517        <type name="GUI" context="Framsticks Theater">
    64686518<description><![CDATA[Manage GUI elements]]></description>
    64696519                <element name="newLabel" function="true" type="GUIElement">
     
    65596609                                <argument name="identifier" type="string"/>
    65606610                                <argument name="timeout" type="float"/>
    6561                                 <argument name="function" type="JumpTarget"/>
     6611                                <argument name="function" type="FunctionReference"/>
    65626612                        </arguments>
    65636613                </element>
     
    65736623                                <argument name="message" type="string"/>
    65746624                                <argument name="buttons" type="Vector"/>
    6575                                 <argument name="function" type="JumpTarget"/>
     6625                                <argument name="function" type="FunctionReference"/>
    65766626                        </arguments>
    65776627                </element>
     
    65926642                <element name="bottom_right" type="Element" flags="1"/>
    65936643        </type>
    6594         <type name="GUIElement" context="Command line interface">
     6644        <type name="GUIElement" context="Framsticks Theater">
    65956645<description><![CDATA[GUI element]]></description>
    65966646                <element name="name" type="string"/>
     
    67216771                </element>
    67226772        </type>
    6723         <type name="ImageExport" context="Command line interface">
     6773        <type name="ImageExport" context="Framsticks Theater">
    67246774                <element name="imgex_outdir" type="string" default=".">
    67256775                        <description><![CDATA[Directory name WITHOUT trailing '/' sign]]></description>
     
    67476797                <element name="imgex_lastfile" type="string" flags="18"/>
    67486798        </type>
    6749         <type name="Material" context="Command line interface">
     6799        <type name="Material" context="Framsticks Theater">
    67506800<description><![CDATA[Material object]]></description>
    67516801                <element name="new" function="true" type="Material"><arguments/></element>
     
    67566806                <element name="shader" type="Shader" flags="256"/>
    67576807        </type>
    6758         <type name="Matrix" context="Command line interface">
     6808        <type name="Matrix" context="Framsticks Theater">
    67596809<description><![CDATA[4x4 Marix object]]></description>
    67606810                <element name="new" function="true" type="Matrix"><arguments/></element>
     
    68016851                </element>
    68026852        </type>
    6803         <type name="NeuroDiagram" context="Command line interface">
     6853        <type name="NeuroDiagram" context="Framsticks Theater">
    68046854<description><![CDATA[Can be used as the client object in the Window.]]></description>
    68056855                <element name="new" function="true" flags="32"/>
     
    68166866                <element name="hide" function="true" type="void" flags="288"><arguments/></element>
    68176867        </type>
    6818         <type name="Obj3D" context="Command line interface">
     6868        <type name="Obj3D" context="Framsticks Theater">
    68196869<description><![CDATA[3D object]]></description>
    68206870                <element name="newEmpty" function="true" type="Obj3D"><arguments/></element>
     
    68696919                </element>
    68706920        </type>
    6871         <type name="Rectangle" context="Command line interface">
     6921        <type name="Rectangle" context="Framsticks Theater">
    68726922<description><![CDATA[GUI Rectangle]]></description>
    68736923                <element name="x" type="float" flags="256"/>
     
    68846934                </element>
    68856935        </type>
    6886         <type name="RowFormat" context="Command line interface">
    6887 <description><![CDATA[Used for creating simple listings of objects (in command line applications). There is only one shared RowFormat object. In order to use RowFormat you should first configure it, by adding column definitions (prepare or addColumn), i.e. defining column names and widths. Then, the "format" method can be invoked on a number of objects (of the same class) returning the formatted rows of the table.
    6888 
    6889 Example:
    6890 RowFormat.clear();
    6891 RowFormat.prepare(Genotype.*,"name/20,strsiz/5,nnsiz/5,fit/6");
    6892 CLI.println(RowFormat.format(Genotype.*));]]></description>
    6893                 <element name="prepare" function="true" type="void">
    6894                         <description><![CDATA[Adds a number of columns, described as FIELD_NAME/WIDTH, columns are separated by "," (comma). Existing column definitions are not removed. Usually you will need to call "clear()" before "prepare".]]></description>
    6895                         <arguments>
    6896                                 <argument name="Object" type="Object"/>
    6897                                 <argument name="Column Descriptions" type="string"/>
    6898                         </arguments>
    6899                 </element>
    6900                 <element name="format" function="true" type="string">
    6901                         <description><![CDATA[Returns the formatted string taking data from the supplied object.]]></description>
    6902                         <arguments>
    6903                                 <argument name="Object" type="Object"/>
    6904                         </arguments>
    6905                 </element>
    6906                 <element name="clear" function="true" type="void">
    6907                         <description><![CDATA[Remove all existing column definitions.]]></description>
    6908 <arguments/></element>
    6909                 <element name="addColumn" function="true" type="void">
    6910                         <description><![CDATA[Low level call, adds a single column. "prepare" is better.]]></description>
    6911                         <arguments>
    6912                                 <argument name="Field#" type="integer"/>
    6913                                 <argument name="Column width" type="integer"/>
    6914                         </arguments>
    6915                 </element>
    6916                 <element name="fillchar" type="string">
    6917                         <description><![CDATA[The characted used for padding the columns contents]]></description>
    6918                 </element>
    6919                 <element name="fieldsep" type="string">
    6920                         <description><![CDATA[The character used for separating columns]]></description>
    6921                 </element>
    6922                 <element name="header" type="string" flags="1">
    6923                         <description><![CDATA[Contains the field names with the same formatting applied (i.e. with fill and separators)]]></description>
    6924                 </element>
    6925         </type>
    6926         <type name="Shader" context="Command line interface">
     6936        <type name="Shader" context="Framsticks Theater">
    69276937<description><![CDATA[Shader object]]></description>
    69286938                <element name="new" function="true" type="Shader">
     
    69346944                <element name="fragment" type="string" flags="256"/>
    69356945        </type>
    6936         <type name="Sharing" context="Command line interface">
     6946        <type name="Sharing" context="Framsticks Theater">
    69376947                <element name="service" type="integer" min="0" max="4"/>
    69386948                <element name="message" type="string"/>
     
    69496959                <element name="execute" function="true" type="void"><arguments/></element>
    69506960        </type>
    6951         <type name="ShowManager" context="Command line interface">
     6961        <type name="ShowManager" context="Framsticks Theater">
    69526962                <element name="show" type="string"/>
    69536963                <element name="name" type="string" flags="50"/>
     
    69907000                <element name="changedPropertyId" type="string" flags="35"/>
    69917001        </type>
    6992         <type name="ShowParams" context="Command line interface">
     7002        <type name="ShowParams" context="Framsticks Theater">
    69937003                <element name="clear" function="true" flags="34"/>
    69947004                <element name="add" function="true" flags="34"/>
     
    69997009                <element name="changedPropertyId" type="string" flags="35"/>
    70007010        </type>
    7001         <type name="SimStatsCharts" context="Command line interface">
     7011        <type name="SimStatsCharts" context="Framsticks Theater">
    70027012<description><![CDATA[Manages charts for monitoring simulator statistics.
    70037013This class has no corresponding static object. If you want to use it, you have to create an object or get a reference to the existing object.]]></description>
     
    70117021                <element name="createChart" function="true" flags="288"/>
    70127022        </type>
    7013         <type name="TrackingCam" context="Command line interface">
     7023        <type name="TrackingCam" context="Framsticks Theater">
    70147024<description><![CDATA[Camera object with the automatic target tracking ability.]]></description>
    70157025                <element name="cam_tracking" type="integer" min="0" max="3" default="1"/>
     
    70717081                </element>
    70727082        </type>
    7073         <type name="VisualStyle" context="Command line interface">
     7083        <type name="VisualStyle" context="Framsticks Theater">
    70747084                <element name="style" type="string" default="standard"/>
    70757085                <element name="name" type="string" flags="19"/>
     
    71247134                </element>
    71257135        </type>
    7126         <type name="Window" context="Command line interface">
     7136        <type name="Window" context="Framsticks Theater">
    71277137<description><![CDATA[Window object, used in the Framsticks Theater application.
    71287138This class has no corresponding static object. If you want to use it, you have to create an object or get a reference to the existing object.
Note: See TracChangeset for help on using the changeset viewer.