|
||||||||||
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
org.jhotdraw.standard.StandardDrawingView
org.jhotdraw.contrib.zoom.ZoomDrawingView
A view that can display drawings at an arbitrary scale.
Nested Class Summary |
Nested classes inherited from class org.jhotdraw.standard.StandardDrawingView |
StandardDrawingView.DrawingViewKeyListener, StandardDrawingView.DrawingViewMouseListener, StandardDrawingView.DrawingViewMouseMotionListener |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
Fields inherited from class org.jhotdraw.standard.StandardDrawingView |
MINIMUM_HEIGHT, MINIMUM_WIDTH, SCROLL_INCR, 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 | |
ZoomDrawingView(DrawingEditor editor)
|
|
ZoomDrawingView(DrawingEditor editor,
int width,
int height)
|
Method Summary | |
protected java.awt.Point |
constrainPoint(java.awt.Point p)
Constrain to user coordinates, not screen coordinates. |
protected java.awt.event.KeyListener |
createKeyListener()
|
protected java.awt.event.MouseListener |
createMouseListener()
|
protected java.awt.event.MouseMotionListener |
createMouseMotionListener()
|
void |
deZoom(int x,
int y)
Sets the zoom scale to 1.0 and adjusts the scroll pane so that point (x, y) is in the center. |
void |
drawBackground(java.awt.Graphics g)
Draws the background. |
void |
drawingInvalidated(DrawingChangeEvent e)
Overridden to accumulate damage in an instance variable of this class. |
java.awt.Graphics |
getGraphics()
Gets a graphic to draw into |
java.awt.Dimension |
getMinimumSize()
Gets the minimum dimension of the drawing. |
java.awt.Dimension |
getPreferredSize()
Gets the preferred dimension of the drawing.. |
double |
getScale()
|
java.awt.Dimension |
getSize()
Gets the size of the drawing. |
java.awt.Dimension |
getUserSize()
|
java.awt.Dimension |
getViewportSize()
|
double |
getZoomSpeed()
Returns the current zoom speed |
protected boolean |
hasZoomSupport()
|
void |
paint(java.awt.Graphics g)
Paints the drawing view. |
void |
repairDamage()
Overridden to scale damage to screen coordinates. |
void |
setDrawing(Drawing d)
Sets and installs another drawing in the view. |
void |
setOriginPosition(java.awt.Point newOrigin)
Sets the coordinates of the left top corner displayed by the view. |
void |
setUserSize(java.awt.Dimension d)
Sets the size of this view in user coordinates. |
void |
setUserSize(int width,
int height)
Sets the size of this view in user coordinates. |
protected void |
setViewPosition(java.awt.Point newPosition)
|
void |
setZoomSpeed(double newZoomSpeed)
Set the zoom speed. |
void |
zoom(float newScale)
Set this view's scale factor |
void |
zoom(int x,
int y,
int width,
int height)
Readjusts this view and its containing ScrollPane to display the given rectangle, which is given in user coordinates. |
void |
zoomIn(int x,
int y)
InContext Zooms in by a factor of the current scale, keeping point (x,y), which is given in user coordinates, in the center. |
void |
zoomOut(int x,
int y)
Zooms out by a factor of two, keeping point (x,y), which is given in user coordinates, in the center. |
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, 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, 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, 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 org.jhotdraw.framework.DrawingView |
createImage, getBackground, setBackground |
Methods inherited from interface java.awt.image.ImageObserver |
imageUpdate |
Constructor Detail |
public ZoomDrawingView(DrawingEditor editor)
public ZoomDrawingView(DrawingEditor editor, int width, int height)
Method Detail |
public final double getScale()
public void setUserSize(int width, int height)
public void setUserSize(java.awt.Dimension d)
public java.awt.Dimension getSize()
DrawingView
public java.awt.Dimension getViewportSize()
protected boolean hasZoomSupport()
public void setOriginPosition(java.awt.Point newOrigin)
protected void setViewPosition(java.awt.Point newPosition)
public java.awt.Dimension getUserSize()
public void zoom(int x, int y, int width, int height)
public void zoom(float newScale)
public void zoomOut(int x, int y)
public void zoomIn(int x, int y)
public void deZoom(int x, int y)
public void paint(java.awt.Graphics g)
DrawingView
public java.awt.Graphics getGraphics()
DrawingView
protected java.awt.Point constrainPoint(java.awt.Point p)
constrainPoint
in class StandardDrawingView
public void drawBackground(java.awt.Graphics g)
StandardDrawingView
drawBackground
in interface DrawingView
drawBackground
in class StandardDrawingView
public void setDrawing(Drawing d)
StandardDrawingView
setDrawing
in interface DrawingView
setDrawing
in class StandardDrawingView
public java.awt.Dimension getMinimumSize()
StandardDrawingView
getMinimumSize
in interface DrawingView
getMinimumSize
in class StandardDrawingView
StandardDrawingView.getMinimumSize()
,
Component.getMinimumSize()
public java.awt.Dimension getPreferredSize()
DrawingView
public void repairDamage()
repairDamage
in interface DrawingView
repairDamage
in class StandardDrawingView
public void drawingInvalidated(DrawingChangeEvent e)
drawingInvalidated
in interface DrawingChangeListener
drawingInvalidated
in class StandardDrawingView
protected java.awt.event.MouseListener createMouseListener()
createMouseListener
in class StandardDrawingView
protected java.awt.event.MouseMotionListener createMouseMotionListener()
createMouseMotionListener
in class StandardDrawingView
protected java.awt.event.KeyListener createKeyListener()
createKeyListener
in class StandardDrawingView
public double getZoomSpeed()
public void setZoomSpeed(double newZoomSpeed)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |