Examples of mxCellState


Examples of com.mxgraph.view.mxCellState

     */
    public String getToolTipForCell(Object cell)
    {
      String tip = "<html>";
      mxGeometry geo = getModel().getGeometry(cell);
      mxCellState state = getView().getState(cell);

      if (getModel().isEdge(cell))
      {
        tip += "points={";

        if (geo != null)
        {
          List<mxPoint> points = geo.getPoints();

          if (points != null)
          {
            Iterator<mxPoint> it = points.iterator();

            while (it.hasNext())
            {
              mxPoint point = it.next();
              tip += "[x=" + numberFormat.format(point.getX())
                  + ",y=" + numberFormat.format(point.getY())
                  + "],";
            }

            tip = tip.substring(0, tip.length() - 1);
          }
        }

        tip += "}<br>";
        tip += "absPoints={";

        if (state != null)
        {

          for (int i = 0; i < state.getAbsolutePointCount(); i++)
          {
            mxPoint point = state.getAbsolutePoint(i);
            tip += "[x=" + numberFormat.format(point.getX())
                + ",y=" + numberFormat.format(point.getY())
                + "],";
          }

          tip = tip.substring(0, tip.length() - 1);
        }

        tip += "}";
      }
      else
      {
        tip += "geo=[";

        if (geo != null)
        {
          tip += "x=" + numberFormat.format(geo.getX()) + ",y="
              + numberFormat.format(geo.getY()) + ",width="
              + numberFormat.format(geo.getWidth()) + ",height="
              + numberFormat.format(geo.getHeight());
        }

        tip += "]<br>";
        tip += "state=[";

        if (state != null)
        {
          tip += "x=" + numberFormat.format(state.getX()) + ",y="
              + numberFormat.format(state.getY()) + ",width="
              + numberFormat.format(state.getWidth())
              + ",height="
              + numberFormat.format(state.getHeight());
        }

        tip += "]";
      }

View Full Code Here

Examples of com.mxgraph.view.mxCellState

   *
   * @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

Examples of com.mxgraph.view.mxCellState

          {
            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

Examples of com.mxgraph.view.mxCellState

          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

Examples of com.mxgraph.view.mxCellState

      // 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

Examples of com.mxgraph.view.mxCellState

   */
  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

Examples of com.mxgraph.view.mxCellState

      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

Examples of com.mxgraph.view.mxCellState

   */
  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

Examples of com.mxgraph.view.mxCellState

    if (editingCell != null)
    {
      stopEditing(true);
    }

    mxCellState state = graphComponent.getGraph().getView().getState(cell);

    if (state != null)
    {
      editingCell = cell;
      trigger = evt;

      double scale = Math.max(minimumEditorScale, graphComponent
          .getGraph().getView().getScale());
      scrollPane.setBounds(getEditorBounds(state, scale));
      scrollPane.setVisible(true);

      String value = getInitialValue(state, evt);
      JTextComponent currentEditor = null;

      // Configures the style of the in-place editor
      if (graphComponent.getGraph().isHtmlLabel(cell))
      {
        if (isExtractHtmlBody())
        {
          value = mxUtils.getBodyMarkup(value,
              isReplaceHtmlLinefeeds());
        }

        editorPane.setDocument(mxUtils.createHtmlDocumentObject(
            state.getStyle(), scale));
        editorPane.setText(value);

        // Workaround for wordwrapping in editor pane
        // FIXME: Cursor not visible at end of line
        JPanel wrapper = new JPanel(new BorderLayout());
        wrapper.setOpaque(false);
        wrapper.add(editorPane, BorderLayout.CENTER);
        scrollPane.setViewportView(wrapper);

        currentEditor = editorPane;
      }
      else
      {
        textArea.setFont(mxUtils.getFont(state.getStyle(), scale));
        Color fontColor = mxUtils.getColor(state.getStyle(),
            mxConstants.STYLE_FONTCOLOR, Color.black);
        textArea.setForeground(fontColor);
        textArea.setText(value);

        scrollPane.setViewportView(textArea);
View Full Code Here

Examples of com.mxgraph.view.mxCellState

        trigger = null;
        graphComponent.labelChanged(cell, getCurrentValue(), trig);
      }
      else
      {
        mxCellState state = graphComponent.getGraph().getView()
            .getState(cell);
        graphComponent.redraw(state);
      }

      if (scrollPane.getParent() != null)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.