org.apache.batik.apps.applet
Class JSVGApplet

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--javax.swing.JApplet
                                |
                                +--org.apache.batik.apps.applet.JSVGApplet
All Implemented Interfaces:
javax.accessibility.Accessible, DocumentListener, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, UserAgent

public class JSVGApplet
extends javax.swing.JApplet
implements UserAgent, DocumentListener

An applet that displays SVG document.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JApplet
javax.swing.JApplet.AccessibleJApplet
 
Inner classes inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Inner classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
protected  JSVGCanvas canvas
          The SVG canvas.
protected static java.awt.Cursor DEFAULT_CURSOR
          The default cursor.
protected  SVGDocumentFactory df
          The factory that creates new SVG Document instances.
protected  EventDispatcher eventDispatcher
          The event dispatcher.
protected  java.lang.Thread thread
          The current processing thread
protected  java.lang.String userLanguages
          The user languages.
protected  java.lang.String userStyleSheetURI
          The user style sheet URI.
protected static java.awt.Cursor WAIT_CURSOR
          The wait cursor.
 
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
JSVGApplet()
           
 
Method Summary
 void displayError(java.lang.Exception ex)
          Displays an error resulting from the specified Exception.
 void displayError(java.lang.String message)
          Displays an error message in the User Agent interface.
 void displayMessage(java.lang.String message)
          Displays a message in the User Agent interface.
 java.awt.Point getClientAreaLocationOnScreen()
          Returns the location on the screen of the client area in the UserAgent.
 EventDispatcher getEventDispatcher()
          Returns the EventDispatcher used by the UserAgent to dispatch events on GVT.
 java.lang.String getLanguages()
          Returns the language settings.
 float getPixelToMM()
          Returns the pixel to mm factor.
 java.awt.geom.AffineTransform getTransform()
          Returns the AffineTransform currently applied to the drawing by the UserAgent.
 java.lang.String getUserStyleSheetURI()
          Returns the user stylesheet uri.
 java.awt.geom.Dimension2D getViewportSize()
          Returns the default size of the viewport of this user agent.
 java.lang.String getXMLParserClassName()
          Returns the class name of the XML parser.
 void init()
           
 void loadDocument(java.lang.String uri)
          Loads the given document.
 void openLink(SVGAElement elt)
          Opens a link.
 void processDocumentEvent(DocumentEvent e)
          Take action on receipt of a document event.
 void processDocumentLoadingEvent(DocumentLoadingEvent e)
          Take action on receipt of a document loading event.
 void processDocumentPropertyEvent(DocumentPropertyEvent e)
          Take action on receipt of a document property change.
 void runThread(java.lang.Thread t)
          Runs the given thread.
 void setSVGCursor(java.awt.Cursor cursor)
          Informs the user agent to change the cursor.
 
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.applet.Applet
destroy, 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.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

thread

protected java.lang.Thread thread
The current processing thread

userLanguages

protected java.lang.String userLanguages
The user languages.

userStyleSheetURI

protected java.lang.String userStyleSheetURI
The user style sheet URI.

canvas

protected JSVGCanvas canvas
The SVG canvas.

df

protected SVGDocumentFactory df
The factory that creates new SVG Document instances.

eventDispatcher

protected EventDispatcher eventDispatcher
The event dispatcher.

DEFAULT_CURSOR

protected static final java.awt.Cursor DEFAULT_CURSOR
The default cursor.

WAIT_CURSOR

protected static final java.awt.Cursor WAIT_CURSOR
The wait cursor.
Constructor Detail

JSVGApplet

public JSVGApplet()
Method Detail

init

public void init()
Overrides:
init in class java.applet.Applet

loadDocument

public void loadDocument(java.lang.String uri)
Loads the given document.
Parameters:
s - The document name.

processDocumentEvent

public void processDocumentEvent(DocumentEvent e)
Take action on receipt of a document event.
Specified by:
processDocumentEvent in interface DocumentListener

processDocumentLoadingEvent

public void processDocumentLoadingEvent(DocumentLoadingEvent e)
Take action on receipt of a document loading event.

processDocumentPropertyEvent

public void processDocumentPropertyEvent(DocumentPropertyEvent e)
Take action on receipt of a document property change.

getViewportSize

public java.awt.geom.Dimension2D getViewportSize()
Returns the default size of the viewport of this user agent.
Specified by:
getViewportSize in interface UserAgent

getEventDispatcher

public EventDispatcher getEventDispatcher()
Returns the EventDispatcher used by the UserAgent to dispatch events on GVT.
Specified by:
getEventDispatcher in interface UserAgent

displayError

public void displayError(java.lang.String message)
Displays an error message in the User Agent interface.
Specified by:
displayError in interface UserAgent

displayError

public void displayError(java.lang.Exception ex)
Displays an error resulting from the specified Exception.
Specified by:
displayError in interface UserAgent

displayMessage

public void displayMessage(java.lang.String message)
Displays a message in the User Agent interface.
Specified by:
displayMessage in interface UserAgent

getPixelToMM

public float getPixelToMM()
Returns the pixel to mm factor.
Specified by:
getPixelToMM in interface UserAgent

getLanguages

public java.lang.String getLanguages()
Returns the language settings.
Specified by:
getLanguages in interface UserAgent

getUserStyleSheetURI

public java.lang.String getUserStyleSheetURI()
Returns the user stylesheet uri.
Specified by:
getUserStyleSheetURI in interface UserAgent
Returns:
null if no user style sheet was specified.

openLink

public void openLink(SVGAElement elt)
Opens a link.
Specified by:
openLink in interface UserAgent
Parameters:
elt - The activated link element.

setSVGCursor

public void setSVGCursor(java.awt.Cursor cursor)
Informs the user agent to change the cursor.
Specified by:
setSVGCursor in interface UserAgent
Parameters:
cursor - the new cursor

runThread

public void runThread(java.lang.Thread t)
Runs the given thread.
Specified by:
runThread in interface UserAgent

getXMLParserClassName

public java.lang.String getXMLParserClassName()
Returns the class name of the XML parser.
Specified by:
getXMLParserClassName in interface UserAgent

getTransform

public java.awt.geom.AffineTransform getTransform()
Returns the AffineTransform currently applied to the drawing by the UserAgent.
Specified by:
getTransform in interface UserAgent

getClientAreaLocationOnScreen

public java.awt.Point getClientAreaLocationOnScreen()
Returns the location on the screen of the client area in the UserAgent.
Specified by:
getClientAreaLocationOnScreen in interface UserAgent


Copyright © 2000 Apache Software Foundation. All Rights Reserved.