Package org.jgraph.graph

Examples of org.jgraph.graph.AttributeMap$SerializableRectangle2D


    cell.add(new DefaultPort());
    return cell;
  }

  private AttributeMap getEdgeAttributes(DefaultEdge edge) {
    AttributeMap eMap = new AttributeMap();
    GraphConstants.setLineEnd(eMap, GraphConstants.ARROW_TECHNICAL);
    GraphConstants.setEndFill(eMap, true);
    GraphConstants.setEndSize(eMap, 10);
    GraphConstants.setForeground(eMap, Color.decode("#25507C"));
    GraphConstants.setFont(eMap,
        GraphConstants.DEFAULTFONT.deriveFont(Font.BOLD, 12));
    GraphConstants.setLineColor(eMap, Color.decode("#7AA1E6"));
    AttributeMap map = new AttributeMap();
    map.put(edge, eMap);
    return map;
  }
View Full Code Here


    map.put(edge, eMap);
    return map;
  }

  private AttributeMap getVertexAttributes(DefaultGraphCell cell) {
    AttributeMap vMap = new AttributeMap();

    Color c = Color.decode("#FF9900");
    GraphConstants.setBounds(vMap, new Rectangle2D.Double(50, 50, 90, 30));
    GraphConstants.setBorder(vMap, BorderFactory.createRaisedBevelBorder());
    GraphConstants.setBackground(vMap, c);
    GraphConstants.setForeground(vMap, Color.white);
    GraphConstants.setFont(vMap,
        GraphConstants.DEFAULTFONT.deriveFont(Font.BOLD, 12));
    GraphConstants.setOpaque(vMap, true);

    AttributeMap map = new AttributeMap();
    map.put(cell, vMap);
    return map;
  }
View Full Code Here

      return false;
    else if (cellObject instanceof DefaultPort)
      return false;
    else if (cellObject instanceof DefaultGraphCell) {
      DefaultGraphCell defaultGraphCell = (DefaultGraphCell) cellObject;
      AttributeMap attributes = defaultGraphCell.getAttributes();
      String type = (String) attributes.get(CELL_TYPE_KEY);
      if (type != null && type.equals(CELL_TYPE_ACTION))
        return true;
      else
        return false;
    } else
View Full Code Here

      graphEditorKit.getTool(JGraphpad.NAME_TEXTTOOL)
    vertexTool = (JGraphpadVertexTool)
      graphEditorKit.getTool(JGraphpad.NAME_VERTEXTOOL)

    DefaultGraphCell defaultGraphCell = (DefaultGraphCell) vertexTool.getPrototype();
    AttributeMap vertexAttributes = defaultGraphCell.getAttributes();
    vertexAttributes.put(CellType.CELL_TYPE_KEY, CellType.CELL_TYPE_ACTION);

    LoadFile loadFile = new LoadFile();
    ImageIcon rectangleIcon = loadFile.receiveImageIcon("rectangleCursor.gif");
    ImageIcon edgeIcon = loadFile.receiveImageIcon("edgeCursor.gif");
    ImageIcon orthogonalIcon = loadFile.receiveImageIcon("orthogonalCursor.gif");
View Full Code Here

   *            The vertex to be configured.
   *
   * @see #addPorts(MutableTreeNode, Point2D[])
   */
  protected void configureVertex(GraphCell vertex) {
    AttributeMap attributes = vertex.getAttributes();
    if (defaultBorderColor != null) {
      GraphConstants.setOpaque(attributes, false);
      GraphConstants.setBorderColor(attributes, defaultBorderColor);
      GraphConstants.setGroupOpaque(attributes, false);
      JGraphpadGraphConstants.setGroupResize(attributes, true);
View Full Code Here

   *            The port to be configured.
   * @param offset
   *            The relative offset of the port.
   */
  public void configurePort(GraphCell port, Point2D offset) {
    AttributeMap map = port.getAttributes();
    if (offset != null)
      GraphConstants.setOffset(map, offset);
  }
View Full Code Here

   *
   * @param edge
   *            The edge to be configured.
   */
  protected void configureEdge(GraphCell edge) {
    AttributeMap attributes = edge.getAttributes();
    if (defaultEdgeFont != null)
      GraphConstants.setFont(attributes, defaultEdgeFont);
    if (defaultEndDecoration != GraphConstants.ARROW_NONE)
      GraphConstants.setLineEnd(attributes, defaultEndDecoration);
    if (defaultBeginDecoration != GraphConstants.ARROW_NONE)
View Full Code Here

   * implementation returns a new instance of {@link AttributeMap}.
   *
   * @return Returns a new attribute map.
   */
  protected AttributeMap createAttributeMap() {
    return new AttributeMap();
  }
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

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.