|
||||||||||
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
net.sf.jaxodraw.gui.AbstractJaxoCanvas
net.sf.jaxodraw.gui.JaxoCanvas
public final class JaxoCanvas
An instance of the canvas: responsible for all the painting.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class net.sf.jaxodraw.gui.AbstractJaxoCanvas |
---|
HANDLE_PAINT_OFF, HANDLE_PAINT_ON, HANDLE_PAINT_SELECTION, HOVERING_EDITED_OBJECTS |
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 net.sf.jaxodraw.gui.JaxoDrawingArea |
---|
DEFAULT_HELP_COLOR, DEFAULT_HELP_STROKE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JaxoCanvas(ActionListener listener)
Constructs a new canvas. |
Method Summary | |
---|---|
void |
clear()
Clears the drawing area. |
void |
continueEdit(Point p,
Point last)
Continue an edit actione that has been initiated before. |
void |
continueSelect(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(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(Point p)
End a select action. |
void |
groupMarkedObjects()
Groups the currently marked objects. |
void |
initiateEdit(Point p)
Start an edit action at a given point. |
void |
initiateSelect(Point p)
Start a select action. |
void |
markImageInvalid(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(Graphics g)
Paint the Canvas. |
void |
pasteFromClipboard()
Paste the objects currently on the clipboard. |
protected void |
printComponent(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(Point p)
Updates the visual aid that is painted for objects in click-move mode. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.jaxodraw.gui.JaxoCanvasComponent |
---|
addMouseListener, addMouseMotionListener, addPropertyChangeListener, getGraphics, print, removeMouseListener, removeMouseMotionListener, repaint |
Constructor Detail |
---|
public JaxoCanvas(ActionListener listener)
listener
- An ActionListener to receive events from the Canvas.Method Detail |
---|
public void markImageInvalid(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(Graphics g)
paintComponent
in class JComponent
g
- The graphics context to paint to.protected void printComponent(Graphics gr)
printComponent
in class 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(Point p)
p
- the test pointpublic void initiateEdit(Point p)
p
- the point associated with the edit action.public void continueEdit(Point p, 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(Point p)
p
- the current location of the cursor.public void initiateSelect(Point p)
p
- the point where the select action was started.public void continueSelect(Point p)
p
- the current point of the select action.public void finalizeSelect(Point p)
p
- the point where the select action was finished.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |