Skip to content

Instantly share code, notes, and snippets.

@kenwebb
Last active October 2, 2018 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenwebb/80324485c0e348da6046cca2442b8153 to your computer and use it in GitHub Desktop.
Save kenwebb/80324485c0e348da6046cca2442b8153 to your computer and use it in GitHub Desktop.
The Love Letter - Jake - PostMessage
<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook http://www.primordion.com/Xholon/gwt/ MIT License, Copyright (C) Ken Webb, Tue Oct 02 2018 14:01:06 GMT-0400 (Eastern Daylight Time)-->
<XholonWorkbook>
<Notes><![CDATA[
Xholon
------
Title: The Love Letter - Jake - PostMessage
Description:
Url: http://www.primordion.com/Xholon/gwt/
InternalName: 80324485c0e348da6046cca2442b8153 based on 88113e296a37af87317f b82b688d02e6b9f06fef 81786af30c8ac62e4753
Keywords:
My Notes
--------
September 24, 2018
This tests connecting separate Helen and Jake windows, using the RemoteNodeService with PostMessage.java.
Helen connects to Jake, while Jake listens for Helen's connection request.
Helen uses a "port", while Jake uses a "trop".
References
----------
(1) http://www.primordion.com/Xholon/gwt/wb/editwb.html?app=9460309abdef48f184cf&src=gist
Helen's world
(2) http://en.wikipedia.org/wiki/Jack_Finney
(3) http://richters-time.blogspot.ca/2007/09/love-letter-by-jack-finney.html
(4) http://en.wikipedia.org/wiki/The_Love_Letter_%281998_film%29
(5)
]]></Notes>
<_-.XholonClass>
<NoBoundariesSystem/>
<Jake/>
<Letter superClass="Attribute_String"/>
<Letters/>
</_-.XholonClass>
<xholonClassDetails>
<Jake xhType="XhtypePureActiveObject">
<port name="port" index="0" connector="../Letters/Letter"/>
<!-- localPortName, remoteXPathExpr -->
<!--<port name="trop" index="1" connector="RemoteNodeService-PostMessage,1,NoBoundariesSystem/Helen"/>-->
<port name="trop" index="1" connector="RemoteNodeService-MessageChannel,1,NoBoundariesSystem/Helen"/>
</Jake>
<Avatar><Color>red</Color></Avatar>
</xholonClassDetails>
<NoBoundariesSystem>
<Jake/>
<Letters>
<Letter><![CDATA[
Helen: I have just read the letter in the secret drawer of your desk, and I wish I knew how I could possibly help you. I can't tell what you might think of me if there were a way I could reach you.But you are someone I am certain I would like to know. I hope you are beautiful, but you needn't be; you're a girl I could like, and maybe ardently, and if I did I promise you I'd be true and loving.Do the best you can, Helen Elizabeth Worley, in the time and place you are;I can't reach you or help you. But I'll think of you. And maybe I'll dream of you, too.
Yours,
JAKE BELKNAP
]]></Letter>
<Letter><![CDATA[
Helen, my dear: I don't know how to say this so it will seem even comprehensible to you. But I do exist, here in Brooklyn,less than three blocks from where you now read this — in the year 1959. We are separated not by space, but by the years which lie between us. Now I own the desk which you once had, and at which you wrote the note I found in it. Helen, all I can tell you is that I answered that note, mailed it late at night at the old Wister station, and that somehow it reached you, as I hope this will too. This is no hoax! Can you imagine anyone playing a joke that cruel? I live in a Brooklyn, within sight of your house, that you cannot imagine. It is a city whose streets are now crowded with wheeled vehicles propelled by engines. And it is a city extending far beyond the limits you know, with a population of millions, so crowded there is hardly room any longer for trees. From my window as I write I can see — across Brooklyn Bridge, which is hardly changed from the way you, too, can see it now — Manhattan Island,and rising from it are the lighted silhouettes of stone-and-steel buildings more than one thousand feet high.
You must believe me. I live, I exist, seventy-seven years after you read this; and with the feeling that I have fallen in love with you.
Helen: there are three secret drawers in our desk. Into the first you put only the letter I found. You cannot now add something to that drawer and hope that it will reach me. For I have already opened that drawer and found only the letter you put there. Nothing else can now come down through the years to me in that drawer, for you cannot now alter what you have already done.
Into the second drawer, in 1882, you put the note which lies before me, which I found when I opened that drawer a few minutes ago. You put nothing else into it. and now that, too, cannot be changed. But I haven't opened the third drawer, Helen. Not yet! It is the last way you can still reach me, and the last time. I will mail this as I did before,then wait. In a week I will open the last drawer.
JAKE BELKNAP
]]></Letter>
</Letters>
<Animate duration="2" selection="#xhgraph" xpath="./NoBoundariesSystem" cssStyle=".d3cpnode circle {stroke-width: 0px;}" efParams="{&quot;selection&quot;:&quot;#xhgraph&quot;,&quot;sort&quot;:&quot;disable&quot;,&quot;width&quot;:300,&quot;height&quot;:300,&quot;mode&quot;:&quot;tween&quot;,&quot;labelContainers&quot;:true,&quot;includeId&quot;:true,&quot;shape&quot;:&quot;circle&quot;}"/>
<InteractionsViewer/>
</NoBoundariesSystem>
<NoBoundariesSystembehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var sys;
var beh = {
postConfigure: function() {
sys = this.cnode.parent();
$wnd.xh.param("TimeStep", "19590001");
$wnd.xh.param("InformationFile","http://en.wikipedia.org/wiki/The_Love_Letter_%281998_film%29");
}
}
//# sourceURL=NoBoundariesSystembehavior.js
]]></NoBoundariesSystembehavior>
<Jakebehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var jake, helen, letter;
var beh = {
postConfigure: function() {
jake = this.cnode.parent();
letter = jake.port(0);
},
processReceivedMessage: function(msg) {
jake.println("\n\nJake has received a message (signal:" + msg.signal + ") from "
+ msg.sender.xhc().name() + ":\n" + msg.data);
jake.port(1, msg.sender);
if (letter) {
msg.sender.msg(102, letter.text(), jake);
letter = letter.next();
}
}
}
//# sourceURL=Jakebehavior.js
]]></Jakebehavior>
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml,
<svg width="100" height="50" xmlns="http://www.w3.org/2000/svg">
<g>
<title>Jake</title>
<rect id="NoBoundariesSystem/Jake" fill="#98FB98" height="50" width="50" x="25" y="0"/>
</g>
</svg>
]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient>
</XholonWorkbook>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment