|
JHotDraw 7.0.6 | |||||||||
| 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
org.jhotdraw.draw.DefaultDrawingView
public class DefaultDrawingView
DefaultDrawingView.
| Nested Class Summary |
|---|
| 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.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 | |
|---|---|
DefaultDrawingView()
Creates new instance. |
|
| Method Summary | |
|---|---|
void |
addFigureSelectionListener(FigureSelectionListener fsl)
Add a listener for selection changes in this DrawingView. |
void |
addNotify(DrawingEditor editor)
Informs the view that it has been added to the specified editor. |
void |
addToSelection(java.util.Collection<Figure> figures)
Adds a collection of figures to the current selection. |
void |
addToSelection(Figure figure)
Adds a figure to the current selection. |
void |
areaInvalidated(DrawingEvent evt)
Sent when an area of the drawing needs to be repainted. |
void |
areaInvalidated(HandleEvent evt)
Sent when an area of the drawing view needs to be repainted. |
void |
clearSelection()
Clears the current selection. |
void |
copy()
Copies the selected region and place its contents into the system clipboard. |
void |
cut()
Cuts the selected region and place its contents into the system clipboard. |
void |
delete()
Deletes the component at (or after) the caret position. |
protected void |
drawBackground(java.awt.Graphics2D g)
|
protected void |
drawDrawing(java.awt.Graphics2D gr)
|
protected void |
drawGrid(java.awt.Graphics2D g)
|
protected void |
drawHandles(java.awt.Graphics2D g)
|
java.awt.Point |
drawingToView(java.awt.geom.Point2D.Double p)
Converts drawing coordinates to view coordinates. |
java.awt.Rectangle |
drawingToView(java.awt.geom.Rectangle2D.Double r)
Converts drawing coordinates to view coordinates. |
protected void |
drawTool(java.awt.Graphics2D g)
|
void |
duplicate()
Duplicates the selected region. |
void |
figureAdded(DrawingEvent evt)
Sent when a figure was added. |
void |
figureRemoved(DrawingEvent evt)
Sent when a figure was removed. |
Figure |
findFigure(java.awt.Point p)
Finds a figure at a given coordinates. |
java.util.Collection<Figure> |
findFigures(java.awt.Rectangle r)
Returns all figures that lie within or intersect the specified bounds. |
java.util.Collection<Figure> |
findFiguresWithin(java.awt.Rectangle r)
Returns all figures that lie within the specified bounds. |
Handle |
findHandle(java.awt.Point p)
Finds a handle at a given coordinates. |
protected void |
fireSelectionChanged()
Notify all listenerList that have registered interest for notification on this event type. |
protected void |
fireViewTransformChanged()
|
java.util.Collection<Handle> |
getCompatibleHandles(Handle master)
Gets compatible handles. |
Constrainer |
getConstrainer()
Gets the editor's constrainer. |
java.awt.Container |
getContainer()
Returns the container of the drawing view. |
DOMFactory |
getDOMFactory()
|
Drawing |
getDrawing()
Gets the drawing. |
java.awt.geom.AffineTransform |
getDrawingToViewTransform()
Gets an transform which can be used to convert drawing coordinates to view coordinates. |
java.lang.String |
getEmptyDrawingMessage()
|
int |
getHandleDetailLevel()
Returns the detail level of the handles. |
java.awt.Dimension |
getPreferredSize()
Side effect: Changes view Translation!!! |
double |
getScaleFactor()
Gets the scale factor of the drawing view. |
java.util.Collection<Figure> |
getSelectedFigures()
Gets the current selection as a FigureSelection. |
int |
getSelectionCount()
Gets the number of selected figures. |
java.util.Set |
getTools()
Gets the tools. |
void |
handleRequestRemove(HandleEvent e)
Sent when requesting to remove a handle. |
void |
handleRequestSecondaryHandles(HandleEvent e)
Sent when requesting to add secondary handles. |
void |
invalidate()
|
protected void |
invalidateDimension()
|
boolean |
isFigureSelected(Figure checkFigure)
Test whether a given figure is selected. |
void |
paintComponent(java.awt.Graphics gr)
|
void |
paste()
Pastes the contents of the system clipboard at the caret position. |
void |
removeFigureSelectionListener(FigureSelectionListener fsl)
Remove a listener for selection changes in this DrawingView. |
void |
removeFromSelection(Figure figure)
Removes a figure from the selection. |
void |
removeNotify(DrawingEditor editor)
Informs the view that it has been removed from the specified editor. |
protected void |
repaint(java.awt.geom.Rectangle2D.Double r)
|
void |
selectAll()
Selects all figures. |
void |
setConstrainer(Constrainer newValue)
Sets the editor's constrainer. |
void |
setDOMFactory(DOMFactory newValue)
|
void |
setDrawing(Drawing d)
Sets and installs another drawing in the view. |
void |
setEmptyDrawingMessage(java.lang.String newValue)
|
void |
setHandleDetailLevel(int newValue)
The detail level of the handles. |
void |
setScaleFactor(double newValue)
Sets the scale factor of the drawing view. |
void |
toggleSelection(Figure figure)
If a figure isn't selected it is added to the selection. |
java.awt.geom.Point2D.Double |
viewToDrawing(java.awt.Point p)
Converts view coordinates to drawing coordinates. |
java.awt.geom.Rectangle2D.Double |
viewToDrawing(java.awt.Rectangle r)
Converts view coordinates to drawing coordinates. |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, updateUI |
| 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, 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, 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, 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 org.jhotdraw.draw.DrawingView |
|---|
addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, isEnabled, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, requestFocus, setCursor, setEnabled |
| Constructor Detail |
|---|
public DefaultDrawingView()
| Method Detail |
|---|
public Drawing getDrawing()
DrawingView
getDrawing in interface DrawingViewpublic java.util.Set getTools()
DrawingView
getTools in interface DrawingViewpublic void setEmptyDrawingMessage(java.lang.String newValue)
public java.lang.String getEmptyDrawingMessage()
public void paintComponent(java.awt.Graphics gr)
paintComponent in class javax.swing.JComponentprotected void drawBackground(java.awt.Graphics2D g)
protected void drawGrid(java.awt.Graphics2D g)
protected void drawDrawing(java.awt.Graphics2D gr)
protected void drawHandles(java.awt.Graphics2D g)
protected void drawTool(java.awt.Graphics2D g)
public void setDrawing(Drawing d)
DrawingView
setDrawing in interface DrawingViewprotected void repaint(java.awt.geom.Rectangle2D.Double r)
public void areaInvalidated(DrawingEvent evt)
DrawingListener
areaInvalidated in interface DrawingListenerpublic void areaInvalidated(HandleEvent evt)
HandleListener
areaInvalidated in interface HandleListenerpublic void figureAdded(DrawingEvent evt)
DrawingListener
figureAdded in interface DrawingListenerpublic void figureRemoved(DrawingEvent evt)
DrawingListener
figureRemoved in interface DrawingListenerpublic void invalidate()
invalidate in class java.awt.Containerpublic void addToSelection(Figure figure)
addToSelection in interface DrawingViewpublic void addToSelection(java.util.Collection<Figure> figures)
addToSelection in interface DrawingViewpublic void removeFromSelection(Figure figure)
removeFromSelection in interface DrawingViewpublic void toggleSelection(Figure figure)
toggleSelection in interface DrawingViewpublic void selectAll()
selectAll in interface EditableComponentselectAll in interface DrawingViewpublic void clearSelection()
clearSelection in interface DrawingViewpublic boolean isFigureSelected(Figure checkFigure)
isFigureSelected in interface DrawingViewpublic java.util.Collection<Figure> getSelectedFigures()
getSelectedFigures in interface DrawingViewpublic int getSelectionCount()
getSelectionCount in interface DrawingViewpublic Handle findHandle(java.awt.Point p)
findHandle in interface DrawingViewpublic java.util.Collection<Handle> getCompatibleHandles(Handle master)
getCompatibleHandles in interface DrawingViewpublic Figure findFigure(java.awt.Point p)
findFigure in interface DrawingViewpublic java.util.Collection<Figure> findFigures(java.awt.Rectangle r)
DrawingView
findFigures in interface DrawingViewpublic java.util.Collection<Figure> findFiguresWithin(java.awt.Rectangle r)
DrawingView
findFiguresWithin in interface DrawingViewpublic void addFigureSelectionListener(FigureSelectionListener fsl)
DrawingView
addFigureSelectionListener in interface DrawingViewfsl - jhotdraw.framework.FigureSelectionListenerpublic void removeFigureSelectionListener(FigureSelectionListener fsl)
DrawingView
removeFigureSelectionListener in interface DrawingViewfsl - jhotdraw.framework.FigureSelectionListenerprotected void fireSelectionChanged()
public void handleRequestRemove(HandleEvent e)
HandleListener
handleRequestRemove in interface HandleListenerprotected void invalidateDimension()
public Constrainer getConstrainer()
DrawingView
getConstrainer in interface DrawingViewpublic void setConstrainer(Constrainer newValue)
DrawingView
setConstrainer in interface DrawingViewpublic java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponentpublic java.awt.Point drawingToView(java.awt.geom.Point2D.Double p)
drawingToView in interface DrawingViewpublic java.awt.geom.Point2D.Double viewToDrawing(java.awt.Point p)
viewToDrawing in interface DrawingViewpublic java.awt.Rectangle drawingToView(java.awt.geom.Rectangle2D.Double r)
DrawingView
drawingToView in interface DrawingViewpublic java.awt.geom.Rectangle2D.Double viewToDrawing(java.awt.Rectangle r)
DrawingView
viewToDrawing in interface DrawingViewpublic java.awt.Container getContainer()
DrawingView
getContainer in interface DrawingViewpublic double getScaleFactor()
DrawingView
getScaleFactor in interface DrawingViewpublic void setScaleFactor(double newValue)
DrawingView
setScaleFactor in interface DrawingViewprotected void fireViewTransformChanged()
public void setHandleDetailLevel(int newValue)
DrawingView
setHandleDetailLevel in interface DrawingViewpublic int getHandleDetailLevel()
DrawingView
getHandleDetailLevel in interface DrawingViewpublic void handleRequestSecondaryHandles(HandleEvent e)
HandleListener
handleRequestSecondaryHandles in interface HandleListenerpublic java.awt.geom.AffineTransform getDrawingToViewTransform()
DrawingView
getDrawingToViewTransform in interface DrawingViewpublic void setDOMFactory(DOMFactory newValue)
public DOMFactory getDOMFactory()
public void copy()
EditableComponent
copy in interface EditableComponentpublic void cut()
EditableComponent
cut in interface EditableComponentpublic void delete()
EditableComponent
delete in interface EditableComponentpublic void paste()
EditableComponent
paste in interface EditableComponentpublic void duplicate()
EditableComponent
duplicate in interface EditableComponentpublic void removeNotify(DrawingEditor editor)
DrawingView
removeNotify in interface DrawingViewpublic void addNotify(DrawingEditor editor)
DrawingView
addNotify in interface DrawingView
|
Copyright 1996-2006 © JHotDraw.org | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||