org.objectweb.jac.ide.diagrams
Class IDEDrawingView

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--org.objectweb.jac.ide.diagrams.IDEDrawingView
All Implemented Interfaces:
Accessible, Autoscroll, CH.ifa.draw.framework.DrawingChangeListener, CH.ifa.draw.framework.DrawingView, EventListener, ImageObserver, KeyListener, MenuContainer, Scrollable, Serializable

public class IDEDrawingView
extends JPanel
implements CH.ifa.draw.framework.DrawingView, KeyListener, Autoscroll, Scrollable

Same as CH.ifa.draw.standard.StandardDrawingView, but with specific handling of "remove".

See Also:
Serialized Form

Field Summary
static int MINIMUM_HEIGHT
           
static int MINIMUM_WIDTH
          Scrolling increment
static int SCROLL_INCR
           
static int SCROLL_OFFSET
           
 
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
IDEDrawingView(CH.ifa.draw.framework.DrawingEditor editor)
          Constructs the view.
IDEDrawingView(CH.ifa.draw.framework.DrawingEditor editor, int width, int height)
           
 
Method Summary
 CH.ifa.draw.framework.Figure add(CH.ifa.draw.framework.Figure figure)
          Adds a figure to the drawing.
 void addAll(Vector figures)
          Adds a vector of figures to the drawing.
 void addBackground(CH.ifa.draw.framework.Painter painter)
          Adds a background.
 void addFigureSelectionListener(CH.ifa.draw.framework.FigureSelectionListener fsl)
          Add a listener for selection changes.
 void addForeground(CH.ifa.draw.framework.Painter painter)
          Adds a foreground.
 void addToSelection(CH.ifa.draw.framework.Figure figure)
          Adds a figure to the current selection.
 void addToSelectionAll(CH.ifa.draw.framework.FigureEnumeration fe)
          Adds a FigureEnumeration to the current selection.
 void addToSelectionAll(Vector figures)
          Adds a vector of figures to the current selection.
 void autoscroll(Point p)
           
 void checkDamage()
          Refreshes the drawing if there is some accumulated damage
 void clearSelection()
          Clears the current selection.
protected  Point constrainPoint(Point p)
          Constrains a point to the current grid.
 void draw(Graphics g, CH.ifa.draw.framework.FigureEnumeration fe)
          Draws the given figures.
 void drawAll(Graphics g)
          Draws the contents of the drawing view.
 void drawBackground(Graphics g)
          Draws the background.
 void drawDrawing(Graphics g)
          Draws the drawing.
 void drawHandles(Graphics g)
          Draws the currently active handles.
 CH.ifa.draw.framework.Drawing drawing()
          Gets the drawing.
 void drawingInvalidated(CH.ifa.draw.framework.DrawingChangeEvent e)
           
 void drawingRequestUpdate(CH.ifa.draw.framework.DrawingChangeEvent e)
           
 CH.ifa.draw.framework.DrawingEditor editor()
          Gets the editor.
 boolean figureExists(CH.ifa.draw.framework.Figure inf, CH.ifa.draw.framework.FigureEnumeration e)
          Check existance of figure in the drawing
 CH.ifa.draw.framework.Handle findHandle(int x, int y)
          Finds a handle at the given coordinates.
protected  void fireSelectionChanged()
          Informs that the current selection changed.
 void freezeView()
          Freezes the view by acquiring the drawing lock.
 Insets getAutoscrollInsets()
           
 Vector getConnectionFigures(CH.ifa.draw.framework.Figure inFigure)
          Returns a vector of connectionfigures attached to this figure
 CH.ifa.draw.framework.PointConstrainer getConstrainer()
          Gets the current constrainer.
 int getDefaultDNDActions()
           
 CH.ifa.draw.framework.Painter getDisplayUpdate()
          Sets the current display update strategy.
 CH.ifa.draw.framework.FigureSelection getFigureSelection()
          Gets the current selection as a FigureSelection.
 Dimension getMinimumSize()
          Gets the minimum dimension of the drawing.
 Dimension getPreferredScrollableViewportSize()
           
 Dimension getPreferredSize()
          Gets the preferred dimension of the drawing..
 int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
           
 boolean getScrollableTracksViewportHeight()
           
 boolean getScrollableTracksViewportWidth()
           
 int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
           
