|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Panel java.applet.Applet javax.swing.JApplet org.erowid.sperosearch.SearcherApplet
Description: Provides searching functionality to web pages.Applet parameters :
There are several public methods exposed to the calling web page :
<APPLET code="org/erowid/search/SearcherApplet.class" width=500 height=500 name="searchapplet"> <PARAM NAME="bgcolor" VALUE="-16777216"> <PARAM NAME="fgcolor" VALUE="-16777216"> <PARAM NAME="img" VALUE="sperowider.jpg"> </APPLET>
search(String)
to execute a search.getResultCount()
to get the number of entries in the current result set.getResultURL(int)
to get the URL for a given entry.getResultTitle(int)
to get the Title for a given entry.getResultDescription(int)
to get the description for a given entry.getResultWeight(int)
to get the weight for a given entry.isSearchGood()
to get if the search was good, or if an error happened.isSearchOver()
to get if the search has completed yet.getErrorMessage()
to get the error message if the search is not good.
Nested Class Summary |
Nested classes inherited from class javax.swing.JApplet |
JApplet.AccessibleJApplet |
Nested classes inherited from class java.applet.Applet |
Applet.AccessibleApplet |
Nested classes inherited from class java.awt.Panel |
Panel.AccessibleAWTPanel |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
Fields inherited from class javax.swing.JApplet |
accessibleContext, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
SearcherApplet()
|
Method Summary | |
void |
destroy()
Automatically called by the Java Plugin. |
String |
getErrorMessage()
Returns the error message that interrupted the last search, if there is one. |
int |
getResultCount()
Returns the number of URLs found in the last search. |
String |
getResultDescription(int resultIndex)
Returns the description of the resultIndexth page found in the last search. |
String |
getResultTitle(int resultIndex)
Returns the title of the resultIndexth page found in the last search. |
String |
getResultURL(int resultIndex)
Returns the URL of the resultIndexth page found in the last search. |
float |
getResultWeight(int resultIndex)
Returns the weight of the resultIndexth page found in the last search. |
void |
init()
Automatically called by the Java Plugin, this initializes the applet UI and instantiates the search engine. |
boolean |
isInitGood()
Returns true if initialization has succeeded |
boolean |
isInitOver()
Returns true if initialization is complete. |
boolean |
isSearchGood()
Returns true if the applet wasn't interrupted by an exception the last time search(String) was called. |
boolean |
isSearchOver()
Returns true if the applet is done searching, whether the search was successful or ended in an error. |
void |
search(String term)
Delegates to search(term, true) . |
void |
search(String term,
boolean threaded)
Searches for URLs that matches the current set of search criteria, and returns the number of matching URLs found. |
void |
setImage(String url)
Sets the image to display in this applet. |
void |
setText(String text)
Sets the text displayed in this applet. |
void |
start()
Automatically called by the Java Plugin. |
void |
stop()
Automatically called by the Java Plugin. |
Methods inherited from class javax.swing.JApplet |
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.applet.Applet |
getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus |
Methods inherited from class java.awt.Panel |
addNotify |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SearcherApplet()
Method Detail |
public void setText(String text)
public void setImage(String url)
public void init()
public void search(String term)
search(term, true)
.
term
- public void search(String term, boolean threaded)
isSearchOver()
method
to determine if the run is done.
public boolean isSearchOver()
public boolean isSearchGood()
search(String)
was called. If this returns false, you can get the
error message by calling getErrorMessage()
.
public boolean isInitOver()
public boolean isInitGood()
public String getErrorMessage()
public int getResultCount()
public String getResultURL(int resultIndex)
public String getResultTitle(int resultIndex)
public String getResultDescription(int resultIndex)
public float getResultWeight(int resultIndex)
public void destroy()
public void start()
public void stop()
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |