|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DrawingView
DrawingView renders a Drawing and listens to its changes. It receives user input and delegates it to the current tool.
Observer
DrawingView observes drawing for changes via the DrawingListener interface.
State
DrawingView plays the role of the StateContext in
the State pattern. Tool is the State.
Strategy
DrawingView is the StrategyContext in the Strategy pattern
with regard to the UpdateStrategy.
DrawingView is the StrategyContext for the PointConstrainer.
Drawing
,
Painter
,
Tool
Field Summary |
---|
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Method Summary | |
---|---|
Figure |
add(Figure figure)
Adds a figure to the drawing. |
void |
addAll(java.util.Vector figures)
Adds a vector of figures to the drawing. |
void |
addToSelection(Figure figure)
Adds a figure to the current selection. |
void |
addToSelectionAll(java.util.Vector figures)
Adds a vector of figures to the current selection. |
void |
checkDamage()
Checks whether the drawing has some accumulated damage |
void |
clearSelection()
Clears the current selection. |
java.awt.Image |
createImage(int width,
int height)
Creates an image with the given dimensions |
void |
drawAll(java.awt.Graphics g)
Draws the contents of the drawing view. |
void |
drawBackground(java.awt.Graphics g)
Draws the background. |
void |
drawDrawing(java.awt.Graphics g)
Draws the drawing. |
void |
drawHandles(java.awt.Graphics g)
Draws the currently active handles. |
Drawing |
drawing()
Gets the drawing. |
DrawingEditor |
editor()
Gets the editor. |
Handle |
findHandle(int x,
int y)
Finds a handle at the given coordinates. |
void |
freezeView()
Freezes the view by acquiring the drawing lock. |
java.awt.Color |
getBackground()
Gets the background color of the DrawingView |
PointConstrainer |
getConstrainer()
Gets the current grid setting. |
FigureSelection |
getFigureSelection()
Gets the current selection as a FigureSelection. |
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.. |
java.awt.Dimension |
getSize()
Gets the size of the drawing. |
java.awt.Point |
lastClick()
Gets the position of the last click inside the view. |
void |
paint(java.awt.Graphics g)
Paints the drawing view. |
Figure |
remove(Figure figure)
Removes a figure from the drawing. |
void |
removeFromSelection(Figure figure)
Removes a figure from the selection. |
void |
repairDamage()
Repair the damaged area |
java.util.Vector |
selection()
Gets the currently selected figures. |
int |
selectionCount()
Gets the number of selected figures. |
FigureEnumeration |
selectionElements()
Gets an enumeration over the currently selected figures. |
java.util.Vector |
selectionZOrdered()
Gets the currently selected figures in Z order. |
void |
setBackground(java.awt.Color c)
Gets the background color of the DrawingView |
void |
setConstrainer(PointConstrainer p)
Sets the current point constrainer. |
void |
setCursor(java.awt.Cursor c)
Sets the cursor of the DrawingView |
void |
setDisplayUpdate(Painter updateStrategy)
Sets the current display update strategy. |
void |
setDrawing(Drawing d)
Sets and installs another drawing in the view. |
void |
setEditor(DrawingEditor editor)
Sets the view's editor. |
void |
toggleSelection(Figure figure)
If a figure isn't selected it is added to the selection. |
Tool |
tool()
Gets the current tool. |
void |
unfreezeView()
Unfreezes the view by releasing the drawing lock. |
Methods inherited from interface java.awt.image.ImageObserver |
---|
imageUpdate |
Methods inherited from interface CH.ifa.draw.framework.DrawingChangeListener |
---|
drawingInvalidated, drawingRequestUpdate |
Method Detail |
---|
void setEditor(DrawingEditor editor)
Tool tool()
Drawing drawing()
void setDrawing(Drawing d)
DrawingEditor editor()
Figure add(Figure figure)
Figure remove(Figure figure)
void addAll(java.util.Vector figures)
java.awt.Dimension getSize()
java.awt.Dimension getMinimumSize()
java.awt.Dimension getPreferredSize()
void setDisplayUpdate(Painter updateStrategy)
Painter
java.util.Vector selection()
FigureEnumeration selectionElements()
java.util.Vector selectionZOrdered()
selection()
int selectionCount()
void addToSelection(Figure figure)
void addToSelectionAll(java.util.Vector figures)
void removeFromSelection(Figure figure)
void toggleSelection(Figure figure)
void clearSelection()
FigureSelection getFigureSelection()
Handle findHandle(int x, int y)
java.awt.Point lastClick()
void setConstrainer(PointConstrainer p)
PointConstrainer getConstrainer()
void checkDamage()
void repairDamage()
void paint(java.awt.Graphics g)
Painter
java.awt.Image createImage(int width, int height)
java.awt.Graphics getGraphics()
java.awt.Color getBackground()
void setBackground(java.awt.Color c)
void drawAll(java.awt.Graphics g)
void drawHandles(java.awt.Graphics g)
void drawDrawing(java.awt.Graphics g)
void drawBackground(java.awt.Graphics g)
void setCursor(java.awt.Cursor c)
void freezeView()
Drawing.lock()
void unfreezeView()
Drawing.unlock()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |