public interface DrawingComponent
The DrawingComponent covers the whole content pane of the DrawingApplet. It thus has to provide the user interface elements for saving the drawing and canceling the applet on its own. The DrawingApplet registers with the DrawingComponent as an ActionListener to receive "save" and "cancel" action commands.
Modifier and Type | Method and Description |
---|---|
void |
addActionListener(java.awt.event.ActionListener listener)
Adds an ActionListener.
|
javax.swing.JComponent |
getComponent()
Returns the component of the DrawingComponent.
|
Drawing |
getDrawing()
Returns the drawing of the DrawingComponent.
|
java.lang.String |
getSummary()
Returns a summary about the changes made on the drawing.
|
void |
removeActionListener(java.awt.event.ActionListener listener)
Removes an ActionListener.
|
void |
setDrawing(Drawing newValue)
Sets the drawing of the DrawingComponent.
|
javax.swing.JComponent getComponent()
Drawing getDrawing()
void setDrawing(Drawing newValue)
void addActionListener(java.awt.event.ActionListener listener)
The ActionListener receives an ActionEvent with action command "save" when the user clicks at the save button on the drawing component.
The ActionListener receives an ActionEvent with action command "cancel" when the user clicks at the cancel button on the drawing component.
void removeActionListener(java.awt.event.ActionListener listener)
java.lang.String getSummary()