java.awt.image.ImageObserver
, java.awt.MenuContainer
, java.beans.PropertyChangeListener
, java.io.Serializable
, java.util.EventListener
, javax.swing.Scrollable
, JaxoCanvasComponent
, JaxoDrawingArea
, JaxoLocalized
public final class JaxoCanvas extends AbstractJaxoCanvas
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
HANDLE_PAINT_OFF, HANDLE_PAINT_ON, HANDLE_PAINT_SELECTION, HOVERING_EDITED_OBJECTS
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
DEFAULT_HELP_COLOR, DEFAULT_HELP_STROKE
Constructor | Description |
---|---|
JaxoCanvas(java.awt.event.ActionListener listener) |
Constructs a new canvas.
|
Modifier and Type | Method | Description |
---|---|---|
void |
clear() |
Clears the drawing area.
|
void |
continueEdit(java.awt.Point p,
java.awt.Point last) |
Continue an edit actione that has been initiated before.
|
void |
continueSelect(java.awt.Point p) |
Carry on a select action that was started previously.
|
protected void |
deleteMarkedObjects() |
Deletes all 'marked' objects from the drawing area and the current canvas graph.
|
void |
editNearestObject(java.awt.Point p) |
Determine the closest object to the given point and bring up an edit panel for it.
|
void |
finalizeEdit() |
Finalize a user input action.
|
void |
finalizeSelect(java.awt.Point p) |
End a select action.
|
void |
groupMarkedObjects() |
Groups the currently marked objects.
|
void |
initiateEdit(java.awt.Point p) |
Start an edit action at a given point.
|
void |
initiateSelect(java.awt.Point p) |
Start a select action.
|
void |
markImageInvalid(java.awt.Rectangle boundingBox) |
Mark the specified region as invalid.
|
void |
moveSelection(boolean backGround) |
Moves the currently selected objects into either fore- or background.
|
protected void |
paintComponent(java.awt.Graphics g) |
Paint the Canvas.
|
void |
pasteFromClipboard() |
Paste the objects currently on the clipboard.
|
protected void |
printComponent(java.awt.Graphics gr) |
Print the Canvas.
|
protected void |
rebuildImage() |
Build a new off-screen image.
|
void |
refresh() |
Refresh the canvas.
|
protected void |
revalidateCanvas() |
Resets the preferred size of the canvas.
|
void |
setCanvasGraph(JaxoGraph value) |
Sets the current graph.
|
void |
ungroupMarkedObjects() |
Ungroup all marked objects.
|
void |
ungroupSelectedObject() |
If the selected object is a group, ungroup it.
|
void |
updateMode(int mode) |
Resets canvas parameters for the given mode.
|
void |
updatePointsAid(java.awt.Point p) |
Updates the visual aid that is painted for objects in click-move mode.
|
asComponent, canPasteGraphFromSystemClipboard, copyMarkedObjects, cutMarkedObjects, getCanvasBackground, getCanvasBounds, getCanvasGraph, getCanvasOrigin, getCanvasSize, getClipboard, getEffectiveMaximumCanvasSize, getFboxPopup, getGrid, getHandle, getHandlePaintMode, getMaximumCanvasSize, getMinimumCanvasSize, getPreferredScrollableViewportSize, getScreenBounds, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSystemClipboardGraph, getZoom, isAntialiasEnabled, markBackgroundInvalid, markImageInvalid, moveGraph, paintBackgroundAndGrid, propertyChange, putToSystemClipboard, repaintBoundingBox, setAntialiasEnabled, setCanvasBackground, setCanvasGraphAndGrid, setGrid, setHandle, setHandlePaintMode, setMaximumCanvasSize, setMinimumCanvasSize, showColorPanel, showEditPanel, showSelectionPanel, snapObject, snapPoint, toComponentCoordinates, toComponentCoordinates, toGraphCoordinates, unMarkGraph, updateLanguage
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, getAccessibleContext, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
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, transferFocusDownCycle, validate, validateTree
addMouseListener, addMouseMotionListener, addPropertyChangeListener, getGraphics, print, removeMouseListener, removeMouseMotionListener, repaint
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, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, 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
public JaxoCanvas(java.awt.event.ActionListener listener)
listener
- An ActionListener to receive events from the Canvas.public void markImageInvalid(java.awt.Rectangle boundingBox)
boundingBox
- The region to update.
May be null in which case the whole image is marked for update.public void refresh()
public void setCanvasGraph(JaxoGraph value)
setCanvasGraph
in interface JaxoDrawingArea
setCanvasGraph
in class AbstractJaxoCanvas
value
- The graph to be set.protected void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
g
- The graphics context to paint to.protected void printComponent(java.awt.Graphics gr)
printComponent
in class javax.swing.JComponent
gr
- The graphics context to print to.protected void rebuildImage()
rebuildImage
in class AbstractJaxoCanvas
protected void revalidateCanvas()
revalidateCanvas
in class AbstractJaxoCanvas
protected void deleteMarkedObjects()
deleteMarkedObjects
in class AbstractJaxoCanvas
public void pasteFromClipboard()
public void ungroupMarkedObjects()
public void ungroupSelectedObject()
public void groupMarkedObjects()
public void updateMode(int mode)
updateMode
in class AbstractJaxoCanvas
mode
- The mode to adjust to.public void clear()
public void moveSelection(boolean backGround)
backGround
- True for moving into background, false for foreground.public void editNearestObject(java.awt.Point p)
p
- the test pointpublic void initiateEdit(java.awt.Point p)
p
- the point associated with the edit action.public void continueEdit(java.awt.Point p, java.awt.Point last)
p
- the point on this drawing area associated with the edit action.last
- the last recorded action point, or null if none.public void finalizeEdit()
public void updatePointsAid(java.awt.Point p)
p
- the current location of the cursor.public void initiateSelect(java.awt.Point p)
p
- the point where the select action was started.public void continueSelect(java.awt.Point p)
p
- the current point of the select action.public void finalizeSelect(java.awt.Point p)
p
- the point where the select action was finished.Licensed under GPL. For more information, see http://jaxodraw.sourceforge.net/license.html or the LICENSE file in the jaxodraw distribution.