NWNDialogEditorInterface
Class MainWindow.EditWindow

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--NWNDialogEditorInterface.MainWindow.EditWindow
All Implemented Interfaces:
Accessible, ActionListener, DocumentListener, DragGestureListener, DragSourceListener, DropTargetListener, EventListener, FocusListener, ImageObserver, ItemListener, MenuContainer, Observer, Serializable, TreeSelectionListener, WindowListener
Enclosing class:
MainWindow

public class MainWindow.EditWindow
extends JPanel
implements ActionListener, WindowListener, Observer, ItemListener, DocumentListener, TreeSelectionListener, FocusListener, DragSourceListener, DropTargetListener, DragGestureListener

Author:
Alexandre Brunel This object represents an edition field for a single dailog file.
See Also:
Serialized Form

Nested Class Summary
protected  class MainWindow.EditWindow.DialogTreeNode
           
protected  class MainWindow.EditWindow.FieldChangeUndo
          16 juil. 2003
protected  class MainWindow.EditWindow.MovingNode
          10 août 2003
protected  class MainWindow.EditWindow.NodeMoover
          2 août 2003
protected  class MainWindow.EditWindow.TreeEditor
          15 juil. 2003
 
Field Summary
protected  Stack redoStack
           
protected  Stack undoStack
           
 
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
MainWindow.EditWindow(MainWindow _owner)
           
MainWindow.EditWindow(MainWindow _owner, boolean isDoubleBuffered)
           
MainWindow.EditWindow(MainWindow _owner, File _dialogFile)
           
MainWindow.EditWindow(MainWindow _owner, LayoutManager layout)
           
MainWindow.EditWindow(MainWindow _owner, LayoutManager layout, boolean isDoubleBuffered)
           
 
Method Summary
 void actionPerformed(ActionEvent e)
           
protected  void addNode()
          Adds a node to the selected node.
 void changedUpdate(DocumentEvent e)
           
protected  boolean close()
          Ferfomes some cleaning operations.
 void copy()
           
 void cut()
           
protected  void deleteNode()
          Delete the selected node
 void dragDropEnd(DragSourceDropEvent dsde)
           
 void dragEnter(DragSourceDragEvent dsde)
           
 void dragEnter(DropTargetDragEvent dtde)
           
 void dragExit(DragSourceEvent dse)
           
 void dragExit(DropTargetEvent dte)
           
 void dragGestureRecognized(DragGestureEvent dge)
           
 void dragOver(DragSourceDragEvent dsde)
           
 void dragOver(DropTargetDragEvent dtde)
           
 void drop(DropTargetDropEvent dtde)
           
 void dropActionChanged(DragSourceDragEvent dsde)
           
 void dropActionChanged(DropTargetDragEvent dtde)
           
 void focusGained(FocusEvent e)
           
 void focusLost(FocusEvent e)
           
protected  Object[] generateAnimationComboList()
           
 int getCurrentGender()
           
 long getCurrentLanguageId()
           
protected  String[] getGenderNames()
           
protected  String[] getLanguageNames()
           
protected  void init()
          Initializes the edit zone.
 void insertUpdate(DocumentEvent e)
           
 boolean isModified()
          Returns the modification state of that dialog.
 void itemStateChanged(ItemEvent e)
           
 void link()
           
protected  void loadDialog()
          Loads the dialog from the current dialog file.
protected  void modifyRedo(MainWindow.UndoRedo operation)
          Adds an operation to the redo stack.
protected  void modifyUndo(MainWindow.UndoRedo operation)
          Adds an operation to the undo stack.
 void paste()
           
 void redo()
          Restores the last canceled operation.
 void removeUpdate(DocumentEvent e)
           
protected  void save()
          Saves the dialog file to the GFF format.
protected  void save(File fileName)
          Saves the dialog file to the GFF format.
 void setEnabled(boolean enabled)
           
protected  void setModified(boolean b)
          Sets the modification state of the dialog
 void undo()
          Cancels the last operation.
 void update(Observable o, Object arg)
           
protected  void updateText(DocumentEvent e)
          Handles the text events.
 void valueChanged(TreeSelectionEvent e)
           
 void windowActivated(WindowEvent e)
           
 void windowClosed(WindowEvent e)
           
 void windowClosing(WindowEvent e)
           
 void windowDeactivated(WindowEvent e)
           
 void windowDeiconified(WindowEvent e)
           
 void windowIconified(WindowEvent e)
           
 void windowOpened(WindowEvent e)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, 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

redoStack

protected Stack redoStack

undoStack

protected Stack undoStack
Constructor Detail

MainWindow.EditWindow

public MainWindow.EditWindow(MainWindow _owner)
                      throws FileNotFoundException,
                             FileDoesNotExist,
                             InvalidFile,
                             NameTooLong,
                             IOException,
                             InvalidType

MainWindow.EditWindow

public MainWindow.EditWindow(MainWindow _owner,
                             boolean isDoubleBuffered)
                      throws FileNotFoundException,
                             FileDoesNotExist,
                             InvalidFile,
                             NameTooLong,
                             IOException,
                             InvalidType
Parameters:
isDoubleBuffered -

MainWindow.EditWindow

public MainWindow.EditWindow(MainWindow _owner,
                             File _dialogFile)
                      throws FileNotFoundException,
                             FileDoesNotExist,
                             InvalidFile,
                             NameTooLong,
                             IOException,
                             InvalidType

MainWindow.EditWindow

public MainWindow.EditWindow(MainWindow _owner,
                             LayoutManager layout)
                      throws FileNotFoundException,
                             FileDoesNotExist,
                             InvalidFile,
                             NameTooLong,
                             IOException,
                             InvalidType
Parameters:
layout -