protected  void handleCursorKey(int key)
          Handles cursor keys by moving all the selected figures one grid point in the cursor direction.
 CH.ifa.draw.framework.FigureEnumeration insertFigures(CH.ifa.draw.framework.FigureEnumeration fe, int dx, int dy, boolean bCheck)
          Inserts a vector of figures and translates them by the given offset.
 boolean isFigureSelected(CH.ifa.draw.framework.Figure checkFigure)
          Test whether a given figure is selected.
 boolean isFocusTraversable()
           
 boolean isInteractive()
           
 void keyPressed(KeyEvent e)
          Handles key down events.
 void keyReleased(KeyEvent e)
           
 void keyTyped(KeyEvent e)
           
 Point lastClick()
          Gets the position of the last click inside the view.
protected  void paintComponent(Graphics g)
          Paints the drawing view.
 CH.ifa.draw.framework.Figure remove(CH.ifa.draw.framework.Figure figure)
          Removes a figure from the drawing.
 void removeBackground(CH.ifa.draw.framework.Painter painter)
          Removes a background.
 void removeFigureSelectionListener(CH.ifa.draw.framework.FigureSelectionListener fsl)
          Remove a listener for selection changes.
 void removeForeground(CH.ifa.draw.framework.Painter painter)
          Removes a foreground.
 void removeFromSelection(CH.ifa.draw.framework.Figure figure)
          Removes a figure from the selection.
 void repairDamage()
           
 Vector selection()
          Gets the currently selected figures.
 int selectionCount()
          Gets the number of selected figures.
 CH.ifa.draw.framework.FigureEnumeration selectionElements()
          Gets an enumeration over the currently selected figures.
 Vector selectionZOrdered()
          Gets the currently selected figures in Z order.
 void setConstrainer(CH.ifa.draw.framework.PointConstrainer c)
          Sets the grid spacing that is used to constrain points.
 void setDisplayUpdate(CH.ifa.draw.framework.Painter updateStrategy)
          Sets the current display update strategy.
 void setDrawing(CH.ifa.draw.framework.Drawing d)
          Sets and installs another drawing in the view.
 void setEditor(CH.ifa.draw.framework.DrawingEditor editor)
          Sets the view's editor.
 void toggleSelection(CH.ifa.draw.framework.Figure figure)
          If a figure isn't selected it is added to the selection.
 CH.ifa.draw.framework.Tool tool()
          Gets the current tool.
 String toString()
           
 void unfreezeView()
          Unfreezes the view by releasing the drawing lock.
 
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, getNextFocusableComponent, 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, 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, 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, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface CH.ifa.draw.framework.DrawingView
createImage, getBackground, getGraphics, getSize, paint, setBackground, setCursor
 
Methods inherited from interface java.awt.image.ImageObserver
imageUpdate
 

Field Detail

MINIMUM_WIDTH

public static final int MINIMUM_WIDTH
Scrolling increment

See Also:
Constant Field Values

MINIMUM_HEIGHT

public static final int MINIMUM_HEIGHT
See Also:
Constant Field Values

SCROLL_INCR

public static final int SCROLL_INCR
See Also:
Constant Field Values

SCROLL_OFFSET

public static final int SCROLL_OFFSET
See Also:
Constant Field Values
Constructor Detail

IDEDrawingView

public IDEDrawingView(CH.ifa.draw.framework.DrawingEditor editor)
Constructs the view.


IDEDrawingView

public IDEDrawingView(CH.ifa.draw.framework.DrawingEditor editor,
                      int width,
                      int height)
Method Detail

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

getPreferredScrollableViewportSize

public Dimension getPreferredScrollableViewportSize()
Specified by:
getPreferredScrollableViewportSize in interface Scrollable

