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 classNodePickerPanel.AddButtonActionThe action associated with the 'Add' button.protected classNodePickerPanel.ApplyButtonActionThe action associated with the 'Apply' button.static classNodePickerPanel.AttributesTableModelThe attributesTable model.protected classNodePickerPanel.AttributesTableModelListenerListens for the changes in the table and updates this node picker panel if needed.static classNodePickerPanel.NameEditorDialogDialog for choosing element name.static classNodePickerPanel.NodePickerAdapterThe adapter for the NodePicker listener.protected classNodePickerPanel.NodePickerEditListenerManages the edits on focus events.static classNodePickerPanel.NodePickerEventEvent to pass to listener.static interfaceNodePickerPanel.NodePickerListenerNode picker listener.protected classNodePickerPanel.RemoveButtonActionThe action associated with the 'Remove' button.protected classNodePickerPanel.ResetButtonActionThe action associated with the 'Reset' button.protected static classNodePickerPanel.SVGInputPanelThe panel to view and edit the elements xml representation.protected classNodePickerPanel.XMLAreaListenerListens 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 voidaddListener(NodePickerPanel.NodePickerListener listener)Adds the listener to the listener list.voidenterAddNewElementMode(org.w3c.dom.Element newElement, org.w3c.dom.Node parent)Enters the add new element mode.voidenterEditMode()Enters the edit mode.voidenterViewMode()Enters the view mode.voidfireAddNewElement(NodePickerPanel.NodePickerEvent event)Fires the AddNewElement event.voidfireUpdateElement(NodePickerPanel.NodePickerEvent event)Fires the updateElement event.javax.swing.ActiongetAction(java.lang.String key)Returns the action associated with the given string or null on errorjava.lang.StringgetResults()Gets the results of this node picker panel - gets the contents of the xml text area.booleanpromptForChanges()Shows a dialog to save changes.voidsetEditable(boolean editable)Sets the node picker components to be editable / uneditable.voidsetPreviewElement(org.w3c.dom.Element elem)Sets the preview element.voidupdateOnDocumentChange(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 MissingListenerExceptionReturns 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
-
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
-
-