MainWindow.EditWindow

public MainWindow.EditWindow(MainWindow _owner,
                             LayoutManager layout,
                             boolean isDoubleBuffered)
                      throws FileNotFoundException,
                             FileDoesNotExist,
                             InvalidFile,
                             NameTooLong,
                             IOException,
                             InvalidType
Parameters:
layout -
isDoubleBuffered -
Method Detail

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener

addNode

protected void addNode()
Adds a node to the selected node.


changedUpdate

public void changedUpdate(DocumentEvent e)
Specified by:
changedUpdate in interface DocumentListener

close

protected boolean close()
Ferfomes some cleaning operations.

Returns:
Returns true if the edition tab can be closed.

copy

public void copy()

cut

public void cut()

deleteNode

protected void deleteNode()
Delete the selected node


dragDropEnd

public void dragDropEnd(DragSourceDropEvent dsde)
Specified by:
dragDropEnd in interface DragSourceListener

dragEnter

public void dragEnter(DragSourceDragEvent dsde)
Specified by:
dragEnter in interface DragSourceListener

dragEnter

public void dragEnter(DropTargetDragEvent dtde)
Specified by:
dragEnter in interface DropTargetListener

dragExit

public void dragExit(DragSourceEvent dse)
Specified by:
dragExit in interface DragSourceListener

dragExit

public void dragExit(DropTargetEvent dte)
Specified by:
dragExit in interface DropTargetListener

dragGestureRecognized

public void dragGestureRecognized(DragGestureEvent dge)
Specified by:
dragGestureRecognized in interface DragGestureListener

dragOver

public void dragOver(DragSourceDragEvent dsde)
Specified by:
dragOver in interface DragSourceListener

dragOver

public void dragOver(DropTargetDragEvent dtde)
Specified by:
dragOver in interface DropTargetListener

drop

public void drop(DropTargetDropEvent dtde)
Specified by:
drop in interface DropTargetListener

dropActionChanged

public void dropActionChanged(DragSourceDragEvent dsde)
Specified by:
dropActionChanged in interface DragSourceListener

dropActionChanged

public void dropActionChanged(DropTargetDragEvent dtde)
Specified by:
dropActionChanged in interface DropTargetListener

focusGained

public void focusGained(FocusEvent e)
Specified by:
focusGained in interface FocusListener

focusLost

public void focusLost(FocusEvent e)
Specified by:
focusLost in interface FocusListener

generateAnimationComboList

protected Object[] generateAnimationComboList()
Returns:
Returns an array containing the animation names

getCurrentGender

public int getCurrentGender()

getCurrentLanguageId

public long getCurrentLanguageId()
Returns:
The currently used languaged id.

getGenderNames

protected String[] getGenderNames()
Returns:
Returns a String array containing the gender names.

getLanguageNames

protected String[] getLanguageNames()
Returns:
Returns a list of languages supported by NWN.

init

protected void init()
             throws FileNotFoundException,
                    FileDoesNotExist,
                    InvalidFile,
                    NameTooLong,
                    IOException,
                    InvalidType
Initializes the edit zone.

Throws:
FileNotFoundException
FileDoesNotExist
InvalidFile
NameTooLong
IOException
InvalidType

insertUpdate

public void insertUpdate(DocumentEvent e)
Specified by:
insertUpdate in interface DocumentListener

isModified

public boolean isModified()
Returns the modification state of that dialog.

Returns:
true if the dialog has been modified

itemStateChanged

public void itemStateChanged(ItemEvent e)
Specified by:
itemStateChanged in interface ItemListener

link

public void link()

loadDialog

protected void loadDialog()
Loads the dialog from the current dialog file.


modifyRedo

protected void modifyRedo(MainWindow.UndoRedo operation)
Adds an operation to the redo stack.

Parameters:
operation - Operation to be added to the redo stack.

modifyUndo

protected void modifyUndo(MainWindow.UndoRedo operation)
Adds an operation to the undo stack.

Parameters:
operation - Operation to be added to the undo stack

paste

public void paste()

redo

public void redo()
Restores the last canceled operation.


removeUpdate

public void removeUpdate(DocumentEvent e)
Specified by:
removeUpdate in interface DocumentListener

save

protected void save()
Saves the dialog file to the GFF format.


save

protected void save(File fileName)
Saves the dialog file to the GFF format.

Parameters:
fileName - New file name.

setEnabled

public void setEnabled(boolean enabled)
Overrides:
setEnabled in class JComponent

setModified

protected void setModified(boolean b)
Sets the modification state of the dialog

Parameters:
b - new state.

undo

public void undo()
Cancels the last operation.


update

public void update(Observable o,
                   Object arg)
Specified by:
update in interface Observer

updateText

protected void updateText(DocumentEvent e)
Handles the text events.

Parameters:
e - Event fired by the text component

valueChanged

public void valueChanged(TreeSelectionEvent e)
Specified by:
valueChanged in interface TreeSelectionListener

windowActivated

public void windowActivated(WindowEvent e)
Specified by:
windowActivated in interface WindowListener

windowClosed

public void windowClosed(WindowEvent e)
Specified by:
windowClosed in interface WindowListener

windowClosing

public void windowClosing(WindowEvent e)
Specified by:
windowClosing in interface WindowListener

windowDeactivated

public void windowDeactivated(WindowEvent e)
Specified by:
windowDeactivated in interface WindowListener

windowDeiconified

public void windowDeiconified(WindowEvent e)
Specified by:
windowDeiconified in interface WindowListener

windowIconified

public void windowIconified(WindowEvent e)
Specified by:
windowIconified in interface WindowListener

windowOpened

public void windowOpened(WindowEvent e)
Specified by:
windowOpened in interface WindowListener