com.esri.arcgis.schematic
Interface INgDiagram

All Superinterfaces:
Serializable
All Known Implementing Classes:
INgDiagramProxy, NgDiagram

public interface INgDiagram
extends Serializable

Provides access to members that control the graphic diagram.

Description

A diagram is a structure that is an implementation of a diagram type. A network, made up of nodes and links, is displayed in a diagram. One or more diagrams of a diagram type can exist in a project. Various schematic layout algorithms can represent the same network. Each schematic representation of a network is displayed in its own diagram. For instance, a network displayed as both an orthogonal schematic and a hierarchical schematic will be displayed in two different diagrams. A diagram cannot exist without a view, and it can create many views. All views of a diagram will display the same network in the same geographic or schematic position, with each view differing only in its zoom level or symbol size. An element selected in one view will be selected in all open views created from the same diagram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

See Also:
ISchematicDiagram, INgDiagramType

Method Summary
 boolean canRedoLastUndo()
          Indicates if the last operation that impacted the diagram can be redone.
 boolean canUndoLastOperation()
          Indicates if the last operation that impacted the diagram can be undone.
 void close()
          Closes the diagram and all its views.
 INgDrawing createDrawing(INgElementType eltType, String eltName, double x, double y, boolean visualize)
          Creates the drawing implemented by the 'eltType' type and named 'eltName' at the ('x','y') location in the diagram.
 INgLink createLink(INgElementType eltType, String eltName, INgNode fromNode, INgNode toNode, int fromPort, int toPort, boolean visualize)
          Creates the link implemented by the 'eltType' element type and named 'eltName' between the 'fromNode' and 'toNode' nodes in the diagram.
 INgNode createNode(INgElementType eltType, String eltName, double x, double y, boolean visualize)
          Creates the node implemented by the 'eltType' element type and named 'eltName' at the ('x','y') location in the diagram.
 INgNodeOnLink createNodeOnLink(INgElementType eltType, String eltName, INgLink refLink, int mode, double position, boolean visualize)
          Creates the node-on-link implemented by the 'eltType' type and named 'eltName' at the 'Position' location on the 'refLink' link in the diagram.
 INgSubLink createSubLink(INgElementType eltType, String eltName, INgLink refLink, INgNode fromNode, INgNode toNode, int fromPort, int toPort, boolean visualize)
          Creates the sub-link implemented by the 'eltType' element type and named 'eltName' on the 'refLink' link between the 'fromNode' and 'toNode' nodes in the diagram.
 void deleteSavedLayout()
          Removes the backup version of the diagram.
 String getAttributeValue(String attributeName)
          Returns the value of the attribute named 'attributeName' defined for the diagram.
 INgDiagramType getDiagramType()
          Diagram type that implements the diagram.
 INgDrawing getDrawing(String drawingName)
          Returns the drawing named 'drawingName' contained in the diagram.
 INgElements getElements()
          List of the elements contained in the diagram.
 INgElements getElementsByElementType(INgElementType eltType)
          Returns the list of all elements implemented by the the 'eltType' element type that are contained in the diagram.
 INgElements getElementsByType(int type)
          Returns a list of all the elements belonging to the 'Type' type that are contained in the diagram.
 INgElements getElementsByUserData(INgUserDatas userDatas, INgValues values, INgElementType eltType)
          Returns all the elements contained in the diagram that are implemented by the 'eltType' element type and which each associated user-data in the 'userDatas' list verifies the 'values' list corresponding values.
 INgLink getLink(String linkName)
          Returns the link named 'linkName' contained in the diagram.
 INgLinks getLinksBetweenNodes(INgNode n1, INgNode n2, int orientation, int fromPort, int toPort)
          Returns a list of all the links that connect the two nodes 'n1' and 'n2' in the diagram.
 String getName()
          Name of the diagram.
 String getNextRedoLabel()
          Returns the label of the next operation in the redo stack.
 String getNextUndoLabel()
          Returns the label of the next operation in the undo stack.
 INgNode getNode(String nodeName)
          Returns the node named 'nodeName' contained in the diagram.
 int getSaveMode()
          Saving option for the diagram.
 INgViews getViews()
          List of the views associated with the diagram.
 boolean isLayoutSaved()
          Indicates if there is a backup version for the diagram.
 boolean isModified()
          Indicates if the diagram has been modified regarding to its saving version.
 void moveElements(INgElements elements, double x, double y, int computeMode)
          Moves the 'Elements' set of elements contained in the diagram to the (X,Y) relative position.
 void newView()
          Creates a new view associated with the active view comprising all the elements contained in the latter.
 void open()
          Opens the diagram.
 void openFromStream(IStream pStream)
          Loads the diagram from the specified stream.
 void redoLastUndo()
          Redoes the last undone operation in the diagram.
 void redraw(int mode)
          Redraws the elements contained in the diagram's view(s) according to the 'mode' redrawing option.
 void refresh()
          Updates all the views associated with the diagram, reflecting the modifications that may have occurred in the database.
 void refreshLegend(int displayMode)
          Updates the legend content for all the views associated with the diagram so it reflects the modifications that may have occurred in the database.
 void restoreInitialPosition(int modeIfNotSet, int modeIfSet)
          Restores the elements contained in the diagram to their initially defined positions.
 void save()
          Saves the diagram and records positions for all the elements contained in the different views of the diagram.
 void saveToStream(IStream pStream)
          Saves the diagram to the specified stream.
 void setModified(boolean modified)
          Forces the value returned by the 'IsModified' function.
 void setSaveMode(int pVal)
          Saving option for the diagram.
 boolean startOperation(String label)
          Starts a new operation that will impact the diagram.
 void stopOperation()
          Stop the current started operation that impacted the diagram.
 void undoLastOperation()
          Undoes the last operation that impacted the diagram.
 

Method Detail

getDiagramType

INgDiagramType getDiagramType()
                              throws IOException,
                                     AutomationException
Diagram type that implements the diagram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
A reference to a com.esri.arcgis.schematic.INgDiagramType
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getName

String getName()
               throws IOException,
                      AutomationException
Name of the diagram.

Description

This name must be consistent with the diagram identifier set for its associated diagram type.

The Name property is automatically set when the diagram is created:

- either by calling the INgDiagramType OpenDiagram or INgProject OpenDiagram methods in the code,

- or through ArcGIS Schematics Designer, when its associated diagram type is defined.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

open

void open()
          throws IOException,
                 AutomationException
Opens the diagram.

Remarks

About events managed during schematic diagram opening.


When the INgDiagram interface's Open method, the INgProject interface's OpenDiagram method or the INgDiagramType interface's OpenDiagram method is triggered, several event procedures are successively fired:

(1) BeforeOpenDiagram

(2) BeforeOpenView

(3) (OnLoadDiagram)

(4) AfterOpenDiagram

(5) AfterOpenView



The following lines detail the Schematics running way during any diagram opening:

(1) The BeforeOpenDiagram event is fired.


(2) A new schematic window is created. The BeforeOpenView event is fired:

- Either the handle returned value is not null, and Schematics retrieves the associated applicative window,

- Or the handle returned value is null, and Schematics creates and displays a new window.


(3) Then, the INgDiagram object is created.

The elements contained in the diagram are created. If there is a backup version for the diagram and if the ‘restore’ parameter of the OpenDiagram method is True (default value), the diagram content is restored according to its last saving.

If an OnLoadDiagram event has been declared for the associated diagram type in the project parameters file, the treatments are executed. The elements are displayed.


(4) The AfterOpenDiagram event is fired.


(5) If the diagram opening is asked out of a session opening which is restoring, the elements are automatically fit in the window. The AfterOpenView event is fired.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagramType.openDiagram(String, boolean)

save

void save()
          throws IOException,
                 AutomationException
Saves the diagram and records positions for all the elements contained in the different views of the diagram.

Description

This method updates the layout stored in the schematic database relative to the schematic diagram. All the layout changes introduced in the diagram since it was opened or last saved (node and link positions, …) are taken into account and saved in the schematic database.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

close

void close()
           throws IOException,
                  AutomationException
Closes the diagram and all its views.

Description

If you have changed the diagram and have not saved it yet, depending on the value the SaveMode property is set to, you may be asked if you want to save the changes. Also note that the BeforeCloseDiagram event is automatically fired when you use this method.

Remarks

About events managed during schematic diagram closure


When the INgDiagram interface’s Close method is triggered, several event procedures are successively fired:

(1) IsDiagramSavedByFramework

(2) BeforeCloseDiagram

(3) BeforeCloseView

(4) IsViewDestroyedByFramework


The following lines detail the Schematics running way during any schematic diagram closure:

(1) Schematics takes interest about the diagram saving. First, the SaveMode property value set for the diagram is analyzed.

. If SaveMode is esriNgNotSaveByFramework, Schematics doesn’t charge of the diagram saving.

. If SaveMode is esriNgSaveByFramework or esriNgSaveUndefined, the IsDiagramSavedByFramework event is fired. If the event procedure returns False, Schematics doesn’t charge of the diagram saving. If the event procedure returns True, a predefined form is automatically opened and end-user is asked if he wants to save the changes for the diagram. If he asks to save it, all the changes introduced in the diagram since it was opened or last saved (node and link positions, etc.) are taken into account and saved according to the parameters specified for this diagram.

(2) Then, the BeforeCloseDiagram event is fired

(3) At least, the diagram's elements are removed and for each associated open view:

> The BeforeCloseView event is fired.

> If the legend sub-window is displayed, it is deleted.

(4) If the IsViewDestroyedByFramework event procedure returns True, Schematics charges of the view destruction.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.getSaveMode(), INgProjectEvents.beforeCloseDiagram(com.esri.arcgis.schematic.INgProjectEventsBeforeCloseDiagramEvent)

newView

void newView()
             throws IOException,
                    AutomationException
Creates a new view associated with the active view comprising all the elements contained in the latter.

Description

All the commands for selecting, moving, and positioning elements executed in either view are also executed in the other view. View operations alone (Zoom, Fit...) executed in either one of the views are not reflected in the other. At the time the new view is created, all the elements that are then visible in the other view are also displayed in the new view.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

refresh

void refresh()
             throws IOException,
                    AutomationException
Updates all the views associated with the diagram, reflecting the modifications that may have occurred in the database.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgElement.refresh(boolean), INgDiagram.redraw(int)

getElements

INgElements getElements()
                        throws IOException,
                               AutomationException
List of the elements contained in the diagram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
A reference to a com.esri.arcgis.schematic.INgElements
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getViews

INgViews getViews()
                  throws IOException,
                         AutomationException
List of the views associated with the diagram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
A reference to a com.esri.arcgis.schematic.INgViews
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getElementsByElementType

INgElements getElementsByElementType(INgElementType eltType)
                                     throws IOException,
                                            AutomationException
Returns the list of all elements implemented by the the 'eltType' element type that are contained in the diagram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
eltType - A reference to a com.esri.arcgis.schematic.INgElementType (in)
Returns:
A reference to a com.esri.arcgis.schematic.INgElements
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.getElementsByType(int)

getElementsByType

INgElements getElementsByType(int type)
                              throws IOException,
                                     AutomationException
Returns a list of all the elements belonging to the 'Type' type that are contained in the diagram.

Description

That is, returns a list of all the nodes associated with the diagram when Type = esriNgElementNode, a list of all the links when Type = esriNgElementLink, a list of all the drawings; when Type = esriNgElementDrawing; see esriNgElementTypeEnum topic.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
type - A com.esri.arcgis.schematic.esriNgElementTypeEnum constant (in)
Returns:
A reference to a com.esri.arcgis.schematic.INgElements
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.getElementsByElementType(com.esri.arcgis.schematic.INgElementType)

getLinksBetweenNodes

