|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
net.xoetrope.optional.svg.XSvgCanvas
public class XSvgCanvas
The PPSVGCanvas is the J2ME Personal Profile implementation of the SVG Canvas.
anit
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
java.lang.String |
currentURL
The current URL to go |
SVGEventQueue |
eventQueue
The events queue |
com.tinyline.svg.SVGRaster |
raster
The SVG renderer |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| 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 | |
|---|---|
XSvgCanvas()
Constructs a new PPSVGCanvas instance. |
|
| Method Summary | |
|---|---|
void |
addEventListener(java.lang.String type,
EventListener listener,
boolean useCapture)
uDOM: This method allows the registration of event listeners on the event target. |
void |
addNotify()
Requests a repaint of the control once it has been created |
void |
alertError(java.lang.String s)
StatusBar: shows an alert |
void |
alertInit(java.lang.String s)
StatusBar: inits the bar |
void |
alertWait(java.lang.String s)
StatusBar: shows a wait |
com.tinyline.tiny2d.TinyBitmap |
createTinyBitmap(byte[] imageData,
int imageOffset,
int imageLength)
Creates a TinyBitmap which decodes the image stored in the specified byte array, and at the specified offset and length. |
com.tinyline.tiny2d.TinyBitmap |
createTinyBitmap(com.tinyline.tiny2d.TinyString uri)
Returns a TinyBitmap for the given image URL or path. |
boolean |
dispatchEvent(Event evt)
uDOM: This method allows the dispatch of events into the implementations event model. |
void |
flush()
Flushes the allocated resources. |
java.awt.Dimension |
getMinimumSize()
The minimum size of the canvas. |
java.awt.Dimension |
getPreferredSize()
The preferred size of the canvas. |
void |
goURL(java.lang.String url)
Loads and dispalys an SVG document from the given URL. |
boolean |
hasFileLoadCompleted()
Has the component finished with the input file? |
boolean |
imageUpdate(java.awt.Image img,
int flags,
int x,
int y,
int width,
int height)
This method is called when information about an image which was previously requested using an asynchronous interface becomes available. |
void |
init()
|
com.tinyline.svg.SVGDocument |
loadSVG(java.io.InputStream is)
Loads an SVGT document from the given InputStream. |
com.tinyline.svg.SVGDocument |
loadSVG(java.lang.String urlStr)
Loads an SVGT document from the given URL. |
void |
origView()
Returns the current SVGT document to its original view. |
void |
paintComponent(java.awt.Graphics g)
Paints this canvas |
void |
pan(int x,
int y)
Pan/scroll the image to toa new location |
void |
pauseResumeAnimations()
Suspends or unsuspends all animations that are defined within the current SVGT document fragment. |
void |
postEvent(SVGEvent theEvent)
Posts an event to the event queue. |
void |
removeEventListener(EventListener listener)
uDOM: This method allows the removal of event listeners from the event target. |
void |
reset()
Reset the image to its original size and position |
void |
run()
The events dispatching thread run() |
int |
setAttribute(java.lang.String attribName,
java.lang.Object attribValue)
Set one or more attributes of the component. |
void |
setBounds(int x,
int y,
int w,
int h)
|
void |
setVisible(boolean state)
|
void |
start()
Starts the events dispatching thread |
void |
stop()
Stops the events dispatching thread |
void |
switchQuality()
Switches the rendering quality of this SVGPlayer . |
protected void |
updateImage()
Update the raster image |
void |
zoom(double scaleFactor)
Zoom in on the image param scaleFactor the factor by which to adjust the scaling. |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update, updateUI |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public com.tinyline.svg.SVGRaster raster
public SVGEventQueue eventQueue
public java.lang.String currentURL
| Constructor Detail |
|---|
public XSvgCanvas()
| Method Detail |
|---|
public boolean hasFileLoadCompleted()
true - if the input file is closedpublic void addNotify()
addNotify in class javax.swing.JComponent
public void setBounds(int x,
int y,
int w,
int h)
setBounds in class java.awt.Componentpublic void init()
public com.tinyline.tiny2d.TinyBitmap createTinyBitmap(com.tinyline.tiny2d.TinyString uri)
createTinyBitmap in interface com.tinyline.svg.ImageLoaderuri - The image URL or path.
public com.tinyline.tiny2d.TinyBitmap createTinyBitmap(byte[] imageData,
int imageOffset,
int imageLength)
createTinyBitmap in interface com.tinyline.svg.ImageLoaderimageData - an array of bytes, representing
image data in a supported image format.imageOffset - the offset of the beginning
of the data in the array.imageLength - the length of the data in the array.
public void start()
public void stop()
public void run()
run in interface java.lang.Runnablepublic void goURL(java.lang.String url)
public void origView()
public void switchQuality()
public void pauseResumeAnimations()
public boolean imageUpdate(java.awt.Image img,
int flags,
int x,
int y,
int width,
int height)
imageUpdate in interface java.awt.image.ImageObserverimageUpdate in class java.awt.Componentimg - the image being observed.flags - the image status flags.x - the x coordinate.y - the y coordinate.width - the width.height - the height.
false if the infoflags indicate that the
image is completely loaded; true otherwise.public void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponentg - the specified Graphics context.public java.awt.Dimension getMinimumSize()
getMinimumSize in class javax.swing.JComponentpublic java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponentpublic void flush()
public com.tinyline.svg.SVGDocument loadSVG(java.lang.String urlStr)
urlStr - The SVGT document URL or path.
public com.tinyline.svg.SVGDocument loadSVG(java.io.InputStream is)
is - The InputStream.
public void alertError(java.lang.String s)
public void alertWait(java.lang.String s)
public void alertInit(java.lang.String s)
public void postEvent(SVGEvent theEvent)
theEvent - an instance of Event, or a
subclass of it.
public void addEventListener(java.lang.String type,
EventListener listener,
boolean useCapture)
addEventListener in interface EventTargettype - The event type for which the user is registeringlistener - The listener parameter takes an interface implemented by the
user which contains the methods to be called when the event occurs.useCapture - If true, useCapture indicates that the user wishes
to initiate capture. After initiating capture, all events of the
specified type will be dispatched to the registered EventListener
before being dispatched to any EventTargets beneath them in the tree.
Events which are bubbling upward through the tree will not trigger an
EventListener designated to use capture.public void removeEventListener(EventListener listener)
removeEventListener in interface EventTargetlistener - The listener parameter indicates the EventListener to be removed.public boolean dispatchEvent(Event evt)
dispatchEvent in interface EventTargetevt - Specifies the event type, behavior, and contextual
information to be used in processing the event.
public int setAttribute(java.lang.String attribName,
java.lang.Object attribValue)
setAttribute in interface XAttributedComponentattribName - the name of the attributeattribValue - the value of the attribute
public void setVisible(boolean state)
setVisible in class javax.swing.JComponent
public void pan(int x,
int y)
x - the number of pixels to move horizontally, moved the display viewporty - the number of pixels to move vertically, moved the display viewportpublic void zoom(double scaleFactor)
public void reset()
protected void updateImage()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||