Browser.getBrowser(Applet) 
Author Message
 Browser.getBrowser(Applet)

Here is part of my code:

   browser = Browser.getBrowser(this);
   browser.isActive();

and it returns false value, why?

k.polak



Mon, 11 Aug 2003 21:00:25 GMT  
 Browser.getBrowser(Applet)
VRML EAI combines the high rendering speed of a
vrml plug-in Viewer with your own Java code ...

  for Fast Rendering with the modern, productive
convenience of Object-Oriented-Programming with Java ...

Quote:
> Here is part of my code:

>    browser = Browser.getBrowser(this);
>    browser.isActive();

> and it returns false value, why?


 You have to patient:  Ask, Wait, Ask again ...

  It takes a while for everything to load and be ready,
your program asks just once ... and too early ...
so you have to do the getBrowser( ) call several
times, and pause between requests ( details follow ) ...

 The FAQ, demos, & source are below ....

VRML EAI FAQ & my demos :
-------------------------------------
  http://www.frontiernet.net/~imaging/eaifaq.html#22
  http://www.frontiernet.net/~imaging/HAnimPoser.html
  http://www.frontiernet.net/~imaging/H-Anim_Avatars.html

  * the 3rd is ~  not ~ EAI ...  you * might * find it a better way.

  The FAQ has links to demos, several with Source Code.

___ extract :  Java Source Code for getting the Browser ___

public class VrmlEaiApplet extends Applet
{
  Browser   browser = null;

    public void init( )
    {                                   // ... do something ...
        if( !getBrowser( this ) ) {
            System.out.println( " ERROR:  Failed to connect with
Browser." );
            return;
        }
                                        // ...
    }

    protected boolean getBrowser( Applet app )

        for(        int i = 0;  i < 30;  i++  ) {       //  repeat several
times
            try {                                       //  try: get Browser
Node
                    if( (  browser  = Browser.getBrowser( app )  ) != null )
{
                                return( true );         // got it: success !
                    }                                   // if not null, otherwise
                    try {       Th
read.sleep( 500 );    // pause ( mSec )
                    }               catch( InterruptedException ieSleep  )
 }
            }                       catch( Exception            exOther  )
 }
        }
        return(     false   );          //  report failure to get browser
    }

   Please use VRML EAI if that's best for you ...
but 'pure' java  1.1 is easier and more portable ...

 I had sworn off working with plug-ins, but Evgeny Demidov's
great posts,  programs, and plans for B-Splines have lured me back:

  http://www.ipm.sci-nnov.ru/~demidov/VRML/Splines/Splines.htm
  http://www.frontiernet.net/~imaging/nurbs.html

 ... but I'm already porting it to work * without * the plug-ins ...

  Have fun.  May your VRML run without error in all Browsers !

 -- Paul,   Java Developer & Web Animator
 -------------------------------------------------
"Imaging the Imagined: Modeling with Math & a keyboard"



Wed, 13 Aug 2003 12:06:21 GMT  
 Browser.getBrowser(Applet)

Hi all,

I also got the same problem as Krystian, and tried the suggestion by
Paul, but it doesn't work. It print "Cosmo Player: Browser::getBrowser:
Plugin pointer not available." on the java console.
Can anyone tell me why? Here is my code:

import vrml.external.*;
import vrml.external.exception.*;
import vrml.external.field.*;
import java.applet.Applet;

public class Test1 extends Applet
{
 vrml.external.Browser b;
 EventInSFBool isActive;

 public void init() {
    if(!getBrowser(this))
    {
        System.out.println( " ERROR:  Failed to connect with Browser."
);
        return;
    }
  System.out.println("end main v1.01");
  b.setDescription("end main v1.01");
 }
 public void start()
 {
  Node ps = b.getNode("PS");
  isActive = (EventInSFBool) ps.getEventIn("isActive");
  System.out.println("is avtive? "+isActive);
 }

