blueDonkey.org

Plugins.TWikiDrawPlugin

TWikiDrawPlugin

This plugin encapsulates the TWikiDraw Java Applet first developed by PeterThoeny from the original JHotDraw.

Syntax Rules

  • Write the command %DRAWING{name}% anywhere in a TWiki topic. You can name the drawing anything you like, allowed characters are A-Z a-z 0-9 _ - . . If you have only one drawing in the topic you can simply write %DRAWING% . A drawing with no map can be edited simply by clicking on the drawing, or if it has a map by clicking the edit button or failing that on the boundary of the image. Browser support for Java 1.1 required.

Tools

The tools on the left create or manipulate figures.

Selection selects, moves or resizes a figure; the shift-key toggles the selection. Dragging the selection tool in the background selects the figures within the dragged rectangle.
Text creates a new or edits an existing text figure
Connected Text creates a new text figure and attaches it to the clicked figure. Once a text figure is attached it remains connected to the figure.
Rectangle creates a rectangle figure
Round Rectangle creates a round rectangle figure
Ellipse creates an ellipse figure
Line creates a line figure
Connection Line creates or adjusts connections between figures. A connection is split into segments by dragging a point on the connection. To join two segments click the end point of a segment
Elbow Connection Line creates an elbow connection and offers the same features as the ordinary connection tool
Scribble creates a scribble figure; dragging the mouse creates a smooth line while successive clicks yields a polyline figure. A two-button click terminates the figure.
Polygon creates a polygon figure; dragging the mouse creates a smooth border while successive clicks yields a polyline border. A two-button click or the ESCAPE key terminates the figure.
Border decorates the clicked figure with a border
URL adds a sensitive area to the figure that will redirect to a URL. If an image contains any sensitive areas it can only be selected for edit by clicking on the boundary or (if enabled) the attached Edit button.

Handles

When selected, figures provide different handles to manipulate them.

  • the filled red handles enable you to manipulate the shape of a figure
  • the blue circle handle is a connection handle. It allows you to create connections between figures.
  • the framed red handles are null handles. They only show the selection status of a figure but don't support any manipulation.
  • the green handles are shown on connections. They enable you to reconnect them with another figure.
  • the yellow handle enables you to change the font size of a text figure or the size of the radius of a rounded rectangle.

Commands

Commands are invoked from the button bar at the bottom or from the menu bar at the top.

The standard commands that are provided include cut, copy, paste, duplicate, delete, group, ungroup, bring to front, and send to back.

Attributes

Attributes, such as fill color, text color or arrow tip, can be changed through the attributes menus.

TWikiDrawPlugin Settings

  • Set SHORTDESCRIPTION = Drawing editor
Extra colors to be added to the menu of colors in the applet, as a comma-separated list with colors in HTML format (see StandardColors)
  • Set EXTRA_COLORS = Aquamarine=#70DB93,New Tan=EBC79E,Sea Green=238E68,Motorola Blue=#3ff
Set to 1 if an "Edit" button is to be generated attached to the image. You will still be able to edit it by clicking on the boundary of the image.
  • Set EDIT_BUTTON = 1
  • Set DEBUG = 0