INgLinks getLinksBetweenNodes(INgNode n1,
                              INgNode n2,
                              int orientation,
                              int fromPort,
                              int toPort)
                              throws IOException,
                                     AutomationException
Returns a list of all the links that connect the two nodes 'n1' and 'n2' in the diagram.

Description

By default, the function returns a list of the undirected links connecting nodes n1 and n2. If a list of the directed links connecting n1 to n2 is desired, then the 'orientation' parameter must be passed to esriNgOriented (see esriNgOrientationMode topic). By default, the function ignores the link ports on the nodes. If you wish to obtain a list of the links connecting a specific port on n1 to a specific port on n2, or a list of the links connecting n1 to a specific port on n2, or a list of the links connecting a specific port on n1 to n2, then you must specify the fromPort and/or toPort parameter(s) that are used to identify the sequence number of the desired port.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
n1 - A reference to a com.esri.arcgis.schematic.INgNode (in)
n2 - A reference to a com.esri.arcgis.schematic.INgNode (in)
orientation - A com.esri.arcgis.schematic.esriNgOrientationMode constant (in, optional, pass 2073 if not required)
fromPort - The fromPort (in, optional, pass 0 if not required)
toPort - The toPort (in, optional, pass 0 if not required)
Returns:
A reference to a com.esri.arcgis.schematic.INgLinks
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.getLink(String)

createNode

INgNode createNode(INgElementType eltType,
                   String eltName,
                   double x,
                   double y,
                   boolean visualize)
                   throws IOException,
                          AutomationException
Creates the node implemented by the 'eltType' element type and named 'eltName' at the ('x','y') location in the diagram.

Description

By default, the created node is not visualized.

The eltType node element type must already exist. It can have been defined:

- either in the current opened project through the Schematics Designer GUI,

- or by calling the INgProjectBuilder CreateElementType method in the code.

Remarks

The query related to the associated node element type must have been set to NULL so the CreateNode method correctly works.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
eltType - A reference to a com.esri.arcgis.schematic.INgElementType (in)
eltName - The eltName (in)
x - The x (in)
y - The y (in)
visualize - The visualize (in, optional, pass false if not required)
Returns:
A reference to a com.esri.arcgis.schematic.INgNode
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgProjectEvents.nameOfDigitNode(com.esri.arcgis.schematic.INgProjectEventsNameOfDigitNodeEvent), INgDiagram.createNodeOnLink(com.esri.arcgis.schematic.INgElementType, String, com.esri.arcgis.schematic.INgLink, int, double, boolean)

createLink

INgLink createLink(INgElementType eltType,
                   String eltName,
                   INgNode fromNode,
                   INgNode toNode,
                   int fromPort,
                   int toPort,
                   boolean visualize)
                   throws IOException,
                          AutomationException
Creates the link implemented by the 'eltType' element type and named 'eltName' between the 'fromNode' and 'toNode' nodes in the diagram.

Description

By default, the created link is not visualized. The link ports can be specified for the origin and end nodes (fromPort and toPort parameters).

The eltType link element type must already exist. It can have been defined:

- either in the current opened project through the Schematics Designer GUI,

- or by calling the INgProjectBuilder CreateElementType method in the code.

Remarks

The query related to the associated link element type must have been set to NULL so the CreateLink method correctly works.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
eltType - A reference to a com.esri.arcgis.schematic.INgElementType (in)
eltName - The eltName (in)
fromNode - A reference to a com.esri.arcgis.schematic.INgNode (in)
toNode - A reference to a com.esri.arcgis.schematic.INgNode (in)
fromPort - The fromPort (in, optional, pass 0 if not required)
toPort - The toPort (in, optional, pass 0 if not required)
visualize - The visualize (in, optional, pass false if not required)
Returns:
A reference to a com.esri.arcgis.schematic.INgLink
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgProjectEvents.nameOfDigitLink(com.esri.arcgis.schematic.INgProjectEventsNameOfDigitLinkEvent), INgDiagram.createSubLink(com.esri.arcgis.schematic.INgElementType, String, com.esri.arcgis.schematic.INgLink, com.esri.arcgis.schematic.INgNode, com.esri.arcgis.schematic.INgNode, int, int, boolean)