 protected boolean getBrowser( Applet app )
 {
  for(int i = 0;  i < 30;  i++) {       //  repeat several times
   try {                                       //  try: get Browser Node

    if( (  b = Browser.getBrowser( app )  ) != null )
    {
     return( true );         // got it: success !
    }                // if not null, otherwise
    try {
     Thread.sleep( 500 );    // pause ( mSec )
    } catch( InterruptedException ieSleep ){

    }
   }  catch( Exception  exOther){

   }
        }
  return false;          //  report failure to get browser
 }
 public void shutdown(){}

Quote:
}

> Here is part of my code:

>    browser = Browser.getBrowser(this);
>    browser.isActive();

> and it returns false value, why?

> k.polak



Thu, 14 Aug 2003 23:43:36 GMT  
 Browser.getBrowser(Applet)
Quote:
> Hi all,

> I also got the same problem as Krystian, and tried the suggestion by
> Paul, but it doesn't work. It print "Cosmo Player: Browser::getBrowser:
> Plugin pointer not available." on the java console.
> Can anyone tell me why? Here is my code: ...


 Your program worked for me ... up until it tried to grab
a node in the VRML named "PS" ... and I don't have your
VRML file.

 VRML EAI with Java is tricky, I think dumping the plug-in
makes life easier ... using one of the free VRML Viewers from
Anfy3d, Blaxxun3d, or Shout3d, or your own code ... etc ...

 The FAQ at my site has links to about 10 examples with
source code, try four or five on the web, then download
everything and try them ... the four or five on your machine ...

 That's one of the neat things about Java, you can try it
on the web before you download it and build on it.

 Grab * ALL * the files ...

  .html
  .class
  .java
  .wrl

 With the VRML EAI the web page has to match the
other components, you need tags for VRML and the Java:

 -- extract --- web page for vrml eai ---

<embed src="eai_test.wrl" width="640" height="480">

 <p>

 <applet code=EaiTest2.class width=300 height=200 mayscript>
 </applet>

 -- end extract ---

 ... and VRML EAI has to be run from _ web page _

it _ did _ get the browser ... for me ...

 then it failed because you have it to configured to read a specific
VRML  file that I don't have ... it couldn't find the "PS" node ...

 cosmo is probably the best for VRML EAI.

  -- Java console output ---

end main v1.01

vrml.external.exception.InvalidNodeException: Browser::getNode: Node PS not
found in database
  at EaiTest2.start(Compiled Code)
* at netscape.applet.DerivedAppletFrame$StartAppletEvent.dispatch(Compiled
Code)
  at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code)
  at java.awt.EventDispatchThread.run(Compiled Code)
  at
netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled
Code)

 -- end output --

 I'd rather you get the .jar files and install them as per
the Rev. Bob Crispen's FAQ says ... if you're still having
trouble you can try this :

http://home.rochester.rr.com/javajava/eai_files.zip

this has 142 files, extract them so they form a directory tree ...

 ... it's wrong & won't work if they all just sit in the one directory.

 The structure should look, in part, like this ...

 /netscape/plugin
 /netscape/security/
 /vrml
 /vrml/cosmo
 /vrml/external/exception
 /vrml/external/field
 ...

 If you're still having problems put a println statement
between ** EVERY LINE ** of code and print out
messages so you know exactly where it going wrong and
what it's doing.

 Don't use Microsoft's J++ not-really-java abomination ...

 If you're still having troubles ...

  look at some of the pure java solutions ( below )
and think about doing it that way.

 I'll try going another round, but if you're still having
trouble please also tell me what you are trying to do
... what speed, complexity, portability, and other
requirements are ... VRML EAI may not be the right
solution to the problem.

  -- Paul, Java Developer & Web Animator.
 -------------------------------------------------
 "Imaging the Imagined: Modeling with Math & a keyboard"

" Walk Around Game Engine Demo "
 http://anfyteam.com/game/