Plugin Installation Instructions

  • Download the ZIP file from the Plugin web (see below). Contents:
    File: Description:
    TWikiDrawPlugin.xml Ant build file
    data/Plugins/TWikiDrawPlugin.txt Plugin topic
    templates/twikidraw.tmpl Applet page template
    pub/Plugins/TWikiDrawPlugin/twikidraw.jar JAR file
    lib/TWiki/Plugins/TWikiDrawPlugin.pm Plugin Perl module
    lib/TWiki/Plugins/TWikiDrawPlugin/source.zip Java sources
    pub/Plugins/TWikiDrawPlugin/twikidraw.jar JAR file
    pub/Plugins/TWikiDrawPlugin/example.gif Example file
    pub/Plugins/TWikiDrawPlugin/example.gif,v Example file
    pub/Plugins/TWikiDrawPlugin/example.draw Example file
    pub/Plugins/TWikiDrawPlugin/example.draw,v Example file
    pub/Plugins/TWikiDrawPlugin/ATEXT1.gif Button image
    pub/Plugins/TWikiDrawPlugin/BORDDEC1.gif Button image
    pub/Plugins/TWikiDrawPlugin/CONN1.gif Button image
    pub/Plugins/TWikiDrawPlugin/ELLIPSE1.gif Button image
    pub/Plugins/TWikiDrawPlugin/LINE1.gif Button image
    pub/Plugins/TWikiDrawPlugin/OCONN1.gif Button image
    pub/Plugins/TWikiDrawPlugin/POLYGON1.gif Button image
    pub/Plugins/TWikiDrawPlugin/RECT1.gif Button image
    pub/Plugins/TWikiDrawPlugin/RRECT1.gif Button image
    pub/Plugins/TWikiDrawPlugin/SCRIBBL1.gif Button image
    pub/Plugins/TWikiDrawPlugin/SEL1.gif Button image
    pub/Plugins/TWikiDrawPlugin/TEXT1.gif Button image
  • Unzip TWikiDrawPlugin.zip in your twiki installation directory.
  • Add Plugins.TWikiDrawPlugin to the INSTALLEDPLUGINS variable in TWikiPreferences (or any WebPreferences? topic).
  • To test if the plugin is correctly installed, view this topic in the installation and you should see a placeholder box below. Click on it.

    Edit image

Plugin Info

Plugin Author: CrawfordCurrie?
Plugin Version: 23 Sep 2001
Change History: 23 Sep 2001: Initial version
  1 Oct 2001: Updated this text
  20 Feb 2002: Merged RobWalker?'s fixes for text attached to figures
  30 Sep 2002: Add support for URLs, EXTRA_COLORS, fixed a number of outstanding bugs
CPAN Dependencies: None
Other Dependencies: Java 1.1 enabled browser
Perl Version: 5.0
Java Version: 1.1
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/TWikiDrawPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/TWikiDrawPluginDev

Related Topics: TWikiPreferences, TWikiPlugins

  • TWikiDraw? is based on Erich Gamma's JHotDraw 5.1. (JHotDraw is copyright 1996, 1997 by IFA Informatik and Erich Gamma, erich_gamma@acm.org . It is hereby granted that this software can be used, copied, modified, and distributed without fee provided that this copyright notice appears in all copies. )
  • TWikiDraw? uses ACME Labs' GifEncoder to convert a drawing into a GIF file format. (GifEncoder is Copyright (C)1996,1998 by Jef Poskanzer, jef@acme.com . All rights reserved. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. )
  • TWikiDraw? uses some ideas of KmWiki drawing applet.
  • TWikiDraw?: Copyright 2000 by Peter Thoeny, Peter@Thoeny.com. It is hereby granted that this software can be used, copied, modified, and distributed without fee provided that this copyright notice appears in all copies.
  • Modifications Copyright (C) 2001 Motorola. All Rights Reserved.
  • PeterThoeny created TWikiDraw based on above software:
    • TWikiDraw applet that allows you to save a drawing as a .draw and a .gif file. (Save calls the TWiki upload script)
    • New %DRAWING% variable to insert a drawing into any TWiki topic. (defined in wikicfg.pm )
    • New oopstwikidraw.tmpl template that contains the TWikiDraw applet.
  • CrawfordCurrie? made a number of improvements, including porting to the 2001 release.
  • RobWalker? fixed a couple of related bugs noted below. The approach to these seems correct, although the fix implementation could possibly be done better * if a connected text figure were added to a shape figure, and the pair were then duplicated, the text figure in the copy did not appear in same relative location as the original * if a selection of figures included both the shape and it's connected text, moving by cursor key or drag cause the relative text location to change incorrectly * if a composite figure included a shape and it's connected text, moving the composite figure cause the relative text location to move incorrectly * also added a "clean" and "run" step to the Ant build to aid in development

Attachment: sort Action: Size: Date: Who: Comment:
example.draw action 27996 16 Mar 2003 - 22:37 JohnGordon TWikiDraw? draw file
example.map action 437 16 Mar 2003 - 22:37 JohnGordon TWikiDraw? map file
example.gif action 10077 16 Mar 2003 - 22:37 JohnGordon TWikiDraw? GIF file

 
 
© 2003-5 blueDonkey.org, except where otherwise noted. All rights reserved.