NIH LISTSERV
NIH LISTSERV
IMAGEJ archives -- September 2000 (#27)

Go to: Previous Message | Next Message
Previous in Topic | Next in Topic
Previous by Same Author | Next by Same Author
Previous Page (September 2000) | Back to Main IMAGEJ Page


Options: Reply | Post a New Message | Join or Leave IMAGEJ, or Change Options | Search
View: Chronologically | Most Recent First | Wrap Text (Proportional Font) | Don't Wrap Text (Non-proportional Font)
*

Content-Type: TEXT/plain; charset=us-ascii
Content-MD5: DRDEqmiYF1BcrcIV1rHCqg==
Message-ID:  <[log in to unmask]>
Date:         Thu, 21 Sep 2000 12:45:28 -0400
Reply-To:     Ping Tan <[log in to unmask]>
Sender:       ImageJ Interest Group <[log in to unmask]>
From:         Ping Tan <[log in to unmask]>
Subject:      Interface,parameters...

Dear Wayne, I am a new user of ImageJ, and I am trying to understand your program's structure and logic before I can utilize your wonderful program. I have some questions to ask, please help me if you have time. In method runUserPlugin(), there are some code like the following: thePlugin = (loader.loadClass(className)).newInstance(); if(thePlugin instance of Plugin) ((Plugin)thePlugin).run(arg); .................. 1). According to the source code of class PluginClassLoad (I downloaded your v.118), there should be 2 parameters instead of just one in the loadClass(Sting name, boolean resolve) method, and you don't have any override method for this one. One parameter is missing, how does it work? 2). Plugin is defined as an interface, it has one abstract method run(). Many classes implements this Plugin interface, such as class DICOM. As a class, DICOM extends from ImagePlus and implements Plugin, (loader.loadClass(className)) will return a class c, if the className is "ij.plugin.DICOM", the returned c should be DICOM.class, when it is new by newInstance() we will have an instance of class DICOM,then how does the JVM knows that it should be a subclass of ImagePlus or an implementor of Plugin (maybe both) when your call if(thePlugin instance of Plugin)? 3). Another question related with 2) is (sorry I am new for Java also): when you call loadit(calssname) in PluginClassLoader, the very last statement is : return defineClass(classname, buf, buf.length); here the classname is something like "ij.plugin.DICOM", how does the compiler match it with "DICOM"? In other words, statement loader.loadClass(className) will return ij.plugin.DICOM or DICOM? Thanks in advance for your help! Ping Tan, Ph.D. Medical Engineering Department Radiology Department Wake Forest University, School of Medicine Medical Center BLVD Winston-Salem, NC 27157, USA (phone) 336-716-2704 (fax) 336-716-2870 e_mail [log in to unmask]




Back to: Top of message | Previous page | Main IMAGEJ page

NIH LISTSERV Home Page

CIT
Center for Information Technology
National Institutes of Health
Bethesda, Maryland 20892
301 594 6248 (v) 301 496 8294 (TDD)
Comments and Assistance
Accessibility wheelchair icon