| Developing with the SDK > Introducing the SDK > The Diagram Component > Managing the Diagram |
Managing the Diagram |
INDEX
PREVIOUS
NEXT
|
You can interact with the diagram, control the view, edit the diagram, apply a layout to the objects, print the diagram by using the appropriate methods as described below.
The following methods determine which interactions are available to users of the diagram component, that is, what happens when a user clicks:
SetZoomMode: the view can be zoomed in or out
SetPanMode: the view can be moved in any direction
SetSelectMode: objects can be selected/deselected
SetEditLabelMode: the label of a new object can be edited when it is created
For scrolling, you can use the setScrollable method to control the visibility of the diagram scrollbars.
For zooming, you can use the following methods:
zoomIn and zoomOut methods to zoom the diagram in or out.
fitToContents method to make the whole diagram visible.
resetZoom method to reset the zoom factor to 1:1.
The IlvDiagrammer class provides full support for editing, that is, you have all the methods necessary to create an editor based on the diagram component.:
setSelected, isSelected, selectAll, deselectAll methods control the set of selected objects.
cut, copy, paste, delete, duplicate, addObject, removeObject, group, ungroup, methods and others let you edit the nodes and links.
setObjectProperty and getObjectProperty methods let you edit property values.
| Note |
| Graph layout features are available only if you purchased a full JViews Diagrammer license. |
The layoutAllNodes method applies the graph layout algorithm configured in the style sheet to all the nodes of the diagram. The layoutSelectedNodes method applies the layout only to the selected nodes.
The layoutLinks method applies the link layout algorithm configured in the style sheet to all the links of the diagram
The setAutomaticLinkLayout and setAutomaticNodeLayout methods cause the link (or node) layout to be applied automatically whenever the diagram is modified.
The methods print, printToBitmap, pageSetup, printPreview, setPrintArea let you print all or part of the diagram.
The methods of the IlvDiagrammer class let you achieve the most common tasks, but you will often need to extend the diagram component, or access advanced functionality not available directly in the IlvDiagrammer class.
For this reason, methods such as getEngine, getView, getSelectInteractor, getPrintingController give you access to the low-level objects that implement advanced features.
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. Legal terms. | PREVIOUS NEXT |