createSubLink

INgSubLink createSubLink(INgElementType eltType,
                         String eltName,
                         INgLink refLink,
                         INgNode fromNode,
                         INgNode toNode,
                         int fromPort,
                         int toPort,
                         boolean visualize)
                         throws IOException,
                                AutomationException
Creates the sub-link implemented by the 'eltType' element type and named 'eltName' on the 'refLink' link between the 'fromNode' and 'toNode' nodes in the diagram.

Description

Sublinks extremity nodes are either both nodes-on-link related to the same link the sublink is related to, or a node-on-link and the origin or end node of the link the sub-link is related to. By default, the created sub-link is not visualized. Sub-link ports can be specified for the origin and end nodes (fromPort and toPort parameters).

The eltType sub-link element type must already exist. It can have been defined:

- either in the current opened project through the Schematics Designer GUI,

- or by calling the INgProjectBuilder CreateElementType method in the code

Remarks

The query related to the associated sublink elemeny type must have been set to NULL so the CreateSubLink method correctly works.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
eltType - A reference to a com.esri.arcgis.schematic.INgElementType (in)
eltName - The eltName (in)
refLink - A reference to a com.esri.arcgis.schematic.INgLink (in)
fromNode - A reference to a com.esri.arcgis.schematic.INgNode (in)
toNode - A reference to a com.esri.arcgis.schematic.INgNode (in)
fromPort - The fromPort (in, optional, pass 0 if not required)
toPort - The toPort (in, optional, pass 0 if not required)
visualize - The visualize (in, optional, pass false if not required)
Returns:
A reference to a com.esri.arcgis.schematic.INgSubLink
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.createNodeOnLink(com.esri.arcgis.schematic.INgElementType, String, com.esri.arcgis.schematic.INgLink, int, double, boolean)

createDrawing

INgDrawing createDrawing(INgElementType eltType,
                         String eltName,
                         double x,
                         double y,
                         boolean visualize)
                         throws IOException,
                                AutomationException
Creates the drawing implemented by the 'eltType' type and named 'eltName' at the ('x','y') location in the diagram.

Description

By default, the created drawing is not visualized.

The eltType drawing element type must already exist. It can have been defined:

- either in the current opened project through the Schematics Designer GUI,

- or by calling the INgProjectBuilder CreateElementType method in the code.

Remarks

The query related to the associated drawing element type must have been set to NULL so the CreateDrawing method correctly works.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
eltType - A reference to a com.esri.arcgis.schematic.INgElementType (in)
eltName - The eltName (in)
x - The x (in)
y - The y (in)
visualize - The visualize (in, optional, pass false if not required)
Returns:
A reference to a com.esri.arcgis.schematic.INgDrawing
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgProjectEvents.nameOfDigitDrawing(com.esri.arcgis.schematic.INgProjectEventsNameOfDigitDrawingEvent)

createNodeOnLink

INgNodeOnLink createNodeOnLink(INgElementType eltType,
                               String eltName,
                               INgLink refLink,
                               int mode,
                               double position,
                               boolean visualize)
                               throws IOException,
                                      AutomationException
Creates the node-on-link implemented by the 'eltType' type and named 'eltName' at the 'Position' location on the 'refLink' link in the diagram.

Description

The 'position' parameter value depends on the chosen positioning 'mode'. By default, the created node-on-link is not visualized. The eltType link element type must already exist. It can have been defined:

- either in the current opened project through the Schematics Designer GUI,

- or by calling the INgProjectBuilder CreateElementType method in the code.

Remarks

