context menu in java

  • I've created my mini tour in autopano Tour and I'm trying to add general functionalities like context menu to start with.
    heres the code.
    Is there something I'm not seeing here.

    Another thing, if I have to upload and embed the tour into wordpress. Is there a particular way I should be organise my assets.
    {
    house_tour_v01.html
    house_tour_v01.swf
    context.xml
    swfobject [FOLDER]
    house_tour_v01data [FOLDER]

    }


    autopano spit out with my added variable

    <html>
    <body>
    <div id="aptDIV">
    <noscript>ERROR: no Javascript</noscript>
    </div>

    <script type="text/javascript" src="./swfobject/swfobject.js">
    </script>
    <script type="text/javascript" src="./swfobject/swfkrpanomousewheel.js">
    </script>


    <script type="text/javascript">
    if (typeof(deconcept) !== 'undefined' &&
    deconcept.SWFObjectUtil.getPlayerVersion().major >= 6)
    {
    var so = new SWFObject("house_tour_v01.swf", "aptSWFObject",
    "640", "480", "9.0.28","#000000");
    so.addParam("allowFullScreen","true");
    so.addVariable("xml", "context.xml");


    so.useExpressInstall("./swfobject/expressinstall.swf");
    if ( so.write("aptDIV") )
    { var mousewheelfixes = new SWFkrpanoMouseWheel(so); }
    }
    else
    {
    document.getElementById("aptDIV").innerHTML = 'Flash Player 9 needed';
    }
    </script>
    </body>
    </html>

  • my xml.xml file contains


    <contextmenu fullscreen="false">
    <item name="item1"
    caption="About the Panorama..."
    onclick="action(show_pano_info);"
    />
    <item name="item2"
    caption="The Photographer"
    onclick="openurl(http://www.nameform.org);"
    />
    <item name="item3"
    caption="About this Hotspot..."
    enabled="false"
    />
    <item name="item4"
    separator="true"
    caption="Normal Projection"
    onclick="set(view.fisheye,0);
    set(view.architectural,0);
    set(update,view);"
    />
    <item name="item5"
    caption="Fisheye Projection"
    onclick="set(view.fisheye,0.35);
    set(view.architectural,0);
    set(update,view);"
    />
    <item name="item6"
    caption="Architectural Projection"
    onclick="set(view.fisheye,0.0);
    set(view.architectural,1.0);
    set(update,view);"
    />
    <item name="item7"
    separator="true"
    caption="KRPANO"
    />
    </contextmenu>

    and my context.xml contains

    <krpano>
    -
    <!--
    global settings for all krpano.com example panoramas
    -->
    <display movequality="LOW" stillquality="HIGHSHARP"/>
    <!-- mouse cursor -->
    <control movetocursor="arrow"/>
    <!-- set DEFAULT showtext style -->
    <textstyle name="DEFAULT" font="Arial" fontsize="12" yoffset="-10" textalign="center" border="false" background="false" textcolor="0xFFFFFF" effect="glow(0x000000,0.7,4,2);dropshadow(2,45,0x000000,3,1);"/>


    <!--
    right-click context menu to change the viewing settings
    -->
    -
    <contextmenu>
    <item caption="KRPANO"/>
    <item caption="FULLSCREEN"/>
    <item caption="normal view" onclick="action(rectview);" separator="true"/>
    <item caption="fisheye view" onclick="action(fisheyeview);"/>
    <item caption="architectural view" onclick="action(architectural);"/>
    <item caption="stereographic view" onclick="action(stereofisheyeview);"/>
    <item caption="little planet view" onclick="action(littleplanet);"/>
    </contextmenu>
    <!-- actions for view changing -->
    -
    <action name="rectview">

    tween(view.fovmax, 155.0, distance(179, 0.25), easeoutquad);
    tween(view.architectural, 0.0, distance(1.0, 0.25), easeoutquad);
    tween(view.fisheye, 0.0, distance(1.0, 0.25), easeoutquad, set(view.stereographic,false); );

    </action>
    -
    <action name="fisheyeview">

    tween(view.architectural, 0.0, distance(1.0, 0.25), easeoutquad);
    tween(view.fisheye, 0.0 ,distance(1.0, 0.20), easeoutquad,
    set(view.stereographic,false);
    set(view.fovmax,179);
    tween(view.fisheye, 0.35, distance(1.0, 1.25));
    );

    </action>
    -
    <action name="stereofisheyeview">

    tween(view.architectural, 0.0, distance(1.0, 0.25), easeoutquad);
    tween(view.fisheye, 0.0 ,distance(1.0, 0.10), easeoutquad,
    set(view.stereographic,true);
    tween(view.fisheye, 1.0, distance(1.0, 1.25));
    tween(view.fovmax, 150, distance(179, 1.25));
    );

    </action>
    -
    <action name="littleplanet">

    tween(view.architectural, 0.0, distance(1.0, 0.25), easeoutquad);
    tween(view.fisheye, 0.0 ,distance(1.0, 0.10), easeoutquad,
    set(view.stereographic,true);
    tween(view.fisheye, 1.0, distance(1.0, 0.75));
    tween(view.fov, 130, distance(179, 0.75), easeoutquad, set(view.fovmax,150););
    tween(view.vlookat, 90, distance(179, 0.75), easeoutquad);
    );

    </action>
    -
    <action name="architectural">

    tween(view.fovmax, 155.0, distance(179, 0.25), easeoutquad);
    tween(view.architectural, 1.0, distance(1.0, 0.25), easeoutquad);
    tween(view.fisheye, 0.0, distance(1.0, 0.25), easeoutquad, set(view.stereographic,false); );

    </action>
    </krpano>

    Is this right?
    I still don't see my contextmenu

  • yes I have an unlimited krpano license.
    Sure, I've made a template in APT.
    Used Java as an html template and used contextmenu as another template.

    However after having rendered you would expect it be part of the code as
    so.addVariable("xml", "context.xml");

    I've not been able to see it added
    to the code.
    After doctoring the java template and sticking it inside permanently, It now has showed up.
    when you embed the data Its stops working again and I've had to add it in manually.
    Whew!!! Its buggy.Man!

    I have 4 questions, if you could please oblige me with some clarity.

    How do I add more functionalty to my tour?
    do I have to keep adding

    so.addVariable("xml", "context.xml");

    so.addVariable("xml", "autorotation.xml"); I know I could roll that into the same context file and keep auto rotation checked off in APT. But as an example.

    What has to be declared in the "xml" file and does it have to sit in the java template folder before I render and upload the tour?
    So far APT is not adding the xml file at all, I have to manually add all this. Therefore stopping me from embeding the xml files and all data.

    What is the added benefit of embeding all data and all xml files in APT?
    Why and where would you use this option. Is it because I have just one embedded tour to upload?

    and lastly how would you add a simple event or function to my context menu
    ?

    <item name="item1"
    caption="About the Panorama..."
    onclick="action(show_pano_info);"
    />
    <item name="item2"
    caption="The Photographer..."
    onclick="openurl(http://www.yahoo.com);"
    />
    <item name="item3"
    caption="About this Hotspot..."
    enabled="false"
    />

    I've added this to the context menu.xml but I keep seeing loading errors?
    What the action That I have to add to "about the panorama"
    and
    The photographer web link??

    Thanks you sincerely. I know its all long windeded but I need to get a feel before I start diving in.
    cheers

  • Hi,

    so.addVariable("xml", "context.xml");
    so.addVariable("xml", "autorotation.xml");

    that doesn't work!

    first some notes:

    1. use the normal 'krpano.swf' from the viewer or tools download package as main swf file,
    the swf file generated from APT doesn't look for the external "xml" parameter, it always loads
    the generated xml,

    2. only one xml file can be set in the html file as startup xml file!
    if you want more xml files - other xml files can be included into other xml files via the <include> tag,
    e.g.

    Code
    <krpano>
      ...
      <include url="contextmenu.xml" />
     ...
    </krpano>


    What has to be declared in the "xml" file and does it have to sit in the java template folder before I render and upload the tour?
    So far APT is not adding the xml file at all, I have to manually add all this. Therefore stopping me from embeding the xml files and all data.

    the html and javascript files are mainly for embedding the flash object into the html page,
    normally it's not nessecery to change something there until you what to do something special,


    What is the added benefit of embeding all data and all xml files in APT?
    Why and where would you use this option. Is it because I have just one embedded tour to upload?

    the benefit of embedding all data is to have a single swf file, that's all
    for better loading performance I would recommend to keep (especially for tours) the images external,

    best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!