Package com.mxgraph.view

Examples of com.mxgraph.view.mxCellState


  public void mouseDragged(MouseEvent e)
  {
    if (!e.isConsumed() && graphComponent.isEnabled() && isEnabled()
        && (e.getButton() == 0 || connectPreview.isActive()))
    {
      mxCellState state = marker.process(e);

      if (connectPreview.isActive())
      {
        mxGraph graph = graphComponent.getGraph();
        double x = graph.snap(e.getX());
View Full Code Here


            {
              // Disables edges as drop targets if the target cell was created
              if (dropTarget == null
                  || !graph.getModel().isEdge(dropTarget))
              {
                mxCellState pstate = graph.getView().getState(
                    dropTarget);

                if (pstate != null)
                {
                  mxGeometry geo = graph.getModel()
                      .getGeometry(vertex);

                  mxPoint origin = pstate.getOrigin();
                  geo.setX(geo.getX() - origin.getX());
                  geo.setY(geo.getY() - origin.getY());
                }
              }
              else
              {
                dropTarget = graph.getDefaultParent();
              }

              graph.addCells(new Object[] { vertex }, dropTarget);
            }

            double x = graph.snap(e.getX());
            double y = graph.snap(e.getY());

            // FIXME: Here we pre-create the state for the vertex to be
            // inserted in order to invoke update in the connectPreview.
            // This means we have a cell state which should be created
            // after the model.update, so this should be fixed.
            mxCellState targetState = graph.getView().getState(
                vertex, true);
            connectPreview.update(e, targetState, x, y);
          }

          Object cell = connectPreview.stop(graphComponent
View Full Code Here

   *
   */
  public void revalidate(mxCellState pState, Object cell)
  {
    mxGraph graph = graphComponent.getGraph();
    mxCellState tmp = graph.getView().getState(cell);
    tmp.setInvalid(true);

    graph.getView().validateBounds(pState, cell);
    graph.getView().validatePoints(pState, cell);

    mxIGraphModel model = graph.getModel();
View Full Code Here

   *
   * @param cell
   */
  public void scrollCellToVisible(Object cell, boolean center)
  {
    mxCellState state = graph.getView().getState(cell);

    if (state != null)
    {
      mxRectangle bounds = state;

View Full Code Here

          {
            return result;
          }
          else if (graph.isCellVisible(cell))
          {
            mxCellState state = view.getState(cell);

            if (state != null
                && canvas.intersects(this, hit, state)
                && (!graph.isSwimlane(cell)
                    || hitSwimlaneContent || (transparentSwimlaneContent && !canvas
View Full Code Here

          int childCount = model.getChildCount(parent);

          for (int i = 0; i < childCount; i++)
          {
            Object cell = model.getChildAt(parent, i);
            mxCellState state = view.getState(cell);

            if (graph.isCellVisible(cell) && state != null)
            {
              if (canvas.contains(this, rect, state))
              {
View Full Code Here

      // Draws the collapse/expand icons
      boolean isEdge = model.isEdge(cell);

      if (foldingEnabled && (model.isVertex(cell) || isEdge))
      {
        mxCellState state = graph.getView().getState(cell);

        if (state != null)
        {
          ImageIcon icon = getFoldingIcon(state);
View Full Code Here

   */
  public Hashtable<Object, Component[]> updateComponents(Object cell)
  {
    Hashtable<Object, Component[]> result = new Hashtable<Object, Component[]>();
    Component[] c = components.remove(cell);
    mxCellState state = getGraph().getView().getState(cell);

    if (state != null)
    {
      if (c == null)
      {
View Full Code Here

      arr2[arr.length] = overlay;
      arr = arr2;
    }

    overlays.put(cell, arr);
    mxCellState state = graph.getView().getState(cell);

    if (state != null)
    {
      updateCellOverlayComponent(state, overlay);
    }
View Full Code Here

   */
  public Hashtable<Object, mxICellOverlay[]> updateCellOverlays(Object cell)
  {
    Hashtable<Object, mxICellOverlay[]> result = new Hashtable<Object, mxICellOverlay[]>();
    mxICellOverlay[] c = overlays.remove(cell);
    mxCellState state = getGraph().getView().getState(cell);

    if (c != null)
    {
      if (state != null)
      {
View Full Code Here

TOP

Related Classes of com.mxgraph.view.mxCellState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.