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.MouseInputDemo | Demonstrates how to add a custom drawable to the view that interacts with the MouseInputMode that is registered with class EditMode by default. |
| demo.view.viewmode.PopupModeDemo | Demonstrates how to display context sensitive popup menus in the view and how to utilize the inlined label editor of the view. |
| demo.view.viewmode.CreateEdgeModeDemo |
Demonstrates how CreateEdgeMode can be customized to prevent
the creation of certain edges.
This demo does only allow the creation of edges that start with nodes that have an even numbered label and end with nodes that have uneven numbered labels. |
| demo.view.viewmode.FullScreenNavigationDemo |
This demo demonstrates the usage of y.view.NavigationComponent and y.view.Overview. Both controls
will be added to a glass pane the view provides (y.view.Graph2DView#getGlassPane()) and can be toggled during
runtime.
Besides one can switch to a full screen mode and navigate through the graph view. |
| demo.view.viewmode.OrthogonalEdgeViewModeDemo | Demonstrates how to customize EditMode in order to simulate orthogonal edges.
This demo only allows to switch between the creation of orthogonal and polyline edges. Toggling the button in the toolbar switches the type of newly created edges. This affects the behavior of CreateEdgeMode and EditMode, as well as implicitly the minor modes of EditMode. |
| demo.view.viewmode.PortCreateEdgeModeDemo | Demonstrates how CreateEdgeMode can be customized in order to control automatic assignments of ports for edges. |
| demo.view.viewmode.RollOverEffectDemo | Demonstrates how to create a custom ViewMode that uses yFiles' Animation Framework to produce a roll over effect for nodes under the mouse cursor. |
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.