Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.togethersoft.openapi.ide.diagram
Interface IdeDiagramManager

public interface IdeDiagramManager

`IdeDiagramManager` is responsible for opening/closing a diagram and providing access to the opened diagrams.

Given a `RwiDiagram` the `find` method allows to find an opened `IdeDiagram` visualizing it.

Current `IdeDiagramManager` can be obtained via `IdeDiagramManagerAccess.getDiagramManager` method.

Author:
  TogetherSoft
See Also: IdeDiagramManagerAccess.getDiagramManager()

Method Summary
`void` | `addIdeDiagramListener(IdeDiagramListener listener)` Adds a diagram listener.
`void` | `closeDiagram(IdeDiagram diagram)` Closes the specified diagram.
`void` | `createImagemap(RwiDiagram rwiDiagram, IdeMapBuilder builder)` Creates `ImageMap` for this diagram using the specified `IdeMapBuilder` as the actual creator.
`IdeDiagramEnumeration` | `diagrams()` Returns an enumeration of all opened diagrams.
`IdeDiagram` | `findDiagram(RwiDiagram rwiDiagram)` Specified `RwiDiagram` finds an opened `IdeDiagram` visualizing it.
`IdeDiagram` | `getActiveDiagram()` Returns an active `IdeDiagram` (the one the user is working with).
`boolean` | `isPaneVisible()` Checks whether the Together's diagram pane is visible on the screen.
`IdeDiagram` | `openDiagram(RwiDiagram rwiDiagram, boolean inNewWindow)` Given the `RwiDiagram` creates and opens `IdeDiagram`.
`void` | `print(RwiDiagram rwiDiagram, java.awt.PrintJob printJob)`
`void` | `removeIdeDiagramListener(IdeDiagramListener listener)` Removes a diagram listener.
`void` | `requestFocus()` Requests focus for the diagram pane.
`void` | `saveImage(RwiDiagram rwiDiagram, OutputStream output, String formatID)` Saves the image of the diagram into the OutputStream.
`void` | `setActiveDiagram(IdeDiagram diagram)` Sets the active `IdeDiagram` (the one the user is working with).
`void` | `setPaneVisible(boolean value)` Sets visibility flag of the Together's diagram pane.

Method Detail

### addIdeDiagramListener

    public void addIdeDiagramListener(IdeDiagramListener listener)

  Adds a diagram listener.
  Parameters:
    listener - the `IdeDiagramListener`
  See Also:
    IdeDiagramListener

### closeDiagram

    public void closeDiagram(IdeDiagram diagram)

  Closes the specified diagram.
  Parameters:
    diagram - the `IdeDiagram` to be closed
  See Also:
    IdeDiagram

### createImagemap

    public void createImagemap(RwiDiagram rwiDiagram, IdeMapBuilder builder)

  Creates `ImageMap` for this diagram using the specified `IdeMapBuilder` as the actual creator.
  Parameters:
    builder - `IdeMapBuilder` instance
  See Also:
    IdeMapBuilder

### diagrams

    public IdeDiagramEnumeration diagrams()

  Returns an enumeration of all opened diagrams.
  Returns: `IdeDiagramEnumeration`

### findDiagram

    public IdeDiagram findDiagram(RwiDiagram rwiDiagram)

  Specified `RwiDiagram` finds an opened `IdeDiagram` visualizing it. If there is no opened `IdeDiagram` visualizing it, returns `null`.
  Parameters:
    rwiDiagram - `RwiDiagram` instance
  Returns: opened `IdeDiagram`
  See Also:
    openDiagram(com.togethersoft.openapi.rwi.RwiDiagram,boolean), RwiDiagram

### getActiveDiagram

    public IdeDiagram getActiveDiagram()

  Returns an active `IdeDiagram` (the one the user is working with). If there is no open diagram, this method returns `null`. For example:

       IdeDiagram activeIdeDiagram = IdeDiagramManagerAccess.getDiagramManager().getActiveDiagram();
       if (activeIdeDiagram == null){
         IdeMessageManagerAccess.printMessage(IdeMessageType.ERROR_MODAL,"No open diagram");
       }

  Returns: `IdeDiagram`

### isPaneVisible

    public boolean isPaneVisible()

  Checks whether the Together's diagram pane is visible on the screen.
  Returns: `true` if the diagram pane if visible, `false` otherwise

### openDiagram

    public IdeDiagram openDiagram(RwiDiagram rwiDiagram, boolean inNewWindow)

  Given the `RwiDiagram` creates and opens `IdeDiagram`.
  Parameters:
    rwiDiagram - `RwiDiagram` instance
    inNewWindow - if `true` then the diagram will be opened in a new window, if `false` the in the active window
  Returns: opened `IdeDiagram`
  See Also:
    findDiagram(com.togethersoft.openapi.rwi.RwiDiagram), RwiDiagram, IdeDiagram

### print

    public void print(RwiDiagram rwiDiagram, java.awt.PrintJob printJob)

### removeIdeDiagramListener

    public void removeIdeDiagramListener(IdeDiagramListener listener)

  Removes a diagram listener.
  Parameters:
    listener - the `IdeDiagramListener`
  See Also:
    IdeDiagramListener

### requestFocus

    public void requestFocus()

  Requests focus for the diagram pane. If the diagram pane cannot accept focus, nothing happens.

### saveImage

    public void saveImage(RwiDiagram rwiDiagram, OutputStream output, String formatID)
                    throws java.io.IOException

  Saves the image of the diagram into the OutputStream. The format that the image will be saved in is specified by the `formatID` argument. There are two predefined `formatID` values for GIF and WMF format in `IdeImageFormat` interface.
  Parameters:
    output - `OutputStream` to receive the image
    formatID - `String` ID of the output image format
  Throws:
    IOException - if IO error occurred.
  See Also:
    IdeImageFormat

### setActiveDiagram

    public void setActiveDiagram(IdeDiagram diagram)

  Sets the active `IdeDiagram` (the one the user is working with).
  Parameters:
    diagram - the `IdeDiagram` instance to be set as the active diagram

### setPaneVisible

    public void setPaneVisible(boolean value)

  Sets visibility flag of the Together's diagram pane.
  Parameters:
    value - `boolean` flag. If `true` then the diagram pane will be made visible, invisible otherwise.

Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD