Apprisant Logo
List of Examples

The toolkit contains a number of example programs, each illustrating a single concept or configuration. The tables below describe the programs.

Basic Example
BasicEx A basic example that reads display elements and renderers from XML files, and does not use data objects. Many of the other examples build on this basic program.
Rendering
MultiPassEx Uses multi-pass rendering, and paint and style values from the StyleCatalog.
LargeScaleEx Shows the use of scalable and non-scalable renderers with large scaling values.
LayersEx Implements layers in the diagram by enabling and disabling renderers.
BoundsRenEx Demonstrates the BoundsRenderer.
AlignmentEx Demonstrates renderer alignment and also uses a renderer plugin.
TransformEx Shows aligned and rotated text.
AlignSamplerEx Shows a variety of bounds alignment and transform examples.
BoundsSamplerEx Shows several examples of BoundsRenderers with alignments and transformations.
GradientRenEx Shows a percentage gradient on a renderer.
IconRenEx Shows an IconRenderer with an application Icon class and a renderer plugin to configure the Icon instance for each element.
Runner Uses a FormattedTextRenderer with font size and color directives and line wrapping.
Data Modeling
DataPropertyEx This example expands on BasicEx by adding data objects.
DataPosEx Like DataPropertyEx but the data objects also contain the element positions which can be accessed directly by the renderers.
DataAttributeEx Like DataPropertyEx but uses a data object class that implements the toolkit's DataObject interface rather than using property accessor methods.
DataModelEx An example data model class with data objects; used with some of the Element Model examples. This class is not executable.
DataObjectEx Like DataPropertyEx but uses collections of data objects rather than a data model and adds them to the element model through the element model's API.
CustomKeyEx Like DataPropertyEx but using custom key objects and a key converter to convert the keys read from the elements file to instances of the key class.
Element Model
ElementPropertyEx Has a custom display element class with property accessor methods to make data values available to the renderers, and an element factory to instantiate the custom elements.
ElementAttributeEx Similar to ElementPropertyEx except the display element class overrides GeneralElement's update method to set display attributes.
CounterEx Shows the use of selection tags on arrowheads to increment a counter, and a display element class that manages the counter.
LayoutEx A simple example of a layout class that positions elements as they are added and updates the layout as they are removed.
BoundsLayoutEx An enhancement of LayoutEx to position the display elements based on the sizes of their graphics.
LayoutToSizeEx Uses a layout class to reposition the elements when the diagram's size changes.
ModelEx Another implementation of LayoutEx using a custom element model that extends BasicModel to add data handling capabilities.
NestedLayoutEx An example of a nested layout with a custom layout manager, a hierarchical element class that positions its children, and a renderer plugin.
View
ViewBasicEx Defaults all view parameters, allowing the diagram to calculate its size automatically.
ViewRectEx Sets the view rectangle explicitly to determine the diagram's size.
ViewAnchorEx An example using an anchor point to anchor the diagram to one corner of the window.
ViewPrefSizeEx Shows the use of the diagram's preferredSize property to set the initial size of the diagram.
ViewRectFlipEx Demonstrates a negative Y scale with an explicit view rectangle.
ViewAnchorFlipEx Demonstrates a negative Y scale with an anchor.
ViewAutoEx Shows dynamic behavior with default view parameters as elements are added to the model.
ViewSetSizeEx Demonstrates changing the view rectangle on a button click.
ZoomElementEx Demonstrates zooming on an element.
ZoomMouseEx Demonstrates zooming on a mouse click.
Selection
SelectionListenerEx An example with a selection listener that prints information from the selection events.
TagSelectionEx Shows how to use tagged selection areas.
SelectionShapeEx Demonstrates the use of a display element property to select background areas without rendering them.
Other Diagram Features
BgGradientEx Like BasicEx except with a choice of background gradients.
PrintDialogEx A print example that uses the PrintJob model with a print dialog.
PrintAttrEx A print example that uses the DocPrintJob model. The code can be modified to try other orientations and margin values.
HeadlessEx Shows how to write a diagram to an image file.
DiagramFileEx Shows how to read a diagram file saved in Geo.
Framework
ConverterEx Shows how to write converter classes and register them in the renderer file.