Examples of JGraphpadVertexTool


Examples of com.jgraph.pad.tool.JGraphpadVertexTool

   * @see #createVertexTool(String, Object, int, ImageIcon)
   * @see #createEdgeTool(String, String, Edge.Routing)
   */
  protected void addTools(JGraphEditor editor, JGraphEditorKit kit) {
    kit.addTool(new JGraphEditorTool(NAME_SELECTTOOL, false));
    JGraphpadVertexTool tool = createVertexTool(NAME_TEXTTOOL,
        new JGraphpadRichTextValue(""), -1, null, true);
    tool.setPreviewEnabled(false);
    kit.addTool(tool);
    kit.addTool(createVertexTool(NAME_VERTEXTOOL,
        new JGraphpadRichTextValue(""),
        JGraphpadVertexRenderer.SHAPE_RECTANGLE, null));
    JComponent c = new JGraphpadHeavyweightRenderer();
View Full Code Here

Examples of com.jgraph.pad.tool.JGraphpadVertexTool

   * @see JGraphpadGraphConstants#setVertexShape(Map, int)
   * @see JGraphpadVertexTool
   */
  protected JGraphpadVertexTool createVertexTool(String name, Object defaultValue,
  int shape, ImageIcon icon, boolean postEdit) {
    JGraphpadVertexTool vertextTool = null

    Object userObject = createVertexUserObject(defaultValue);
    GraphCell vertex = createVertex(userObject);
    if (shape >= 0) {
      JGraphpadGraphConstants.setVertexShape(vertex.getAttributes(),
                                             shape);
    } else {
      vertex.getAttributes().remove(GraphConstants.BORDERCOLOR);
      vertex.getAttributes().remove(GraphConstants.BORDER);
    }
    if (icon != null) {
      GraphConstants.setIcon(vertex.getAttributes(), icon);
    }
    if (postEdit) {
      vertextTool = new JGraphpadVertexTool(name, vertex) {
        protected void execute(JGraph graph, Object cell) {
          super.execute(graph, cell);
          graph.startEditingAtCell(cell);
        }
      };
    } else {
      vertextTool = new JGraphpadVertexTool(name, vertex);
    }
    Dimension dimension =
      new Dimension(WorkflowProperties.cellHeight, WorkflowProperties.cellWidth);
    vertextTool.setSingleClickSize(dimension);
    return vertextTool; 
  }
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.