create new tag
, view all tags

TWikiDrawPlugin Frequently Asked Questions.

See also TWikiDrawPluginDev


How do I install it?

Unzip over the top level of your twiki installation.

Where does it come from?

The Java code is derived from JHotDraw (see the botton of the TWikiDrawPlugin page). It has however diverged from this development stream to answer the requirements of TWiki.

-- CrawfordCurrie - 01 Oct 2002

How is it tested?

JHotDraw has no test suite (whatever happened to test-first development?) so the only way to test is to try it out. There's a test applet packaged with the zip that can help. It would be really great if someone were to add a JUnit suite.

-- CrawfordCurrie - 01 Oct 2002

Why not upgrade JHotDraw?

Later versions of JHotDraw started to use Swing and other features of Java not available in Java 1.1, which is still the baseline of most browsers. Rather than getting everyone to install plugins it's easier to keep going on Java 1.1 - which means no upgrade.

Why not show how to do it?

  • Many corporates do desktop updates. They can force standardisation of a particular version of a browser. Given this, maybe it would be useful to show how to upgrade to the versions requiring Swing even if the default bundled version did not. - MartinCleaver

How do I edit an image? Why does it work this way?

Click on the image. Being able to edit images this way feels rather "non-wiki" but it's effective and popular.

-- CrawfordCurrie - 01 Oct 2002

Note: edit is invoked in different ways now, since the introduction of image map support.

  • If your drawing has no image map, just click on the drawing.
  • If there is an image map, it can be configured so that edit is invoked using a link below the drawing, or by clicking on the boundary of the image. See TWikiDrawPlugin.

-- CrawfordCurrie - 11 Dec 2003

Is there any SVG support?

See TWikiDrawSvgPlugin.

Is there an easy way to copy portions of a drawing and paste them to another drawing?

(I guess I could download the files to my machine, view the text file (.draw), copy and paste the appropriate lines of text between the files -- any better suggestions?)

  • A: Unfortunately from the applet you are restricted to the Java clipboard. It's a major security hole to allow access to the system clipboard for a browser application so Java doesn't allow it. One way would be to download the .draw file and edit it using the command-line version of TWikiDraw which I think allows multiple files or a more recent JHotDraw which I know does. -- CrawfordCurrie

What / where is the command-line version of TWikiDraw?

(I downloaded twikidraw.zip from TWikiDrawApplet, but, from what I can tell, it still works in a browser -- maybe the files are stored locally (which would help) -- I haven't installed it yet, the installation looks a little confusing. If that is what you are referring to I will make a renewed effort to install it.)

I have downloaded and installed JHotDraw 5.1 and 5.2 and will start a Wikilearn.JHotDraw page to record my experiences. I'm not sure 5.2 will work with the TWikiDrawPlugin .draw files. 5.1 seems to work reasonably well for local editing with a few obvious differences -- word wrapping doesn't work within a label, and the background is gray which confused me a little at first.

There may be other differences, I haven't done much testing so far. I haven't yet tried a round trip (that is, editing locally and viewing on twiki.org) -- I'm hoping that if I don't disturb the word wrapping locally it will reappear when viewed on twiki.org. Update: Yes, the word wrapping does reappear (at least on a round trip to/from JHotDraw 5.1 on Windows. On JHotDraw 5.1 on Windows, the <cr><lf> characters appear as a small square block but I have not found a way to enter them in JHotDraw. In a text editor, it shows up as a "\n". On JHotDraw 5.1 on Linux, the square block does not show up. -- RandyKramer - 13 Apr 2002

If there is a command line TWikiDraw I'm hoping it may preserve the word wrapping in labels.

Can I take sketches to my machine, edit them with JHotDraw (or some other application) and then upload them again to TWiki?

Yes, see above -- CrawfordCurrie

Is JHotDraw available for Windows (and Linux)?

Yes, it's Java and is available for any platform/browser combination with Java 1.1 support -- CrawfordCurrie

Are drawings created offline with JHotDraw (or some other application) fully compatible with the TWikiDrawPlugin, or perhaps, must certain commands / tools be avoided?

Probably. I doubt it. I don't think more recent versions of JHotDraw have changed the serialisation format, though I haven't tested it. They certainly haven't widened the command set much, which is why I never bothered researching it; all they've really done is to add Swing, which IMHO is more trouble than it's worth to us, since most browsers don't support it without plugins. But you should check out the command-line version of TWikiDraw, or look at the test applet RobWalker added to the zip. -- CrawfordCurrie

Where can I get the source for this tool?

The source is all in the zip. At some point we will be moving this to the twiki plugins project CVS, but right now the zip is the right place to start. You'll need Ant from http://jakarta.apache.org/ant/ -- CrawfordCurrie - 21 Mar 2002

What is the maximum size of the canvas?

A wild guess would be +/- 2147483648. The canvas stretches automatically as you move objects off the edge of the visible area. -- CrawfordCurrie

  • Update: OK, you can stretch the canvas vertically beyond the limit I thought I ran into before -- basically use the same expanding text technique that someone described above, but stretch it vertically instead of horizontally by inserting <return>s to wrap the text. _Update: Even simpler -- just move any drawing entity so it extends below and to the right of the bottom left corner of the drawing, then save and reopen the drawing to see the expanded canvas. I think my original problems occurred because I tried to expand the canvas to the right (which works) and up (which does not work). -- RandyKramer - 17 Apr 2002

To make the drawing space larger the easiest way I've found so far is to use the text tool. Create some text, then use the little yellow expansion button to grow the font size to stretch the entire canvas. Edit drawing `canvastretch` (requires a Java 1.1 enabled browser)

You must save and quit and then reopen the drawing to see the stretched canvas. The syntax of specifiying the height and width in the %DRAWING% command does not seem to work.

If you delete the expanded text block the drawing will shrink -- put some drawing entity (a rectangle, whatever) in the lower right corner of the stretched canvas to preserve the size. When the drawing is finished this entity can be deleted if other parts of the drawing force the canvas to stay at this size, or you can convert the rectangle to be transparent (color none) and leave it there. For more information see Wikilearn.EditingATWikiDrawSketch.

What's the structure of a .draw file?

.DRAW data structure

Draw figures "attributes" "attributes" ID "FillColor" "Color" #1 #2 #3 #4 #5 "textvalue" "textfont"

TextFigure definition? definition? =1 are these IDs fixed? can they be used represent other template matches? looks like the RgB data to the right? the first 3 numbers set the color ?=199 ? =158 X coordinate =599 Y coordinates = 38 text Helvetica

Here's the draw text for the code above. [CH.ifa.draw.figures.TextFigure "attributes" "attributes" 1 "FillColor" "Color" 255 199 158 599 38 "text" "Helvetica"]

I know there are thirteen values and my table only represents 11 (building tables is tough with more than a few columns. Any chance this data could be written out in xml? Proto SVG? The new Mozilla browser is reported to support SVG natively...

I'll try drawing this table here Edit drawing `draw_domain_table` (requires a Java 1.1 enabled browser)

but unfortunately the applet did not respond again to my save and exit request.

-- DennisDaniels - 21 Mar 2002

Is there a way to specify that an old copy of a drawing be displayed?

Maybe something like %DRAWING(test ver="1.9"%?


  1. I know that as a workaround I can upload a copy of the older drawing under a different file name
  2. I'm not sure there would be a whole lot of use for such a thing, so I am not suggesting it be an RFE -- I expect my need to be temporary and occasional -- if others have similar needs??

-- RandyKramer - 20 Apr 2002

Nope. But I guess it wouldn't be too hard to do.

-- CrawfordCurrie - 21 Apr 2002

Thanks for the response! As I don't see a big demand for this, I won't list it as an RFE. If you ever run out of things to do ;-), it might be useful occasionally.

-- RandyKramer - 21 Apr 2002

Any idea what version of Java this seems to work best with?

I'm having issues with several browsers on Solaris, probably each using a different version of java. One bug seems to be that the objects in the drawing don't show up the same way with multiple edits (looks like a save issue on NS4.78.1), and the other browser (NS6.2.2) doesn't allow me to add (or edit existing) text to a diagram. I'll dig around and verify which version of Java each is using, but it seems weird...

-- PeterNixon - 11 Jul 2002

I've used it with Netscape 4.6.1, IE 5, Java 2 plugins on both. I haven't seen either of the problems you describe, though I'm aware that there's a refresh issue when you save in NS.

-- CrawfordCurrie - 12 Jul 2002

Does it work with https:?

It does now. At the moment (2 Feb 2003) only the version attached to this topic will function with https:. Watch the man TWikiDrawPlugin topic for a version more recent than this, and it will contain the fixes.

Thanks to StephenWilliams for reporting and DavidCarrel for analysing the problem.

-- CrawfordCurrie - 02 Feb 2003

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2003-12-12 - PeterThoeny
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.