The query related to the associated node-on-link element type must have been set to NULL so the CreateNodeOnLink method correctly works.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
eltType - A reference to a com.esri.arcgis.schematic.INgElementType (in)
eltName - The eltName (in)
refLink - A reference to a com.esri.arcgis.schematic.INgLink (in)
mode - A com.esri.arcgis.schematic.esriNgPositionOnLinkMode constant (in)
position - The position (in)
visualize - The visualize (in, optional, pass false if not required)
Returns:
A reference to a com.esri.arcgis.schematic.INgNodeOnLink
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.createSubLink(com.esri.arcgis.schematic.INgElementType, String, com.esri.arcgis.schematic.INgLink, com.esri.arcgis.schematic.INgNode, com.esri.arcgis.schematic.INgNode, int, int, boolean)

setModified

void setModified(boolean modified)
                 throws IOException,
                        AutomationException
Forces the value returned by the 'IsModified' function.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
modified - The modified (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.isModified()

redraw

void redraw(int mode)
            throws IOException,
                   AutomationException
Redraws the elements contained in the diagram's view(s) according to the 'mode' redrawing option.

Description

This parameter is optional. The default mode is esriNgRedrawAll; that is Schematics redraws all the elements in all the diagram views.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
mode - A com.esri.arcgis.schematic.esriNgRedrawMode constant (in, optional, pass 1 if not required)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgView.redraw(int), INgDiagram.refresh()

isLayoutSaved

boolean isLayoutSaved()
                      throws IOException,
                             AutomationException
Indicates if there is a backup version for the diagram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The exist
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.deleteSavedLayout()

deleteSavedLayout

void deleteSavedLayout()
                       throws IOException,
                              AutomationException
Removes the backup version of the diagram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.isLayoutSaved()

isModified

boolean isModified()
                   throws IOException,
                          AutomationException
Indicates if the diagram has been modified regarding to its saving version.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The modified
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.setModified(boolean)

restoreInitialPosition

void restoreInitialPosition(int modeIfNotSet,
                            int modeIfSet)
                            throws IOException,
                                   AutomationException
Restores the elements contained in the diagram to their initially defined positions.

Description

If the elements were positioned using their database coordinates, the ModelfSet parameter must be specified so that their positions are modified and the ModelfNotSet parameter can be ignored.

If the elements were positioned without using their database coordinates, then the ModelfNotSet parameter must be specified and the ModelfSet parameter can be ignored.

At all events,

- The esriNgDB parameter value causes the elements to be repositioned based on their database coordinate values (if modeIfSet is used) or to be placed on the 0, 0 coordinate value position (if modeIfNotSet is used).

- The esriNgCenter parameter value causes each element to be relocated on a position averaging the current position of the neighboring elements (modeIfSet case, or modeIfNotSet case)

- The esriNgNothing parameter value does not cause the elements to be relocated (modeIfSet case, or modeIfNotSet case). The elements retain their current position

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
modeIfNotSet - A com.esri.arcgis.schematic.esriNgInitialPositionMode constant (in, optional, pass 0 if not required)
modeIfSet - A com.esri.arcgis.schematic.esriNgInitialPositionMode constant (in, optional, pass 0 if not required)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgNode.restoreInitialPosition(int, int), INgLink.restoreInitialPosition(), INgDrawing.restoreInitialPosition(int, int)

getNode

INgNode getNode(String nodeName)
                throws IOException,
                       AutomationException
Returns the node named 'nodeName' contained in the diagram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
nodeName - The nodeName (in)
Returns:
A reference to a com.esri.arcgis.schematic.INgNode
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.getLink(String), INgDiagram.getDrawing(String)

getLink

INgLink getLink(String linkName)
                throws IOException,
                       AutomationException
Returns the link named 'linkName' contained in the diagram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
linkName - The linkName (in)
Returns:
A reference to a com.esri.arcgis.schematic.INgLink
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.getNode(String), INgDiagram.getLinksBetweenNodes(com.esri.arcgis.schematic.INgNode, com.esri.arcgis.schematic.INgNode, int, int, int), INgDiagram.getDrawing(String)

getDrawing

INgDrawing getDrawing(String drawingName)
                      throws IOException,
                             AutomationException
Returns the drawing named 'drawingName' contained in the diagram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
drawingName - The drawingName (in)
Returns:
A reference to a com.esri.arcgis.schematic.INgDrawing
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.getNode(String), INgDiagram.getLink(String)

refreshLegend

void refreshLegend(int displayMode)
                   throws IOException,
                          AutomationException
Updates the legend content for all the views associated with the diagram so it reflects the modifications that may have occurred in the database.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
displayMode - A com.esri.arcgis.schematic.esriNgLegendDisplayMode constant (in, optional, pass 1 if not required)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getAttributeValue

String getAttributeValue(String attributeName)
                         throws IOException,
                                AutomationException
Returns the value of the attribute named 'attributeName' defined for the diagram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
attributeName - The attributeName (in)
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSaveMode

int getSaveMode()
                throws IOException,
                       AutomationException
Saving option for the diagram.

Description

The default value for the SaveMode property is esriNgSaveUndefined.

The process that is automatically launched each time a schematic diagram is closed depends on the SaveMode property value:

- SaveMode = esriNgSaveUndefined: when you close a diagram you have modified, the IsDiagramSavedByFramework event is automatically fired. If this event returns TRUE (default returned value) you are asked if you want to save the changes.

- SaveMode = esriNgSaveByFramework: when you close a diagram you have modified, Schematics automatically asks you if you want to save your changes (without even calling the IsDiagramSavedByFramework event). If you answer Yes, the information stored in the schematic database relative to the schematic diagram is automatically updated. All the changes introduced in the diagram since it was opened or last saved (node and link positions, …) are taken into account and saved in the schematic database.

- SaveMode = esriNgNotSaveByFramework, Schematics does not save the changes introduced in the diagram. All changes introduced in the diagram since it was opened or last saved are definitively lost.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
A com.esri.arcgis.schematic.esriNgSaveModeType constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.save(), INgProjectEvents.isDiagramSavedByFramework(com.esri.arcgis.schematic.INgProjectEventsIsDiagramSavedByFrameworkEvent)

setSaveMode

void setSaveMode(int pVal)
                 throws IOException,
                        AutomationException
Saving option for the diagram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
pVal - A com.esri.arcgis.schematic.esriNgSaveModeType constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getElementsByUserData

INgElements getElementsByUserData(INgUserDatas userDatas,
                                  INgValues values,
                                  INgElementType eltType)
                                  throws IOException,
                                         AutomationException
Returns all the elements contained in the diagram that are implemented by the 'eltType' element type and which each associated user-data in the 'userDatas' list verifies the 'values' list corresponding values.

Description

The collection of user datas and collection of values passed as parameters must have the same count of elements and go exactly in the correct order.

The method takes care of the user data type. So when you build the INgValues collection in order to use it as a parameter to the method, make sure the type of userdata match the type of value.

Remarks

Suppose you have an element type that has an attribute based on a specific field which possible values are 10, 12, 15, 18 or 20, and you are interested in only getting the elements which field value is 10 or 12. You can associate the attribute with an user data and use the GetElementsByUserData method to retrieve this set of elements. In this case, the process will have to operate in two steps:


Dim Value1 As Variant

Dim Value2 As Variant

Dim pUserDataValues1 As INgValues

Dim pUserDataValues2 As INgValues

Dim pDesiredUserdata As INgUserData

Dim pUserDatas As INgUserDatas

Dim pElements1 As INgElements

Dim pElements2 As INgElements

Dim pElementsFinal As INgElements

Dim pElement As INgElement

Dim pDiagram As INgDiagram

...

pUserDatas.Add (pDesiredUserdata)

' Retrieving elements which user data value is 10

Value1 = CStr(10)

pUserDataValues1.Add Value1

Set pElements1 = pDiagram.GetElementsByUserData(pUserDatas, pUserDataValues1)

' Retrieving elements which user data value is 12

Value2 = CStr(12)

pUserDataValues2.Add Value2

Set pElements2 = pDiagram.GetElementsByUserData(pUserDatas, pUserDataValues2)

' Merging the 2 sets of elements

Set pElementsFinal = pElements1

For Each pElement In pElements2

    pElementsFinal.Add pElement

Next pElement

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
userDatas - A reference to a com.esri.arcgis.schematic.INgUserDatas (in)
values - A reference to a com.esri.arcgis.schematic.INgValues (in)
eltType - A reference to a com.esri.arcgis.schematic.INgElementType (in, optional, pass 0 if not required)
Returns:
A reference to a com.esri.arcgis.schematic.INgElements
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgElementType.getElementsByUserData(com.esri.arcgis.schematic.INgUserDatas, com.esri.arcgis.schematic.INgValues)

openFromStream

void openFromStream(IStream pStream)
                    throws IOException,
                           AutomationException
Loads the diagram from the specified stream.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
pStream - A reference to a com.esri.arcgis.system.IStream (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

saveToStream

void saveToStream(IStream pStream)
                  throws IOException,
                         AutomationException
Saves the diagram to the specified stream.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
pStream - A reference to a com.esri.arcgis.system.IStream (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

startOperation

boolean startOperation(String label)
                       throws IOException,
                              AutomationException
Starts a new operation that will impact the diagram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
label - The label (in, optional, pass if not required)
Returns:
The pOK
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.stopOperation()

stopOperation

void stopOperation()
                   throws IOException,
                          AutomationException
Stop the current started operation that impacted the diagram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.startOperation(String)

canUndoLastOperation

boolean canUndoLastOperation()
                             throws IOException,
                                    AutomationException
Indicates if the last operation that impacted the diagram can be undone.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The canUndo
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.undoLastOperation(), INgDiagram.redoLastUndo()

canRedoLastUndo

boolean canRedoLastUndo()
                        throws IOException,
                               AutomationException
Indicates if the last operation that impacted the diagram can be redone.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The canRedo
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.redoLastUndo()

undoLastOperation

void undoLastOperation()
                       throws IOException,
                              AutomationException
Undoes the last operation that impacted the diagram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.canUndoLastOperation()

redoLastUndo

void redoLastUndo()
                  throws IOException,
                         AutomationException
Redoes the last undone operation in the diagram.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.canRedoLastUndo()

moveElements

void moveElements(INgElements elements,
                  double x,
                  double y,
                  int computeMode)
                  throws IOException,
                         AutomationException
Moves the 'Elements' set of elements contained in the diagram to the (X,Y) relative position.

Remarks

If there are schematic relations between schematics objects contained in a schematic diagram, it’s the developer responsibility to call the appropriate ISchematicRelationController or ISchematicRelationManager methods for the related objects as the containers to be automatically redrawn when he uses the INgDiagram:MoveElements method. Please also note that programming the relations redraw on the INgProjectEvents::OnMoveElements or ISchematicRelationControllerEvent::OnMoveElements events will be completely unuseful because these events are only triggered when schematic elements are moved using the GUI tools; that is when end-users move schematic elements using the mouse or the keyboard arrows. So when elements are moved by programming using any "Move" method, the custom code specified on these events will be not fired. In this case, you must either force the redraw at the end of the move operations sequences in your custom procedure or customize the SchematicAlgorithmEvents::AfterExecuteAlgorithm event (when the "Move" methods are called during a custom algorithm).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
elements - A reference to a com.esri.arcgis.schematic.INgElements (in)
x - The x (in)
y - The y (in)
computeMode - A com.esri.arcgis.schematic.esriNgComputeLinkPointMode constant (in, optional, pass 2059 if not required)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDrawing.move(double, double, int), INgProjectEvents.onMoveElements(com.esri.arcgis.schematic.INgProjectEventsOnMoveElementsEvent), INgNode.move(double, double, int, int)

getNextUndoLabel

String getNextUndoLabel()
                        throws IOException,
                               AutomationException
Returns the label of the next operation in the undo stack.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The label
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.getNextRedoLabel()

getNextRedoLabel

String getNextRedoLabel()
                        throws IOException,
                               AutomationException
Returns the label of the next operation in the redo stack.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The label
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
INgDiagram.getNextUndoLabel()