Tensegrity Graph Framework

Table of Contents

About This Manual
Overview
Notation
Symbols
I. Creating and Modeling Graphs
1. Graph Basics
Graphs
Nodes and Edges
Directed And Undirected Graphs
Graph Types and Terms
Graph Visualization
Model View Controller (MVC)
Single Model - Multiple Views
The MVC Pattern
Notifying views about model changes
Graph Model
Interface GraphObject
Interface Node
Interface Edge
Interface Port
Interface GraphObjectContainer
Interface Graph
Factories
Creating a Graph Model
Graph View
VisualGraph Interfaces and Classes
Interface VisualGraphObject
Interface VisualNode
Interface VisualEdge
Interface VisualPort
Interface VisualGraphObjectContainer
Interface VisualGraphView
Interface GraphViewFactory
Creating a VisualGraph
Adding and Removing View Objects
Graph Controllers
Info Objects
Subgraphs
Graph Abstraction Layer
GraphObject IDs
Modeling Rules
GraphObjectRule
NodeRule
EdgeRule
Graph Rule
Rule Registry
Relations and General Use
Modelling Handlers
Handlers and Handler Registries
Summary
2. Composites
Scales
Interface Scale
Coordinate Systems
Interface CoordinateSystem
Pooling
Primitives
Interface Primitive
Primitive Implementations
Polygon2D
Composite Interfaces
BaseComposite Interface
Composite
CompositeLine
CompositeView
Creating a Simple Composite
Composite Groups
BaseCompositeContainer
CompositeGroup
CompositeTable
3. Elements
Introduction
Geometries
GeometryItem
GeometryDescriptorItem
Interface GeometryDescriptor
Definition of a polygon
Example for a GeometryDescriptor definition
Styles
Formats
StyleItem
StyleDescriptorItem
StyleDescriptor
Rules
GraphObjectRule
NodeRule
EdgeRule
GraphRule
Elements
Creating an Element
Tutorial
Separate into basic shapes
Define GeometryItem
Define the GeometryDescriptor
Define the Style Items
Create the StyleDescriptor
Combine Style and Geometry
4. Layout
Overview
High-Level Layout Controlling
LayoutController
Predefined Layout Controllers
Custom LayoutController
Performing A Layout On A VisualGraph
Layout Component Interfaces
Interface Layout
Interface NodeLayout
Interface EdgeLayout
Interface Layoutable
Interface LayoutableNode
Interface LayoutableEdge
Custom Layout Class Implementation
Layout Implementation Classes
Hierarchical Layout
Energy Layout
Circular Layout
Tree Layout
Orgchart Layout
Edge Layout
5. Attributes
Attribute Definition
Attribute Definition
AttributeType
Restrictable Attributes
Cloning an Attribute
Attribute Collections
The Attribute Package
Nesting An AttributeCollection
Traversing Attribute Trees
AttributeCollection Searching And Removing
Restrictions For Attribute Collections
Attribute-Related Exceptions
Default Attribute Implementation
Mutable And Immutable Attributes
Constructing an Attribute via Factory
Constraints
The Purpose Of Constraints
Restricting Values And Types
Adding New Custom Constraints
Restrictable Interface
Summary
II. Creating User Interfaces
6. Fundamentals
Application and ApplicationFrame
Application
ApplicationFrame
Components and Containers
Interface BasicComponent
Container
Documents
Interface Document
GraphDocument
MDIComponent
Attribute Editor
AttributeTable
AttributeTree
AttributeEditorStateManager
AttributeEditorProperties
Custom Attribute
Default Editor and Renderer Components
Navigator
CompositeNavigator
CompositeNavigatorProvider
Internationalization (I18N)
UIItem
UIManager
Language Update
Example
Summary
7. GUI Elements
Components
AttributeEditor
Navigator
SlidePanel
Containers
Injecting User-Defined Containers
Document Implementation Classes
SwingMDIComponent
Defining the Container Layout
Injecting Custom Containers
Toolbar
Adding ToolBars
StatusBar
8. Conflict Handling
Basics
Why conflict handling?
Conflict Resolution
Conflict Situations
Conflict Types
Style Name Conflicts vs. Attribute Conflicts
Definition Dependencies
Automatic Conflict Handling
Conflict Resolving Dialogs
Open Document or Definitions Conflict
Insert Element Conflict
III. Creating Applications
9. Introduction
Main classes
A Swing-based Example
A SWT-based Example
Application Customization
Application Icon
Replacing the Splash Screen
10. Application Initialization
Launch Tasks
Customizing a LaunchTask
LaunchTask Order
11. Commands
Command and BaseCommand
Predefined Commands
Independent Windowing Toolkit Commands
Swing Commands
SWT Commands
Creating Custom Commands
Excluding Default Commands
12. Preferences
Preferences
PreferenceDialog
A Basic Set
Setting up a preferences.xml file
Application Integration
Initialization
Registering Listeners
Saving
Preference Utilities
13. Application Help
Custom Application Help
HelpSet File Creation
Setting up a Map
The TOC and the Index
Context sensitive Help
Enabling Search
IV. Under The Hood
14. Renderer and Device
Interface Renderer
RendererConfiguration
RenderingData
RendererChain
Illustrator
Device
Interface Device
15. Exception Handling
Runtime Exceptions
Static Exceptions
16. Efficient Containers
Class CombinedCollection
Design Considerations
Primitive Containers
Available Operations And Their Performance Costs
Arraylist Usage Examples
Fast Multiple Value Lookups
ArrayList Size And Capacity
Iterators
17. The Math Sub-API
Using Polynomials
Solving Linear Equations
Using Class Transform2D
Properties Of Affine Transformations
18. Persistence
XMLStreamWriter and XMLStreamReader
Colors
Serializer and Builder
Serializing Composite Objects
Building Composites
19. Infrastructure
Undo/Redo Support
Undo/Redo Of Programmatic Changes
Clipboard Support
Clipboard Methods
Cut And Copy
Paste
Special Paste Methods
Auxiliary Methods
20. Utility classes
Class CommandLine
Class IndexMap
Class KeyStroke
Observer & Observable
Patternmatcher
StableHashMap & StableHashSet
Timer
21. Composite Utilities
Transformations
Matrices and Compositions
Composite Hierarchies
A. Debugging
Debug Flags
Assertions
Assertions in the Tensegrity Graph Framework
B. Performance Guide
Tuning Expensive Operations
Adjust Renderer Configurations
Bulk Modifications
Do's and Don'ts
C. Graph Utilities
Graph Algorithms
Helper And Utility Methods
Class VisualOperations
GraphOperations
D. Preference Tables
Conflict Handling
Definition Embedding
E. Directed and Undirected Graphs
Theory
Practice
F. Ports
Assigning ports
G. Listings
Complete Composite Layout Example
A Simple Graph Document
A Custom Table Header Visualizer
H. FAQ
I. Revision History
Bibliography
Glossary
Index

