Skip to content

yWorks/yfiles-for-java-swing-demos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 focus on the diagramming aspect and show how graph visualization helps in the context of a specific use-case.

Demo Description
LayoutStyles Play with the most used layout algorithms of yFiles.
BPMNEditor Business Process Diagram sample application.
OrgChart View and manipulate an organization chart.
IsometricDrawing Displays graphs in an isometric fashion to create an impression of a 3-dimensional view.
Uml Interactive creation and editing of UML class diagrams.
TagCloud Shows how to create a Tag Cloud visualization.
LogicGates An editor for networks of logic gates with dedicated ports for incoming and outgoing connections.
GraphAnalysis Algorithms to analyse the structure of a graph in yFiles for Java (Swing).
LargeGraphs Improve the rendering performance for very large graphs in yFiles for Java (Swing).
LargeGraphAggregation A demo showing smart node aggregation for drill-down exploration of large graphs.
Neighborhood Shows how to display the neighborhood of a selected node.
ChordDiagram Shows how to create a chord diagram.

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
Sankey Shows how to produce a Sankey diagram by means of the hierarchical layout.
TreeMap Shows disk usage of a directory tree with the Tree Map layout.
HierarchicalNesting Shows how to nicely expand and collapse sub-graphs organized in group.
FoldingWithLayout Shows how to automatically trigger a layout that clears or fills the space when opening or closing groups.
EdgeBundling Shows how edge bundling can be applied for reducing visual cluttering in dense graphs.
ArcDiagram Shows how to arrange and visualize a graph as an arc diagram.
MazeRouting Shows how the EdgeRouter can be used for finding routes through a maze.
EdgeLabelPlacement Shows how to place edge labels at the preferred location with a labeling algorithm.
NodeLabeling Show how to use GenericLabeling to set the positions of labels.
NodeTypes Shows how different layout algorithms handle nodes with types.
InteractiveHierarchical Shows how to enable the sketch mode of the hierarchical layout.
InteractiveEdgerouting Show EdgeRouter's ability to find and re-layout edge paths which are not yet ‘good’.
EdgeGrouping Shows the effects of edge and port grouping when arranging graphs with Hierarchical Layout.
EdgeRouterGrouping Shows how to configure edge and port grouping using the EdgeRouter.
OrganicSubstructures Shows how OrganicLayout handles substructures and node types.
FillAreaLayout Shows how to fill free space in the graph after deleting nodes.
ClearAreaMarquee 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.
NodeAlignment Shows how to automatically align nodes in rows and columns using the AlignmentStage layout algorithm.
HierarchicalGridComponents Shows how to obtain compact arrangement using grid components in the hierarchical layout.
HierarchicalSubcomponents Shows how hierarchical layout can arrange selected subcomponents of a graph with different layout styles.
TabularGroups Shows how to configure the tabular groups of the Hierarchical Layout.
CriticalPaths Shows how to emphazise important paths with hierarchical and tree layout algorithms.
CustomLayoutStage Show how to implement a custom layout stage.
SplitEdges Shows how to align edges at group nodes using RecursiveGroupLayout together with HierarchicalLayout.
LayoutGrid Shows the usage of a LayoutGrid for hierarchical and organic layout calculations.
SimpleLayoutGrid Shows how to create a simple LayoutGrid.
InteractiveOrganicLayout Shows how to use the InteractiveOrganicLayout for organic layout in interactive environments.
TreeLayout Shows the tree layout style and the different ways in which this layout can arrange a node and its children.
PartialLayout Shows how to arrange some elements in a graph while keeping other elements fixed.
PortAlignment Shows how to implement port alignment in HierarchicalLayout.
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 make use of the different features of the viewer component of yFiles for Java (Swing).

