JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.aspects.gui.swing
Class SHEditor

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--org.objectweb.jac.aspects.gui.swing.SHEditor
All Implemented Interfaces:
Accessible, ClipboardOwner, EventListener, FocusListener, ImageObserver, KeyListener, MenuContainer, MouseListener, MouseMotionListener, Scrollable, Serializable

public class SHEditor
extends JPanel
implements KeyListener, MouseListener, MouseMotionListener, Scrollable, ClipboardOwner, FocusListener

Version:
1.0 The CodeEditor is constructed to display java code with syntax coloring. It was created to be used in the SimpleJavaEditor but it can easily be adjusted so it can be used with any SWING application that needs to display syntax colored java code. Please use it in any leagal way you whant, but if you find it usefull tell me aboute it, along with any wishes you migt have for changes and I'll see what I can do.
Author:
Lars-Erik H. Bergland www.mycgiserver.com/~hbergla //vagastorm@microsnyft.com
See Also:
Serialized Form

Field Summary
protected  SHEditorConfig conf
           
protected  boolean isSelectionCompletion
          Whether the selection is some text added by the completion engine
 
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
SHEditor()
          Constructs a empty SHEditor.
SHEditor(File file)
          Constructs a SHEditor and reads the content of a file into it.
SHEditor(String txt)
          Constructs a SHEditor where the content is set by a string.
 
Method Summary
 void addCaretListener(CaretListener listener)
          Adds a caret listener for notification of any changes to the caret.
 void addKeywords(Set addedKeywords)
          Define some new keywords
 void addKeywords(String[] addedKeywords)
          Define some new keywords
 void addModifiers(String[] addedModifiers)
          Define some new keywords
 void addTextListener(TextListener listener)
          Adds a text listener for notification of any changes to the text.
 void addTypes(String[] addedTypes)
           
 void backwardChar(int n, boolean select)
          Moves backward n characters
 void backwardWord(int n, boolean select)
          Moves backward n words
 void beginningOfLine(boolean select)
          Moves the caret to the beginning of the current line.
 void beginningOfText(boolean select)
          Moves the caret to the beginning of the text.
 void clearKeywords()
           
 void copy()
          Preformes a copy action on the JJAvaPane.
 int countChar(char c, int offs, int length)
          Returns the number of a char in a the text between to positions.
 void cut()
          Preformes a cut action on the SHEditor.
 void endOfLine(boolean select)
          Moves the caret to the end of the current line.
 void endOfText(boolean select)
          Moves the caret to the end of the text.
protected  void fireCaretUpdate()
           
protected  void fireTextUpdate()
           
 void focusGained(FocusEvent e)
          The SHEditor has gained focus.
 void focusLost(FocusEvent e)
          The SHEditor has lost focus.
 void forwardChar(int n, boolean select)
          Moves forward n characters
 void forwardWord(int n, boolean select)
          Moves forward n words
 Rectangle getCaretPos(int position)
          Returns a rectangle representation of the caret at a given position.
 int getCaretPosition()
          Returns the caretPosition.
 int getCharPos(int mousePosX, int mousePosY)
          Returns position in the text based on coordinates x and y.
 CompletionEngine getCompletionEngine()
           
 SHEditorConfig getConfig()
           
protected  int getMarginLeft()
           
protected  int getPixelTextWidth(String text)
          Returns the pixel width of a string
 Dimension getPreferredScrollableViewportSize()
          Copied from JTextComponent.
 int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
           
 boolean getScrollableTracksViewportHeight()
           
 boolean getScrollableTracksViewportWidth()
           
 int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
           
 int getSelectionEnd()
          Returns selection end position.
 int getSelectionStart()
          Returns selection start position
 String getText()
          Returns the a String containing the java file.
 void gotoLine(int lineNumber)
          Sets the caret at the beginning of a line
 void insertCloseCBracket()
          Inserts a closing curly bracket and takes indentation into account.
 void insertReturn()
          Inserts a closing curly bracket and takes indentation into account.
 void insertString(int pos, String str)
          Inserts a String s into the text at pos.
 boolean isDivider(char c)
          Tests if a character is a divider.
