org.apache.batik.apps.svgbrowser

Class FindDialog

public class FindDialog extends JDialog implements ActionMap

This class represents a Dialog that lets the user searching for text inside an SVG document.
Nested Class Summary
protected classFindDialog.ClearButtonAction
The action associated to the 'clear' button.
protected classFindDialog.CloseButtonAction
The action associated to the 'close' button.
protected classFindDialog.FindButtonAction
The action associated to the 'find' button.
Field Summary
protected static ResourceBundlebundle
The resource bundle
protected ButtonFactorybuttonFactory
The button factory
protected JCheckBoxcaseSensitive
The case sensitive button.
protected JButtonclearButton
The next button.
protected JButtoncloseButton
The cancel button.
protected intcurrentIndex
The current index in the TextNode's string.
static StringCLEAR_ACTION
static StringCLOSE_ACTION
protected JButtonfindButton
The next button.
static StringFIND_ACTION
protected GraphicsNodegvtRoot
The GVT root into which text is searched.
protected JRadioButtonhighlightButton
The highlight button.
protected JRadioButtonhighlightCenterButton
The highlight and center button.
protected JRadioButtonhighlightCenterZoomButton
The highlight center and zoom button.
protected Maplisteners
The map that contains the listeners
protected static ResourceManagerresources
The resource manager
protected static StringRESOURCES
The resource file name
protected JTextFieldsearch
The TextField that owns the text to search.
protected JSVGCanvassvgCanvas
The canvas.
protected GVTTreeWalkerwalker
The GVTTreeWalker used to scan the GVT Tree.
Constructor Summary
FindDialog(JSVGCanvas svgCanvas)
Constructs a new FindDialog.
FindDialog(Frame owner, JSVGCanvas svgCanvas)
Constructs a new FindDialog.
Method Summary
protected JPanelcreateButtonsPanel()
Creates the buttons panel
protected JPanelcreateFindPanel()
Creates the Find panel.
protected JPanelcreateShowResultPanel()
ActiongetAction(String key)
Returns the action associated with the given string or null on error
protected GraphicsNodegetNext(String text)
Returns the next GraphicsNode that matches the specified string or null if any.
protected intmatch(GraphicsNode node, String text, int index)
Returns the index inside the specified TextNode of the specified text, or -1 if not found.
voidsetGraphicsNode(GraphicsNode gvtRoot)
Sets the graphics node into which text is searched.
protected voidshowSelectedGraphicsNode()
Shows the current selected TextNode.

Field Detail

bundle

protected static ResourceBundle bundle
The resource bundle

buttonFactory

protected ButtonFactory buttonFactory
The button factory

caseSensitive

protected JCheckBox caseSensitive
The case sensitive button.

clearButton

protected JButton clearButton
The next button.

closeButton

protected JButton closeButton
The cancel button.

currentIndex

protected int currentIndex
The current index in the TextNode's string.

CLEAR_ACTION

public static final String CLEAR_ACTION

CLOSE_ACTION

public static final String CLOSE_ACTION

findButton

protected JButton findButton
The next button.

FIND_ACTION

public static final String FIND_ACTION

gvtRoot

protected GraphicsNode gvtRoot
The GVT root into which text is searched.

highlightButton

protected JRadioButton highlightButton
The highlight button.

highlightCenterButton

protected JRadioButton highlightCenterButton
The highlight and center button.

highlightCenterZoomButton

protected JRadioButton highlightCenterZoomButton
The highlight center and zoom button.

listeners

protected Map listeners
The map that contains the listeners

resources

protected static ResourceManager resources
The resource manager

RESOURCES

protected static final String RESOURCES
The resource file name

search

protected JTextField search
The TextField that owns the text to search.

svgCanvas

protected JSVGCanvas svgCanvas
The canvas.

walker

protected GVTTreeWalker walker
The GVTTreeWalker used to scan the GVT Tree.

Constructor Detail

FindDialog

public FindDialog(JSVGCanvas svgCanvas)
Constructs a new FindDialog.

FindDialog

public FindDialog(Frame owner, JSVGCanvas svgCanvas)
Constructs a new FindDialog.

Method Detail

createButtonsPanel

protected JPanel createButtonsPanel()
Creates the buttons panel

createFindPanel

protected JPanel createFindPanel()
Creates the Find panel.

createShowResultPanel

protected JPanel createShowResultPanel()

getAction

public Action getAction(String key)
Returns the action associated with the given string or null on error

Parameters: key the key mapped with the action to get

Throws: MissingListenerException if the action is not found

getNext

protected GraphicsNode getNext(String text)
Returns the next GraphicsNode that matches the specified string or null if any.

Parameters: text the text to match

match

protected int match(GraphicsNode node, String text, int index)
Returns the index inside the specified TextNode of the specified text, or -1 if not found.

Parameters: node the graphics node to check text the text use to match index the index from which to start

setGraphicsNode

public void setGraphicsNode(GraphicsNode gvtRoot)
Sets the graphics node into which text is searched.

Parameters: gvtRoot the GVT root node

showSelectedGraphicsNode

protected void showSelectedGraphicsNode()
Shows the current selected TextNode.
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.