Package net.sf.jaxodraw.gui
Interface JaxoDrawingArea
- All Superinterfaces:
EventListener
,JaxoCanvasComponent
,JaxoLocalized
,PropertyChangeListener
,Scrollable
- All Known Implementing Classes:
AbstractJaxoCanvas
,JaxoCanvas
public interface JaxoDrawingArea
extends JaxoCanvasComponent, PropertyChangeListener, Scrollable, JaxoLocalized
The drawing area.
- Since:
- 2.1
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the drawing area.void
continueEdit
(Point p, Point last) Continue an edit actione that has been initiated before.void
Carry on a select action that was started previously.void
Puts the current clipboard to the system clipboard.void
Copies the current clipboard to the system clipboard and removes the corresponding objects from the drawing area.void
Determine the closest object to the given point and bring up an edit panel for it.void
Finalize a user input action.void
End a select action.Gets the current clipboard.getZoom()
Return a zoom on this drawing area.void
Groups the currently marked objects.void
Start an edit action at a given point.void
Start a select action.void
markImageInvalid
(Rectangle boundingBox) Mark the specified region as invalid.void
moveGraph
(int dx, int dy) Displace the whole graph by a given offset.void
moveSelection
(boolean backGround) Moves the currently selected objects into either fore- or background.void
Paste the graph currently on the clipboard into this drawing area.void
refresh()
Refresh the canvas.void
setCanvasGraph
(JaxoGraph value) Sets the graph to be painted.void
setGrid
(JaxoPaintableGrid value) Sets the grid to be painted on this drawing area.void
Ungroup all marked objects.boolean
Sets all objects in the current graph as not marked.void
Updates the visual aid that is painted for objects in click-move mode.Methods inherited from interface net.sf.jaxodraw.gui.JaxoCanvasComponent
addMouseListener, addMouseMotionListener, addPropertyChangeListener, asComponent, getCanvasBackground, getCanvasBounds, getCanvasOrigin, getCanvasSize, getGraphics, getMaximumCanvasSize, getMinimumCanvasSize, print, removeMouseListener, removeMouseMotionListener, repaint, setCanvasBackground, setMaximumCanvasSize, setMinimumCanvasSize
Methods inherited from interface net.sf.jaxodraw.util.JaxoLocalized
updateLanguage
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
Methods inherited from interface javax.swing.Scrollable
getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement
-
Field Details
-
DEFAULT_HELP_COLOR
Default visualAid color. -
DEFAULT_HELP_STROKE
Default visualAid Stroke.
-
-
Method Details
-
clear
void clear()Clears the drawing area. -
continueEdit
Continue an edit actione that has been initiated before.- Parameters:
p
- the point on this drawing area associated with the edit action.last
- the last recorded action point, or null if none.
-
continueSelect
Carry on a select action that was started previously.- Parameters:
p
- the current point of the select action.
-
copyMarkedObjects
void copyMarkedObjects()Puts the current clipboard to the system clipboard. -
cutMarkedObjects
void cutMarkedObjects()Copies the current clipboard to the system clipboard and removes the corresponding objects from the drawing area. -
editNearestObject
Determine the closest object to the given point and bring up an edit panel for it.- Parameters:
p
- the test point
-
finalizeEdit
void finalizeEdit()Finalize a user input action. -
finalizeSelect
End a select action.- Parameters:
p
- the point where the select action was finished.
-
getClipboard
JaxoGraph getClipboard()Gets the current clipboard. This never returns null.- Returns:
- A JaxoGraph holding all the objects that are currently on the clipboard, or an empty graph, if the clipboard is empty.
-
getZoom
JaxoZoom getZoom()Return a zoom on this drawing area.- Returns:
- a zoom on this drawing area.
-
groupMarkedObjects
void groupMarkedObjects()Groups the currently marked objects. -
initiateEdit
Start an edit action at a given point.- Parameters:
p
- the point associated with the edit action.
-
initiateSelect
Start a select action.- Parameters:
p
- the point where the select action was started.
-
markImageInvalid
Mark the specified region as invalid. Currently this is also synchronous.- Parameters:
boundingBox
- The region to update. May be null in which case the whole image is marked for update.
-
moveSelection
void moveSelection(boolean backGround) Moves the currently selected objects into either fore- or background.- Parameters:
backGround
- True for moving into background, false for foreground.
-
moveGraph
void moveGraph(int dx, int dy) Displace the whole graph by a given offset.- Parameters:
dx
- the offset in x direction.dy
- the offset in y direction.
-
pasteFromClipboard
void pasteFromClipboard()Paste the graph currently on the clipboard into this drawing area. -
refresh
void refresh()Refresh the canvas. This should basically clean up any drawing operation and repaint the drawing area. -
setCanvasGraph
Sets the graph to be painted.- Parameters:
value
- The graph to be set.
-
setGrid
Sets the grid to be painted on this drawing area.- Parameters:
value
- The new grid. May be null.
-
ungroupMarkedObjects
void ungroupMarkedObjects()Ungroup all marked objects. This is not recursive, only one level is resolved. -
unMarkGraph
boolean unMarkGraph()Sets all objects in the current graph as not marked.- Returns:
- true if the graph had actually contained marked objects. In this case the canvas was also repainted. False otherwise, in which case this method has no effect.
-
updatePointsAid
Updates the visual aid that is painted for objects in click-move mode.- Parameters:
p
- the current location of the cursor.
-