" Chase / Gun Fight " :  'Beat Monk Bash'
  http://www.shout3d.com/demo_1.html

" Chess Player : The First H-Anim Avatar  _ GAME _ "
 http://www.frontiernet.net/~imaging/H-Anim_Avatars.html

" Kids at Play with 'Gestures' ( multiple animations ) "
 http://www.avatardom.com/bouchon/x3d.html

" Subway, NYC, with Train " - 'walk' with mouse drags
 http://www.ismarvr.cz/shout3d/sub.htm



Fri, 15 Aug 2003 10:41:49 GMT  
 Browser.getBrowser(Applet)
I use Netscape4.7x and cosmo 2.1.1, but really can't work.
I put all the files here http://www2.ee.cuhk.edu.hk/~s987061/test/
can you try again?
Also, can you tell me which browser and plugin you use?

Martin

Quote:

> > Hi all,

> > I also got the same problem as Krystian, and tried the suggestion by
> > Paul, but it doesn't work. It print "Cosmo Player: Browser::getBrowser:
> > Plugin pointer not available." on the java console.
> > Can anyone tell me why? Here is my code: ...

>  Your program worked for me ... up until it tried to grab
> a node in the VRML named "PS" ... and I don't have your
> VRML file.

>  VRML EAI with Java is tricky, I think dumping the plug-in
> makes life easier ... using one of the free VRML Viewers from
> Anfy3d, Blaxxun3d, or Shout3d, or your own code ... etc ...

>  The FAQ at my site has links to about 10 examples with
> source code, try four or five on the web, then download
> everything and try them ... the four or five on your machine ...

>  That's one of the neat things about Java, you can try it
> on the web before you download it and build on it.

>  Grab * ALL * the files ...

>   .html
>   .class
>   .java
>   .wrl

>  With the VRML EAI the web page has to match the
> other components, you need tags for VRML and the Java:

>  -- extract --- web page for vrml eai ---

> <embed src="eai_test.wrl" width="640" height="480">

>  <p>

>  <applet code=EaiTest2.class width=300 height=200 mayscript>
>  </applet>

>  -- end extract ---

>  ... and VRML EAI has to be run from _ web page _

> it _ did _ get the browser ... for me ...

>  then it failed because you have it to configured to read a specific
> VRML  file that I don't have ... it couldn't find the "PS" node ...

>  cosmo is probably the best for VRML EAI.

>   -- Java console output ---

> end main v1.01

> vrml.external.exception.InvalidNodeException: Browser::getNode: Node PS not
> found in database
>   at EaiTest2.start(Compiled Code)
> * at netscape.applet.DerivedAppletFrame$StartAppletEvent.dispatch(Compiled
> Code)
>   at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code)
>   at java.awt.EventDispatchThread.run(Compiled Code)
>   at
> netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled
> Code)

>  -- end output --

>  I'd rather you get the .jar files and install them as per
> the Rev. Bob Crispen's FAQ says ... if you're still having
> trouble you can try this :

> http://home.rochester.rr.com/javajava/eai_files.zip

> this has 142 files, extract them so they form a directory tree ...

>  ... it's wrong & won't work if they all just sit in the one directory.

>  The structure should look, in part, like this ...

>  /netscape/plugin
>  /netscape/security/
>  /vrml
>  /vrml/cosmo
>  /vrml/external/exception
>  /vrml/external/field
>  ...

>  If you're still having problems put a println statement
> between ** EVERY LINE ** of code and print out
> messages so you know exactly where it going wrong and
> what it's doing.

>  Don't use Microsoft's J++ not-really-java abomination ...

>  If you're still having troubles ...

>   look at some of the pure java solutions ( below )
> and think about doing it that way.

>  I'll try going another round, but if you're still having
> trouble please also tell me what you are trying to do
> ... what speed, complexity, portability, and other
> requirements are ... VRML EAI may not be the right
> solution to the problem.