Demo Description
GanttChart Shows how to create a "Gantt chart" with yFiles for Java (Swing).
CollapsibleTree Interactively collapse and expand subgraphs.
GraphEditor A graph editor which demonstrates the editing features of yFiles for Java (Swing).
GraphViewer Showcase of different kinds of graphs created with yFiles for Java (Swing).
RenderingOrder Shows the effect of different rendering policies to the model items.
ArrangeObjects Shows simple operations for aligning and distributing nodes
Bridges Showcases the capabilities of the BridgeManager class for inserting bridges into edge paths.
EdgeToEdge Shows edge-to-edge connections.
ImageExport Export a graph as a bitmap image.
SVGImageExport Export a graph as a SVG image.
Printing Print a graph by using the yFiles CanvasPrintable.
EventsViewer Explore the different kinds of events dispatched by yFiles for Java (Swing).
Clipboard Shows different ways of using GraphClipboard for Copy and Paste operations.
GraphMLCompatibility A demo that shows how to enable backwards compatibility for reading GraphML files from version 3.x.

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

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

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

Demo Description
CriticalPathAnalysis Shows how to perform critical path analysis (CPA).
NetworkFlows Usage and visualization of network flow algorithms in yFiles for Java (Swing).

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

Demo Description
AggregateGraphWrapper Analyzing a graph by aggregating groups of nodes.
TableEditor Interactive creation and editing of tables.
RotatableNodes Shows how support for rotated node visualizations can be implemented on top of the yFiles library.
SimpleDragAndDrop Enable and customize the drag-and-drop support for nodes, labels and ports.
BackgroundImage Demonstrates interactive orthogonal edge editing where edges remain orthogonal during creation and manipulation.
Filtering Demonstrates how to hide and show graph items without changing the original graph.
FilteringWithFolding Demonstrates how to combine filtering and folding in the same application.
Folding Shows how to collapse and expand group nodes.
FoldingWithMergedEdges Illustrates collapsing and expanding group nodes while merging their edges.
GraphCopy Shows how to copy a graph or sub graph.
GraphDecorator Shows how to highlight a node or an edge when the mouse hovers over the said node or edge.
SimpleHighlightDecorator Shows how to highlight a node or an edge when the mouse hovers over the said node or edge.
ComplexHighlightDecorator Highlights nodes on hover, adapting the highlight shape to match data stored in each node's tag.
GraphSearch Demonstrates interactive orthogonal edge editing where edges remain orthogonal during creation and manipulation.
GridSnapping Shows the grid snapping feature which enables snapping graph items to grid points.
SaveAndLoadGraphML Shows how to use GraphML input and output .
CustomGraphML Shows how to read and write custom data bound to graph elements to and from a GraphML file.
LabelTextWrapping Shows how to enable the text wrapping and trimming feature provided by the LabelStyle class.
OrthogonalEdgeEditing Demonstrates interactive orthogonal edge editing where edges remain orthogonal during creation and manipulation.
RectangularIndicator Demonstrates how to apply a rectangular indicator to a graph.
SmartClickNavigation Demonstrates smart zooming and highlighting when clicking nodes or edges in large graphs.
Snapping Enables snapping (guide lines) for graph elements using GraphSnapContext .
SubdivideEdges Shows how to use a custom NodeDropInputMode for dragging nodes from a separate panel onto an edge.
Theming Shows how to add an overview component that controls the main canvas.
Tooltips Shows how to enable tooltips for graph items.
OverviewComponent Shows how to add an overview component that controls the main canvas.
FlowFiltering Demonstrates how to dynamically show or hide items in the upstream or downstream flow of a selected node.

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

