Create JGraph Cell


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. DefaultGraphCell cell = new DefaultGraphCell(name);
  2. GraphConstants.setBorderColor(cell.getAttributes(), Color.black);
  3. GraphConstants.setBounds(cell.getAttributes(), new Rectangle2D.Double(posx, posy, 100, 20));
  4. DefaultPort port = new DefaultPort();
  5. cell.add(port);
  6. graph.getGraphLayoutCache().insert(cell);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.