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.
-
IMAGES
-
-
DrawApplet()
-
-
createAttributeChoices(Panel)
- Creates the attribute choices.
-
createAttributesPanel()
- Creates the attributes panel.
-
createButtonPanel()
- Creates the buttons panel.
-
createButtons(Panel)
- Creates the buttons shown in the buttons panel.
-
createColorChoice(String)
- Creates the color choice for the given attribute.
-
createDrawing()
- Creates the drawing used in this application.
-
createDrawingView()
- Creates the drawing view used in this application.
-
createFontChoice()
- Creates the font choice.
-
createSelectionTool()
- Creates the selection tool used in this editor.
-
createToolButton(String, String, Tool)
- Creates a tool button with the given image, tool, and text
-
createToolPalette()
- Creates the tools palette.
-
createTools(Panel)
- Creates the tools.
-
drawing()
- Gets the current drawing.
-
init()
- Initializes the applet and creates its contents.
-
loadDrawing(String)
-
-
paletteUserOver(PaletteButton, boolean)
- Handles when the mouse enters or leaves a palette button.
-
paletteUserSelected(PaletteButton)
- Handles a user selection in the palette.
-
selectionChanged(DrawingView)
- Handles a change of the current selection.
-
setBufferedDisplayUpdate()
-
-
setSimpleDisplayUpdate()
-
-
showHelp()
- Shows a help page for the applet.
-
tool()
- Gets the current tool.
-
toolDone()
- Sets the default tool of the editor.
-
view()
- Gets the current drawing view.
IMAGES
public static final String IMAGES
DrawApplet
public DrawApplet()
init
public void init()
- Initializes the applet and creates its contents.
- Overrides:
- init in class Applet
createAttributesPanel
protected Panel createAttributesPanel()
- Creates the attributes panel.
createAttributeChoices
protected void createAttributeChoices(Panel panel)
- Creates the attribute choices. Override to add additional
choices.
createColorChoice
protected Choice createColorChoice(String attribute)
- Creates the color choice for the given attribute.
createFontChoice
protected Choice createFontChoice()
- Creates the font choice. The choice is filled with
all the fonts supported by the toolkit.
createButtonPanel
protected Panel createButtonPanel()
- Creates the buttons panel.
createButtons
protected void createButtons(Panel panel)
- Creates the buttons shown in the buttons panel. Override to
add additional buttons.
- Parameters:
- panel - the buttons panel.
createToolPalette
protected Panel createToolPalette()
- Creates the tools palette.
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.
createSelectionTool
protected Tool createSelectionTool()
- Creates the selection tool used in this editor. Override to use
a custom selection tool.
createToolButton
protected ToolButton createToolButton(String iconName,
String toolName,
Tool tool)
- Creates a tool button with the given image, tool, and text
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.
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.
paletteUserSelected
public void paletteUserSelected(PaletteButton button)
- Handles a user selection in the palette.
- See Also:
- PaletteListener
paletteUserOver
public void paletteUserOver(PaletteButton button,
boolean inside)
- Handles when the mouse enters or leaves a palette button.
- See Also:
- PaletteListener
drawing
public Drawing drawing()
- Gets the current drawing.
- See Also:
- DrawingEditor
tool
public Tool tool()
- Gets the current tool.
- See Also:
- DrawingEditor
view
public DrawingView view()
- Gets the current drawing view.
- See Also:
- DrawingEditor
toolDone
public void toolDone()
- Sets the default tool of the editor.
- See Also:
- DrawingEditor
selectionChanged
public void selectionChanged(DrawingView view)
- Handles a change of the current selection. Updates all
menu items that are selection sensitive.
- See Also:
- DrawingEditor
loadDrawing
protected void loadDrawing(String param)
setSimpleDisplayUpdate
protected void setSimpleDisplayUpdate()
setBufferedDisplayUpdate
protected void setBufferedDisplayUpdate()
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