Package org.apache.batik.apps.svgbrowser
Class NodePickerPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- org.apache.batik.apps.svgbrowser.NodePickerPanel
-
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,javax.accessibility.Accessible
,ActionMap
public class NodePickerPanel extends javax.swing.JPanel implements ActionMap
Used to preview and edit nodes.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
NodePickerPanel.AddButtonAction
The action associated with the 'Add' button.protected class
NodePickerPanel.ApplyButtonAction
The action associated with the 'Apply' button.static class
NodePickerPanel.AttributesTableModel
The attributesTable model.protected class
NodePickerPanel.AttributesTableModelListener
Listens for the changes in the table and updates this node picker panel if needed.static class
NodePickerPanel.NameEditorDialog
Dialog for choosing element name.static class
NodePickerPanel.NodePickerAdapter
The adapter for the NodePicker listener.protected class
NodePickerPanel.NodePickerEditListener
Manages the edits on focus events.static class
NodePickerPanel.NodePickerEvent
Event to pass to listener.static interface
NodePickerPanel.NodePickerListener
Node picker listener.protected class
NodePickerPanel.RemoveButtonAction
The action associated with the 'Remove' button.protected class
NodePickerPanel.ResetButtonAction
The action associated with the 'Reset' button.protected static class
NodePickerPanel.SVGInputPanel
The panel to view and edit the elements xml representation.protected class
NodePickerPanel.XMLAreaListener
Listens for the changes in the xml text area and updates this node picker panel if needed.-
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description NodePickerPanel(NodePickerController controller)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(NodePickerPanel.NodePickerListener listener)
Adds the listener to the listener list.void
enterAddNewElementMode(org.w3c.dom.Element newElement, org.w3c.dom.Node parent)
Enters the add new element mode.void
enterEditMode()
Enters the edit mode.void
enterViewMode()
Enters the view mode.void
fireAddNewElement(NodePickerPanel.NodePickerEvent event)
Fires the AddNewElement event.void
fireUpdateElement(NodePickerPanel.NodePickerEvent event)
Fires the updateElement event.javax.swing.Action
getAction(java.lang.String key)
Returns the action associated with the given string or null on errorjava.lang.String
getResults()
Gets the results of this node picker panel - gets the contents of the xml text area.boolean
promptForChanges()
Shows a dialog to save changes.void
setEditable(boolean editable)
Sets the node picker components to be editable / uneditable.void
setPreviewElement(org.w3c.dom.Element elem)
Sets the preview element.void
updateOnDocumentChange(java.lang.String mutationEventType, org.w3c.dom.Node targetNode)
Updates the panel when DOM Mutation event occures.-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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, setVisible, unregisterKeyboardAction, update
-
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, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Constructor Detail
-
NodePickerPanel
public NodePickerPanel(NodePickerController controller)
Constructor.- Parameters:
controller
- The node picker panel controller
-
-
Method Detail
-
getResults
public java.lang.String getResults()
Gets the results of this node picker panel - gets the contents of the xml text area.
-
setPreviewElement
public void setPreviewElement(org.w3c.dom.Element elem)
Sets the preview element. Enters the view mode and updates the associated components.- Parameters:
elem
- the element to set
-
enterViewMode
public void enterViewMode()
Enters the view mode.
-
enterEditMode
public void enterEditMode()
Enters the edit mode.
-
enterAddNewElementMode
public void enterAddNewElementMode(org.w3c.dom.Element newElement, org.w3c.dom.Node parent)
Enters the add new element mode.- Parameters:
newElement
- The element to be addedparent
- The parent node of the element to be added
-
updateOnDocumentChange
public void updateOnDocumentChange(java.lang.String mutationEventType, org.w3c.dom.Node targetNode)
Updates the panel when DOM Mutation event occures.
-
setEditable
public void setEditable(boolean editable)
Sets the node picker components to be editable / uneditable.- Parameters:
editable
- Whether to enable or disable edit
-
promptForChanges
public boolean promptForChanges()
Shows a dialog to save changes.
-
getAction
public javax.swing.Action getAction(java.lang.String key) throws MissingListenerException
Returns the action associated with the given string or null on error- Specified by:
getAction
in interfaceActionMap
- Parameters:
key
- the key mapped with the action to get- Throws:
MissingListenerException
- if the action is not found
-
fireUpdateElement
public void fireUpdateElement(NodePickerPanel.NodePickerEvent event)
Fires the updateElement event.- Parameters:
event
- The associated NodePickerEvent event
-
fireAddNewElement
public void fireAddNewElement(NodePickerPanel.NodePickerEvent event)
Fires the AddNewElement event.- Parameters:
event
- The associated NodePickerEvent event
-
addListener
public void addListener(NodePickerPanel.NodePickerListener listener)
Adds the listener to the listener list.- Parameters:
listener
- The listener to add
-
-