input
stringlengths
10
828
output
stringlengths
5
107
public void handle event container available event e log debug scale received a container available event system out println scale received a container available event container activator available e
handles events generated by containers such as unexpected termination of
public void connect interface source check if this service reference contains an interface by the same name if interfaces contains key source get name interfaces get source get name connect source connect the reference to the source else throw new system model exception this name mismatch trying to wire interface source get name of remote service source service get name
connects a single interface to this service
public void handle event authenticate event e log debug scale received an authenticate event system out println scale received an authenticate event container activator authenticate e
handles events generated by containers such as unexpected termination of
public system model node find model uri uri throws not found exception if uri get scopes last element equals root get scope fixme this is a dirty hack we need a clearer definition of uris string new scope string scopes uri get scope names for int i 0 i scopes length 1 i if new scope equals new scope new scope scopes i string old uri to string string new uri old replace first xcf xcf new scope uri new model uri new uri return uri evaluate root
returns the model element denoted by the provided uri
public void handle event component event e log debug scale received a component event
handles events generated by the components control interface such as
public void handle event component error e log debug scale received a component error vector chained target executor executors copy new vector chained target executor target executors for chained target executor cte executors copy cte error e
handles events generated by the components control interface such as
public void bind values bindings bindings apply overrides to parameters for string key bindings key set if contains key key put key bindings get key else throw new system model exception parent found value binding for non existing parameter get prefix key
overrides values of this parameter list with values from the provided
protected document get default system descriptor throws validity exception parsing exception string hostname localhost try hostname inet address get local host get host name catch unknown host exception e e print stack trace string xml xml version 1 0 xcf system name hostname xmlns xcf system model xml namespace uri xcf system todo search for an xcfrc xml in the defined locations and use it if present return parse document xml
returns a default system descriptor to be used if none has been specified
public string get parameter string key return component get parameter key
get the value of the parameter identified by key
public string get parameter string key string dflt try return component get parameter key catch invalid parameter exception e return dflt
get the value of the parameter identified by key or return default if
public int get integer parameter string key string str val get parameter key try return integer parse int str val catch number format exception e throw new invalid parameter exception parameter key does not contain an integer value
get the value of the parameter identified by key as integer
public model uri get reference local uri string name return component get reference local uri name
returns the local uri for the participant which takes the reference role
public model uri get first reference remote uri string name iterator model uri it component get reference remote uri iterator name if it has next return it next else return null
returns the first remote uri for the participant which takes the
public model uri get interface local uri string name return component get interface local uri name
returns the local uri for the participant which takes the interface role
public model uri get first interface remote uri string name iterator model uri it component get interface remote uri iterator name if it has next return it next else return null
returns the first remote uri for the participant which takes the
protected jcomponent build log view log set cell renderer new log renderer log add mouse listener new mouse adapter override public void mouse clicked mouse event e super mouse clicked e if e get click count 2 log get selected index 1 log message msg log message log get model get element at log get selected index if msg get cause null log message dialog show log message dialog frame msg return new jscroll pane log
builds up the log view on the bottom of scale gui
public pvector constrain translation pvector translation frame frame return new pvector translation x translation y translation z
filters the translation applied to the frame
public quaternion constrain rotation quaternion rotation frame frame return new quaternion rotation
filters the rotation applied to the
public string description string description new string if key null description key to string else if mask 0 description desktop events get key text v key else description desktop events get modifiers ex text mask desktop events get key text v key return description
returns a textual description of this keyboard shortcut
public type translation constraint type return trans constraint type
returns the translation constraint type
public interactive drivable frame clone interactive drivable frame cloned iavtr frame interactive drivable frame super clone cloned iavtr frame fly up vec new pvector fly up vec x fly up vec y fly up vec z cloned iavtr frame fly disp new pvector fly disp x fly disp y fly disp z cloned iavtr frame fly timer new timer return cloned iavtr frame
implementation of the clone method
public float fly speed return fly spd
returns the fly speed expressed in processing scene units
public void set quaternion q1 set q1 true
convenience function that simply calls
public type rotation constraint type return rot constraint type
returns the rotation constraint type
public pvector fly up vector return fly up vec
returns the up vector used in fly mode expressed in the world coordinate
public pvector rotation constraint direction return rot constraint dir
returns the axis direction used by the rotation constraint
public void fly update fly disp set 0 0f 0 0f 0 0f switch action case move forward fly disp z fly speed translate local inverse transform of fly disp break case move backward fly disp z fly speed translate local inverse transform of fly disp break case drive fly disp z fly speed drv spd translate local inverse transform of fly disp break default break
called for continuous frame motion in first person mode see
public void set quaternion q1 boolean normalize this x q1 x this y q1 y this z q1 z this w q1 w if normalize this normalize
set this quaternion from quaternion
protected void start action scene mouse action a boolean with constraint super start action a with constraint switch action case move forward case move backward case drive if fly timer null fly timer cancel fly timer purge fly timer new timer timer task timer task new timer task public void run fly update fly timer schedule at fixed rate timer task 0 10 break default break
protected internal method used to handle mouse actions
public void feed float tx float ty float tz float rx float ry float rz feed translation tx ty tz feed rotation rx ry rz
feed the hidevice with hardware output using a controller
public void set translation constraint type type type trans constraint type type
sets the type of the
public void feed translation float x float y float z if mode mode absolute prev translation set translation translation set x y z
defines the device translation feed
public void from axis angle pvector axis float angle float norm axis mag if norm 1 e 8f null rotation this x 0 0f this y 0 0f this z 0 0f this w 1 0f else float sin half angle papplet sin angle 2 0f this x sin half angle axis x norm this y sin half angle axis y norm this z sin half angle axis z norm this w papplet cos angle 2 0f
sets the quaternion as a rotation of
public void set rotation constraint type type type if rotation constraint type axis plane constraint type plane papplet println warning axis plane constraint set rotation constraint type the plane type cannot be used for a rotation constraints return rot constraint type type
set the type of the
public void feed rotation float x float y float z if mode mode absolute prev rotation set rotation rotation set x y z
defines the device rotation feed
public void apply transformation apply transformation scene pg3d
convenience function that simply calls
public interactive camera frame clone interactive camera frame cloned icam frame interactive camera frame super clone cloned icam frame arcball ref pnt new pvector arcball ref pnt x arcball ref pnt y arcball ref pnt z return cloned icam frame
implementation of the clone method
public void feed xtranslation float t if mode mode absolute prev translation x translation x translation x t
defines the device x axis translation feed
public frame frame return fr
returns the associated frame that is interpolated by the
public pvector arcball reference point return arcball ref pnt
returns the point the interactive camera frame revolves around when rotated
public void feed ytranslation float t if mode mode absolute prev translation y translation y translation y t
defines the device y axis translation feed
public interactive frame clone interactive frame cloned iframe interactive frame super clone cloned iframe spng timer new timer return cloned iframe
implementation of the clone method
public int number of key frames return key fr size
returns the number of key frames used by the interpolation
public void feed ztranslation float t if mode mode absolute prev translation z translation z translation z t
defines the device z axis translation feed
public int grabs mouse threshold return grabs mouse threshold
returns the grabs mouse threshold which is used by this interactive frame to
public boolean grabs mouse return grabs mouse
returns true when the mouse grabbable grabs the scene mouse events
public void from euler angles pvector angles from euler angles angles x angles y angles z
convenience function that simply calls
public void mouse pressed point event point camera camera if grabs mouse keeps grabbing mouse true
callback method called when the mouse grabber
public void feed xrotation float t if mode mode absolute prev rotation x rotation x rotation x t
defines the device x axis rotation feed
public float interpolation time return interpolation tm
returns the current interpolation time in seconds along the
public void mouse released point event point camera camera keeps grabbing mouse false
mouse release event callback method
public void set grabs mouse threshold int threshold if threshold 0 grabs mouse threshold threshold
sets the number of pixels that defined the
public float get center x return float x float width 2
returns the x coordinate of the center of the rectangle
public float get center y return float y float height 2
returns the y coordinate of the center of the rectangle
public void feed yrotation float t if mode mode absolute prev rotation y rotation y rotation y t
defines the device y axis rotation feed
public boolean register return scene register camera profile this
registers the camera profile at the scene
public string description string description new string if mask 0 description desktop events get modifiers ex text mask switch button case left description button1 break case middle description button2 break case right description button3 break if number of clicks 1 description number of clicks to string click else description number of clicks to string clicks return description
returns a textual description of this click shortcut
public void from euler angles float roll float pitch float yaw quaternion qx new quaternion new pvector 1 0 0 roll quaternion qy new quaternion new pvector 0 1 0 pitch quaternion qz new quaternion new pvector 0 0 1 yaw set qy multiply qz multiply qx
converts euler rotation angles
public void check if grabs mouse int x int y camera camera pvector proj camera projected coordinates of position set grabs mouse keeps grabbing mouse papplet abs x proj x grabs mouse threshold papplet abs y proj y grabs mouse threshold
implementation of the mouse grabber main method
public float interpolation speed return interpolation spd
returns the current interpolation speed
public void feed zrotation float t if mode mode absolute prev rotation z rotation z rotation z t
defines the device z axis rotation feed
public float feed xtranslation return 0
overload this method to define the x axis translation feed this method
public void unregister scene unregister camera profile this
unregisters the camera profile from the scene
public int interpolation period return period
returns the current interpolation period expressed in milliseconds
public float feed ytranslation return 0
overload this method to define the y axis translation feed this method
public float feed ztranslation return 0
overload this method to define the z axis translation feed this method
public boolean is in mouse grabber pool return scene is in mouse grabber pool this
convenience wrapper function that simply returns
public float feed xrotation return 0
overload this method to define the x axis rotation feed this method
public void add in mouse grabber pool scene add in mouse grabber pool this
convenience wrapper function that simply calls
public float feed yrotation return 0
overload this method to define the y axis rotation feed this method
public constraint constraint return kernel constraint
returns the current constraint applied to the frame
protected a binding k key return map get key
returns the action associated to a given keyboard shortcut
protected void set binding k key a action map put key action
defines the shortcut that triggers a given action
public void remove from mouse grabber pool scene remove from mouse grabber pool this
convenience wrapper function that simply calls
public float feed zrotation return 0
overload this method to define the z axis rotation feed this method
protected void remove binding k key map remove key
removes the shortcut binding
protected void remove all bindings map clear
removes all the shortcuts from this object
protected boolean is shortcut in use k key return map contains key key
returns true if this object contains a binding for the specified shortcut
public float tracking distance return tracking dist
returns the distance between the frame and the tracking camera
public void set tracking distance float d tracking dist d compute camera position
sets the distance between the frame and the tracking camera
public void set translation sensitivity float sx float sy float sz trans sens set sx sy sz
sets the translation sensitivity
public float azimuth azimuth pitch return q tait bryan angles y
returns the azimuth of the tracking camera measured respect to the frames
public float inclination inclination roll return q tait bryan angles x
returns the inclination of the tracking camera measured respect to the
public float wheel sensitivity return wheel sensitivity
returns the mouse wheel sensitivity
public void set rotation sensitivity float sx float sy float sz rot sens set sx sy sz
sets the rotation sensitivity
public camera camera return camera
returns the associated camera
public void set loop interpolation set loop interpolation true
convenience function that simply calls
public void set xtranslation sensitivity float sensitivity trans sens x sensitivity
sets the x axis translation sensitivity
public string camera mouse bindings description string description new string for entry integer mouse action entry camera actions map entry set description key event get modifiers ex text entry get key entry get value description n return description
returns a string containing the camera mouse bindings descriptions
protected void modified iterator key frame interpolator it list iterator while it has next it next invalidate values
resets the cache of all key frame interpolators associated with this frame
public void set ytranslation sensitivity float sensitivity trans sens y sensitivity
sets the y axis translation sensitivity
public void start spinning int update interval is spng true if update interval 0 if spng timer null spng timer cancel spng timer purge spng timer new timer timer task timer task new timer task public void run spin spng timer schedule at fixed rate timer task 0 update interval
starts the spinning of the interactive frame
public string frame mouse bindings description string description new string for entry integer mouse action entry frame actions map entry set description key event get modifiers ex text entry get key entry get value description n return description
returns a string containing the interactive frame mouse bindings descriptions
public void set ztranslation sensitivity float sensitivity trans sens z sensitivity
sets the z axis translation sensitivity
public boolean link to frame source frame avoid loops if linked frames list is empty source frame linked frames list contains this source frame this return false if source frame linked frames list add this src frame source frame set kernel src frame kernel return true return false
links this frame referred to as the requested frame to
public void set xrotation sensitivity float sensitivity rot sens x sensitivity
sets the x axis rotation sensitivity
public string mouse click bindings description string description new string for entry click binding click action entry click actions map entry set description entry get key description entry get value description n return description
returns a string containing the camera mouse click bindings descriptions
public void spin rotate spinning quaternion
rotates the interactive frame by its
public void set yrotation sensitivity float sensitivity rot sens y sensitivity
sets the y axis rotation sensitivity
public void set zrotation sensitivity float sensitivity rot sens z sensitivity
sets the z axis rotation sensitivity