setEditor

public void setEditor(CH.ifa.draw.framework.DrawingEditor editor)
Sets the view's editor.

Specified by:
setEditor in interface CH.ifa.draw.framework.DrawingView

tool

public CH.ifa.draw.framework.Tool tool()
Gets the current tool.

Specified by:
tool in interface CH.ifa.draw.framework.DrawingView

drawing

public CH.ifa.draw.framework.Drawing drawing()
Gets the drawing.

Specified by:
drawing in interface CH.ifa.draw.framework.DrawingView

setDrawing

public void setDrawing(CH.ifa.draw.framework.Drawing d)
Sets and installs another drawing in the view.

Specified by:
setDrawing in interface CH.ifa.draw.framework.DrawingView

editor

public CH.ifa.draw.framework.DrawingEditor editor()
Gets the editor.

Specified by:
editor in interface CH.ifa.draw.framework.DrawingView

add

public CH.ifa.draw.framework.Figure add(CH.ifa.draw.framework.Figure figure)
Adds a figure to the drawing.

Specified by:
add in interface CH.ifa.draw.framework.DrawingView
Returns:
the added figure.

remove

public CH.ifa.draw.framework.Figure remove(CH.ifa.draw.framework.Figure figure)
Removes a figure from the drawing.

Specified by:
remove in interface CH.ifa.draw.framework.DrawingView
Returns:
the removed figure

addAll

public void addAll(Vector figures)
Adds a vector of figures to the drawing.

Specified by:
addAll in interface CH.ifa.draw.framework.DrawingView

figureExists

public boolean figureExists(CH.ifa.draw.framework.Figure inf,
                            CH.ifa.draw.framework.FigureEnumeration e)
Check existance of figure in the drawing


insertFigures

public CH.ifa.draw.framework.FigureEnumeration insertFigures(CH.ifa.draw.framework.FigureEnumeration fe,
                                                             int dx,
                                                             int dy,
                                                             boolean bCheck)
Inserts a vector of figures and translates them by the given offset. This function is used to insert figures from clipboards (cut/copy)

Specified by:
insertFigures in interface CH.ifa.draw.framework.DrawingView
Returns:
enumeration which has been added to the drawing. The figures in the enumeration can have changed during adding them (e.g. they could have been decorated).

getConnectionFigures

public Vector getConnectionFigures(CH.ifa.draw.framework.Figure inFigure)
Returns a vector of connectionfigures attached to this figure

Specified by:
getConnectionFigures in interface CH.ifa.draw.framework.DrawingView

getMinimumSize

public Dimension getMinimumSize()
Gets the minimum dimension of the drawing.

Specified by:
getMinimumSize in interface CH.ifa.draw.framework.DrawingView
Overrides:
getMinimumSize in class JComponent

getPreferredSize

public Dimension getPreferredSize()
Gets the preferred dimension of the drawing..

Specified by:
getPreferredSize in interface CH.ifa.draw.framework.DrawingView
Overrides:
getPreferredSize in class JComponent

setDisplayUpdate

public void setDisplayUpdate(CH.ifa.draw.framework.Painter updateStrategy)
Sets the current display update strategy.

Specified by:
setDisplayUpdate in interface CH.ifa.draw.framework.DrawingView
See Also:
Painter

getDisplayUpdate

public CH.ifa.draw.framework.Painter getDisplayUpdate()
Sets the current display update strategy.

Specified by:
getDisplayUpdate in interface CH.ifa.draw.framework.DrawingView
See Also:
Painter

selection

public Vector selection()
Gets the currently selected figures.

Specified by:
selection in interface CH.ifa.draw.framework.DrawingView
Returns:
a vector with the selected figures. The vector is a copy of the current selection.

selectionElements

public CH.ifa.draw.framework.FigureEnumeration selectionElements()
Gets an enumeration over the currently selected figures.

Specified by:
selectionElements in interface CH.ifa.draw.framework.DrawingView

selectionZOrdered

