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.MagnifierViewModeDemo | Demonstrates how to use a magnifying glass effect to zoom view regions locally |
demo.view.viewmode.FullScreenNavigationDemo | How to use the NavigationComponent and Overview to controll the view |
demo.view.viewmode.OrthogonalEdgeViewModeDemo | Demonstrates how to customize EditMode in order to simulate orthogonal edges |
demo.view.viewmode.SnapLineDemo | Demonstrates EditMode's snapping feature in conjunction with orthogonal edges |
demo.view.viewmode.RollOverEffectDemo | Shows roll over effect for nodes |
demo.view.viewmode.MouseInputDemo | Demonstrates how to create drawable to the view that interacts with the MouseInputMode |
demo.view.viewmode.PopupModeDemo | Demonstrates how to display context sensitive popup menus and how to edit node labels in the view |
demo.view.viewmode.CreateEdgeModeDemo | Demonstrates how to customize CreateEdgeMode to prevent the creation of certain edges and to provide feedback |
demo.view.viewmode.PortCreateEdgeModeDemo | Demonstrates how CreateEdgeMode can be customized in order to control automatic assignments of ports for edges |
demo.view.viewmode.HyperlinkDemo | Demonstrates how to use a HtmlLabelConfiguration to trigger and process hyperlink events |
demo.view.viewmode.SmartLabelModelDemo | Demonstrates how to use a SmartNodeLabelModel and a SmartEdgeLabelModel |
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.
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.