Package org.jgraph.graph

Examples of org.jgraph.graph.AttributeMap$SerializableRectangle2D


  public void updateAutoSize(CellView view) {
    if (view != null && !isEditing()) {
      Rectangle2D bounds = (view.getAttributes() != null) ? GraphConstants
          .getBounds(view.getAttributes())
          : null;
      AttributeMap attrs = getModel().getAttributes(view.getCell());
      if (bounds == null)
        bounds = GraphConstants.getBounds(attrs);
      if (bounds != null) {
        boolean autosize = GraphConstants.isAutoSize(view
            .getAllAttributes());
        boolean resize = GraphConstants.isResize(view
            .getAllAttributes());
        if (autosize || resize) {
          Dimension2D d = getUI().getPreferredSize(this, view);
          bounds.setFrame(bounds.getX(), bounds.getY(), d.getWidth(),
              d.getHeight());
          // Remove resize attribute
          snap(bounds);
          if (resize) {
            if (view.getAttributes() != null)
              view.getAttributes().remove(GraphConstants.RESIZE);
            attrs.remove(GraphConstants.RESIZE);
          }
          view.refresh(getGraphLayoutCache(), getGraphLayoutCache(), false);
        }
      }
    }
View Full Code Here


   * Returns the attributes for the specified cell. If the layout cache
   * returns a view for the cell then this method returns allAttributes,
   * otherwise the method returns model.getAttributes(cell).
   */
  public AttributeMap getAttributes(Object cell) {
    AttributeMap attrs;
    CellView cellView = getGraphLayoutCache().getMapping(cell, false);
    if (cellView != null) {
      attrs = cellView.getAllAttributes();
    } else {
      attrs = getModel().getAttributes(cell);
View Full Code Here

                CellView[] all = graphLayoutCache
                    .getAllDescendants(views);
                for (int i = 0; i < all.length; i++) {
                  CellView orig = graphLayoutCache
                      .getMapping(all[i].getCell(), false);
                  AttributeMap attr = orig.getAllAttributes();
                  all[i].changeAttributes((AttributeMap) attr
                      .clone());
                  all[i].refresh(graph.getModel(), context,
                      false);
                }
              }
View Full Code Here

                  if (view != null
                      && !graphModel.isPort(view
                          .getCell())) {
                    // TODO: Clone required? Same in
                    // GraphConstants.
                    AttributeMap attrs = (AttributeMap) view
                        .getAllAttributes().clone();
                    // Maybe translate?
                    // attrs.translate(dx, dy);
                    attributes.put(cells[i], attrs.clone());
                  }
                }
              }
              ConnectionSet cs = ConnectionSet.create(graphModel,
                  cells, false);
View Full Code Here

    protected GraphActivityInterface createActivityCell(Activity act, String type) {
        return new DefaultGraphActivity(act);
    }

    protected Map initActivityProperties(Point partPoint, Point offset, Activity act, String type) {
        AttributeMap map = new AttributeMap();

        //CUSTOM
        String displayName = act.getName();
        int actW = GraphUtilities.getGraphController().getGraphSettings().getActivityWidth();
        int actH = GraphUtilities.getGraphController().getGraphSettings().getActivityHeight();
View Full Code Here

    protected GraphBubbleActivityInterface createStartCell(ExtendedAttribute sea) {
        return new DefaultGraphBubbleActivity(sea);
    }

    protected Map initStartProperties(Point partPoint, ExtendedAttribute sea) {
        AttributeMap map = new AttributeMap();
        StartEndDescription sed = new StartEndDescription(sea);
        Rectangle bounds = new Rectangle(
                partPoint.x + sed.getOffset().x,
                partPoint.y + sed.getOffset().y,
                GraphUtilities.getGraphController().getGraphSettings().getActivityHeight() / 5 * 3,
 
View Full Code Here

    protected GraphBubbleActivityInterface createEndCell(ExtendedAttribute eea) {
        return new DefaultGraphBubbleActivity(eea);
    }

    protected Map initEndProperties(Point partPoint, ExtendedAttribute eea) {
        AttributeMap map = new AttributeMap();
        StartEndDescription sed = new StartEndDescription(eea);
        Rectangle bounds = new Rectangle(
                partPoint.x + sed.getOffset().x,
                partPoint.y + sed.getOffset().y,
                GraphUtilities.getGraphController().getGraphSettings().getActivityHeight() / 5 * 3,
 
View Full Code Here

    protected GraphParticipantInterface createParticipantCell(Participant par) {
        return new DefaultGraphParticipant(par);
    }

    protected Map initParticipantProperties(Rectangle bounds, Participant par) {
        AttributeMap map = new AttributeMap();
        GraphConstants.setBounds(map, bounds);
        GraphConstants.setOpaque(map, false);
        GraphConstants.setBorderColor(map, Color.black);
        GraphConstants.setMoveable(map, false);
        String fntn = JaWEManager.getFontName();
View Full Code Here

    protected GraphTransitionInterface createTransitionCell(Transition tra) {
        return new DefaultGraphTransition(tra);
    }

    protected Map initTransitionProperties(List points, Transition tra) {
        AttributeMap map = new AttributeMap();
//if (points!=null && points.size()>0) System.out.println("Setting points "+points);
        GraphConstants.setPoints(map, points);
        setTransitionStyle(GraphUtilities.getStyle(tra), map);

        //GraphConstants.setLineColor(map,Utils.getColor(JaWEConfig.getInstance().getTransitionColor()));
View Full Code Here

        return map;
    }

    protected Map initBubbleTransitionProperties(List points, String style) {
        AttributeMap map = new AttributeMap();
//if (points!=null && points.size()>0) System.out.println("Setting points "+points);
        GraphConstants.setPoints(map, points);
        setTransitionStyle(style, map);
        //GraphConstants.setLineColor(map,Utils.getColor(JaWEConfig.getInstance().getTransitionColor()));
        GraphConstants.setLineEnd(map, GraphConstants.ARROW_TECHNICAL);
View Full Code Here

TOP

Related Classes of org.jgraph.graph.AttributeMap$SerializableRectangle2D

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.