Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Version 4 beta (Read 1421 times)
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Version 4 beta
Dec 26th, 2012 at 8:17am
Print Post  
We are soon releasing version 4 of JDiagram. It contains the following new features:

Styles and themes
The appearance of the items in a diagram can now be modified using styles. The style represents a set of properties, which can be applied to an individual diagram item (by assigning it to the DiagramItem.Style property) or to all items of a specific type (by using a Theme). The styles can be easily expanded to include the properties in derived item classes.

The theme represents a collection of styles. Each style in the theme is associated with the diagram items of a specific type and affects all items of this type. Themes can be loaded from XML files. New themes can be created using the Theme Editor tool. Several pre-defined theme files are installed under the Themes subfolder of the control's root installation folder.

Node effects
Two visual effects, represented by GlassEffect and AeroEffect classes, can be applied to nodes. To apply an effect, create an instance of the respective class, set up its properties, then add the instance to the Effects collection of a node (or to Diagram.NodeEffects collection to apply it to all nodes). Effects can be added, removed or modified at any time and this will immediately reflect on the diagram. Effects of different types can be applied simultaneously. It is also possible to apply more than one effect of the same type.

Diagram documents and tabbed views
The DiagramDocument class represents a collection of diagram pages or sheets, represented by DiagramPage objects. DiagramPage is derived from Diagram and only adds a Title property, so any current code that processes Diagram objects will work with DiagramPage objects too. New pages can be added to the document and existing pages can be removed and reordered via the Pages collection. The diagram document provides higher level of events for the pages contained inside it. The document supports the notion of an active page.

A DocumentView object placed inside a TabbedScrollPane can be used to display DiagramDocument objects. The view displays tabs for the individual pages in the document. The active page can be changed interactively by activating its associated tab. New pages can be added and removed to/from the document through buttons in the tab tray and the pages can be rearranged by dragging their associated tabs with the mouse.

One-way graph Layout
The OneWayLayout class ensures that links enter into nodes from the same general direction and exit them from the opposite side. If the graph contains cycles, some links bend around the nodes to keep the enter/exit direction consistent. The algorithm aims to minimize the number of such links.


Rotation improvements
~ All built-in node types can now be rotated by setting their RotationAngle property, or interactively through the rotation handle. To enable interactive rotation, you must set the respective bit in DiagramNode.EnabledHandles;
~ Attached nodes can rotate together with their master node if the group's FollowMasterRotation property is set to RotateChildren;

Node list control
The NodeListView is a JList control that can host any type of DiagramNode objects. Nodes from to the NodeListView control can be drag-and-dropped onto a Diagram, which creates a clone of the dragged node at the drop position.

Layers
Items can now be assigned to layers, and layers can be hidden, locked or moved up/down in the Z order as a group. Call the setLayerIndex method of items to associate them with layers in the Diagram.Layers collection. The Layer objects provide Visible, Locked and ZIndex properties, which will affect all items in the respective layer. Layers also expose a Title property shown in the LayerListView control. Newly drawn items are added to the layer specified via Diagram.setActiveLayer.

Layer list control
The LayerListView control provides user interface for working with Layer objects. The control displays a list of all layers in a specified Diagram with a title and an overview area, and also allows editing of layer's Title, Visible and Locked properties and choosing the Diagram's currently active layer. New layers can be added to the Diagram by clicking the '+' button. The selected layer can be deleted by clicking the '-' button.

Magnifier
The new magnifier tool allows users to interactively zoom in (or out) portions of the diagram by holding down a modifier key or pressing a mouse button. The magnifier's zoom factor and appearance can be customized. Additional information can be found in the corresponding section of Scrolling and Zooming.

Ruler improvements
The ruler units can now be specified more precisely through instances of the new MeasureUnit class. The MeasureUnit class provides several built-in units as well as the opportunity to create custom units of measure. As a result, the RulerUnit enumeration has been removed and the type of the Unit property has been changed. The InchDivisions property of the Ruler class has been removed as well - the division information is now built into the MeasureUnit type and no longer needs to be specified explicitly. Custom divisions can still be specified for any unit by creating a custom MeasureUnit instance and providing the appropriate value in the standardDivisons constructor parameter.

Miscellaneous
~ The value of DiagramItem.ZIndex property is no longer required to be unique and smaller than the number of items;
~ The Shape property in ContainerNode and TreeViewNode can be set to Rectangle or RoundedRectangle;
~ Link labels are arranged automatically by the control when their AutoArrange property is enabled. Auto-arranged labels will avoid overlapping nodes or other labels.
~ The new TextPadding property specify the distance between node's text and the node borders

API changes
~ RotationAngle property moved from ShapeNode to base DiagramNode;
~ Inherited node classes should now override the drawLocal method instead of draw to get built-in support for node rotation. Overriding draw still works, but any custom drawing code would have to take care of rotation;
~ Type of Group.FollowMasterRotation changed from boolean to enum GroupRotation;
~ LinkStyle enum renamed to LinkShape;
~ DiagramLink.Style property renamed to Shape;
~ TableStyle enum renamed to SimpleShape;
~ TableNode.Style property renamed to Shape;
~ The type of TextColor and CaptionColor properties have been changed to Brush; the properties have been renamed to TextBrush and CaptionBrush;
~ The default value of Pen, Brush and Font properties of items is now null (Nothing in Visual Basic) to allow for inheritance from DiagramItem.Style or Diagram.Theme. Custom drawing code in inherited classes should use the values returned by getEffectivePen, getEffectiveBrush or getEffectiveFont to get the actual object that should be used when drawing;
~ zLevelUp, zLevelDown, zTop and zBottom methods now require a boolean argument specifying whether items are allowed to change layers;
~ ZIndex no longer corresponds to the position of items within Diagram.Items collection. Items however still contains the items sorted by Z order, as defined by item's ZIndex and LayerIndex;

If anyone is interested in trying this preview version, please download this archive containing the updated jdiagram.jar, help file and updated sample projects:
https://mindfusion.eu/_beta/jdiagram4.zip

Any comments, questions and general feedback are welcome.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint