Simple MouseBehavior example and later vanish the object !!!

Hi all,
I am new to Java3D and trying to model a network. For nodes of the network I am using spheres. Users of this model will click on any nodes, and links later, to get more information about it. I don�t know what is the best way to implement this, I know that I need a MouseBehavior to get the node which was clicked on and then show a label with some information in it. My problem is:
1- I could not find a simple example of MouseBehavior to learn from.
2- I don�t know how to make that label disappear later, as for example when user presses Esc.
Thanks all,
Ava

Hi Venkat,
It is still not working! I set the user data this way:
[vector[][] include coordinates for each node]
//To put each sphere in its position
        for ( j = 0; j < 2; j++ )// This representation includes a 2-layered network
            for ( i = 0; i < subnetCount; i++ ) {
                if ( j == 1 && nodes2.get( i ).equals( "Not Found!" ) ) {
                    continue;
                Sphere s = new Sphere( 0.07f );
                s.setUserData( j+"."+i );
                s.setCapability( Shape3D.ENABLE_PICK_REPORTING );
                s.setCapability( Shape3D.ALLOW_PICKABLE_WRITE );
                s.setCapability( Shape3D.ALLOW_PICKABLE_READ );
                s.setCapability( Shape3D.ALLOW_APPEARANCE_WRITE );
                s.setCapability( Shape3D.ALLOW_APPEARANCE_READ );
                s.getShape(Sphere.BODY).setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
                s.setAppearance( app[j] );
                // This sphere can be picked to view more information about the corresponding cluster
                 s.setPickable( true );
                TransformGroup tg = new TransformGroup();
                Transform3D transform = new Transform3D();
                transform.setTranslation( vector[j] );
tg.setTransform( transform );
tg.addChild( s );
Bounds boundSphere = new BoundingSphere( new Point3d( vector[j][i].x, vector[j][i].y,vector[j][i].z), 1.0 );
PickMouseBehavior mousePick = new PickHighlightBehavior ( canvas3D, globalBR, boundSphere );
//Add the sphere to the graph
globalBR.addChild( tg );
}Then I try to get it by:pickResult = pickCanvas.pickClosest();
     if (pickResult != null) {
     shape = (Shape3D) pickResult.getNode(PickResult.SHAPE3D);
System.out.println( "Shape name: "+shape.getUserData()); // It returns all nul!!!
It returns null ! I checked It actually sets the user data but when it is picked, it returns null!
Your concerns are appreciated,
Ava                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • I am trying to create a simple animated gif in Photoshop. I've set up my frames and want to use the tween to make the transitions less jerky. When I tween between frame 1 and frame 2 the object in frame two goes out of position, appearing in a different p

    I am trying to create a simple animated gif in Photoshop. I've set up my frames and want to use the tween to make the transitions less jerky. When I tween between frame 1 and frame 2 the object in frame two goes out of position, appearing in a different place than where it is on frame 2. Confused!

    Hi Melissa - thanks for your interest. Here's the first frame, the second frame and the tween frame. I don't understand why the tween is changing the position of the object in frame 2, was expecting it to just fade from one frame to the next.

  • Some of my rotation animation is stepping at about one degree increments instead of tweening smoothly.  I'm using classic tweening.  I see that if I select the whole interval and use F6 to convert every tween frame to a key and then select the object at t

    Some of my rotation animation is stepping at about one degree increments instead of tweening smoothly.  I'm using classic tweening.  I see that if I select the whole interval and use F6 to convert every tween frame to a key and then select the object at the different frames, that I see under transform that the skew values are changes from frame to frame aroung that same one degree range.  Is there a solution to this?

    Some of my rotation animation is stepping at about one degree increments instead of tweening smoothly.  I'm using classic tweening.  I see that if I select the whole interval and use F6 to convert every tween frame to a key and then select the object at the different frames, that I see under transform that the skew values are changes from frame to frame aroung that same one degree range.  Is there a solution to this?

  • HT4740 i already did the Hidding part and later moved the events and projects to the FCP events and projects folder . I still cannot share - keep getting this message "THE SHARE OPERATION 1080P FOR APPLE DEVICES (10 MBPS) HAS FAILED. Quicktime Error -50

    i already did the Hidding part and later moved the events and projects to the FCP events and projects folder . I still cannot share - keep getting this message "THE SHARE OPERATION 1080P FOR APPLE DEVICES (10 MBPS) HAS FAILED. Quicktime Error -50
    I dont know what else to do to be able to share my project - I know i updated FCPX before i shared this project  but i dont know what im doing wrong

    masterpieces wrote:
    later moved the events and projects to the FCP events and projects folder .
    Can you explain in detail what you did?
    Do any other shsre destinations complete? If not, do you get the same error message?

  • Algorithm to find the area and color  of the objects in an image

    Hello everyone,
    I have some problems in finding the segmented objects once i find the threshold , i want to find the area of the objects in the image . for example i have some lymphocytes in the image and i need to seperate them from the background by labelling them. can i seperate them by using the colour as well . please give some idea .
    my code till now is:
    int data = -1;
    try {
    System.out.println("Is the input a FloatImage ?");
    m_fi_in = (FloatImage)inputData[0];
    data = 0;
    catch (ClassCastException cce) {
    System.out.println("Not a FloatImage");
    data = -1;
    try {
    System.out.println("Is the input a Volume ?");
    m_vol_in = (Volume)inputData[0];
    data = 1;
    catch (ClassCastException cce2) {
    System.out.println("Not a Volume");
    data = -1;
    System.out.println(data);
    // For the FloatImage
    if (data == 0) {
    // For the Volume
    else if(data == 1) {
    System.out.println("Entering Volume for segmentation....");
    // Get target dimensions
    int depth = m_vol_in.getDepth();
    int height = m_vol_in.getHeight();
    int width = m_vol_in.getWidth();
    int region = 1;
    // Create a label structure
    // Consists of Image and region info
    m_label = new Label(m_vol_in);
    if(m_label == null) {
    System.out.println("Label could not be created");
    return false;
    // apply the threshold set by user
    float threshold = m_threshold.getValue();
    float maxi = m_threshold.getMaximum();
    float mini = m_threshold.getMinimum();
    // label the center of the volume in the region part of label as region 1
    m_label.setRegion(m_start_z.getValue(), m_start_y.getValue(), m_start_x.getValue(), region);
    System.out.println("Set starting voxel ("+m_start_z.getValue()+","+m_start_y.getValue()+","+m_start_x.getValue()+" to "+region);
    // Now process 8 partial volumina starting from a given point in the yz-plane in positive and then negative x directions
    // check the neighbours if they are already segmented and set the region in the target volume accordingly
    // do so for the whole yz-plane
    int x,y,z;
    int dir = 0; // the direction of the search. Only initialised here !
    System.out.println("Processing Volume in z++");
    for (z = m_start_z.getValue(); z < depth-1; z++) {
    for (y = m_start_y.getValue(); y < height-1; y++) {
    dir = 1;
    for (x = m_start_x.getValue(); x < width-1; x++) {
    checkRegion(m_label, z, y, x, threshold, region, dir);
    dir = -1;
    for (x = m_start_x.getValue(); x > 0; x--) {
    checkRegion(m_label, z, y, x, threshold, region, dir);
    for (y = m_start_y.getValue(); y > 0; y--) {
    dir = 1;
    for (x = m_start_x.getValue(); x < width-1; x++) {
    checkRegion(m_label, z, y, x, threshold, region, dir);
    dir = -1;
    for (x = m_start_x.getValue(); x > 0; x--) {
    checkRegion(m_label, z, y, x, threshold, region, dir);
    System.out.println("Processing Volume in z--");
    for (z = m_start_z.getValue(); z > 0 ; z--) {
    for (y = m_start_y.getValue(); y < height-1; y++) {
    dir = 1;
    for (x = m_start_x.getValue(); x < width-1; x++) {
    checkRegion(m_label, z, y, x, threshold, region, dir);
    dir = -1;
    for (x = m_start_x.getValue(); x > 0; x--) {
    checkRegion(m_label, z, y, x, threshold, region, dir);
    for (y = m_start_y.getValue(); y > 0; y--) {
    dir = 1;
    for (x = m_start_x.getValue(); x < width-1; x++) {
    checkRegion(m_label, z, y, x, threshold, region, dir);
    dir = -1;
    for (x = m_start_x.getValue(); x > 0; x--) {
    checkRegion(m_label, z, y, x, threshold, region, dir);
    // Apply result to output
    outputData[0] = m_label;
    else {
    return false;
    }

    search for cluster analysis
    spieler

  • Best way to store objects' properties and later remake those objects?

    I want to create a bunch of objects, set their properties and then save that so on restart, the objects can be reconstituted. Is serialization the best way/ Some other way? I want to store them in XML so I can also create a GUI to show the objects stored.

    JoachimSauer wrote:
    6tr6tr wrote:
    I want to create a bunch of objects, set their properties and then save that so on restart, the objects can be reconstituted. Is serialization the best way/ Some other way?Serialization is definitely one way to do that.
    I want to store them in XMLUse JAXB or XMLEncoder/XMLDecoder.
    so I can also create a GUI to show the objects stored.What does a GUI have to do with writing XML? I don't see how that's in any way related.Thanks. What I meant was that I want to have a JTree populated easily with that info and I know there's good support for populating a JTree with XML.

  • Simple Question: JList and JDesktopPane in the same Swing app?

    Hi,
    I'm really inexperienced with Swing and so have hit what I think is quite a simple problem that I hope someone here can help me with.
    I have a class Frame which extends JFrame, I would like to have it contain a JTree running down the left hand side, with the rest of the JFrame taken up by a JDesktopPane. I have sorted out the code for both the JDesktopPane and the JTree independently, and can get them displaying on their own, but how can I display them side by side?
    I have a feeling that I have to use some layout manager of some sort and add the JTree and JDesktopPane to it, then add the layout to the JFrame or something but as you can tell I'm a little lost.
    I hope that this is a simple problem, it certainly seems quite fundamental and so I hope that someone can help!
    Thanks in advance
    Richard

    JFrame by default has a BorderLayout Manager
    so to add these two componets for the center one add it as usual, but for the other u have to add it
    JFrame.getContentPane().add(instance, BorderLayout.WEST);
    or any one of three other values.
    hope this is what u ask about

  • When saving a pdf the objects on the page appear offset of the page boundries.

    This happens mostly in illustrator but it just happened again to me while printing a .ps booklet out of indesign and converting to a pdf using distiller.
    See the image below:
    The left shows my InDesign Document. On the right is the pdf that results from the save. As you can see the page boundaries are being completely disregarded when saving the pdf and everything is equally shifted down and to the right.
    Here is an example of me having the same problem in illustrator:
    As you can see there is sometimes zero correlation between what is on the artboard and what page the objects end up on in the pdf.
    This problem also has another strange symptom, it seems to have to do with dragging images from firefox onto an artboard in illustrator. The image is place automatically in the center and all objects in the file move together in one direction. see before and after photos below:
    Before:
    After image dragged in:
    You can even continue to drag images in and it will move in the same direction the same amount every time:
    I'm running Adobe CS6 on OSX 10.9.1.
    Thanks in advance!

    In so many words: We can't know. You have not provided any details about your exact settings, what version of Acrobat, your placed images, color settings, color profiles and a million other things including perhaps providing your test fioles for inspection by other people. That aside simply ask in teh relevant ID/ AI/ Acro/ PDF forums. This place here is a dead place and only meant for general sales, install and activation questions, not specific workflow questions.
    Mylenium

  • Clicking sound originating from Airport Express firmware 7.5.2 and later

    Hello,
    I have submitted a bug report through Apple Developer Connection (I am a registered developer). By posting this here I want to get support for our case: Make Apple fix the Airport Express firmware.
    Summary:
    The Airport Express device has a bug which appeared first in version 7.5.2. It produces a "clicking" sound when using AirPlay to transport music from an iPhone or a Mac, when certain frequencies are being played. This is not depending on the attached amplifier or headphones, digital or analog output, network settings (network created by Airport Express or not), Mac or iPhone used, audio cable or power supply involved or due to bad quality of the sound file played. The problems are not there when audio is played directly from a Mac or an iPhone through headphones or optical out. We and my colleagues (developers and audophiles) have ruled out all the other options. The problem boils down to a change in the Airports firmware starting with 7.5.2. In 7.4.2 the clicking sound is not there.
    Steps to Reproduce:
    Play the following song via AirPlay on an Airport Express device having firmware 7.5.2 or higher. The Airport Express being used in our tests is the model produced from March 2008 – June 2012. Attach high fidelity headphones (like Bowers & Wilkins P5, which we used) to Airport Express. Alternatively use a very good amplifier/loundspeaker setup. We also reproduced the bug for example on an Onkyo A-9070 amplifier with both optical and analog connection - there is no difference there. The loudspeakers we used are passive Dynaudio X12.
    Play track no. 6 from the "Songs without words" album: http://itunes.apple.com/de/album/lieder-ohne-worte-op.-67-no.-2/id209380163?i=20 9381206
    Listen to this solo piano piece carefully for at least 40 seconds. You will notice a clicking sound with high frequencies. This clicking is *not* there in firmwares 7.4.2 and earlier.
    Expected Results:
    Perfect audio quality as in firmware 7.4.2 and earlier.
    Actual Results:
    Reproducible clicking sounds in high frequencies.
    Regression:
    This problem appeared first in Airport Express firmware 7.5.2 and has not been fixed yet. It can also be observed in the current version of Apple TV (as of September 16th).
    Notes:
    This issue, while not being recognized by the casual listener, makes AirPlay unusable for critical listening - at least when using any firmware after 7.4.2. I would love to use the current firmware (which produces a much more stable connection), but I (and other audiophile AIrplay users) would love to see this issue fixed first.
    Here is a thread that concludes - as we did - that Airport firmware 7.5.2 and later is the source of the problem. It is not the hardware, neither Apple's, nor the connected devices:
    https://discussions.apple.com/message/17296916#17296916
    Hope this helps!
    Best,
    Gabriel

    I'm having the exact same problem. As a classical music lover, this is driving me nuts. It's especially noticable in soft passages in the music, when the volume is turned up high. When the dynamics increase, the little pops/clicks appear (they sound a bit like static noise, as someone stated earlier in this thread). It happens at irregular intervals. When you play pop music, the clicks will disappear (drown) in the music. But for true audiophiles who listen mainly to jazz and classical music this is a severe problem.
    I have checked everything and it's definitely an airplay issue. My apple lossless files are 100% okay and play without any problem, except when streamed via airplay. Also, it makes no difference whether you use the analogue or the optical ouptut from the airport express.
    I've created a sine frequency sweep myself in Adobe Audition, from 20 Hz up to 20000 Hz with a duration of 25 seconds and a level of -6 dB. 
    When played through airplay, the clicks always start to appear after 4 seconds in the sweep, only to disappear at 23 seconds.
    The clicks manifest themselves at different volume levels. To my ears, they make the same sound as when you change the volume in iTunes when streaming music through airplay. Only when you set the volume in iTunes extremely low, the clicks will disappear.
    Apple engineers should use a frequency sweep to recreate the problem, as this is very revealing.
    PS: file format isn't an issue here. I've converted the Apple Lossless file to MP3, and it makes no difference at all.

  • How to set the classpath and path from the jsp to call  java class function

    Hi Exprets,
    I have a requirement to call a java class function which returns a hashmap object from the jsp. The java class in present in one jar file and that jar file is location somewhere in unix path. So the requirement is to set the classpath for that jar file and then create the object of the java class and then call the function.
    If any one know how to achieve it, please reply as soon as possible.
    thanks in advance,
    swapna soni.

    It is never advisable to store large data sets in the session. But it will depend on a lot of factors:
    1. How costly is the query retrieving the data from the database?
    If it's a complex query with lots of joins and stuff, then it will be better to store it in the session as processing the query each time will take a lot of time and will decrease performance. On the other hand if the query is simple then it's advisable not to store it in the session, and fetch it each time.
    2. Are there chances for the data to become stale within a session?
    In this case storing the data is session will mean holding the stale data till the user session lasts which is not right.
    3. How many data sets does the session already holds?
    If there are large no. of data sets already present in the session, then it's strictly not advisable to store the data in the session.
    4. Does the server employ some kind of caching mechanism?
    Using session cache can definitely improve performance.
    You will have to figure out, what is the best way analyzing all the factors and which would be best in the situation. As per my knowledge, session is the only place where session specific data can be stored.
    Also, another thing, if the data set retrieved is some kind of data to be displayed in reports, then it would be better to use a pagination query, which will retrieve only the specific no. of rows at a time. A navigation provided in the UI will retrieve the next/previous data set to display.
    Thanks,
    Shakti

  • HELP! When saving a pdf the objects on the page appear offset of the page boundries.

    This happens mostly in illustrator but it just happened again to me while printing a .ps booklet out of indesign and converting to a pdf using distiller.
    See the image below:
    The left shows my InDesign Document. On the right is the pdf that results from the save. As you can see the page boundaries are being completely disregarded when saving the pdf and everything is equally shifted down and to the right.
    Here is an example of me having the same problem in illustrator:
    As you can see there is sometimes zero correlation between what is on the artboard and what page the objects end up on in the pdf.
    This problem also has another strange symptom, it seems to have to do with dragging images from firefox onto an artboard in illustrator. The image is place automatically in the center and all objects in the file move together in one direction. see before and after photos below:
    Before:
    After image dragged in:
    You can even continue to drag images in and it will move in the same direction the same amount every time:
    I'm running Adobe CS6 on OSX 10.9.1. Please let me know what other settings you might need to know to help solve this problem.
    Thanks in advance!

    In so many words: We can't know. You have not provided any details about your exact settings, what version of Acrobat, your placed images, color settings, color profiles and a million other things including perhaps providing your test fioles for inspection by other people. That aside simply ask in teh relevant ID/ AI/ Acro/ PDF forums. This place here is a dead place and only meant for general sales, install and activation questions, not specific workflow questions.
    Mylenium

  • Cencelling a BPM  process and later restart it .

    Hi
    I have created a BPM with a synchronous call. If the answer of the called system is negative for example the material is missing, I would like to stop the BPM with an error and later (after the application error is corrected) I would like to restart the error message from sxmb_moni . Could you give a tip how to create the step in BPM (probably a control with exception?)  cencelling the process and later restart it .
    thanks
    Antonis

    Hi,
    Probably you could use the smart exceptions mapping and that could be used in Transformation step.
    Please if you can explain your requirment in more details so we could give you the better solution or alternative on it.
    Thanks
    Swarup

  • Transporting a REdeveloped with UNDO in changes in the object..

    Lets  suppose i have a  Report  which is  already  developed and if i need to do Changes in the code.. and lets suppose i did it .. and later  i have  TRANSPORTED the   changed object to QA ..to PROD......
    and lets suppose if i realized  that the changes wat i have made is unnecessary...and not required then wat i have to do  to UNDO my  changes to the report....???
    do i need to create the special Transpt Request num  and later delete the changes and then transport to QA ????
    pls  give methe PROCESS ....to do ..with minimal effort...
    thnks in advance..
    reply to [email protected]

    hI,
    In SE3b --> Version management , u will get the list of versions.
    there select ur old version & retrieve that version. ur all old code will be in place
    now . create a new request, release & transport that.
    Reward points if it is Useful.
    Thanks,
    Manjunath MS

  • Why does (the object "move" is currently not availible) dialoge box pop up when I run action script?

    when I run actions in CS6 it does nothing close to what Ive recorded , "move" dosnt work, "reflect" dosnt work  ,"copy" dosnt work ? and when I record simple moves it places shapes in compleately different areas then where I recorded them Ive try'd breaking the set up into the smallist possible actions ,with function keys and without . Ive try'd reconfigureing all types of presets in all sorts of combo's its driveing me nuts can anyone esplain ?!?!?

    my first command is "open" and it opens my file  my second command is copy and the first dialog box opens and states that ( the object "copy" is not currently available ) and as long as its still in the clipboard from building the action after i hit continue it pastes the two objects it said the copy wasn't currently available for ...if the clip board is loaded with other stuf two of those pop up instead, next command is rectangle tool witch seems to work but where I record it is not where it shows up when i play back its in different areas everytime time i play back ,then the next command is shapemodes "crop" function witch cropped ounce then not but left the object i was cropping in lines view instead of pixel preview and rite now it just has the rectangles i made appear with solid white and a black stroke but when i recorded my little rectangles were clear with a small black stroke they're also way off to the side on playback ,then the second dialog box pops up and tells me that the object  (?)"reflect" is also currently unavailable but it doesn't matter because they're white anyway's ..... any ways it goes on like that ,I have plenty of time between moves to let the program think.... 

  • I cannot see my photos in iphoto library - I tried to restore with Time Machine and that doubled the number of photos (copies) but I still cannot see the images - the events are there but no thumbnails although the number of pics per event is correct...

    Can someone help me see my pictures again in iphoto? 3 weeks ago while uploading a video from iphoto to Facebook, my events thumbnails all disappeared and were replaced by black squares - the event names and number of pics in each remain but when I click on the event, I only get squares where the pics should be - when I click those squares, I get  a square with a triangle  and an exclamation mark in middle.
    Apple had emailed me about defective disks in iMacs so I took mine to the Apple Store and they replaced my HD then reinstalled from my backup via Time Machine - I still cannot see my pics! I tried to reinstall from an earlier Time Machine date - that copied everything and now my HD has double the amount of data but I still cannot see my pictures!
    I would be thankful for any guidance on how to retrieve my pictures...
    Thank you.

    iPhoto 6 and later: Rebuilding the iPhoto library

Maybe you are looking for

  • Steps involved in validating a server's certificate

    Hello All, I'm writing a custom trust manager and wondering if anyone can tell me all the steps that are involved in validating a certificate presented by the server during an SSL handshake. The following are the things I think are must to check if a

  • How to process a JCO.Table object line by line

    Hello all. I am new to development using JCo. How to process a JCO.Table line by line?! I want to print each line of the table using System.out.println ... Thx a lot Mike

  • Automatic forwarding of landscape data

    Hello We have a DEV and CONS system, each with its own SLD. The XI content trasport is intended using CMS. Also, the two SLD's need to be synchronized via automatic forwarding of landscape data. Where can I find a suitable document giving the complet

  • Maping of material in repetative manufacturing

    Dear Guru Plz suggest how to map the material in repetative manufacturing scenario: input material : A, B AND C Output material: x y and z how to map in backflush(mfbf) . In one shot we want to enter the input and output material . We have to  enter

  • Ignore already planned network cost in RA

    Dear All, My client uses network cost planning and option determine planned cost after release. Now client decided to use Result Analysis (RA) and want to use Unit Cost Planning (UCP). Now, problem is RA (KKA2) considered already planned network cost