List of Figures

1.1. Example Graph
1.2. Classdiagram Graph View - Composite Associations
1.3. VisualGraphObjects
1.4. Graph Objects
2.1. Class Diagram Primitive
2.2. Structure of the Composite
2.3. Class Diagram BaseComposite
2.4. Class Diagram CompositeLine
2.5. Class Diagram CompositeView
2.6. An arrangement of Composites in a Composite View
2.7. Class Diagram BaseCompositeContainer
2.8. Screenshot CompositeTable
3.1. Structure of a Geometry
3.2. Font Dialog Box
3.3. Paint Dialog
3.4. Stroke Dialog
3.5. Transducer
3.6. Parts of the Transducer
3.7. Screenshot Transducer
5.1. Class Diagram AttributeCollection
5.2. Class Diagram Constraint
6.1. Class Diagram BasicComponent
6.2. Class Diagram Container
6.3. Class Diagram Document
6.4. AttributeTable Category
6.5. Class Diagram UIManager
7.1. Screenshot SwingAttributeTable
7.2. Screenshot SwingAttributeTree
7.3. Screenshot from a SwtAttributeTree
7.4. Screenshot from a SlidePanel
7.5. Class Diagram Container
7.6. Layout Constraints
9.1. HelloWorld Screenshot
10.1. Class Diagram LaunchTask
12.1. Screenshot PreferenceDialog
13.1. Merged TOC
14.1. Sequence Diagram Rendering
14.2. Classdiagram Renderer
18.1. Persistence Writer and Reader
18.2. Serializer and Builder
20.1. Classdiagram Observer Pattern
21.1. A Simple Composite Hierarchy
21.2. A Simple Composite Hierarchy
E.1. Directed Graph
E.2. Directed Graph that behaves like an undirected instance
E.3. Undirected instance of the original directed graph

List of Tables

