/yfiles-for-java-swing-demos

The source code demos for the yFiles for Java Swing diagramming library

OtherNOASSERTION

yFiles for Java (Swing) Programming Samples

This repository contains source code demos and tutorials that use the commercial yFiles for Java (Swing) software programming library for the visualization of graphs, diagrams, and networks. The library itself is not part of this repository.

yFiles for HTML

Running the Demos

For most of these demos equivalent ones based on yFiles for HTML are hosted online here for everyone to play with. Developers should evaluate the library, instead. The evaluation version also contains these demos and the necessary library to execute the code.

This folder and its subfolders contain demo applications which make use of the different features of yFiles for Java (Swing).

Demo Description
SimpleEditor A graph editor which demonstrates the editing features of yFiles for Java (Swing).
OrgChart View and manipulate an organization chart.
RotatableNodes Shows how support for rotated node visualizations can be implemented on top of the yFiles library.
BPMNEditor Business Process Diagram sample application.
HierarchicGrouping Organize subgraphs in groups and folders and interactively expand and collapse them.
IsometricDrawing Displays graphs in an isometric fashion to create an impression of a 3-dimensional view.
LogicGate An editor for networks of logic gates with dedicated ports for incoming and outgoing connections.
CollapsibleTree Interactively collapse and expand subgraphs.
AggregateGraphWrapper Analyzing a graph by aggregating groups of nodes.
TableEditor Interactive creation and editing of tables.
Uml Interactive creation and editing of UML class diagrams.

This folder and its subfolders contain demo applications which make use of the different layout algorithms of the layout component of yFiles for Java (Swing).

Demo Description
LayoutStyles Play with the most used layout algorithms of yFiles.
HierarchicLayout Showcase of one of our central layout algorithms, the HierarchicLayout.
InteractiveOrganicLayout Use InteractiveOrganicLayout for organic layout in interactive environments.
FamilyTree This demo shows how genealogical graphs (family trees) can be visualized.
MarqueeClearAreaLayout Shows how to interactively move graph elements around a marquee rectangle in a given graph layout so that the modifications in the graph are minimal.
CriticalPaths This demo shows how to emphazise important paths with hierarchic and tree layout algorithms.
EdgeBundling Shows how edge bundling can be applied for reducing visual cluttering in dense graphs.
EdgeGrouping Shows the effects of edge and port grouping when arranging graphs with HierarchicLayout.
FillAreaAfterDeletion Shows howto fill free space in the graph after deleting nodes.
NodeTypes A demo that shows how different layout algorithms handle nodes with types.
OrganicSubstructures Shows how OrganicLayout handles substructures and node types.
PartialLayout Shows how to arrange some elements in a graph while keeping other elements fixed.
PartitionGrid Demonstrates the usage of a PartitionGrid for hierarchic and organic layout calculations.
Sankey Showcase of how a Sankey diagram can be produced by means of the HierarchicLayout.
SplitEdges Shows how to align edges at group nodes using RecursiveGroupLayout together with HierarchicLayout.
TreeLayout Demonstrates the tree layout style and the different ways in which this layout can arrange a node and its children.
TreeMap Shows disk usage of a directory tree with the Tree Map layout.
LayoutWithoutView Shows how to create a graph, run a graph analysis algorithm, and calculate a layout without using a view or the IGraph API.

This folder and its subfolders contain demo applications which use and customize the graph editing features provided by yFiles for Java (Swing).

Demo Description
CustomLabelModel Customize label placement model.
CustomPortModel Customize port location model.
CustomSnapping Enable and customize the snapping behaviour of graph items.
DragAndDrop Enable and customize the drag-and-drop support for nodes, labels and ports.
EdgeReconnection Enable and customize the reconnection behavior of edges.
Hyperlink Add hyperlink support to HTML formatted labels.
LabelHandleProvider Enable interactive rotating and resizing labels.
LensInputMode This demo shows how to use a specialized LensInputMode to display the part of the graph the pointer is hovering over in a kind of magnifying glass.
OrthogonalEdges Enable and customize orthogonal edge editing.
PopupMenu Enable and customize context menus for nodes and for the canvas background.
PortCandidateProvider Customize the ports at which edges connect to nodes.
PositionHandler Customize the movement behavior of nodes.
ReparentHandler Customize the re-parenting behavior of nodes.
ReshapeHandleProvider Implements a custom IReshapeHandleProvider .
ReshapeHandleProviderConfiguration Customize the reshape behavior of nodes.
SingleSelection Configure the GraphEditorInputMode for single selection mode.
SizeConstraintProvider Customize the resizing behavior of nodes.

This folder and its subfolders contain demo applications which illustrate the integration of yFiles for Java with different GUI frameworks.

Demo Description
JavaFXApplication Integrate yFiles for Java (Swing) in a JavaFX application.
Neo4j Demo application that shows how to integrate Neo4j into yFiles for Java (Swing).