>   -- Paul, Java Developer & Web Animator.
>  -------------------------------------------------
>  "Imaging the Imagined: Modeling with Math & a keyboard"

> " Walk Around Game Engine Demo "
>  http://anfyteam.com/game/

> " Chase / Gun Fight " :  'Beat Monk Bash'
>   http://www.shout3d.com/demo_1.html

> " Chess Player : The First H-Anim Avatar  _ GAME _ "
>  http://www.frontiernet.net/~imaging/H-Anim_Avatars.html

> " Kids at Play with 'Gestures' ( multiple animations ) "
>  http://www.avatardom.com/bouchon/x3d.html

> " Subway, NYC, with Train " - 'walk' with mouse drags
>  http://www.ismarvr.cz/shout3d/sub.htm



Fri, 15 Aug 2003 14:44:05 GMT  
 Browser.getBrowser(Applet)
 For simple Networked 3d games
Java on the Server & Client with
Linux / Apache / Servlets on the Server
is optimal for :

    Value, Reliability, & Simplicity.

 Source code is available for the Server & Client,
here are some demos of 3d animation that don't
require a plug-in, don't require windows, don't
require ** any ** software from Microsoft  ; ^ )

 *** You can get source to 3d rendering engines,
but not all,  or necessarily the source you want ...

 and can run on :

  Windows, Linux, Macintosh, ... the Web ...
 portable &  embedded devices ...

 " 3D Chat /  Adventure Walk Around Game  "
  http://www.anfy3d.com/game/

 " 3D Dungeon Walk Around (with textures) - use arrow keys
  http://www.2nu.com/Wayne/SplattJava/SplattJava480x300.html

 " 3D Combat / Kick Boxing Game "
  http://www.anfyteam.com/dev/

 " ' BattleZone' / Tank Combat Game "
  http://www.javagameplay.com/tankHunter.html

 " 3D Chess Player with IK:  e makes _ YOUR _ moves "
  http://www.frontiernet.net/~imaging/H-Anim_Avatars.html

 " VRML EAI People Poser " ( requires VRML plug-in Viewer )
  http://www.frontiernet.net/~imaging/HAnimPoser.html

 Server Software Source & Demo & Resources:
  http://www.geometrek.com/products/deepmatrix.html
  http://www.lucidspace.com
  http://www.frontiernet.net/~imaging/great_3d_java.html

 EAI FAQ: http://www.frontiernet.net/~imaging/eaifaq.html#22
 Servlets: http://www.frontiernet.net/~imaging/servlets_intro.html

Quote:
> I use Netscape4.7x and cosmo 2.1.1, but really can't work.
> I put all the files here http://www2.ee.cuhk.edu.hk/~s987061/test/
> can you try again?
> Also, can you tell me which browser and plugin you use?

> Martin


http://nooz.org/comp.lang.vrml/msg01672.html

 3D VRML Viewers that are ' pure Java '

 ... are 'open' to all web visitors with any real browser ...

 The Web ... Windows, Linux, Macintosh, etc ...

 a safe, convenient,  portable way -- safer & more portable
than solutions that use "ActiveX" for instance ...

You're not tied to the x86 or a company found
guilty of illegally destroying it's competitors,
corrupting & subverting standards with it's
Monopoly powers and unethical conduct
( according to the US Federal Court System )

 Those who hate capitalism, competition, freedom,
the US, or our court system please don't reply to this
thread ... this is about doing 3d on the web ... in
a portable way with software you can get for free.

 Web 3D : You have a Web Browser, You get 3D.

  --  Paul,  Java Developer & Web Animator.
  -----------------------------------------------
"Imaging the Imagined: Modeling with Math & a Keyboard"

 All you need:   a Browser & a Brain,  Math & Java:
  http://www.frontiernet.net/~imaging/java3dviewer.html

 ~~~~~~ Don't Look ~~~~~ ___  Source Code follows __

 // Test.java : VRML EAI control MU with VRML plug-in -- the hard way to do