public Vector selectionZOrdered()
Gets the currently selected figures in Z order.

Specified by:
selectionZOrdered in interface CH.ifa.draw.framework.DrawingView
Returns:
a vector with the selected figures. The vector is a copy of the current selection.
See Also:
selection()

selectionCount

public int selectionCount()
Gets the number of selected figures.

Specified by:
selectionCount in interface CH.ifa.draw.framework.DrawingView

isFigureSelected

public boolean isFigureSelected(CH.ifa.draw.framework.Figure checkFigure)
Test whether a given figure is selected.

Specified by:
isFigureSelected in interface CH.ifa.draw.framework.DrawingView

addToSelection

public void addToSelection(CH.ifa.draw.framework.Figure figure)
Adds a figure to the current selection. The figure is only selected if it is also contained in the Drawing associated with this DrawingView.

Specified by:
addToSelection in interface CH.ifa.draw.framework.DrawingView

addToSelectionAll

public void addToSelectionAll(Vector figures)
Adds a vector of figures to the current selection.

Specified by:
addToSelectionAll in interface CH.ifa.draw.framework.DrawingView

addToSelectionAll

public void addToSelectionAll(CH.ifa.draw.framework.FigureEnumeration fe)
Adds a FigureEnumeration to the current selection.

Specified by:
addToSelectionAll in interface CH.ifa.draw.framework.DrawingView

removeFromSelection

public void removeFromSelection(CH.ifa.draw.framework.Figure figure)
Removes a figure from the selection.

Specified by:
removeFromSelection in interface CH.ifa.draw.framework.DrawingView

toggleSelection

public void toggleSelection(CH.ifa.draw.framework.Figure figure)
If a figure isn't selected it is added to the selection. Otherwise it is removed from the selection.

Specified by:
toggleSelection in interface CH.ifa.draw.framework.DrawingView

clearSelection

public void clearSelection()
Clears the current selection.

Specified by:
clearSelection in interface CH.ifa.draw.framework.DrawingView

getFigureSelection

public CH.ifa.draw.framework.FigureSelection getFigureSelection()
Gets the current selection as a FigureSelection. A FigureSelection can be cut, copied, pasted.

Specified by:
getFigureSelection in interface CH.ifa.draw.framework.DrawingView

findHandle

public CH.ifa.draw.framework.Handle findHandle(int x,
                                               int y)
Finds a handle at the given coordinates.

Specified by:
findHandle in interface CH.ifa.draw.framework.DrawingView
Returns:
the hit handle, null if no handle is found.

fireSelectionChanged

protected void fireSelectionChanged()
Informs that the current selection changed. By default this event is forwarded to the drawing editor.


lastClick

public Point lastClick()
Gets the position of the last click inside the view.

Specified by:
lastClick in interface CH.ifa.draw.framework.DrawingView

setConstrainer

public void setConstrainer(CH.ifa.draw.framework.PointConstrainer c)
Sets the grid spacing that is used to constrain points.

Specified by:
setConstrainer in interface CH.ifa.draw.framework.DrawingView

getConstrainer

public CH.ifa.draw.framework.PointConstrainer getConstrainer()
Gets the current constrainer.

Specified by:
getConstrainer in interface CH.ifa.draw.framework.DrawingView

constrainPoint

protected Point constrainPoint(Point p)
Constrains a point to the current grid.


keyPressed

public void keyPressed(KeyEvent e)
Handles key down events. Cursor keys are handled by the view the other key events are delegated to the currently active tool.

Specified by:
keyPressed in interface KeyListener
Returns:
whether the event was handled.

handleCursorKey

protected void handleCursorKey(int key)
Handles cursor keys by moving all the selected figures one grid point in the cursor direction.


checkDamage

public void checkDamage()
Refreshes the drawing if there is some accumulated damage

Specified by:
checkDamage in interface CH.ifa.draw.framework.DrawingView

repairDamage

public void repairDamage()
Specified by:
repairDamage in interface CH.ifa.draw.framework.DrawingView

drawingInvalidated