Demo Description
LensInputMode 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.
Valid Begin Cursor Shows how GraphComponent updates the mouse cursor to reflect the action that can start at the current location.
Interactive Graph Structuring Shows how a graph can be restructured interactively by dragging subtrees.
Custom Edge Creation Shows how to provide directional ports and port candidates and demonstrates several customizations for the edge creation gesture.
Node Selection Resizing Shows how to implement a single set of reshape-handles for multiple selected nodes.
BorderAlignedLabelModel Shows how to implement a custom node label model to position labels around the circumference of a node.
Offset Wrapper Label Model Demo Learn how to add an adjustable offset to labels produced by another label model.
CustomPortModel Customize port location model.
CustomSnapping Enable and customize the snapping behavior of graph items.
PopupMenu Enable and customize context menus for nodes and for the canvas background.
DragAndDrop Enable and customize the drag-and-drop support for nodes, labels and ports.
EdgeReconnection Enable and customize the reconnection behavior of edges.
Label Editing Shows customizations of interactive label editing, including validation, instant typing, and custom helpers.
Custom Handle Provider Shows how to implement custom handles and an IHandleProvider.
LabelHandleProvider Enable interactive rotating and resizing labels.
Move Unselected Nodes Shows how the move unselected items input mode can be constrained, e.g. with keys or custom hit testing.
OrthogonalEdges Enable and customize orthogonal edge editing.
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.
ReshapeHandleProviderConfiguration Customize the reshape behavior of nodes.
ReshapeHandleProvider Implements a custom IReshapeHandleProvider .
Restricted Editing Demonstrates how to toggle interactive editing capabilities while still using GraphEditorInputMode for selection.
Lasso Selection Select graph elements by drawing a lasso.
Marquee Node Creation Shows how to use MarqueeSelectionInputMode to create new nodes.
Mouse Wheel Customization Shows how to customize the mouse wheel behavior.
SingleSelection Configure the GraphEditorInputMode for single selection mode.
SizeConstraintProvider Customize the resizing behavior of nodes.
CircleSnapping Shows how to configure snapping in a way that is suited to circular/radial arrangements of child nodes around parent nodes.
Hyperlink Add hyperlink support to HTML formatted labels.

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
LabelStyle Shows the most important configuration options for the built-in LabelStyle class.
RectangleNodeStyle Implement sophisticated styles for graph objects in yFiles for Java (Swing).
ShapeNodeStyle Implement sophisticated styles for graph objects in yFiles for Java (Swing).
ShapePortStyle Shows the main features of ShapePortStyle and its supported port shapes.
GroupNodeStyle Implement sophisticated styles for graph objects in yFiles for Java (Swing).
Arrow Shows how to customize arrows on edges.
ArrowNodeStyle Implement sophisticated styles for graph objects in yFiles for Java (Swing).
ArrowEdgeStyle Shows how to customize arrows on edges.
CustomStyle Implement sophisticated styles for graph objects in yFiles for Java (Swing).
SVGNodeStyle Demonstrates SVG node visualizations.
ThemeVariants Shows various interaction visualization simultaneously
EditablePathNodeStyle Illustrates interactive editing of general path node styles.
ClickableStyleDecorator Shows how to handle mouse clicks in specific areas of a node's visualization.
CompositeNodeStyle Shows how to combine several node styles into one.
LevelOfDetail Demonstrates how to change the level of detail when zooming in and out.
HTMLLabelStyle Shows how to use HtmlLabelStyle for rendering HTML-formatted labels.
ZoomInvariantLabelStyle Demonstrates zoom-invariant label rendering.
SimpleArrowStyle Shows how to create a simple custom arrow for edges.
SelectionStyling Shows customized selection painting of nodes, edges and labels by decorating these items with a corresponding style.
StyleDecorators Shows how to create styles for nodes, edges, and labels.
GeneralPathNodeStyle Shows how to create a variety of star, polygon, and other custom node styles arrows on edges.
JComponentStyle Arbitrary Swing components incorporated as graph elements.

Demonstrates how to create a graph from different data formats using the GraphBuilder , TreeBuilder and AdjacencyGraphBuilder classes in yFiles for Java (Swing).

Demo Description
GraphBuilder Show how to generate a graph with GraphBuilder from XML-based data.
TreeBuilderXML Show how to generate a graph from XML-based business data using TreeBuilder.
AdjacencyGraphBuilder Show how to generate a graph with AdjacencyGraphBuilder from list-based data.
AdjacencyGraphBuilderWithIds Show how to generate a graph with AdjacencyGraphBuilder from list-based data where each node has a unique ID.
GraphBuilderImplicitGroups Show how to generate a graph from list-based business data with implicit group references using GraphBuilder.
TreeBuilderIterable Show how to generate a graph from list-based business data using TreeBuilder.

This series of tutorials provides a comprehensive introduction to the fundamental concepts and features of yFiles for Java Swing. It covers a wide range of topics, from basic graph manipulation to advanced customization and data binding.

