|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
wt.clients.dndMicroApplet.DnDMicroApplet
Simple applet capable of drawing icons and serving as a drag source of
file and string data and as a drop target of file and string data. It
also can respond to double-clicks. See DnDMicroAppletConstants and
HTTPParameterConstants for more information.
Supported API: true
Extendable: false
Nested Class Summary |
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 | |
private String |
baseURLParamString
String rep of base url used to resolve relative URLs. |
private ImageIcon |
currentImageIcon
Current main icon to be displayed by the applet. |
private ImageIcon |
dragOverIcon
The "drag-over" icon to be drawn when the applet is being dragged over. |
private boolean |
encodingNeeded
Whether JSOBject.call() args need special encoding (for Netscape 4.7x browsers) |
private ImageIcon |
glyphIcon
The glyph icon to be drawn over the "main" icons. |
private String |
idString
Identification string corresponding to ID_PARAM parameter value. |
private Component |
mainComponent
This component is target of all drawing, events, etc, etc. |
private ImageIcon |
normalIcon
The "normal" main icon, i.e. |
private boolean |
runningInMSIE
Whether it appears that we're running inside Microsoft Internet Explorer |
private URL |
urlDragSource
URL which provides data for drag source file list generation |
private boolean |
useJSObjectCallForVoidCalls
Whether JSObject.call() should be used to call JavaScript functions in cases where the return value is not of interest. |
Fields inherited from class java.applet.Applet |
|
Fields inherited from class java.awt.Panel |
|
Fields inherited from class java.awt.Container |
|
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 | |
DnDMicroApplet()
|
Method Summary | |
(package private) Object |
callJavaScriptFunction(String functionName,
Object[] args,
boolean treatAsVoid)
Call a JavaScript function of the given name in the current page with the given args. |
private Object |
callJavaScriptFunctionViaJSObject(String functionName,
Object[] args)
This routine calls the specified JavaScript function in the current page via JSObject and returns the JavaScript function's return value. |
private void |
callJavaScriptFunctionViaShowDoc(String functionName,
Object[] args)
Call JavaScript function in the current page via AppletContext.showDocument(). |
(package private) void |
enterDragOverState()
If the current icon is not already set to the drag-over icon, make it so and issue a repaint request. |
private static String |
escapeJavaScriptStringArgForJSUrlCall(String str)
Escape the incoming string for use as an argument to a JavaScript function call via a 'javascript:funcName(...)' URL. |
(package private) void |
exitDragOverState()
If the current icon is not already set to the "normal" icon, make it so and issue a repaint request. |
private String |
getBaseURLString()
Returns the 'baseURLParamString' data member computed in init(). |
private boolean |
getBooleanFromParam(String paramName,
boolean defaultValue)
Get a boolean from an applet parameter. |
private URL |
getCurrentPageURL()
Try to set get URL for current browser page from (current) window.location.href via JSObject |
private Component |
getToolTipDelegate(String tooltipText)
Get tool tip delegate component. |
private URL |
getURLFromParam(String paramName)
Get a URL from an applet parameter using getBaseURLString() to resolve relative URLs. |
void |
init()
Initializes everything necessary for this applet to draw itself, handle drag-and-drop events, and handle double-clicks -- as specified by the applet parameters. |
private void |
initGraphicsData()
Initialize everything necessary to draw the applet from the applet's parameters. |
(package private) boolean |
isRunningInMSIE()
Whether the applet is running in Microsoft Internet Explorer. |
void |
paint(Graphics g)
Draw icon(s), glyph icon on top. |
private void |
setupDoubleClick()
Set up a double-click handler on the applet if and as indicated by the applet parameters. |
private void |
setupDragSource()
Set up the applet as a drag source if and as indicated by the applet parameters. |
private void |
setupDropTarget()
Set up the applet as a drop target if and as indicated by the applet parameters. |
private void |
setupLocale()
Set up locale of component based on LOCALE_PARAM. |
(package private) void |
showDocumentInCurrentWindow(URL url)
Centralized handling for calling AppletContext.showDocument( URL url ), which, by nature, replaces the current page with the response from 'url'. |
private static String |
unicodeToAscii(String in_str)
Returns a string in the form of '\\uxxxx.' Same as wt.httpgw.EncodingConverter.unicodeToAscii method Written by Jason Drake |
(package private) boolean |
willCallJavaScriptViaJSObject(boolean treatAsVoid)
Determines whether JavaScript function will be call via JSObject (when the result is true) or via showDocument() on a 'javascript:' URL (when the result is false). |
Methods inherited from class java.applet.Applet |
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop |
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 |
Field Detail |
private Component mainComponent
private String baseURLParamString
private String idString
private ImageIcon currentImageIcon
private ImageIcon normalIcon
private ImageIcon glyphIcon
private ImageIcon dragOverIcon
private URL urlDragSource
private boolean encodingNeeded
private boolean useJSObjectCallForVoidCalls
private boolean runningInMSIE
Constructor Detail |
public DnDMicroApplet()
Method Detail |
public void init()
public void paint(Graphics g)
void enterDragOverState()
void exitDragOverState()
void showDocumentInCurrentWindow(URL url)
Object callJavaScriptFunction(String functionName, Object[] args, boolean treatAsVoid)
boolean willCallJavaScriptViaJSObject(boolean treatAsVoid)
boolean isRunningInMSIE()
private void callJavaScriptFunctionViaShowDoc(String functionName, Object[] args)
private static String escapeJavaScriptStringArgForJSUrlCall(String str)
private Object callJavaScriptFunctionViaJSObject(String functionName, Object[] args)
private void initGraphicsData()
private Component getToolTipDelegate(String tooltipText)
Done in a separate method in the hope that the JIT, etc, will not fully load DelegateJComponent unless/until this method is called thus eliminating load overhead of DelegateJComponent's JComponent ancestry wherever possible.
private void setupDropTarget()
private void setupDragSource()
private void setupDoubleClick()
Note that if DOUBLE_CLICK_JS_PARAM and DOUBLE_CLICK_URL_PARAM are not set, this routine will use the 'urlDragSource' field as the double click URL as well.
private void setupLocale()
private URL getCurrentPageURL() throws Exception
Exception
private boolean getBooleanFromParam(String paramName, boolean defaultValue)
private URL getURLFromParam(String paramName)
private String getBaseURLString()
private static String unicodeToAscii(String in_str)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |