JGraph X 1.3.0.0

## com.mxgraph.layout
Class mxGraphLayout

    java.lang.Object
      com.mxgraph.layout.mxGraphLayout

All Implemented Interfaces:
  mxIGraphLayout

Direct Known Subclasses:
  mxCircleLayout, mxCompactTreeLayout, mxEdgeLabelLayout, mxFastOrganicLayout, mxHierarchicalLayout, mxOrganicLayout, mxOrthogonalLayout, mxParallelEdgeLayout, mxPartitionLayout, mxStackLayout

    public abstract class mxGraphLayout

extends java.lang.Object
implements mxIGraphLayout

Abstract bass class for layouts

Field Summary
`protected mxGraph` `graph` Holds the enclosing graph.
`protected boolean` `useBoundingBox` Boolean indicating if the bounding box of the label should be used if its available.

Constructor Summary
`mxGraphLayout(mxGraph graph)` Constructs a new fast organic layout for the specified graph.

Method Summary
`java.lang.Object` `getConstraint(java.lang.Object key, java.lang.Object cell)` Returns the constraint for the given key and cell.
`java.lang.Object` `getConstraint(java.lang.Object key, java.lang.Object cell, java.lang.Object edge, boolean source)` Returns the constraint for the given key and cell.
`mxGraph` `getGraph()` Returns the associated graph.
`mxRectangle` `getVertexBounds(java.lang.Object vertex)` Returns an <mxRectangle> that defines the bounds of the given cell or the bounding box if <useBoundingBox> is true.
`boolean` `isEdgeIgnored(java.lang.Object edge)` Returns true if the given edge has no source or target terminal.
`boolean` `isUseBoundingBox()`
`boolean` `isVertexIgnored(java.lang.Object vertex)` Returns true if the given vertex has no connected edges.
`boolean` `isVertexMovable(java.lang.Object vertex)` Returns true if the given vertex may be moved by the layout.
`void` `moveCell(java.lang.Object cell, double x, double y)` Notified when a cell is being moved in a parent that has automatic layout to update the cell state (eg.
`void` `setEdgePoints(java.lang.Object edge, java.util.List<mxPoint> points)` Sets the control points of the given edge to the given list of mxPoints.
`void` `setEdgeStyleEnabled(java.lang.Object edge, boolean value)` Disables or enables the edge style of the given edge.
`void` `setUseBoundingBox(boolean useBoundingBox)`
`mxRectangle` `setVertexLocation(java.lang.Object vertex, double x, double y)` Sets the new position of the given cell taking into account the size of the bounding box if <useBoundingBox> is true.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.mxgraph.layout.mxIGraphLayout
`execute`

Field Detail

### graph

    protected mxGraph graph

  Holds the enclosing graph.

### useBoundingBox

    protected boolean useBoundingBox

  Boolean indicating if the bounding box of the label should be used if its available. Default is true.

Constructor Detail

### mxGraphLayout

    public mxGraphLayout(mxGraph graph)

  Constructs a new fast organic layout for the specified graph.

Method Detail

### moveCell

    public void moveCell(java.lang.Object cell,
                         double x,
                         double y)

  Description copied from interface: `mxIGraphLayout`
  Notified when a cell is being moved in a parent that has automatic layout to update the cell state (eg. index) so that the outcome of the layout will position the vertex as close to the point (x, y) as possible.

  Specified by:
    `moveCell` in interface `mxIGraphLayout`
  Parameters:
    `cell` - Cell which is being moved.
    `x` - X-coordinate of the new cell location.
    `y` - Y-coordinate of the new cell location.

### getGraph

    public mxGraph getGraph()

  Returns the associated graph.

### getConstraint

    public java.lang.Object getConstraint(java.lang.Object key,
                                          java.lang.Object cell)

  Returns the constraint for the given key and cell. This implementation always returns the value for the given key in the style of the given cell.

  Parameters:
    `key` - Key of the constraint to be returned.
    `cell` - Cell whose constraint should be returned.

### getConstraint

    public java.lang.Object getConstraint(java.lang.Object key,
                                          java.lang.Object cell,
                                          java.lang.Object edge,
                                          boolean source)

  Returns the constraint for the given key and cell. The optional edge and source arguments are used to return inbound and outgoing routing- constraints for the given edge and vertex. This implementation always returns the value for the given key in the style of the given cell.

  Parameters:
    `key` - Key of the constraint to be returned.
    `cell` - Cell whose constraint should be returned.
    `edge` - Optional cell that represents the connection whose constraint should be returned. Default is null.
    `source` - Optional boolean that specifies if the connection is incoming or outgoing. Default is false.

### isUseBoundingBox

    public boolean isUseBoundingBox()

  Returns:
    the useBoundingBox

### setUseBoundingBox

    public void setUseBoundingBox(boolean useBoundingBox)

  Parameters:
    `useBoundingBox` - the useBoundingBox to set

### isVertexMovable

    public boolean isVertexMovable(java.lang.Object vertex)

  Returns true if the given vertex may be moved by the layout.

  Parameters:
    `vertex` - Object that represents the vertex to be tested.
  Returns:
    Returns true if the vertex can be moved.

### isVertexIgnored

    public boolean isVertexIgnored(java.lang.Object vertex)

  Returns true if the given vertex has no connected edges.

  Parameters:
    `vertex` - Object that represents the vertex to be tested.
  Returns:
    Returns true if the vertex should be ignored.

### isEdgeIgnored

    public boolean isEdgeIgnored(java.lang.Object edge)

  Returns true if the given edge has no source or target terminal.

  Parameters:
    `edge` - Object that represents the edge to be tested.
  Returns:
    Returns true if the edge should be ignored.

### setEdgeStyleEnabled

    public void setEdgeStyleEnabled(java.lang.Object edge,
                                    boolean value)

  Disables or enables the edge style of the given edge.

### setEdgePoints

    public void setEdgePoints(java.lang.Object edge,
                              java.util.List<mxPoint> points)

  Sets the control points of the given edge to the given list of mxPoints. Set the points to null to remove all existing points for an edge.

### getVertexBounds

    public mxRectangle getVertexBounds(java.lang.Object vertex)

  Returns an <mxRectangle> that defines the bounds of the given cell or the bounding box if <useBoundingBox> is true.

### setVertexLocation

    public mxRectangle setVertexLocation(java.lang.Object vertex,
                                         double x,
                                         double y)

  Sets the new position of the given cell taking into account the size of the bounding box if <useBoundingBox> is true. The change is only carried out if the new location is not equal to the existing location, otherwise the geometry is not replaced with an updated instance. The new or old bounds are returned (including overlapping labels). Parameters: cell - <mxCell> whose geometry is to be set. x - Integer that defines the x-coordinate of the new location. y - Integer that defines the y-coordinate of the new location.

JGraph X 1.3.0.0

Copyright (c) 2008 Gaudenz Alder. All rights reserved.