Search
ItemListView Class
Remarks See Also
 






A list view control that hosts DiagramItems and supports drag-and-drop to DiagramView.

Namespace: com.mindfusion.diagramming
Package: com.mindfusion.diagramming

 Syntax

Java  Copy Code

public class ItemListView extends JList<E>

 Remarks

The ItemListView control provides a list of diagram items that can be dragged and dropped onto a DiagramView to create new item instances.

Item Management

Items can be added to the list by calling the addItem method and removed using removeItemAt. To clear the entire list, use the clearItems method. The control supports displaying both DiagramNode and DiagramLink objects, superseding the legacy NodeListView which was limited to nodes.

Drag-and-Drop Behavior

When an item is dragged from the list and dropped onto a diagram, the control creates a new instance by calling the source item's clone method. If you are using custom item subclasses, ensure you override the clone method to correctly copy all custom property values.

The dimensions of the newly created item are determined by the NewInstanceSize property. If this property is not set, the item's original size is used.

Automatic Connections

The control supports an auto-connect feature enabled via the AutoConnectLinks property. When active:
  • Links: Dropping a link near existing nodes (within the range specified by AutoConnectDistance) will automatically connect the link's ends to those nodes.
  • Nodes: Dropping a node near the unconnected end of an existing link will automatically attach that link to the new node.

 Inheritance Hierarchy

java.lang.Object
    java.awt.Component
        java.awt.Container
            javax.swing.JComponent
                javax.swing.JList(E)
                    com.mindfusion.diagramming.ItemListView

 See Also