yFiles for Java
Release Notes
Skip 2.x — Use the modern 3.x line of yFiles for Java (Swing)!
or higher
Beginning with version 3.0, the yFiles for Java (Swing) diagramming library features a brand-new, modern API which requires Java 8. This API is mature and provides many new features that are not available out-of-the-box in the 2.x line. It also provides the functionality of the ySVG, yExport and yBPMN package as source code application, therefore the extension packages are no longer required.
We recommend to start development with the next-generation yFiles for Java in new Java Swing projects.
Especially in projects that don't need to support legacy Java versions before Java 8, this
is the recommended way to realize your application's diagram visualization part.
Release Notes
yFiles for Java version 2.19 is the newest major release available in the legacy yFiles for Java 2.x technology line.
It contains many new features compared to older versions and is almost completely API compatible with the 2.18 series.
(See also the entire yFiles for Java change log.)
Technical Requirements
- Oracle J2SDK 1.5 or higher is needed for software development with yFiles.
- Oracle J2RE 1.5 or higher is needed to execute programs using yFiles.
- A browser to view the HTML documentation.
yFiles 2.19 - Changes Since 2.18
New Features
Layout
- SmartOrganicLayouter now offers the possibility to define tree substructures, see setTreeSubstructureStyle and setTreeSubstructureSize.
- BalloonLayouter now supports node types. The types influence the ordering of child nodes and the subtrees rooted at them such that nodes of the same type are preferably placed next to each other. Node types are weaker than a user-specified custom comparator (see setComparator). To define types, register a data provider with the graph with key NODE_TYPE_DPKEY.
- The new CactusGroupLayouter offers an alternative representation of hierarchically nested data. It places the children of a group along the groups circular border, resembling the structure of a cactus.
- RadialLayouter now supports a new layering strategy that produces a circular dendrogram drawing.
- RadialLayouter now supports two new edge routing styles, namely a radial polyline style and a curved style. The radial polyline style produces edge paths which consist of a series of straight and arc segments. The curved polyline style routes the edges as curved bezier paths. In the latter case, the edge paths can be also returned as control points that represent cubic bezier control points.
- RadialLayouter now supports integrated node labeling i.e., the node labels are taken into consideration when determining the positions for the nodes of the graph and guarantees that labels will not overlap with other objects in the graph.
- CircularLayouter now supports curved edge routing for edges routed within or between partitions.
- IncrementalHierarchicLayouter: added support for so-called tabular group nodes. The children of such groups are arranged in a compact tabular fashion (i.e., like a single column table for layout orientation left-to-right).
- Intersections provides methods to find and count intersections of elements in a graph.
Improvements
Layout
- SmartOrganicLayouter now produces stable results for inputs with node labels and in deterministic mode where it previously could generate a different arrangement when applied again with the same parameters.
- IncrementalHierarchicLayouter: Reduced the number of required bends for some specific inputs with grouped edges and port constraints/candidates.
- IncrementalHierarchicLayouter: Improved the support for subcomponent layouts (see API SUBCOMPONENT_DESCRIPTOR_DPKEY). Defining subcomponents now works by assigning instances of the new SubcomponentDescriptor class to nodes so that nodes with the same descriptor instance form a component. Components that have inter-edges only to a single non-component node are now integrated directly at that node when using the new placement policies SUB_COMPONENT_PLACEMENT_POLICY_AUTOMATIC or SUB_COMPONENT_PLACEMENT_POLICY_ALWAYS_INTEGRATED (if the orientation of the sub-layout permits it). The overall results for such cases feature better edge routing quality and more compact drawings.
- EdgeRouter: Improved the results for setups with monotonic path restriction enabled (see setMonotonicPathRestriction). and edges with vertically/horizontally overlapping endpoints.
- EdgeRouter: the specified buses may now also include self-loops (see BusDescriptor).
- TemporaryGroupNodeInsertionStage: The stage now also supports specifying hierarchically nested temporary groups, see TemporaryGroupDescriptor.
- EdgeRouter: Fixed an issue that may have caused undesired results due to edges that cross external ports of other edges. The costs of such crossings can now be specified with setPortCrossingPenalty.
- The SmartOrganicLayouter now allows to specify custom node clusters by setting setClusteringPolicy to CLUSTERING_POLICY_USER_DEFINED. The custom cluster ids have to be specified by means of key CLUSTER_ID_DPKEY.
- IncrementalHierarchicLayouter: The algorithm now supports edge straightening (see setEdgeStraighteningOptimizationEnabled) if the barycenter mode is enabled (see isBaryCenterModeEnabled). Previously, this combination was not possible.
- CircularLayouter now supports node types (see NODE_TYPE_DPKEY) also for the layout of the cycle partitions. Previously, the types had an influence only on the layout of a partition itself. If all node of a partition are of the same type, then the partition gets that type as well, so that partitions of same type are preferably placed next to each other.
- GenericTreeLayouter: The LayeredNodePlacer now also places edge labels (if the integrated edge labeling is enabled).
- GenericTreeLayouter: Improved the runtime for setups that use the LayeredNodePlacer.
- CircularLayouter: The algorithm has received a faster approach for calculating edge bundles, see getEdgeBundling.
- TemporaryGroupNodeInsertionStage: The stage now automatically marks inserted group nodes with a DataProvider registered with key INSERTED_GROUP_NODE_DPKEY.
-
MISLabelingAlgorithm: When searching for suitable label positions, the
PartitionGrid
is now considered. This avoids placing labels on grid lines or insets of the partition grid. Additionally OPTIMIZATION_PARTITION_GRID_OVERLAP may be set as the optimization strategy, which further emphasizes this characteristic. - GenericTreeLayouter: The root alignment can also factor in the port position to straighten out an edge.
-
IncrementalHierarchicLayouter: For input graphs with
PartitionGrid
the algorithm now considers the layering produced by the getFromScratchLayerer if it is already compatible with the specified grid structure. Previously, for such cases, the algorithm may have calculated an entirely different layer assignment. - IncrementalHierarchicLayouter: The flow direction is considered to place the ports of port groups when combined with direct group content edges.
- IncrementalHierarchicLayouter: The layer placement is now more compact for graphs with edge labels between layers.
- IncrementalHierarchicLayouter: Nodes without any edges are now placed as far left as possible without violating any constraints. That way they do not disturb the layout for the connected part of the graph.
- IncrementalHierarchicLayouter: With edges between nodes of the same layer and integrated edge labeling, the results in some cases are now more compact, where previously unnecessarily large distances to the label and edge were kept.
Bugfixes
Layout
- IncrementalHierarchicLayouter: Fixed an issue that may have caused superfluous space within group nodes if there are grouped edges.
- IncrementalHierarchicLayouter: Fixed an issue that may have caused superfluous crossings between backloops or same-layer edges in the first or last layer.
- IncrementalHierarchicLayouter: Fixed an issue that may have caused exceptions when using a non-zero grid distance in combination with incremental mode's exact coordinate hints.
- EdgeRouter: Fixed an issue that may have caused edges at fixed ports at group nodes to overlap other nodes.
- IncrementalHierarchicLayouter: Fixed a bug which caused that self-loop edges at group nodes that are edge/port grouped with the same id on both sides were not properly routed or even removed from the graph when not running on a graph copy (buffered).
- GenericTreeLayouter, ARNodePlacer: Fixed an issue that sometimes caused the ARNodePlacer to ignore its fill style.
- IncrementalHierarchicLayouter: Fixed an issue that sometimes caused very long edge segments for graphs containing groups with node halos and polyline edge routing.
-
IncrementalHierarchicLayouter: Fixed a possible
RuntimeException
that could occur with bus structures (see BusDescriptor) if the algorithm runs in incremental layout mode and the group transposition feature is enabled (see setGroupTranspositionEnabled). - IncrementalHierarchicLayouter: Fixed an issue that caused intertwined edge routes with many superfluous crossings and bends for some cases with head/tail sequence constraints. The problem mainly occurred with graphs with groups or PartitionGrid and incompatible sequence constraints.
- ClearAreaLayouter: Fixed an issue that caused violations of the initial partition grid assignment if the algorithm is applied with a local clear area strategy.
- CircularLayouter, TreeReductionStage, RadialLayouter and EdgeBundlingStage: Fixed an issue that may have caused a lot of collinear bends.
- IncrementalHierarchicLayouter: Fixed an issue that may have caused superfluous crossings for edges with alternative paths that are incident to group nodes (see ALTERNATIVE_EDGE_PATH_DPKEY).
- PartialLayouter and EdgeRouter: Fixed a bug that could in rare cases lead to non-deterministic behavior (i.e. different results) when running the same algorithm instance multiple times on the same input.
- PartialLayouter: Fixed an issue that sometimes caused a misplaced arrangement of disconnected components if a layout orientation is specified and property setComponentAssignmentStrategy is not COMPONENT_ASSIGNMENT_STRATEGY_SINGLE.
- EdgeRouter: Fixed an issue that may have caused self-crossing routes of edges with labels if the integrated edge labeling is enabled (see isIntegratedEdgeLabelingEnabled).
-
OrthogonalLayouter and DirectedOrthogonalLayouter: Fixed a rare
IllegalStateException
for some input graphs with tree substructures and a tree style different from TREE_STYLE_NONE. -
IncrementalHierarchicLayouter: Fixed a possible
IllegalStateException
that may have be thrown for some specific combinations of PortCandidates in PortCandidateSets. - CircularLayouter: Fixed an issue that may have caused strange edge routes for bundled edges (see isBundled.
- IncrementalHierarchicLayouter: Fixed an issue that caused a long runtime for some larger, grouped graphs with layering constraints and non-recursive layering.
- IncrementalHierarchicLayouter: Fixed an issue that caused a long runtime for some larger graphs with layering constraints even though a maximum duration was specified.
- EdgeRouter: Fixed a problem that may have caused bad layout results for some scenarios with grouped edges and multiple PortCandidates. Previously, the algorithm selected any of them without considering the alternative options.
- SALabeling and GreedyMISLabeling: Fixed a problem that may have caused bad label placements for edges with direct group content routing (i.e., edges that connect a group node with one of its descendants and are routed directly without leaving the group).
- SALabeling and GreedyMISLabeling: Fixed a rare problem that may have caused non-optimal label placements for some graphs with node halos (see NodeHalo).
-
IncrementalHierarchicLayouter: Fixed a possible
NullPointerException
that may be caused when specifying wrong input for the alternative group bounds in incremental layout mode. - OrthogonalLayouter and DirectedOrthogonalLayouter: Fixed a bug that in rare cases produced overlaps between edge segments (of a parallel edge) and edge labels of other edges.
- OrthogonalLayouter and DirectedOrthogonalLayouter: Fixed a bug that in rare cases generated non-orthogonal edges when using the chain substructure style, i.e., a style different from CHAIN_STYLE_NONE.
- SingleCycleLayouter: Fixed a bug that sometimes lead to violations of the specified minimum node distance (see setMinimalNodeDistance).
- SmartOrganicLayouter: Fixed a bug that sometimes lead to violations of the specified minimum node distance for separated radial substructures (see STAR_SUBSTRUCTURE_STYLE_SEPARATED_RADIAL).
- SmartOrganicLayouter: The algorithm now satisfies the isDeterministic property for more cases when the maximum duration is restricted. Note, however, that non-deterministic behavior is still possible when restricting the duration.
- MultiPageLayouter: Fixed a bug that in rare cases may have caused page size violations.
Algorithms
- ShortestPaths: Fixed a bug that sometimes lead to wrong (i.e., non-shortest paths) results when calling methods kShortestPaths or kShortestPathsCursor.
Incompatible Changes
Changes in Technical Requirements
-
All yFiles for Java distributions now require Java 1.5 or higher for
building and running yFiles for Java based applications.
The reason for this change is Java 17 marking the constructors Boolean(boolean), Boolean(String), Byte(byte), Byte(String), Short(short), Short(String), Integer(int), Integer(String), Long(long), Long(String), Float(float), Float(String), Double(double), and Double(String) to be "subject to removal in a future version". All usages of the aforementioned constructors in yFiles for Java have been replaced with the appropriate staticvalueOf
factory method.
API Changes
-
IncrementalHierarchicLayouter: Data provider keys
SUB_COMPONENT_ID_DPKEY
andSUB_COMPONENT_LAYOUT_ALGORITHM_DPKEY
have been replaced with the new key SUBCOMPONENT_DESCRIPTOR_DPKEY.- Now, defining subcomponents works by assigning instances of the new SubcomponentDescriptor class to nodes so that nodes with the same descriptor instance form a component where previously arbitrary objects were used for component definition.
- The layout algorithm for a component is now defined via property setLayoutAlgorithm.
-
BalloonLayouter: Moved the byte constants
NODE_LABELING_RAYLIKE
,NODE_LABELING_MIXED
, andNODE_LABELING_HORIZONTAL
for the node labeling policy property (see setNodeLabelingPolicy) to the new separate class NodeLabelingPolicy. The reason is that the policy is now not only supported by the balloon layout but also by circular layout, radial layout and the new cactus group layout. - The type of EdgeCellInfo property getCellSegmentInfos was changed from YList to CellSegmentInfo.
-
TemporaryGroupNodeInsertionStage: Data provider keys
COMPONENT_ID_DPKEY
andCOMPONENT_LAYOUT_ALGORITHM_DPKEY
have been replaced with the new key TEMPORARY_GROUP_DESCRIPTOR_DPKEY. The new class TemporaryGroupDescriptor has to be used to define temporary groups and the layout algorithms for arranging the temporary groups' contents. -
YList: Removed (the explicit implementation of) method
addFirst
. The return type of YList'saddFirst
was incompatible with the return type of java.util.List default method addFirst that was introduced in Java 21. Use push instead. -
YList: Removed (the explicit implementation of) method
addLast
. The return type of YList'saddLast
was incompatible with the return type of java.util.List default method addLast that was introduced in Java 21. Use pushLast instead.
Behavior Changes
-
IncrementalHierarchicLayouter: The default maximum duration of the
DefaultLayerSequencer is now unrestricted. Previously, it
was restricted to
10
seconds. - The list returned by GraphPartition method getCells as well as DynamicObstacleDecomposition methods getCells and getObstacles is no longer unmodifiable.