1.1. Object naming
1.2. View - Composite Associations
1.3. Info Objects
2.1. Events and Listeners
3.1. Repository Files
3.2. Custom Attributes Definition
4.1. LayoutController Classes
4.2. Node Layout Contexts
4.3. Edge Layout Contexts
5.1. Attribute exceptions
5.2. Constraint elements
6.1. Default Renderers and Editors
15.1. Exceptions extending DynamicException
16.1. Primitive-type Array Lists
16.2. Primitive-type Linked Lists
16.3. Cost of arraylist operations
18.1. Color definition
B.1. Tuning options
C.1. Graph Algorithms
D.1. Insert Element Conflicts
D.2. Open Definition Conflicts
D.3. Embedding Options
D.4. Settings for "Loss of Data" warnings
I.1. Document Revision History

List of Examples

1.1. Assembling a simple graph
1.2. Assembling a simple graph (2)
1.3. Assembling A Simple VisualGraphView
1.4. Adding VisualNodes and VisualEdges
1.5. Removing VisualNodes and VisualEdges
1.6. Traversal of nested Subgraphs
1.7. Traversal of nested VisualSubgraphs
2.1. Creating a Simple Table
3.1. Structure of geometry and style descriptors
3.2. GeometryItem for rectangle with rounded edges
3.3. Complex GeometryDescriptor
3.4. Minimum StyleItem
3.5. StyleItem with a black-and-white right-to-left gradient fill
3.6. Minimal StyleDescriptorItem
3.7. Definition of a NodeElement
3.8. Line GeometryItem
3.9. Line GeometryItem
3.10. Several Geometry Items
3.11. GeometryDescriptor for the Transducer
3.12. Style Items for the Transducer
3.13. StyleDescriptor for the Transducer
3.14. StyleDescriptor for the Transducer
3.15. Getting the Transducer Composite
4.1. Implementation of a LayoutController.
4.2. Rundom Layout.
5.1. Cloning An Attribute
5.2. Constructing an AttributeCollection and nested Attributes.
5.3. Constraint Pooling
5.4. Clearing the Constraint pool
5.5. Verifying
5.6. Custom Constraint Registration and Use
6.1. Switch resources at runtime
7.1. SwingAttributeTable Creation
7.2. SwingAttributeTree Creation
7.3. Creating a SwtAttributeTree
7.4. Creating a SlidePanel with 2 nested SlidePanels
7.5. Creating and populating nested SWT SlidePanels:
7.6. Custom Container
7.7. Configuring Container Layout
7.8. Specifying a Layout Constraint for a Custom Container
7.9. Overriding getToolBars() method
7.10. Fill the additional ToolBars
7.11. Overriding getStatusBar()
7.12. Overriding getStatusBar() Method
9.1. A minimal SwingApplicationFrame implementation
9.2. HelloWorld main
9.3. A minimal SwtApplicationFrame implementation
9.4. SWT HelloWorld main
10.1. Adding a Custom Menu
11.1. Implementing a Custom Command
11.2. Encapsulation of command instance creation
12.1. An example preferences.xml file
12.2. Code excerpt loadPreferences()
12.3. Code excerpt setPreferences()
12.4. Registering a PreferenceListener
12.5. Saving Preferences
13.1. Excerpt from helloworld.hs
13.2. Excerpt from map.jhm
13.3. File toc.xml of HelloWorld
13.4. File toc.xml of the Skeleton
13.5. File index.xml of the HelloWorld Application
16.1. CombinedCollection Usage
16.2. Extremely fast array searching using binary Search
16.3. Appending to an array efficiently
16.4. Appending to an array efficiently (again)
16.5. Iterating through an arraylist
17.1. Using and solving polynomials
17.2. Solving a system of linear equations
17.3. Rotating a point around an arbitrary axis
18.1. Sample AttributeList
18.2. XML Output of the Sample AttributeList
18.3. Non-String value as Attribute
18.4. XML Output of the Sample AttributeList (2)
18.5. Sample Type Definition
18.6. Sample AttributeList with ScalableFactor instances
18.7. XML Output of the AttributeList with a custom type
18.8. XMLReader Attribute creation
18.9. Restoring objects from String
18.10. Writing the XML file
18.11. Tensegrity Graph Document XML Fragment
20.1. Making use of the CommandLine class:
20.2. IndexMap Code Fragment
A.1. Assertions in the Generics API
B.1. Bulk Modification
E.1. Model Representation of a Graph
E.2. Memory representation of a directed graph
E.3. Traversing a directed graph
E.4. Traversing a undirected graph
F.1. Reassigning a Port
G.1. Complete Layout Example
G.2. A Simple Graph Document
G.3. A Custom Table Header Visualizer
H.1. Geometric attributes of a VisualNode
H.2. Geometric attributes of a VisualEdge
H.3. Temporarily Disabling Loose Object Rule For A VisualGraphView
H.4. Temporarily Disabling Loose Object Rule For A VisualSubgraph