This tool provides a basic GIF editor as a viewer within the JBuilder IDE. It appears as the "Design" tab in the content pane when viewing a GIF image. A preview panel appears in the structure pane. The size of the image is shown in the header of the preview panel, while the current pixel location is shown in the status bar.
Several toolbars let you manipulate the image.
| Icon | Purpose |
|---|---|
| Rotate the image 90 degrees in an anticlockwise (counter-clockwise) direction. Note: this does not work for non-square images in JBuilder 4. | |
| Rotate the image 90 degrees in a clockwise direction. Note: this does not work for non-square images in JBuilder 4. | |
| Flip the image along its horizontal axis so that top becomes bottom and vice versa. | |
| Flip the image along its vertical axis so that left becomes right and vice versa. | |
| Move the image one pixel up and to the left. | |
| Move the image one pixel up. | |
| Move the image one pixel up and to the right. | |
| Move the image one pixel to the left. | |
| Move the image one pixel to the right. | |
| Move the image one pixel down and to the left. | |
| Move the image one pixel down. | |
| Move the image one pixel down and to the right. | |
| Magify the image in the grid to double its previous size. | |
| Contract the image in the grid to half its previous size. | |
| Save any changes to the underlying file. | |
| Discard any changes and revert to the last saved image. | |
| Change the dimensions of the image - details outside the new boundaries are lost. | |
| Display this file. | |
| Drag the entire image to a new position - details outside the image boundaries are lost once you drop the image in its new position. | |
| Cut the selected area to the clipboard, replacing it with the background colour. | |
| Copy the selected area to the clipboard. | |
| Paste the contents of the clipboard into the selected area, clipping any image outside that area. | |
| For the following tools, you can use the left mouse button to draw in the foreground colour, or the right one to draw in the background colour. | |
| Draw individual pixels in the current colour - you can drag to colour multiple pixels. | |
| Make the colour from the selected pixel the current colour. | |
| Replace the colour clicked on, and all connected pixels of the same colour, with the current colour. | |
| Drag to draw a line in the current colour. | |
| Drag to draw an oval in the current colour. | |
| Drag to draw a rectangle in the current colour. | |
| Drag to draw a rounded rectangle in the current colour. | |
| Drag to draw a filled oval in the current colour. | |
| Drag to draw a filled rectangle in the current colour. | |
| Drag to draw a filled rounded rectangle in the current colour. | |
| Within the selected rectangle, replace all occurrences of the foreground colour with the background colour. | |
![]() |
Select the colour to use for drawing. The first button represents the foreground colour, while the second button is the background. Click the buttons to bring up a colour chooser. Press the button on the Transparent tab to make the foreground or background colour transparent. You can also use the Dropper tool to select an existing colour from the image. |
| Swap the foreground and background colours. | |
You can create a new GIF image by going to File | Open File and entering a new filename with a ".gif" extension. Then open up this viewer and create your new image, resizing as necessary.
To install the editor, just copy the *.jar file to the JBuilder/lib/ext directory, the *Doc.jar file to the JBuilder/doc directory, and restart JBuilder.
Portions of this code come from the JIconEditor component described by Claude Duguay in his February 2000 JavaPro article.
Writing out the GIF image uses the GIF encoder from Acme Java (http://www.acme.com/java/).
Version 2.1
Written by Keith Wood (kbwood@iprimus.com.au).