protected  boolean isKeyword(String word)
          Tells wether a word is keyword or not
 boolean isModifier(String word)
          Tells wether a word is a modifier or not
 boolean isType(String word)
          Tells wether a word is a type or not
 void keyPressed(KeyEvent e)
          Key Pressed
 void keyReleased(KeyEvent e)
          Key Released
 void keyTyped(KeyEvent e)
          Key Typed
 void lostOwnership(Clipboard cb, Transferable tr)
          Fiered if the SHEditor loses ownership of a Clipboard
 void mouseClicked(MouseEvent e)
          MouseClicked.
 void mouseDragged(MouseEvent e)
          MouseDragged.
 void mouseEntered(MouseEvent e)
          MouseEntered.
 void mouseExited(MouseEvent e)
          MouseExited.
 void mouseMoved(MouseEvent e)
          MouseMoved.
 void mousePressed(MouseEvent e)
          Mouse has been pressed.
 void mouseReleased(MouseEvent e)
          MouseReleased.
 void nextLine(int n, boolean select)
          Move to the next line
 void paintComponent(Graphics g)
          Paints the SHEditor.
 void paste()
          Preformes a paste action on the SHEditor.
 void positionVisible()
          Makes sure the caret is visible on screen.
 void positionVisible(int position)
          Makes sure a position is visible
 void previousLine(int n, boolean select)
          Move to the previous line
 void readFromFile(File f)
          Reads a file into SHEditor.
 void redo()
          Tels the SHEditor to redo the last undone action.
 void remove(int offs, int length)
          Removes the content of the text from offs to offs + length.
 void removeCaretListener(CaretListener listener)
          Removes a caret listener.
 void removeTextListener(TextListener listener)
          Removes a text listener.
 void repaint()
           
 void saveToFile(File f)
          Saves the file in SHEditor to a file.
 void scrollToLine(int line)
          Sets a line as marked, and scrols to that line if needed.
 void selectionVisible()
          Makes sure the selection is visible on screen.
 void setCaretPosition(int caretPosition)
           
 void setCompletionEngine(CompletionEngine ce)
           
 void setConfig(SHEditorConfig conf)
           
 void setFont(Font font)
          Sets the font of the SHEditor and repaqints it.
 void setSelection(int start, int end)
          Sets the selection
 void setSelectionEnd(int position)
          Sets the end of the selection.
 void setSelectionStart(int position)
          Sets the start of the selection.
 void setText(String t)
           
 void setWordSeparators(char[] separators)
          Sets the characters considered as word separators
 void testClosing(char opening, char closing)
           
 void testOpening(char opening, char closing)
           
 void testOposing()
          Tests oposing (), [] and {}, and makes sure they are marked if the caret is behind one of them.
 void toolDone()
           
 void undo()
          Tels the SHEditor to undo the last action.
 void unmarkOposing()
          Unmarks oposing (), {} or [] given by pos1 and pos2.
 void update(Graphics g)
          Updates the JJAvaPane (cals paint(Graphics g));
 
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, 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, setEnabled, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction
 
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, 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

isSelectionCompletion

protected boolean isSelectionCompletion
Whether the selection is some text added by the completion engine


conf

protected SHEditorConfig conf
Constructor Detail

SHEditor

public SHEditor()
Constructs a empty SHEditor.


SHEditor

public SHEditor(String txt)
Constructs a SHEditor where the content is set by a string.

Parameters:
txt - A String representing initial java file.

SHEditor

public SHEditor(File file)
Constructs a SHEditor and reads the content of a file into it.

Parameters:
file - The initial java file.
Method Detail

getConfig

public SHEditorConfig getConfig()

setConfig

public void setConfig(SHEditorConfig conf)

setWordSeparators

public void setWordSeparators(char[] separators)
Sets the characters considered as word separators


addCaretListener

public void addCaretListener(CaretListener listener)
Adds a caret listener for notification of any changes to the caret.

Parameters:
listener - the listener to be added
See Also:
CaretEvent

removeCaretListener

public void removeCaretListener(CaretListener listener)
Removes a caret listener.

Parameters:
listener - the listener to be removed
See Also:
CaretEvent

addTextListener

public void addTextListener(TextListener listener)
Adds a text listener for notification of any changes to the text.

Parameters:
listener - the listener to be added
See Also:
CaretEvent

removeTextListener

public void removeTextListener(TextListener listener)
Removes a text listener.

Parameters:
listener - the listener to be removed
See Also:
CaretEvent

fireTextUpdate

protected void fireTextUpdate()

getText

public String getText()
Returns the a String containing the java file.

Returns:
A string containing the content of the current java file.

setText

public void setText(String t)

setSelectionStart

public void setSelectionStart(int position)
Sets the start of the selection. It ensures that selectionStart
Parameters:
position - new start of selection

setSelectionEnd

public void setSelectionEnd(int position)
Sets the end of the selection. It ensures that selectionStart
Parameters:
position - new end of selection

setSelection

public void setSelection(int start,
                         int end)
Sets the selection

Parameters:
start - position where selection starts
end - position where selection ends

forwardChar