The tutorials include:

  • yFiles Basic Features Tutorial : An introduction to the basic concepts of yFiles, including graph element creation, viewport management, styles, labels, interaction, undo/redo, grouping, data binding, layout, and analysis.
  • Graph Builder Tutorial : Shows how to use the GraphBuilder to automatically create and update graphs from arbitrary data sources.
  • Node Style Implementation Tutorial : Guides you through the process of creating custom node styles, covering rendering, performance optimization, data handling, hit-testing, and edge cropping.
  • Edge Style Implementation Tutorial : Demonstrates how to create custom visualizations for edges, including polyline rendering, arrows, bridges, and performance consideration.
  • Label Style Implementation Tutorial : Explores the creation of custom label styles, ranging from basic text rendering to complex, multi-line labels with custom shapes. Each tutorial consists of several steps that build upon each other, providing a solid foundation for developing sophisticated graph-based applications.
Demo Description
yFiles Basic Features Tutorial An introduction to the basic concepts of yFiles for Java (Swing).
Graph Builder Tutorial Shows how to use the GraphBuilder to create graphs from custom data sources.
Custom Node Style Tutorial Shows how to implement custom node styles using the yFiles for Java (Swing) API.
Custom Label Style Tutorial Shows how to implement custom label styles using the yFiles for Java (Swing) API.
Custom Edge Style Tutorial Shows how to implement custom edge styles using the yFiles for Java (Swing) API.

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

Demo Description
Hierarchical Layout This demo showcases common configuration options for the Hierarchical Layout algorithm.
Incremental Hierarchical Layout Shows how to run the HierarchicalLayout algorithm on a predefined subset of nodes.
Hierarchical Node Port Candidates Demonstrates how to run a HierarchicalLayout with a configured set of NodePortCandidates.
Hierarchical Edge Grouping Demonstrates how to run a HierarchicalLayout with edge grouping.
Hierarchical Given Layering Demonstrates how to run a HierarchicalLayout with given layering.
Hierarchical Constraints Demonstrates how to run a HierarchicalLayout with configured constraints.
Hierarchical Sequence Constraints Demonstrates how to run a HierarchicalLayout with configured sequence constraints.
Hierarchical Layer Constraints Shows how to customize the assignment of nodes to layers when using HierarchicalLayout.
Hierarchical Node Alignment Demonstrates how to align nodes connected by critical paths in a hierarchical layout.
Hierarchical Edge Labeling Shows how to configure the HierarchicalLayout for automatic edge label placements.
Hierarchical Compact Groups Demonstrates how to configure a left-to-right hierarchical layout with compact group nodes.
Organic Layout Shows basic configuration options for the Organic Layout algorithm.
Incremental Organic Layout Shows how to run the organic layout algorithm on a predefined subset of nodes in a graph.
Organic Edge Labeling Shows how to configure organic layout for automatic edge label placement.
Organic Substructures Shows the ability of OrganicLayout to consider substructures in the graph.
Organic Constraints Shows how to use supplemental layout data to enforce placement constraints when using OrganicLayout.
EdgeRouter Shows how to configure the EdgeRouter algorithm.
Incremental Edge Router Shows how to run the edge router algorithm on a predefined subset of edges in a graph.
BusStyleEdgeRouting Shows how to prepare the EdgeRouter for orthogonal bus-style routes.
Edge Router Buses (Custom) Shows how to configure the EdgeRouter to generate orthogonal bus-style routes with manually defined backbone points.
Tree Layout Shows how to use the Tree layout algorithm to arrange trees.
Tree Node Placers Shows how to use the Tree layout algorithm to arrange trees with different node placers.
Orthogonal Layout Shows basic configuration options for the OrthogonalLayout algorithm.
Recursive Group Layout Shows how to apply a specific layout algorithm to the contents of each group node.
Radial Group Shows how to arrange grouped graphs using a radial layout.
Compact Disk Layout for Group Content Arrange circular group contents compactly with Compact Disk Layout.
Compact Tabular Layout Shows how to configure the TabularLayout algorithm to create compact drawings.

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Contributors