Class JSVGViewerFrame
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
org.apache.batik.apps.svgbrowser.JSVGViewerFrame
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants, UpdateManagerListener, GVTTreeRendererListener, GVTTreeBuilderListener, LinkActivationListener, SVGDocumentLoaderListener, SVGLoadEventDispatcherListener, ActionMap
public class JSVGViewerFrame
extends JFrame
implements ActionMap, SVGDocumentLoaderListener, GVTTreeBuilderListener, SVGLoadEventDispatcherListener, GVTTreeRendererListener, LinkActivationListener, UpdateManagerListener
This class represents a SVG viewer swing frame.
- Version:
- $Id$
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassTo show the about dialogclassTo go back to the previous documentprotected classAn extension of JSVGCanvas that exposes the Rhino interpreter.classTo close the last document.protected static classRhino debugger class.classTo display the DOM viewer of the documentclassTo save the current document as JPG.classTo save the current document as PNG.classTo save the current document as TIFF.classTo display the Find dialogclassTo flush image cache (purely for debugging purposes)classTo go forward to the next documentclassTo display the document full screenprotected static classA FileFilter used when exporting the SVG document as an image.classTo display the memory monitor.classTo open a new window.classTo go forward to the next transformclassTo open a new file.classTo open a new document.classTo pause a document.classTo restart after a pause.classTo show the preferences.classTo go back to the previous transformclassTo print the current document.classTo reload the current document.classTo save the current document as SVG.classTo show the set transform dialogclassTo stop the current processing.classTo display the Thumbnail dialogclassTo toggle visiblity of JavaScript Debugger.protected classThis class implements a SVG user agent.classTo apply the selected author stylesheetclassTo view the source of the current document.Nested classes/interfaces inherited from class JFrame
JFrame.AccessibleJFrameNested classes/interfaces inherited from class Frame
Frame.AccessibleAWTFrameNested classes/interfaces inherited from class Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected StringThe alternate style-sheet title.protected ApplicationThe current application.protected booleanThe auto adjust flag.static final Stringprotected JSVGViewerFrame.BackActionThe back actionprotected static ResourceBundleThe resource bundlestatic final Stringprotected FileThe current path.protected FileThe current export path.protected booleanThe debug flag.protected JSVGViewerFrame.DebuggerThe debugger object.static final CursorThe default cursor.protected static SquiggleInputHandlerThe default input handlerstatic final Stringprotected DOMViewerThe DOM viewer.private static Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected FindDialogThe Find dialog.static final Stringstatic final Stringprotected JSVGViewerFrame.ForwardActionThe forward actionstatic final Stringprotected static VectorThe input handlersprotected static final StringIf the following class can be found (it appeared in JDK 1.4), then we know we are post JDK 1.4.protected MapThe map that contains the action listenersprotected LocalHistoryThe local history.protected LocationBarThe location bar.protected booleanWhether the update manager was stopped.protected static JFrameThe memory monitor frame.static final Stringstatic final Stringstatic final Stringprotected JSVGViewerFrame.NextTransformActionThe next transform actionstatic final Stringstatic final Stringprotected static final StringResource string name for the Open dialog.static final Stringprotected JSVGViewerFrame.PauseActionThe pause actionstatic final Stringprotected JSVGViewerFrame.PlayActionThe play actionstatic final Stringstatic final Stringprotected JSVGViewerFrame.PreviousTransformActionThe previous transform actionstatic final Stringprotected static booleanKind of ugly, but we need to know if we are running before or after 1.4...static final StringName for the os-name propertystatic final StringName for the os.name defaultstatic final StringName for the os.name property prefix we are looking for in OpenAction to work around JFileChooser bugstatic final Stringstatic final Stringprotected static ResourceManagerThe resource managerstatic final StringThe gui resources file namestatic final Stringstatic final Stringprotected StatusBarThe status bar.static final Stringprotected JSVGViewerFrame.StopActionThe stop actionprotected JSVGViewerFrame.CanvasThe JSVGCanvas.protected JPanelThe panel where the svgCanvas is displayedprotected org.w3c.dom.svg.SVGDocumentThe current document.static final Stringprotected ThumbnailDialogThe Find dialog.(package private) longprotected StringThe initial frame title.static final Stringprotected JAffineTransformChooser.DialogThe transform dialogprotected TransformHistoryThe transform history.protected URIChooserThe URI chooser.static final Stringprotected SVGUserAgentThe SVG user agent.protected JSVGViewerFrame.UseStylesheetActionThe use (author) stylesheet actionstatic final Stringstatic final CursorThe cursor indicating that an operation is pending.protected JWindowA window used for full screen displaystatic final Stringstatic final StringFields inherited from class JFrame
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class Frame
CROSSHAIR_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSORFields inherited from class Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Call dispose on canvas as well.voidCalled when the loading of a document was cancelled.voidCalled when the loading of a document was completed.voidCalled when the loading of a document has failed.voidCalled when the loading of a document was started.Returns the action associated with the given string or null on errorprotected static VectorReturns the list of input file handler.getInputHandler(ParsedURL purl) Returns the input handler for the given URIReturns the main JSVGCanvas of this frame.voidCalled when a build was cancelled.voidCalled when a build was completed.voidCalled when a build failed.voidCalled when a build started.voidCalled when a rendering was cancelled.voidCalled when a rendering was completed.voidCalled when a rendering failed.voidCalled when a rendering is in its preparing phase.voidCalled when a rendering started.voidHides and destroys the Rhino debugger.voidCalled when a link was activated.private static FilemakeAbsolute(File f) Needed to work-around JFileChooser bug with abstract FilesvoidCalled when the manager was resumed.voidCalled when the manager was started.voidCalled when the manager was stopped.voidCalled when the manager was suspended.static voidregisterHandler(SquiggleInputHandler handler) Registers an input file handler by adding it to the handlers map.voidsetAutoAdjust(boolean b) Whether to auto adjust the canvas to the size of the document.voidsetDebug(boolean b) Whether to show the debug traces.voidsetSVGDocument(org.w3c.dom.svg.SVGDocument svgDocument, String svgDocumentURL, String svgDocumentTitle) Forces the viewer frame to show the input SVGDocumentvoidShows the Rhino debugger.voidshowSVGDocument(String uri) Shows the given document into the viewer framevoidCalled when a onload event dispatch was cancelled.voidCalled when a onload event dispatch was completed.voidCalled when a onload event dispatch failed.voidCalled when a onload event dispatch started.voidCalled when an update was completed.voidCalled when an update failed.voidCalled when an update started.Methods inherited from class JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateMethods inherited from class Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecoratedMethods inherited from class Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFrontMethods inherited from class Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeMethods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface MenuContainer
getFont, postEvent
-
Field Details
-
EOL
-
priorJDK1_4
protected static boolean priorJDK1_4Kind of ugly, but we need to know if we are running before or after 1.4... -
JDK_1_4_PRESENCE_TEST_CLASS
If the following class can be found (it appeared in JDK 1.4), then we know we are post JDK 1.4.- See Also:
-
RESOURCES
-
ABOUT_ACTION
- See Also:
-
OPEN_ACTION
- See Also:
-
OPEN_LOCATION_ACTION
- See Also:
-
NEW_WINDOW_ACTION
- See Also:
-
RELOAD_ACTION
- See Also:
-
SAVE_AS_ACTION
- See Also:
-
BACK_ACTION
- See Also:
-
FORWARD_ACTION
- See Also:
-
FULL_SCREEN_ACTION
- See Also:
-
PRINT_ACTION
- See Also:
-
EXPORT_AS_JPG_ACTION
- See Also:
-
EXPORT_AS_PNG_ACTION
- See Also:
-
EXPORT_AS_TIFF_ACTION
- See Also:
-
PREFERENCES_ACTION
- See Also:
-
CLOSE_ACTION
- See Also:
-
VIEW_SOURCE_ACTION
- See Also:
-
EXIT_ACTION
- See Also:
-
RESET_TRANSFORM_ACTION
- See Also:
-
ZOOM_IN_ACTION
- See Also:
-
ZOOM_OUT_ACTION
- See Also:
-
PREVIOUS_TRANSFORM_ACTION
- See Also:
-
NEXT_TRANSFORM_ACTION
- See Also:
-
USE_STYLESHEET_ACTION
- See Also:
-
PLAY_ACTION
- See Also:
-
PAUSE_ACTION
- See Also:
-
STOP_ACTION
- See Also:
-
MONITOR_ACTION
- See Also:
-
DOM_VIEWER_ACTION
- See Also:
-
SET_TRANSFORM_ACTION
- See Also:
-
FIND_DIALOG_ACTION
- See Also:
-
THUMBNAIL_DIALOG_ACTION
- See Also:
-
FLUSH_ACTION
- See Also:
-
TOGGLE_DEBUGGER_ACTION
- See Also:
-
WAIT_CURSOR
The cursor indicating that an operation is pending. -
DEFAULT_CURSOR
The default cursor. -
PROPERTY_OS_NAME
Name for the os-name property -
PROPERTY_OS_NAME_DEFAULT
Name for the os.name default -
PROPERTY_OS_WINDOWS_PREFIX
Name for the os.name property prefix we are looking for in OpenAction to work around JFileChooser bug -
OPEN_TITLE
-
handlers
The input handlers -
defaultHandler
The default input handler -
bundle
The resource bundle -
resources
The resource manager -
application
The current application. -
svgCanvas
The JSVGCanvas. -
svgCanvasPanel
The panel where the svgCanvas is displayed -
window
A window used for full screen display -
memoryMonitorFrame
The memory monitor frame. -
currentPath
The current path. -
currentSavePath
The current export path. -
backAction
The back action -
forwardAction
The forward action -
playAction
The play action -
pauseAction
The pause action -
stopAction
The stop action -
previousTransformAction
The previous transform action -
nextTransformAction
The next transform action -
useStylesheetAction
The use (author) stylesheet action -
debug
protected boolean debugThe debug flag. -
autoAdjust
protected boolean autoAdjustThe auto adjust flag. -
managerStopped
protected boolean managerStoppedWhether the update manager was stopped. -
userAgent
The SVG user agent. -
svgDocument
protected org.w3c.dom.svg.SVGDocument svgDocumentThe current document. -
uriChooser
The URI chooser. -
domViewer
The DOM viewer. -
findDialog
The Find dialog. -
thumbnailDialog
The Find dialog. -
transformDialog
The transform dialog -
locationBar
The location bar. -
statusBar
The status bar. -
title
The initial frame title. -
localHistory
The local history. -
transformHistory
The transform history. -
alternateStyleSheet
The alternate style-sheet title. -
debugger
The debugger object. -
listeners
The map that contains the action listeners -
time
long time
-
-
Constructor Details
-
JSVGViewerFrame
Creates a new SVG viewer frame.
-
-
Method Details
-
dispose
-
setDebug
public void setDebug(boolean b) Whether to show the debug traces. -
setAutoAdjust
public void setAutoAdjust(boolean b) Whether to auto adjust the canvas to the size of the document. -
getJSVGCanvas
Returns the main JSVGCanvas of this frame. -
makeAbsolute
-
showDebugger
public void showDebugger()Shows the Rhino debugger. -
hideDebugger
public void hideDebugger()Hides and destroys the Rhino debugger. -
showSVGDocument
Shows the given document into the viewer frame -
getInputHandler
Returns the input handler for the given URI- Throws:
IOException
-
getHandlers
Returns the list of input file handler. -
registerHandler
Registers an input file handler by adding it to the handlers map.- Parameters:
handler- the new input handler to register.
-
getAction
Returns the action associated with the given string or null on error- Specified by:
getActionin interfaceActionMap- Parameters:
key- the key mapped with the action to get- Throws:
MissingListenerException- if the action is not found
-
documentLoadingStarted
Called when the loading of a document was started.- Specified by:
documentLoadingStartedin interfaceSVGDocumentLoaderListener
-
documentLoadingCompleted
Called when the loading of a document was completed.- Specified by:
documentLoadingCompletedin interfaceSVGDocumentLoaderListener
-
setSVGDocument
-
documentLoadingCancelled
Called when the loading of a document was cancelled.- Specified by:
documentLoadingCancelledin interfaceSVGDocumentLoaderListener
-
documentLoadingFailed
Called when the loading of a document has failed.- Specified by:
documentLoadingFailedin interfaceSVGDocumentLoaderListener
-
gvtBuildStarted
Called when a build started. The data of the event is initialized to the old document.- Specified by:
gvtBuildStartedin interfaceGVTTreeBuilderListener
-
gvtBuildCompleted
Called when a build was completed.- Specified by:
gvtBuildCompletedin interfaceGVTTreeBuilderListener
-
gvtBuildCancelled
Called when a build was cancelled.- Specified by:
gvtBuildCancelledin interfaceGVTTreeBuilderListener
-
gvtBuildFailed
Called when a build failed.- Specified by:
gvtBuildFailedin interfaceGVTTreeBuilderListener
-
svgLoadEventDispatchStarted
Called when a onload event dispatch started.- Specified by:
svgLoadEventDispatchStartedin interfaceSVGLoadEventDispatcherListener
-
svgLoadEventDispatchCompleted
Called when a onload event dispatch was completed.- Specified by:
svgLoadEventDispatchCompletedin interfaceSVGLoadEventDispatcherListener
-
svgLoadEventDispatchCancelled
Called when a onload event dispatch was cancelled.- Specified by:
svgLoadEventDispatchCancelledin interfaceSVGLoadEventDispatcherListener
-
svgLoadEventDispatchFailed
Called when a onload event dispatch failed.- Specified by:
svgLoadEventDispatchFailedin interfaceSVGLoadEventDispatcherListener
-
gvtRenderingPrepare
Called when a rendering is in its preparing phase.- Specified by:
gvtRenderingPreparein interfaceGVTTreeRendererListener
-
gvtRenderingStarted
Called when a rendering started.- Specified by:
gvtRenderingStartedin interfaceGVTTreeRendererListener
-
gvtRenderingCompleted
Called when a rendering was completed.- Specified by:
gvtRenderingCompletedin interfaceGVTTreeRendererListener
-
gvtRenderingCancelled
Called when a rendering was cancelled.- Specified by:
gvtRenderingCancelledin interfaceGVTTreeRendererListener
-
gvtRenderingFailed
Called when a rendering failed.- Specified by:
gvtRenderingFailedin interfaceGVTTreeRendererListener
-
linkActivated
Called when a link was activated.- Specified by:
linkActivatedin interfaceLinkActivationListener
-
managerStarted
Called when the manager was started.- Specified by:
managerStartedin interfaceUpdateManagerListener
-
managerSuspended
Called when the manager was suspended.- Specified by:
managerSuspendedin interfaceUpdateManagerListener
-
managerResumed
Called when the manager was resumed.- Specified by:
managerResumedin interfaceUpdateManagerListener
-
managerStopped
Called when the manager was stopped.- Specified by:
managerStoppedin interfaceUpdateManagerListener
-
updateStarted
Called when an update started.- Specified by:
updateStartedin interfaceUpdateManagerListener
-
updateCompleted
Called when an update was completed.- Specified by:
updateCompletedin interfaceUpdateManagerListener
-
updateFailed
Called when an update failed.- Specified by:
updateFailedin interfaceUpdateManagerListener
-