yFiles Tutorial ViewMode Demos

The following tutorial demos describe how to use, customize, and extend diverse ViewMode classes. View modes provide the base functionality to handle mouse-based interaction that happens in a view.

Class Description
demo.view.viewmode.MagnifierViewModeDemoDemonstrates how to use a magnifying glass effect to zoom view regions locally
demo.view.viewmode.FullScreenNavigationDemoHow to use the NavigationComponent and Overview to controll the view
demo.view.viewmode.OrthogonalEdgeViewModeDemoDemonstrates how to customize EditMode in order to simulate orthogonal edges
demo.view.viewmode.SnapLineDemoDemonstrates EditMode's snapping feature in conjunction with orthogonal edges
demo.view.viewmode.RollOverEffectDemoShows roll over effect for nodes
demo.view.viewmode.MouseInputDemoDemonstrates how to create drawable to the view that interacts with the MouseInputMode
demo.view.viewmode.PopupModeDemoDemonstrates how to display context sensitive popup menus and how to edit node labels in the view
demo.view.viewmode.CreateEdgeModeDemoDemonstrates how to customize CreateEdgeMode to prevent the creation of certain edges and to provide feedback
demo.view.viewmode.PortCreateEdgeModeDemoDemonstrates how CreateEdgeMode can be customized in order to control automatic assignments of ports for edges
demo.view.viewmode.HyperlinkDemoDemonstrates how to use a HtmlLabelConfiguration to trigger and process hyperlink events
demo.view.viewmode.SmartLabelModelDemoDemonstrates how to use a SmartNodeLabelModel and a SmartEdgeLabelModel

Running the Demos

From Within an IDE

Set <yFilesDir>/src as your source directory. Then add <yFilesDir>/lib/y.jar and the source folder <yFilesDir>/src to your classpath. Now you should be ready to compile and run all executable demo classes.

With Ant

First make sure you have the build tool Ant installed on your system. Now you can use the demo build script build.xml located in <yFilesDir>/src/demo to launch each demo by specifying its simple class name as a target. Alternatively, launch the interactive demo driver by specifying run as target to conveniently access all demos.