3d.

import java.applet.Applet;
import vrml.external.*;
import vrml.external.exception.*;         // Requires: VRML EAI Nodes
import vrml.external.field.*;

/*----- REQUIRES this __ HTML __

    <EMBED SRC="MuClient.wrl" WIDTH=100% HEIGHT=80%>
    </embed>

    <APPLET code=Test.class width=100% height=20% mayscript>
    </applet>
*/

public class Test extends Applet
{
 vrml.external.Browser  browser;
 EventInSFBool          isActive;

 public void init( )
 {                          println(" init-ing" );
    if( !getBrowser(this) )     {
        println( " ERROR:  Failed to connect with Browser." );
        return;
    }
    println("end main v1.01");
    browser.setDescription("end main v1.01");
 }

 public void start( )
 {                                          println("STARTED");
        Node ps = browser.getNode("PS");    println(" got node PS " );
          //  Warning:  ps.getEvenIn( "isActive" ) gave errors below.    
          //  I'm not sure why it fails,
          //  with all Java solutions you
 don't have that type of problem
          //  if you or someone else can get it to work great
          //  the Java part is working, Is getEvent( "isActive" ) the right
type ?

/*        isActive = (EventInSFBool)      ps.getEventIn( "isActive" );
                                            println( " got event
isActive" );
        println("is avtive? "+ isActive );
 */

 /* -- extract -- errors given for getEventIn( "isActive" );
 init-ing
 got browser: yippy!
end main v1.01
STARTED
 got node PS
vrml.external.exception.InvalidEventInException: EventIn is invalid
  at Test.start(Compiled Code)
* at netscape.applet.DerivedAppletFrame$StartAppletEvent.dispatch(Compiled
Code)
  at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code)
  at java.awt.EventDispatchThread.run(Compiled Code)
  at
netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled
Code)
*/
      println( "start( )-ing : done ... What do you want to do now ? " );
 }

 protected boolean getBrowser( Applet app )

  for( int i = 0;  i < 30;  i++) {       //  repeat several times

   try {                                       //  try: get Browser Node
    if( (  browser = Browser.getBrowser( app )  ) != null )

                                        println( " got browser: yippy!" );
        return( true );         // got it: success !
    }                // if not null, otherwise
    try

                Thread.sleep( 500 );    // pause ( mSec )
    }  catch( InterruptedException  ieSleep ) {  }
    }  catch( Exception             exOther ) {  }
   }        // end for
                        println( " reporting failure to get browser" );
  return false;          //  report failure to get browser
 }

        private void println( String s ) { System.err.println( s ); }

/*
        public void shutdown( ){     System.exit(0);  }
 */

Quote:
}               ///__ end class test

/* --- extract --- Results of run in Console:

 init-ing
 got browser: yippy!
end main v1.01
STARTED
 got node PS

start( )-ing : done ... What do you want to do now ?

 -- end extract --

  vrml scene: white box, blue cylinder, on blue field

      http://nooz.org/comp.lang.vrml/msg01672.html

 Tested on: Win95 / Netscape / Cosmo

 Martin: Please see the EAI FAQ & TRY the demos !
 */
                            ///_____ end of file ____



Sat, 16 Aug 2003 01:43:41 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. EAI: getBrowser(Applet,frame,index)

2. EAI : getBrowser stalls offline applet ?

3. (Browser.getBrowser)Problem.

4. Browser.getBrowser not working

5. Browser::getBrowser: Plugin pointer not available.

6. Browser.getBrowser(this)

7. pb: Browser.getBrowser(this) and Class name?

8. Browser.getBrowser() always failed when using Netscape

9. MMM, a Web browser with applets in Caml Special Light

10. MMM, a Web browser with applets in Caml Special Light

11. MMM, a Web browser with applets in Caml

12. Browser crash after I reload my applet...

 

 
Powered by phpBB® Forum Software