public void forwardChar(int n,
                        boolean select)
Moves forward n characters

Parameters:
n - number of characters to move forward
select - wether to add the text moved over by the caret to the selection

backwardChar

public void backwardChar(int n,
                         boolean select)
Moves backward n characters

Parameters:
n - number of characters to move backward
select - wether to add the text moved over by the caret to the selection

forwardWord

public void forwardWord(int n,
                        boolean select)
Moves forward n words

Parameters:
n - number of words to move forward
select - wether to add the text moved over by the caret to the selection

backwardWord

public void backwardWord(int n,
                         boolean select)
Moves backward n words

Parameters:
n - number of words to move backward
select - wether to add the text moved over by the caret to the selection

nextLine

public void nextLine(int n,
                     boolean select)
Move to the next line

Parameters:
n - move to previous line n times
select - wether to add the text moved over by the caret to the selection

previousLine

public void previousLine(int n,
                         boolean select)
Move to the previous line

Parameters:
n - move to previous line n times
select - wether to add the text moved over by the caret to the selection

beginningOfText

public void beginningOfText(boolean select)
Moves the caret to the beginning of the text.

Parameters:
select - wether to add the text moved over by the caret to the selection

endOfText

public void endOfText(boolean select)
Moves the caret to the end of the text.

Parameters:
select - wether to add the text moved over by the caret to the selection

beginningOfLine

public void beginningOfLine(boolean select)
Moves the caret to the beginning of the current line.

Parameters:
select - wether to add the text moved over by the caret to the selection

endOfLine

public void endOfLine(boolean select)
Moves the caret to the end of the current line.

Parameters:
select - wether to add the text moved over by the caret to the selection

gotoLine

public void gotoLine(int lineNumber)
Sets the caret at the beginning of a line

Parameters:
lineNumber - number of the line (starts with 1)

setCompletionEngine

public void setCompletionEngine(CompletionEngine ce)

getCompletionEngine

public CompletionEngine getCompletionEngine()

toolDone

public void toolDone()

keyPressed

public void keyPressed(KeyEvent e)
Key Pressed

Specified by:
keyPressed in interface KeyListener

keyTyped

public void keyTyped(KeyEvent e)
Key Typed

Specified by:
keyTyped in interface KeyListener

insertCloseCBracket

public void insertCloseCBracket()
Inserts a closing curly bracket and takes indentation into account.


insertReturn

public void insertReturn()
Inserts a closing curly bracket and takes indentation into account.


keyReleased

public void keyReleased(KeyEvent e)
Key Released

Specified by:
keyReleased in interface KeyListener

insertString

public void insertString(int pos,
                         String str)
Inserts a String s into the text at pos.

Parameters:
pos - The position where you whant to insert a String.
str - The String you whant to insert into the text.

remove

public void remove(int offs,
                   int length)
Removes the content of the text from offs to offs + length.

Parameters:
offs - Where to start removing text.

undo

public void undo()
Tels the SHEditor to undo the last action.


redo

public void redo()
Tels the SHEditor to redo the last undone action.


cut

public void cut()
Preformes a cut action on the SHEditor.


copy

public void copy()
Preformes a copy action on the JJAvaPane.


paste

public void paste()
Preformes a paste action on the SHEditor.


countChar

public int countChar(char c,
                     int offs,
                     int length)
Returns the number of a char in a the text between to positions.

Parameters:
c - the char to count.

repaint

public void repaint()
Overrides:
repaint in class Component

paintComponent

public void paintComponent(Graphics g)
Paints the SHEditor.

Overrides:
paintComponent in class JComponent
Parameters:
g - the graphics to draw the SHEditor on.

getPixelTextWidth

protected int getPixelTextWidth(String text)
Returns the pixel width of a string

Parameters:
text - the string to get the width of
Returns:
the width in number of pixels the text will have when drawn.

update

public void update(Graphics g)
Updates the JJAvaPane (cals paint(Graphics g));

Overrides:
update in class JComponent

scrollToLine

public void scrollToLine(int line)
Sets a line as marked, and scrols to that line if needed.


testOposing

public void testOposing()
Tests oposing (), [] and {}, and makes sure they are marked if the caret is behind one of them.


testClosing

public void testClosing(char opening,
                        char closing)

testOpening

public void testOpening(char opening,
                        char closing)

unmarkOposing

public void unmarkOposing()
Unmarks oposing (), {} or [] given by pos1 and pos2.


positionVisible

public void positionVisible()
Makes sure the caret is visible on screen.


selectionVisible

public void selectionVisible()
Makes sure the selection is visible on screen.


positionVisible