public void drawingInvalidated(CH.ifa.draw.framework.DrawingChangeEvent e)
Specified by:
drawingInvalidated in interface CH.ifa.draw.framework.DrawingChangeListener

drawingRequestUpdate

public void drawingRequestUpdate(CH.ifa.draw.framework.DrawingChangeEvent e)
Specified by:
drawingRequestUpdate in interface CH.ifa.draw.framework.DrawingChangeListener

paintComponent

protected void paintComponent(Graphics g)
Paints the drawing view. The actual drawing is delegated to the current update strategy.

Overrides:
paintComponent in class JComponent
See Also:
Painter

drawAll

public void drawAll(Graphics g)
Draws the contents of the drawing view. The view has three layers: background, drawing, handles. The layers are drawn in back to front order.

Specified by:
drawAll in interface CH.ifa.draw.framework.DrawingView

draw

public void draw(Graphics g,
                 CH.ifa.draw.framework.FigureEnumeration fe)
Draws the given figures. The view has three layers: background, drawing, handles. The layers are drawn in back to front order. No background is drawn.

Specified by:
draw in interface CH.ifa.draw.framework.DrawingView

drawHandles

public void drawHandles(Graphics g)
Draws the currently active handles.

Specified by:
drawHandles in interface CH.ifa.draw.framework.DrawingView

drawDrawing

public void drawDrawing(Graphics g)
Draws the drawing.

Specified by:
drawDrawing in interface CH.ifa.draw.framework.DrawingView

drawBackground

public void drawBackground(Graphics g)
Draws the background. If a background pattern is set it is used to fill the background. Otherwise the background is filled in the background color.

Specified by:
drawBackground in interface CH.ifa.draw.framework.DrawingView

addBackground

public void addBackground(CH.ifa.draw.framework.Painter painter)
Adds a background.


removeBackground

public void removeBackground(CH.ifa.draw.framework.Painter painter)
Removes a background.


removeForeground

public void removeForeground(CH.ifa.draw.framework.Painter painter)
Removes a foreground.


addForeground

public void addForeground(CH.ifa.draw.framework.Painter painter)
Adds a foreground.


freezeView

public void freezeView()
Freezes the view by acquiring the drawing lock.

Specified by:
freezeView in interface CH.ifa.draw.framework.DrawingView
See Also:
Drawing.lock()

unfreezeView

public void unfreezeView()
Unfreezes the view by releasing the drawing lock.

Specified by:
unfreezeView in interface CH.ifa.draw.framework.DrawingView
See Also:
Drawing.unlock()

isFocusTraversable

public boolean isFocusTraversable()
Overrides:
isFocusTraversable in class Component

isInteractive

public boolean isInteractive()
Specified by:
isInteractive in interface CH.ifa.draw.framework.DrawingView

keyTyped

public void keyTyped(KeyEvent e)
Specified by:
keyTyped in interface KeyListener

keyReleased

public void keyReleased(KeyEvent e)
Specified by:
keyReleased in interface KeyListener

addFigureSelectionListener

public void addFigureSelectionListener(CH.ifa.draw.framework.FigureSelectionListener fsl)
Add a listener for selection changes.

Specified by:
addFigureSelectionListener in interface CH.ifa.draw.framework.DrawingView
Parameters:
fsl - jhotdraw.framework.FigureSelectionListener

removeFigureSelectionListener

public void removeFigureSelectionListener(CH.ifa.draw.framework.FigureSelectionListener fsl)
Remove a listener for selection changes.

Specified by:
removeFigureSelectionListener in interface CH.ifa.draw.framework.DrawingView
Parameters:
fsl - jhotdraw.framework.FigureSelectionListener

getDefaultDNDActions

public int getDefaultDNDActions()

autoscroll

public void autoscroll(Point p)
Specified by:
autoscroll in interface Autoscroll

getAutoscrollInsets

public Insets getAutoscrollInsets()
Specified by:
getAutoscrollInsets in interface Autoscroll

toString

public String toString()
Overrides:
toString in class Component