|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
CH.ifa.draw.standard.StandardDrawingView
public class StandardDrawingView
The standard implementation of DrawingView.
DrawingView
,
Painter
,
Tool
,
Serialized FormNested Class Summary |
---|
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 |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
---|
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 | |
---|---|
StandardDrawingView(DrawingEditor editor,
int width,
int height)
Constructs the view. |
Method Summary | |
---|---|
Figure |
add(Figure figure)
Adds a figure to the drawing. |
void |
addAll(java.util.Vector figures)
Adds a vector of figures to the drawing. |
void |
addBackground(Painter painter)
Adds a background. |
void |
addForeground(Painter painter)
Adds a foreground. |
void |
addToSelection(Figure figure)
Adds a figure to the current selection. |
void |
addToSelectionAll(java.util.Vector figures)
Adds a vector of figures to the current selection. |
void |
checkDamage()
Refreshes the drawing if there is some accumulated damage |
void |
clearSelection()
Clears the current selection. |
protected java.awt.Point |
constrainPoint(java.awt.Point p)
Constrains a point to the current grid. |
void |
drawAll(java.awt.Graphics g)
Draws the contents of the drawing view. |
void |
drawBackground(java.awt.Graphics g)
Draws the background. |
void |
drawDrawing(java.awt.Graphics g)
Draws the drawing. |
void |
drawHandles(java.awt.Graphics g)
Draws the currently active handles. |
Drawing |
drawing()
Gets the drawing. |
void |
drawingInvalidated(DrawingChangeEvent e)
Sent when an area is invalid |
void |
drawingRequestUpdate(DrawingChangeEvent e)
Sent when the drawing wants to be refreshed |
DrawingEditor |
editor()
Gets the editor. |
Handle |
findHandle(int x,
int y)
Finds a handle at the given coordinates. |
void |
freezeView()
Freezes the view by acquiring the drawing lock. |
PointConstrainer |
getConstrainer()
Gets the current constrainer. |
FigureSelection |
getFigureSelection()
Gets the current selection as a FigureSelection. |
java.awt.Dimension |
getMinimumSize()
Gets the minimum dimension of the drawing. |
java.awt.Dimension |
getPreferredSize()
Gets the preferred dimension of the drawing.. |
protected void |
handleCursorKey(int key)
Handles cursor keys by moving all the selected figures one grid point in the cursor direction. |
boolean |
isFocusTraversable()
|
void |
keyPressed(java.awt.event.KeyEvent e)
Handles key down events. |
void |
keyReleased(java.awt.event.KeyEvent e)
|
void |
keyTyped(java.awt.event.KeyEvent e)
|
java.awt.Point |
lastClick()
Gets the position of the last click inside the view. |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Handles mouse drag events. |
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Handles mouse move events. |
void |
mousePressed(java.awt.event.MouseEvent e)
Handles mouse down events. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Handles mouse up events. |
void |
paint(java.awt.Graphics g)
Paints the drawing view. |
Figure |
remove(Figure figure)
Removes a figure from the drawing. |
void |
removeBackground(Painter painter)
Removes a background. |
void |
removeForeground(Painter painter)
Removes a foreground. |
void |
removeFromSelection(Figure figure)
Removes a figure from the selection. |
void |
repairDamage()
Repair the damaged area |
java.util.Vector |
selection()
Gets the currently selected figures. |
protected void |
selectionChanged()
Informs that the current selection changed. |
int |
selectionCount()
Gets the number of selected figures. |
FigureEnumeration |
selectionElements()
Gets an enumeration over the currently selected figures. |
java.util.Vector |
selectionZOrdered()
Gets the currently selected figures in Z order. |
void |
setConstrainer(PointConstrainer c)
Sets the grid spacing that is used to constrain points. |
void |
setDisplayUpdate(Painter updateStrategy)
Sets the current display update strategy. |
void |
setDrawing(Drawing d)
Sets and installs another drawing in the view. |
void |
setEditor(DrawingEditor editor)
Sets the view's editor. |
void |
toggleSelection(Figure figure)
If a figure isn't selected it is added to the selection. |
Tool |
tool()
Gets the current tool. |
void |
unfreezeView()
Unfreezes the view by releasing the drawing lock. |
void |
update(java.awt.Graphics g)
Updates the drawing view. |
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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, 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 |
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, 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, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, 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, 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 |
Methods inherited from interface CH.ifa.draw.framework.DrawingView |
---|
createImage, getBackground, getGraphics, getSize, setBackground, setCursor |
Methods inherited from interface java.awt.image.ImageObserver |
---|
imageUpdate |
Constructor Detail |
---|
public StandardDrawingView(DrawingEditor editor, int width, int height)
Method Detail |
---|
public void setEditor(DrawingEditor editor)
setEditor
in interface DrawingView
public Tool tool()
tool
in interface DrawingView
public Drawing drawing()
drawing
in interface DrawingView
public void setDrawing(Drawing d)
setDrawing
in interface DrawingView
public DrawingEditor editor()
editor
in interface DrawingView
public Figure add(Figure figure)
add
in interface DrawingView
public Figure remove(Figure figure)
remove
in interface DrawingView
public void addAll(java.util.Vector figures)
addAll
in interface DrawingView
public java.awt.Dimension getMinimumSize()
getMinimumSize
in interface DrawingView
getMinimumSize
in class javax.swing.JComponent
public java.awt.Dimension getPreferredSize()
getPreferredSize
in interface DrawingView
getPreferredSize
in class javax.swing.JComponent
public void setDisplayUpdate(Painter updateStrategy)
setDisplayUpdate
in interface DrawingView
Painter
public java.util.Vector selection()
selection
in interface DrawingView
public FigureEnumeration selectionElements()
selectionElements
in interface DrawingView
public java.util.Vector selectionZOrdered()
selectionZOrdered
in interface DrawingView
selection()
public int selectionCount()
selectionCount
in interface DrawingView
public void addToSelection(Figure figure)
addToSelection
in interface DrawingView
public void addToSelectionAll(java.util.Vector figures)
addToSelectionAll
in interface DrawingView
public void removeFromSelection(Figure figure)
removeFromSelection
in interface DrawingView
public void toggleSelection(Figure figure)
toggleSelection
in interface DrawingView
public void clearSelection()
clearSelection
in interface DrawingView
public FigureSelection getFigureSelection()
getFigureSelection
in interface DrawingView
public Handle findHandle(int x, int y)
findHandle
in interface DrawingView
protected void selectionChanged()
public java.awt.Point lastClick()
lastClick
in interface DrawingView
public void setConstrainer(PointConstrainer c)
setConstrainer
in interface DrawingView
public PointConstrainer getConstrainer()
getConstrainer
in interface DrawingView
protected java.awt.Point constrainPoint(java.awt.Point p)
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
protected void handleCursorKey(int key)
public void checkDamage()
checkDamage
in interface DrawingView
public void repairDamage()
DrawingView
repairDamage
in interface DrawingView
public void drawingInvalidated(DrawingChangeEvent e)
DrawingChangeListener
drawingInvalidated
in interface DrawingChangeListener
public void drawingRequestUpdate(DrawingChangeEvent e)
DrawingChangeListener
drawingRequestUpdate
in interface DrawingChangeListener
public void update(java.awt.Graphics g)
update
in class javax.swing.JComponent
public void paint(java.awt.Graphics g)
paint
in interface DrawingView
paint
in class javax.swing.JComponent
Painter
public void drawAll(java.awt.Graphics g)
drawAll
in interface DrawingView
public void drawHandles(java.awt.Graphics g)
drawHandles
in interface DrawingView
public void drawDrawing(java.awt.Graphics g)
drawDrawing
in interface DrawingView
public void drawBackground(java.awt.Graphics g)
drawBackground
in interface DrawingView
public void addBackground(Painter painter)
public void removeBackground(Painter painter)
public void removeForeground(Painter painter)
public void addForeground(Painter painter)
public void freezeView()
freezeView
in interface DrawingView
Drawing.lock()
public void unfreezeView()
unfreezeView
in interface DrawingView
Drawing.unlock()
public boolean isFocusTraversable()
isFocusTraversable
in class java.awt.Component
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |