JHotDraw 5.3 changes (29.6.2001 by MrFloppy)
- SelectionFigure is now an interface. The default implementation org.jhotdraw.standard.StandardSelectionFigure
- A FigureSelectionListener interface has been introduced in org.jhotdraw.framework. An DrawingEditor
is now a FigureSelectionListener and the signature for all selectionChanged() methods has been
changed to figureSelectionChanged().
- org.jhotdraw.util.Command is now an interface. A AbstractCommand can be found in org.jhotdraw.standard.
- All commands used to have a fView field. This has been moved to org.jhotdraw.standard.AbstactCommand
- A org.jhotdraw.standard.StandardDrawingView has now a paintComponents() method instead of a paint()
and update() method. This allows the org.jhotdraw.util.FloatingTextField to be a javax.swing.JTextField
instead of a java.awt.TextField.
- org.jhotdraw.figures.AbstractLineDecorator has been missing
- DrawApplet, DrawApplication and derived classes are now programmed towards the DrawingView interface
instead of using StandardDrawingView. That leads to occasional cast when some additional StandardDrawingView
functionality is required in some specialized cases. Applications that were derived from DrawApplication
and used to override the createContents() methods should now return a DrawingView as well
Release Notes Version 5.2
Note: This version requires Swing/JFC 1.1
The purpose of this release is to:
- Use Swing/JFC GUI elements instead of AWT (where possible)
- Support for special Swing/FC features:
- Support for Multiple Document Interface (MDI) applications with several
internal frames has been added. org.jhotdraw.contrib.MDI_DrawApplicationis
the base class which must be subclasses to takeadvantage of managing internal
frames. All examples are now derived from this class.
- Support for applications with splitted editor windows by deriving
the drawing application from org.jhotdraw.contrib.SplitPaneDrawApplication
- Drawing windows have scrollbars
- Popup menus are available for additional functionality and control
over graphical figures when using org.jhotdraw.contrib.CustomSelectionTool
- Toolbars can have different tools depending on the context of the
currently selected figure and tool
- A new composite figure is available which delegates its graphical
representation and figure attributes to another figure. Moreover, it canbe
configured with an external layout algorithm that contains the logic forhow
to lay out the child elements of the composite figure. The new compositefigure
is org.jhotdraw.contrib.GraphicalCompositeFigure and can be configuredby a
class implementing org.jhotdraw.contrib.FigureLayoutStrategy such asorg.jhotdraw.contrib.StandardFigureLayoutStrategy.
- New org.jhotdraw.util.StorageFormats that allow to add new file formats
for storing and restoring drawings (e.g. using XML)
- Build configuration for Ant
, which can be used to compile all standard JHotDraw classes, to packagethem
into a jar file and to generate javadoc information. Some instruction how
to compile and build JHotDraw can be found here
.
- Some minor bug fixes
Release Notes Version 5.1
Changes for this release:
- the delegation based event model is used to track figure changes.The
FigureChangeListener interface supports to observe figure changes.A FigureChangeListener
receives FigureChangeEvents.The old mechanism based on Observer/Observable
and the notion of a containerwas eliminated. A figure now onlyhas listeners.
There is a new support class FigureChangeEventMulticasterto manage the listeners.
Using listeners is more consistent with the AWT/JFCevent handling style.CompositeFigure,
Decorator, ConnectionFigure, and Drawingare now FigureChangeListeners.
- StandardDrawing is a CompositeFigure. It is possible to inserta StandardDrawing
as a figure into a drawing. This change does notimpact the framework package.
The Drawing interface is independentof CompositeFigure.
- Tools no longer receive the DrawingView as an argument, but storeit
in an instance variable. Existing Tools have to be adapted accordingly.
- SelectionTool is more open for customization. The trackers to be used
for thedifferent selection modes can be overridden by the factory methods
createHandleTracker, createDragTracker, createAreaTracker. The MouseTracker
class was merged into AbstractTool and could be eliminated.
The selection tool to be used in an application can be customizedby overridding
createSelectionTool in DrawApplication/DrawApplet.JavaDrawApp illustrates
how to use a customized selection tool thatcan handle double clicks on figures.
- DrawApplication supports keyboard short cuts for the common operations.
Release Notes Version 5.0
Note:This version requires JDK 1.1.
The purpose of this release is to:
- use JDK1.1 features: event model, access to resources, serialization,
scrolling, printing, cursors etc.
- improve the packaging structure.
- improve the support for connectivity.
- implement several minor improvements.
JDK1.1 features
Event Model
All event handling related classes use the JDK1.1 event model.This required
to change some method signatures to refer to morespecific events. Returning
a boolean to indicate the consumptionof an event was removed.
Serialization
This version supports to use of serialization to make adrawing persistent.
org.jhotdraw.applet.DrawApplet andorg.jhotdraw.application.DrawApplicationsupport
both the oldstorable and the serializable format. Support for thestorable
formatwill be removed in the next version.
Serialization is used in the default implementation of Figure.clone().
StandardDrawingView supports serialization.
Resource Access
Thanks to 1.1 the access to resources could be drastically simplified.All
the resources are now accessed relative to classes.The images directory with
standard images is therefore part of thepackage hierarchy.
IconKit could be decoupled from DrawingEditor and was moved fromorg.jhotdraw.standard
to org.jhotdraw.util.Refer to the sample applications for how toload and access
resources like images.
Various UI Features
- Tools support to use tool specific cursors.
- org.jhotdraw.application shows the DrawingView by default in a ScrollPane.
There is a new method createContents that can be overridden to customizethe
default arrangement. The default size of the view can be customized byoverriding
getDrawingViewSize().
- org.jhotdraw.application supports to print a drawing.
Packaging
The packaging was changed to separate the framework interfacesfrom default
implementations.
The framework package defines the coreinterfaces and leaves default implementations
to the standard package.All key abstractions of the framework are now defined
as interfaces.Ward Cunningham has suggested this some time ago and it ended
upto be natural and logic evolution.
The implementation of the framework interfaces comes in two flavors.Abstract
classes like AbstractFigure, provide default implementationbut still need
to be subclassed. Standard classeslike StandardDrawing implement aframework
interface and can be used as is.
The framework package was renamed to "framework" the old "fw"was due to
a temprorary bug in the used IDE:
A figures package was forked of the standard package. This packageprovides
a kit of standard figures and their related handle andtool classes.
There is a new package contrib that contains classes contributedby others.
Connectivity
Connectors were introduced to define connections between figures.A figure
can have one or more connectors. A figure creates aconnector for a specific
location connectorAt(int x, int y).A connector knows how to findthe connection
point. A connection figure keeps track of aconnector for its start and end
point.
Figure.chop() is no longer needed and was removed. Its functionalityis
subsumed by Connectors.
A set of standard connectors is provided in the standard and figurepackages.
- BoxChopConnector: finds a connection point by chopping the connection
at the figure's bounding box.
- LocatorConnector: uses a locator to find the connection point.Thisenables
to define connections at specific semantic points ona figure. Referto the
NetApp sample for an example of using them.
- ShortestDistanceConnector: finds the connection points based on the
shortest distancebetween figures.
- EllipseChopConnector: finds a connection point by chopping the connection
at the ellipse defined by the figure's bounding box.
Connectors are optionally visible and Figure has a method connectorVisibility
to turn their visibility on and off. This is used by the ConnectionToolto
highlight connection points when the mouse moves over a figure.
TextFigures can be attached to other figures. The ConnectedTextToolsupports
to create a connected TextFigure. Try it out in JavaDraw.The text figureis
connected to the Figure that is clicked when thetool is active. To position
a connected TextFigure figures can overridethe method connectedTextLocator
to return a locator.
Various Changes
- FigureEnumeration extends Enumeration to enable to iterate overfigures
without having to do a down casted in client code. Itprovides an additional
method nextFigure to get the next Figure.
- AbstractFigure was split. AbstractFigure no longer keeps track ofthe
FigureAttributes dictionary. The dictionary is now maintainedin its derived
class AttributeFigure. This change enables tocreate Figure subclasses without
having to use theFigureAttributes implementation.
- Trackers are gone. Trackerfunctionality is implemented in the Handles
themselves. In contrastto Locators they did not turn out to be reusable for
different handles.The class BoxHandleKit hides the different Handle implementation
classesfrom the API.
- BoxHandleKit provides factory methods to create Handles forcommon locations
on a figure.
- DrawingView is now an interface with a standard implementation, i.e.,
StandardDrawingView.
- Figure.clone() is implemented in a generic way in AbstractFigure.The
figure is serialized and the clone is created by resurrectingthe serialized
figure.
- Image handling was simplified and the preLoadRegisteredImagesis nolonger
necessary.
- Commands know whether they are executable ornot. They provide an isExecutable
operation to check their state.
- Name changes: ObserverFigure -> ConnectionFigure, LineConnectionFigure
->LineConnection.
- There is support for transparent fill colors for AttributeFigures.
- AttributeFigre.draw() is a now a template method that callsdrawBackground()
and drawFrame(). Subclasses should overridethese methods instead of draw().
- The signature of Handle.invokeStep() and Handle.invokeEnd() was changed
to:
public void invokeStep (int x, int y, int anchorX, int anchorY, DrawingView view) {
public void invokeEnd (int x, int y, int anchorX, int anchorY, DrawingView view) {
The passed arguments correspond to the current point and the anchor point
of the interaction.
The old signature are still supported but deprecated.
- Doug Lea implemented a nice PolygonFigure with its corresponding Handles
and Tools. Check it out in JavaDrawApp.
- ElbowHandles support to adjust elbow connections.
Samples
- the samples are now located in subpackages of samples.
- there are two new samples:
- Nothing implements a minimal application/appletthat can be used
as the starting point for your own applications.
- NetApp is a simple editor with nodes and connections. Itillustrates
LocatorConnectors.
Converting
- If you derived classes from Handle, Tool, Locator you have to change
them to inherit from their corresponding Abstract class.
- Change your tool classes to no longer return a boolean fromevent handling
methods.
- Change the event handling method to use a specific event, typically
a MouseEvent.
- Import the figures package if you use figures provided by this version.
- Tools should call editor().toolDone() instead of editor().setDefaultTool.
- Add the serival version stuff to your figure classes.
Change Log
Version 4.0
-
added pattlet slides that are referenced from javadoc.
-
restricted visibility of the classes provided by org.jhotdraw.standard.
-
generalized the start and end points of PolyLineFigures to a LineDecoration.
Note:this breaks the loading of pre 4.0 drawings.
-
LineFigures are now implemented based on PolyLineFigures
-
some UI tweaks related to the look of handles.
Version 4.0a
-
javadoc documentation.
-
features
-
support for cursor keys to move figures
-
support for snap to grid: ToggleGridCommand, DrawingView.setGrid();
-
alignment commands to align (top, centers, bottoms, left, middle, rights)
AlignmentCommand
-
resizable ImageFigures. The ImageFigures use the IconKit to share images.
Images are currently stored by saving a reference to their
image file. The file names are relative to the user.dir
property.
-
org.jhotdraw.util.Geom: geometrical utilities.
-
class RectLocators: useful locators for rectangle locations.
class RectTrackers: useful trackers to manipulate rectangle locations.
-
Major rewrite of Connections.
-
connectivity support is implemented based on an ObserverFigure
interface.
-
ConnectionTool supports the creation and manipulation of
connections (splitting/joining segments). ConnectionTool
takes a prototype of the connection to be created.
-
eliminated AnchorFigure. Its only purpose was to add
ConnectionHandles.
-
Connection support moved from the standard to the framework package
-
ConnectionTrackHandle changed to ChangeConnectionStartHandle and
ChangeConnectionEndHandle. These two handles enable to change
the start/end point of a connection.
-
ConnectionHandle takes the prototype of the connection to be
created as parameter.
-
ConnectionFigure.canConnect(Figure source, Figure target)
to constrain the connection between figures.
See the PertDependency for an example for how to use this.
-
fixed naming inconsistencies in all signatures.
-
anchor was changed to start
-
target was changed to end
-
eliminated Figure.connectionStartPoint, connectionEndPoint
the new connection infrastructure made them obsolete.
-
Figure is now an interface and no longer an abstract class.
AbstractFigure provides default implementations for the
Figure interface. If you defined your own figures you have to change the base class
from Figure to AbstractFigure.
-
eliminated: org.jhotdraw.applet.AppletIconKit and
org.jhotdraw.application.StandaloneIconKit
The functionality of these subclasses is now part of
the DrawingEditor interface
-
IconKit
-
added FigureContainer.forceUpdate() such that a figure
can force a repair of its image immediatly.
-
added transient variable modifier were appropriate
-
DrawingView: added support for additional background and
foreground layers. A layer implements the Painter interface.
-
Replaced ScribbleFigure with a more general PolyLineFigure. A PolyLineFigure
has an optional LineDecoration at its start and end.
-
packaging
-
moved Animatable from standard to util
-
moved BouncingDrawing, Animator, AnimationDecorator from standard to
javadraw
-
changed Transformer to Tracker and Transformer.transform() to Tracker.track()
Version 3.8
-
added Drawing.orphan() to fix grouping bugs related to connectivity
-
added Drawing.replace().
-
added FigureDeletedEvent, FigureChangedEvent. Deliver more
specific update notifications.
Version 3.6
-
add Figure.decompose(), Figure.isMoveable() (to fix connection and grouping bugs)
-
Figure subclasses now have to implement basicDisplayBox instead of
displayBox. DisplayBox is a template method that factors the
common displaybox logic.
-
applet package: provides base infrastructure for applets
Common applets now derive from JavaDrawApplet
-
application package: provides base infrastructure for applications
Common applications now derive from JavaDrawApplet
Version 3.4
-
make reverse iterator package private
-
introduced an Animatable interface
remove animation methods out of basic Drawing
-
GroupFigure propagate setAttribute to figures
-
make locators, transformers sharable, don't have to override constructors
-
CommandMenu return false if not handled by a command
-
Merged DrawWindow & Draw
-
Figure.handles() is now an abstract method
-
nuked the HandleKit stuff
-
Name Changes
- DrawApplet -> Draw
- package framework -> fw
- DrawingReader/DrawingWriter -> Reader/Writer
- DrawWindow -> Draw
- cloneFigure -> clone
- readWith/writeWith -> read/write
-
New
- PertFigure
- Selectiontools support selections with a rubberband
- DuplicateCommand
- FigureAttributes class