public void positionVisible(int position)
Makes sure a position is visible

Parameters:
position - the position that must be visible

getCaretPos

public Rectangle getCaretPos(int position)
Returns a rectangle representation of the caret at a given position.

Parameters:
position - position of the caret
Returns:
a Rectangle representation of the caret.

setFont

public void setFont(Font font)
Sets the font of the SHEditor and repaqints it.

Overrides:
setFont in class JComponent
Parameters:
font - the new font.

getMarginLeft

protected int getMarginLeft()

getCharPos

public int getCharPos(int mousePosX,
                      int mousePosY)
Returns position in the text based on coordinates x and y.

Parameters:
mousePosX - the x coordinate of the position in the text.
mousePosY - the y coordinate of the position in the text.
Returns:
the position in the text represented by pint x, y.

isDivider

public boolean isDivider(char c)
Tests if a character is a divider.

Parameters:
c - the char to test.
Returns:
true if the char is a divider, meaning it might divide two java words, returns false othervise.

addKeywords

public void addKeywords(String[] addedKeywords)
Define some new keywords

Parameters:
addedKeywords - the new keywords

addKeywords

public void addKeywords(Set addedKeywords)
Define some new keywords

Parameters:
addedKeywords - the new keywords

clearKeywords

public void clearKeywords()

isKeyword

protected boolean isKeyword(String word)
Tells wether a word is keyword or not


addModifiers

public void addModifiers(String[] addedModifiers)
Define some new keywords


isModifier

public boolean isModifier(String word)
Tells wether a word is a modifier or not


addTypes

public void addTypes(String[] addedTypes)

isType

public boolean isType(String word)
Tells wether a word is a type or not


fireCaretUpdate

protected void fireCaretUpdate()

setCaretPosition

public void setCaretPosition(int caretPosition)

getCaretPosition

public int getCaretPosition()
Returns the caretPosition.

Returns:
the position of the caret in the text.

getSelectionStart

public int getSelectionStart()
Returns selection start position

Returns:
the position of the selectionStart in the text.

getSelectionEnd

public int getSelectionEnd()
Returns selection end position.

Returns:
the position of the selectionEnd in the text.

mousePressed

public void mousePressed(MouseEvent e)
Mouse has been pressed.

Specified by:
mousePressed in interface MouseListener

mouseMoved

public void mouseMoved(MouseEvent e)
MouseMoved.

Specified by:
mouseMoved in interface MouseMotionListener

mouseDragged

public void mouseDragged(MouseEvent e)
MouseDragged.

Specified by:
mouseDragged in interface MouseMotionListener

mouseReleased

public void mouseReleased(MouseEvent e)
MouseReleased.

Specified by:
mouseReleased in interface MouseListener

mouseClicked

public void mouseClicked(MouseEvent e)
MouseClicked.

Specified by:
mouseClicked in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
MouseEntered.

Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
MouseExited.

Specified by:
mouseExited in interface MouseListener

getPreferredScrollableViewportSize

public Dimension getPreferredScrollableViewportSize()
Copied from JTextComponent.

Specified by:
getPreferredScrollableViewportSize in interface Scrollable

getScrollableUnitIncrement

public int getScrollableUnitIncrement(Rectangle visibleRect,
                                      int orientation,
                                      int direction)
Specified by:
getScrollableUnitIncrement in interface Scrollable

getScrollableBlockIncrement

public int getScrollableBlockIncrement(Rectangle visibleRect,
                                       int orientation,
                                       int direction)
Specified by:
getScrollableBlockIncrement in interface Scrollable

getScrollableTracksViewportWidth

public boolean getScrollableTracksViewportWidth()
Specified by:
getScrollableTracksViewportWidth in interface Scrollable

getScrollableTracksViewportHeight

public boolean getScrollableTracksViewportHeight()
Specified by:
getScrollableTracksViewportHeight in interface Scrollable

lostOwnership

public void lostOwnership(Clipboard cb,
                          Transferable tr)
Fiered if the SHEditor loses ownership of a Clipboard

Specified by:
lostOwnership in interface ClipboardOwner

focusLost

public void focusLost(FocusEvent e)
The SHEditor has lost focus.

Specified by:
focusLost in interface FocusListener

focusGained

public void focusGained(FocusEvent e)
The SHEditor has gained focus.

Specified by:
focusGained in interface FocusListener

readFromFile

public void readFromFile(File f)
Reads a file into SHEditor.

Parameters:
f - the file to read into the SHEditor.

saveToFile

public void saveToFile(File f)
Saves the file in SHEditor to a file.

Parameters:
f - the file where the content of the SHEditor should be saved.

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli