Package org.openbp.cockpit.modeler.tools

Examples of org.openbp.cockpit.modeler.tools.ModelerTool


  {
  }

  public static void setupToolSupport(ModelerToolSupport toolSupport, boolean isModeler)
  {
    ModelerTool tool;

    // Process variable -> select
    tool = new SimpleSelectTool(toolSupport);
    toolSupport.addToolDecisionTableEntry(tool, ProcessVariableFigure.class, 0);

    // Process variable -> select
    tool = new SimpleSelectTool(toolSupport);
    toolSupport.addToolDecisionTableEntry(tool, ProcessVariableConnection.class, 0);

    // Flow connection -> select
    tool = new SimpleSelectTool(toolSupport);
    tool.setToolCursor(ModelerGraphics.moveSplinePointCursor);
    tool.setToolHintMsg(ModelerGraphics.getMsg("msg.spline"));
    toolSupport.addToolDecisionTableEntry(tool, FlowConnection.class, 0);

    // Param connection -> select
    tool = new SimpleSelectTool(toolSupport);
    tool.setToolCursor(ModelerGraphics.moveSplinePointCursor);
    tool.setToolHintMsg(ModelerGraphics.getMsg("msg.spline"));
    toolSupport.addToolDecisionTableEntry(tool, ParamConnection.class, 0);

    // Text element -> drag
    tool = new XDragTracker(toolSupport);
    tool.setToolCursor(ModelerGraphics.moveTextCursor);
    tool.setToolHintMsg(ModelerGraphics.getMsg("msg.textelement"));
    toolSupport.addToolDecisionTableEntry(tool, TextElementFigure.class, 0);

    // Horizontal line -> drag
    tool = new XDragTracker(toolSupport);
    tool.setToolCursor(ModelerGraphics.moveHLineCursor);
    tool.setToolHintMsg(ModelerGraphics.getMsg("msg.line"));
    toolSupport.addToolDecisionTableEntry(tool, HLineFigure.class, 0);

    // Vertical line -> drag
    tool = new XDragTracker(toolSupport);
    tool.setToolCursor(ModelerGraphics.moveVLineCursor);
    tool.setToolHintMsg(ModelerGraphics.getMsg("msg.line"));
    toolSupport.addToolDecisionTableEntry(tool, VLineFigure.class, 0);

    if (isModeler)
    {
      // Node -> drag
      tool = new XDragTracker(toolSupport);
      tool.setToolCursor(ModelerGraphics.moveNodeCursor);
      tool.setToolHintMsg(ModelerGraphics.getMsg("msg.node"));
      toolSupport.addToolDecisionTableEntry(tool, NodeFigure.class, 0);
    }
    else
    {
      // Node -> select
      tool = new SimpleSelectTool(toolSupport);
      tool.setToolCursor(ModelerGraphics.moveNodeCursor);
      tool.setToolHintMsg(ModelerGraphics.getMsg("msg.nodefixed"));
      toolSupport.addToolDecisionTableEntry(tool, NodeFigure.class, 0);
    }

    // CTRL Node -> scale
    tool = new ScaleTracker(toolSupport);
    tool.setToolCursor(ModelerGraphics.resizeNodeCursor);
    if (isModeler)
    {
      tool.setToolHintMsg(ModelerGraphics.getMsg("msg.node"))// For modeler only
    }
    else
    {
      tool.setToolHintMsg(ModelerGraphics.getMsg("msg.nodefixed"))// For node editor only
    }
    toolSupport.addToolDecisionTableEntry(tool, NodeFigure.class, InputState.CTRL);

    // CTRL Param -> reorder
    tool = new ParamReorderTracker(toolSupport);
    tool.setToolCursor(ModelerGraphics.moveParamCursor);
    tool.setToolHintMsg(ModelerGraphics.getMsg("msg.param"));
    toolSupport.addToolDecisionTableEntry(tool, ParamFigure.class, InputState.CTRL);

    if (! isModeler)
    {
      // Param -> reorder
      tool.setToolHintMsg(ModelerGraphics.getMsg("msg.paramfixed"));
      toolSupport.addToolDecisionTableEntry(tool, ParamFigure.class, 0);
    }

    if (isModeler)
    {
      // Param -> connect
      tool = new ParamConnectionTool(toolSupport);
      tool.setToolCursor(ModelerGraphics.createDataLinkCursor);
      tool.setToolHintMsg(ModelerGraphics.getMsg("msg.param"));
      toolSupport.addToolDecisionTableEntry(tool, ParamFigure.class, 0);
    }

    tool = new RotationTracker(toolSupport);
    tool.setToolCursor(ModelerGraphics.moveTextCursor);
    tool.setToolHintMsg(ModelerGraphics.getMsg("msg.tag"));
    toolSupport.addToolDecisionTableEntry(tool, SimpleTextTagFigure.class, 0);

    // CTRL Socket -> rotate
    tool = new RotationTracker(toolSupport);
    tool.setToolCursor(ModelerGraphics.moveSocketCursor);
    tool.setToolHintMsg(ModelerGraphics.getMsg("msg.socket"));
    toolSupport.addToolDecisionTableEntry(tool, SocketFigure.class, InputState.CTRL);

    if (isModeler)
    {
      // Socket -> connect
      tool = new FlowConnectionTool(toolSupport);
      tool.setToolCursor(ModelerGraphics.createControlLinkCursor);
      tool.setToolHintMsg(ModelerGraphics.getMsg("msg.socket"));
      toolSupport.addToolDecisionTableEntry(tool, SocketFigure.class, 0);
    }
    else
    {
      toolSupport.addToolDecisionTableEntry(tool, SocketFigure.class, 0);
    }

    tool = new RubberBandTool(toolSupport);
    tool.setToolCursor(ModelerGraphics.standardCursor);
    toolSupport.addToolDecisionTableEntry(tool, ProcessDrawing.class, 0);

    tool = new ZoomTool(toolSupport);
    tool.setToolCursor(ModelerGraphics.zoomCursor);
    toolSupport.addToolDecisionTableEntry(tool, ProcessDrawing.class, InputState.ALT | InputState.CTRL | InputState.HOVER);

    tool = new ScrollTool(toolSupport);
    tool.setToolCursor(ModelerGraphics.handScrollCursor);
    toolSupport.addToolDecisionTableEntry(tool, ProcessDrawing.class, InputState.ALT | InputState.HOVER);

    tool = new XHandleTracker(toolSupport);
    tool.setToolCursor(ModelerGraphics.moveSplineHandleCursor);
    toolSupport.addToolDecisionTableEntry(tool, Handle.class, 0);
  }
View Full Code Here

TOP

Related Classes of org.openbp.cockpit.modeler.tools.ModelerTool

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.