This folder and its subfolders contain demo applications which make use of the different features of the viewer component of yFiles for Java (Swing).

Demo Description
PDFImageExport Export a graph as a PDF, EPS or EMF document.
SVGImageExport Export a graph as a SVG image.
BackgroundImage Shows how to add background visualizations to a graph component.
ClickableStyleDecorator Shows how to handle mouse clicks in specific areas of a node's visualization.
EdgeToEdge Shows edge-to-edge connections.
GraphEvents Explore the different kinds of events dispatched by yFiles for Java (Swing).
Filtering Shows how to temporarily remove nodes or edges from the graph.
FilteringAndFoldingDemo Shows how to combine yFiles filtering and folding features.
Folding Shows how to use yFiles folding feature.
GanttChartDemo Shows how to create a "Gantt chart" with yFiles for Java (Swing).
GraphCopy Shows how to copy a graph or sub graph.
GraphViewer Showcase of different kinds of graphs created with yFiles for Java (Swing).
GridSnapping Demonstrates how to enable grid snapping functionality for graph elements.
ImageExport Export a graph as a bitmap image.
LargeGraphs Improve the rendering performance for very large graphs in yFiles for Java (Swing).
LevelOfDetail Demonstrates how to change the level of detail when zooming in and out.
Printing Print a graph by using the yFiles CanvasPrintable.
RenderingOrder Shows the effect of different rendering policies to the model items.
SmartClickNavigation Demonstrates how to navigate in a large graph.
Snapping Demonstrates how to enable snapping functionality for graph elements.
Tooltips Demonstrates how to add tooltips to graph items.

This folder and its subfolders contain demo applications which make use of the different features of the styles component of yFiles for Java (Swing).

Demo Description
ArrowNodeStyle Implement sophisticated styles for graph objects in yFiles for Java (Swing).
CompositeNodeStyle This demo shows how to combine several node styles into one.
DefaultLabelStyle Shows the most important configuration options for the built-in DefaultLabelStyle class.
GroupNodeStyle Implement sophisticated styles for graph objects in yFiles for Java (Swing).
RectangleNodeStyle Implement sophisticated styles for graph objects in yFiles for Java (Swing).
ShapeNodeStyle Implement sophisticated styles for graph objects in yFiles for Java (Swing).
SimpleCustomStyle Implement sophisticated styles for graph objects in yFiles for Java (Swing).
TextWrapping Shows how to use the text wrapping and trimming feature provided by the DefaultLabelStyle class.
SVGNodeStyle Demonstrates SVG node visualizations.
JComponentStyle Arbitrary Swing components incorporated as graph elements.
ZoomInvariantLabelStyleDemo Demonstrates zoom-invariant label rendering.

This folder and its subfolders contain demo applications which demonstrate how to use the GraphBuilder classes for binding graph elements to business data in yFiles for Java (Swing).

Demo Description
GraphBuilder Demonstrates creating a graph using the GraphBuilder class.
InteractiveNodesGraphBuilder Demonstrates creating a graph using class AdjacentNodesGraphBuilder .

This folder and its subfolders contain demo applications which demonstrate some of the graph analysis algorithms available in yFiles for Java (Swing).

Demo Description
GraphAnalysis Algorithms to analyse the structure of a graph in yFiles for Java (Swing).
ShortestPath Usage and visualization of shortest path algorithms in yFiles for Java (Swing).
NetworkFlows Usage and visualization of network flow algorithms in yFiles for Java (Swing).

This folder and its subfolders contain demo applications which illustrate tasks for deployment of yFiles for Java (Swing) applications, e.g. obfuscation.

Demo Description
GradleDemo Demonstrates how to setup a basic yFiles for Java (Swing) project using Gradle.
MavenDemo Demonstrates howto setup a basic yFiles for Java (Swing) project using Apache Maven.
ObfuscationDemo Obfuscate an yFiles for Java (Swing) application via yGuard.

Tutorials

The yFiles for Java (Swing) tutorials are extensive source code samples that present the functionality of the yFiles for Java (Swing) library.

To navigate to a specific tutorial, just follow the corresponding link from the table below.

Available Tutorials

Category Description
Getting Started Introduces basic concepts as well as main features like custom styles, full user interaction, Undo/Redo, clipboard, I/O, grouping and folding.
Custom Styles A step-by-step guide to customizing the visual representation of graph elements. This tutorial is intended for users who want to learn how to create custom styles from scratch.

License

Use of the software hosted in this repository is subject to the license terms of the corresponding yFiles for Java (Swing) license. Owners of a valid software license for a yFiles for Java (Swing) version that these demos are shipped with are allowed to use the demo source code as basis for their own yFiles for Java (Swing) powered applications. Use of such programs is governed by the rights and conditions as set out in the yFiles for Java (Swing) license agreement. More details here. If in doubt, feel free to contact the yFiles for Java (Swing) support team.