All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class CH.ifa.draw.applet.DrawApplet

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----CH.ifa.draw.applet.DrawApplet

public class DrawApplet
extends Applet
implements DrawingEditor, PaletteListener
DrawApplication defines a standard presentation for a drawing editor that is run as an applet. The presentation is customized in subclasses.

Supported applet parameters:
DRAWINGS: a blank separated list of drawing names that is shown in the drawings choice.


Variable Index

 o IMAGES

Constructor Index

 o DrawApplet()

Method Index

 o createAttributeChoices(Panel)
Creates the attribute choices.
 o createAttributesPanel()
Creates the attributes panel.
 o createButtonPanel()
Creates the buttons panel.
 o createButtons(Panel)
Creates the buttons shown in the buttons panel.
 o createColorChoice(String)
Creates the color choice for the given attribute.
 o createDrawing()
Creates the drawing used in this application.
 o createDrawingView()
Creates the drawing view used in this application.
 o createFontChoice()
Creates the font choice.
 o createSelectionTool()
Creates the selection tool used in this editor.
 o createToolButton(String, String, Tool)
Creates a tool button with the given image, tool, and text
 o createToolPalette()
Creates the tools palette.
 o createTools(Panel)
Creates the tools.
 o drawing()
Gets the current drawing.
 o init()
Initializes the applet and creates its contents.
 o loadDrawing(String)
 o paletteUserOver(PaletteButton, boolean)
Handles when the mouse enters or leaves a palette button.
 o paletteUserSelected(PaletteButton)
Handles a user selection in the palette.
 o selectionChanged(DrawingView)
Handles a change of the current selection.
 o setBufferedDisplayUpdate()
 o setSimpleDisplayUpdate()
 o showHelp()
Shows a help page for the applet.
 o tool()
Gets the current tool.
 o toolDone()
Sets the default tool of the editor.
 o view()
Gets the current drawing view.

Variables

 o IMAGES
 public static final String IMAGES

Constructors

 o DrawApplet
 public DrawApplet()

Methods

 o init
 public void init()
Initializes the applet and creates its contents.

Overrides:
init in class Applet
 o createAttributesPanel
 protected Panel createAttributesPanel()
Creates the attributes panel.

 o createAttributeChoices
 protected void createAttributeChoices(Panel panel)
Creates the attribute choices. Override to add additional choices.

 o createColorChoice
 protected Choice createColorChoice(String attribute)
Creates the color choice for the given attribute.

 o createFontChoice
 protected Choice createFontChoice()
Creates the font choice. The choice is filled with all the fonts supported by the toolkit.

 o createButtonPanel
 protected Panel createButtonPanel()
Creates the buttons panel.

 o createButtons
 protected void createButtons(Panel panel)
Creates the buttons shown in the buttons panel. Override to add additional buttons.

Parameters:
panel - the buttons panel.
 o createToolPalette
 protected Panel createToolPalette()
Creates the tools palette.

 o createTools
 protected void createTools(Panel palette)
Creates the tools. By default only the selection tool is added. Override this method to add additional tools. Call the inherited method to include the selection tool.

Parameters:
palette - the palette where the tools are added.
 o createSelectionTool
 protected Tool createSelectionTool()
Creates the selection tool used in this editor. Override to use a custom selection tool.

 o createToolButton
 protected ToolButton createToolButton(String iconName,
                                       String toolName,
                                       Tool tool)
Creates a tool button with the given image, tool, and text

 o createDrawing
 protected Drawing createDrawing()
Creates the drawing used in this application. You need to override this method to use a Drawing subclass in your application. By default a standard Drawing is returned.

 o createDrawingView
 protected StandardDrawingView createDrawingView()
Creates the drawing view used in this application. You need to override this method to use a DrawingView subclass in your application. By default a standard DrawingView is returned.

 o paletteUserSelected
 public void paletteUserSelected(PaletteButton button)
Handles a user selection in the palette.

See Also:
PaletteListener
 o paletteUserOver
 public void paletteUserOver(PaletteButton button,
                             boolean inside)
Handles when the mouse enters or leaves a palette button.

See Also:
PaletteListener
 o drawing
 public Drawing drawing()
Gets the current drawing.

See Also:
DrawingEditor
 o tool
 public Tool tool()
Gets the current tool.

See Also:
DrawingEditor
 o view
 public DrawingView view()
Gets the current drawing view.

See Also:
DrawingEditor
 o toolDone
 public void toolDone()
Sets the default tool of the editor.

See Also:
DrawingEditor
 o selectionChanged
 public void selectionChanged(DrawingView view)
Handles a change of the current selection. Updates all menu items that are selection sensitive.

See Also:
DrawingEditor
 o loadDrawing
 protected void loadDrawing(String param)
 o setSimpleDisplayUpdate
 protected void setSimpleDisplayUpdate()
 o setBufferedDisplayUpdate
 protected void setBufferedDisplayUpdate()
 o showHelp
 protected void showHelp()
Shows a help page for the applet. The URL of the help page is derived as follows: codeBase+appletClassname+Help.html"


All Packages  Class Hierarchy  This Package  Previous  Next  Index