Package com.mxgraph.view

Examples of com.mxgraph.view.mxCellState


        }
      }
     
      if (e.getButton() == 0 || (isActive() && connectPreview.isActive()))
      {
        mxCellState state = marker.process(e);
 
        if (connectPreview.isActive())
        {
          connectPreview.update(e, marker.getValidState(), e.getX(),
              e.getY());
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);
              }
 
              // 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, e.getX(),
                  e.getY());
            }
 
View Full Code Here

   */
  protected void animateCell(Object cell, mxCellStatePreview move,
      boolean recurse)
  {
    mxGraph graph = graphComponent.getGraph();
    mxCellState state = graph.getView().getState(cell);
    mxPoint delta = null;

    if (state != null)
    {
      // Moves the animated state from where it will be after the model
View Full Code Here

     * @param cell
     *            Cell that should be drawn onto the canvas.
     */
    public void drawCell(mxICanvas canvas, Object cell)
    {
      mxCellState state = graph.getView().getState(cell);

      if (state != null
          && isCellDisplayable(state.getCell())
          && (!(canvas instanceof mxGraphics2DCanvas) || hitClip(
              (mxGraphics2DCanvas) canvas, state)))
      {
        graph.drawState(canvas, state,
            cell != cellEditor.getEditingCell());
View Full Code Here

    mxGraph graph = graphComponent.getGraph();
    Collection<mxCellState> result = new LinkedList<mxCellState>();

    for (Object cell : movingCells)
    {
      mxCellState cellState = graph.getView().getState(cell);

      if (cellState != null)
      {
        result.add(cellState);

        // Terminates early if too many cells
        if (result.size() >= threshold)
        {
          return null;
        }

        if (isContextPreview())
        {
          Object[] edges = graph.getAllEdges(new Object[] { cell });

          for (Object edge : edges)
          {
            if (!graph.isCellSelected(edge))
            {
              mxCellState edgeState = graph.getView().getState(
                  edge);

              if (edgeState != null)
              {
                // Terminates early if too many cells
View Full Code Here

   * color. The state is returned regardless of the marker color and
   * valid state.
   */
  public mxCellState process(MouseEvent e)
  {
    mxCellState state = null;

    if (isEnabled())
    {
      state = getState(e);
      boolean valid = (state != null) ? isValidState(state) : false;
View Full Code Here

   */
  protected mxCellState getState(MouseEvent e)
  {
    Object cell = getCell(e);
    mxGraphView view = graphComponent.getGraph().getView();
    mxCellState state = getStateToMark(view.getState(cell));

    return (state != null && intersects(state, e)) ? state : null;
  }
View Full Code Here

      mxGraphView view = graph.getView();
      mxPoint sourceConstraint = null;
      mxPoint targetConstraint = null;
      if (view != null)
      {
        mxCellState edgeState = view.getState(edge);
        mxCellState sourceState = view.getState(source);
        mxConnectionConstraint scc = graph.getConnectionConstraint(
            edgeState, sourceState, true);
        if (scc != null)
        {
          sourceConstraint = scc.getPoint();
        }

        mxCellState targetState = view.getState(target);
        mxConnectionConstraint tcc = graph.getConnectionConstraint(
            edgeState, targetState, false);
        if (tcc != null)
        {
          targetConstraint = tcc.getPoint();
View Full Code Here

      while (edge != null)
      {
        list.add(0, edge);

        mxCellState state = view.getState(edge);
        Object source = (state != null) ? state
            .getVisibleTerminal(true) : view.getVisibleTerminal(
            edge, true);
        boolean isSource = source == obj;
        obj = (state != null) ? state.getVisibleTerminal(!isSource)
            : view.getVisibleTerminal(edge, !isSource);
        list.add(0, obj);

        edge = pred.get(obj);
      }
View Full Code Here

    mxGraphView view = graph.getView();
    mxUnionFind uf = createUnionFind(v);

    for (int i = 0; i < e.length; i++)
    {
      mxCellState state = view.getState(e[i]);
      Object source = (state != null) ? state.getVisibleTerminal(true)
          : view.getVisibleTerminal(e[i], true);
      Object target = (state != null) ? state.getVisibleTerminal(false)
          : view.getVisibleTerminal(e[i], false);

      uf.union(uf.find(uf.getNode(source)), uf.find(uf.getNode(target)));
    }
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.