Package org.tinyuml.util

Examples of org.tinyuml.util.MethodCall


  /**
   * Initializes the selector map.
   */
  private static void initSelectorMap() {
    try {
      selectorMap.put("CREATE_PACKAGE", new MethodCall(
        StructureDiagramEditor.class.getMethod("setCreationMode",
        ElementType.class), ElementType.PACKAGE));
      selectorMap.put("CREATE_COMPONENT", new MethodCall(
        StructureDiagramEditor.class.getMethod("setCreationMode",
        ElementType.class), ElementType.COMPONENT));
      selectorMap.put("CREATE_CLASS", new MethodCall(
        StructureDiagramEditor.class.getMethod("setCreationMode",
        ElementType.class), ElementType.CLASS));
      selectorMap.put("CREATE_DEPENDENCY", new MethodCall(
        StructureDiagramEditor.class.getMethod("setCreateConnectionMode",
        RelationType.class), RelationType.DEPENDENCY));
      selectorMap.put("CREATE_ASSOCIATION", new MethodCall(
        StructureDiagramEditor.class.getMethod("setCreateConnectionMode",
        RelationType.class), RelationType.ASSOCIATION));
      selectorMap.put("CREATE_COMPOSITION", new MethodCall(
        StructureDiagramEditor.class.getMethod("setCreateConnectionMode",
        RelationType.class), RelationType.COMPOSITION));
      selectorMap.put("CREATE_AGGREGATION", new MethodCall(
        StructureDiagramEditor.class.getMethod("setCreateConnectionMode",
        RelationType.class), RelationType.AGGREGATION));
      selectorMap.put("CREATE_INHERITANCE", new MethodCall(
        StructureDiagramEditor.class.getMethod("setCreateConnectionMode",
        RelationType.class), RelationType.INHERITANCE));
      selectorMap.put("CREATE_INTERFACE_REALIZATION", new MethodCall(
        StructureDiagramEditor.class.getMethod("setCreateConnectionMode",
        RelationType.class), RelationType.INTERFACE_REALIZATION));
      selectorMap.put("RESET_POINTS", new MethodCall(
        StructureDiagramEditor.class.getMethod("resetConnectionPoints")));
      selectorMap.put("RECT_TO_DIRECT", new MethodCall(
        StructureDiagramEditor.class.getMethod("rectilinearToDirect")));
      selectorMap.put("DIRECT_TO_RECT", new MethodCall(
        StructureDiagramEditor.class.getMethod("directToRectilinear")));
      selectorMap.put("NAVIGABLE_TO_SOURCE", new MethodCall(
        StructureDiagramEditor.class.getMethod("setNavigability",
        RelationEndType.class), RelationEndType.SOURCE));
      selectorMap.put("NAVIGABLE_TO_TARGET", new MethodCall(
        StructureDiagramEditor.class.getMethod("setNavigability",
        RelationEndType.class), RelationEndType.TARGET));
    } catch (NoSuchMethodException ex) {
      ex.printStackTrace();
    }
View Full Code Here


  /**
   * {@inheritDoc}
   */
  @Override
  public void handleCommand(String command) {
    MethodCall methodcall = selectorMap.get(command);
    if (methodcall != null) methodcall.call(this);
    else super.handleCommand(command);
  }
View Full Code Here

  /**
   * Initializes the selector map.
   */
  private static void initSelectorMap() {
    try {
      selectorMap.put("SELECT_MODE", new MethodCall(
        DiagramEditor.class.getMethod("setSelectionMode")));
      selectorMap.put("REDRAW", new MethodCall(
        DiagramEditor.class.getMethod("redraw")));
      selectorMap.put("ZOOM_50", new MethodCall(
        DiagramEditor.class.getMethod("setScaling", Scaling.class),
          Scaling.SCALING_50));
      selectorMap.put("ZOOM_75", new MethodCall(
        DiagramEditor.class.getMethod("setScaling", Scaling.class),
          Scaling.SCALING_75));
      selectorMap.put("ZOOM_100", new MethodCall(
        DiagramEditor.class.getMethod("setScaling", Scaling.class),
          Scaling.SCALING_100));
      selectorMap.put("ZOOM_150", new MethodCall(
        DiagramEditor.class.getMethod("setScaling", Scaling.class),
          Scaling.SCALING_150));
      selectorMap.put("BRING_TO_FRONT", new MethodCall(
        DiagramEditor.class.getMethod("bringToFront")));
      selectorMap.put("PUT_TO_BACK", new MethodCall(
        DiagramEditor.class.getMethod("putToBack")));
      selectorMap.put("EDIT_PROPERTIES", new MethodCall(
        DiagramEditor.class.getMethod("editProperties")));
      selectorMap.put("CREATE_NOTE", new MethodCall(
        DiagramEditor.class.getMethod("setCreationMode",
        ElementType.class), ElementType.NOTE));
      selectorMap.put("CREATE_NOTE_CONNECTION", new MethodCall(
        DiagramEditor.class.getMethod("setCreateConnectionMode",
        RelationType.class), RelationType.NOTE_CONNECTOR));
    } catch (NoSuchMethodException ex) {
      ex.printStackTrace();
    }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void handleCommand(String command) {
    MethodCall methodcall = selectorMap.get(command);
    if (methodcall != null) methodcall.call(this);
  }
View Full Code Here

  /**
   * Initializes the selector map.
   */
  private void initSelectorMap() {
    try {
      selectorMap.put("NEW_MODEL", new MethodCall(
        getClass().getMethod("newModel")));
      selectorMap.put("NEW_STRUCTURE_DIAGRAM", new MethodCall(
        getClass().getMethod("openNewStructureEditor")));
      selectorMap.put("NEW_SEQUENCE_DIAGRAM", new MethodCall(
        getClass().getMethod("openNewSequenceEditor")));
      selectorMap.put("OPEN_MODEL", new MethodCall(
        getClass().getMethod("openModel")));
      selectorMap.put("SAVE_AS", new MethodCall(
        getClass().getMethod("saveAs")));
      selectorMap.put("SAVE", new MethodCall(
        getClass().getMethod("save")));
      selectorMap.put("EXPORT_GFX", new MethodCall(
        getClass().getMethod("exportGfx")));
      selectorMap.put("REDO", new MethodCall(
        getClass().getMethod("redo")));
      selectorMap.put("UNDO", new MethodCall(
        getClass().getMethod("undo")));
      selectorMap.put("DELETE", new MethodCall(
        getClass().getMethod("delete")));
      selectorMap.put("EDIT_SETTINGS", new MethodCall(
        getClass().getMethod("editSettings")));
      selectorMap.put("QUIT", new MethodCall(
        getClass().getMethod("quitApplication")));
      selectorMap.put("ABOUT", new MethodCall(
        getClass().getMethod("about")));
      selectorMap.put("HELP_CONTENTS", new MethodCall(
        getClass().getMethod("displayHelpContents")));
    } catch (NoSuchMethodException ex) {
      ex.printStackTrace();
    }
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void handleCommand(String command) {
    MethodCall methodcall = selectorMap.get(command);
    if (methodcall != null) {
      methodcall.call(this);
    }
  }
View Full Code Here

  /**
   * Initializes the selector map.
   */
  private static void initSelectorMap() {
    try {
      selectorMap.put("CREATE_LIFELINE", new MethodCall(
        SequenceDiagramEditor.class.getMethod("setCreationMode",
          ElementType.class), ElementType.LIFE_LINE));
      selectorMap.put("CREATE_MESSAGE", new MethodCall(
        SequenceDiagramEditor.class.getMethod("setCreateConnectionMode",
          RelationType.class), RelationType.MESSAGE));
    } catch (NoSuchMethodException ex) {
      ex.printStackTrace();
    }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public void handleCommand(String command) {
    MethodCall methodcall = selectorMap.get(command);
    if (methodcall != null) methodcall.call(this);
    else super.handleCommand(command);
  }
View Full Code Here

TOP

Related Classes of org.tinyuml.util.MethodCall

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.