Examples of NodeView


Examples of de.hpi.eworld.networkview.objects.NodeView

   * @param way
   */
  void addEdge(EdgeView way){
    mxGraphics2DCanvas.putShape(way.getShapeName(), way);
    EdgeModel e = way.getModelElement();
    mxCell from = addShape(new NodeView(e.getFromNode()));
    mxCell to = addShape(new NodeView(e.getToNode()));
    if (from != null && to != null) {
      getGraph().insertEdge(
          getGraph().getDefaultParent(),
          way.getShapeName(),
          way,
View Full Code Here

Examples of de.hpi.eworld.networkview.objects.NodeView

   * @param nodeViews
   * @param scrolledLocalCenter
   * @return the nearest node to a given point
   */
  public static NodeModel getNearestNode(List<NodeView> nodeViews, Point2D scrolledLocalCenter){
    NodeView nearestNodeTodropPoint = nodeViews.get(0);
    double nearestNodeDistance = Point2DUtils.distance(scrolledLocalCenter, nearestNodeTodropPoint.getPosition());
    for (NodeView node : nodeViews){
      double nodeDistance = Point2DUtils.distance(scrolledLocalCenter, node.getPosition());
      if (nodeDistance < nearestNodeDistance){
        nearestNodeTodropPoint = node;
        nearestNodeDistance = nodeDistance;
      }
    }
    return nearestNodeTodropPoint.getModelElement();
  }
View Full Code Here

Examples of giny.view.NodeView

    CyNetwork network = view.getNetwork();
      @SuppressWarnings("unchecked")
    List<CyNode> nodes = network.nodesList();
      List<CySBMLBoundingBox> boxes = new LinkedList<CySBMLBoundingBox>();
      for (CyNode node : nodes){
        NodeView nodeView = view.getNodeView(node);
       
        String nodeId = node.getIdentifier();
        double xpos = nodeView.getXPosition();
        double ypos = nodeView.getYPosition();
      double height = nodeView.getHeight();
      double width = nodeView.getWidth();
      CySBMLBoundingBox box = new CySBMLBoundingBox(nodeId, xpos, ypos, height, width);
      boxes.add(box);
      }
      // Creates the XML file
      XMLInterface.writeXMLFileForLayout(file, boxes);
View Full Code Here

Examples of giny.view.NodeView

        for (CyNode node : nodes){
          // if position is stored
          String nodeId = node.getIdentifier();
          if (boxesMap.containsKey(nodeId)){
            CySBMLBoundingBox box = boxesMap.get(nodeId);
            NodeView nodeView = view.getNodeView(node);   
            nodeView.setXPosition(box.getXpos());
            nodeView.setYPosition(box.getYpos());
            // nodeView.setHeight(box.getHeight());
            // nodeView.setWidth(box.getWidth());
          }
        }
        view.updateView();
View Full Code Here

Examples of giny.view.NodeView

      @SuppressWarnings("unchecked")
    List<CyNode> nodes = network.nodesList();
      CyAttributes nodeAttributes = Cytoscape.getNodeAttributes();
     
      for (CyNode node : nodes){
        NodeView nodeView = view.getNodeView(node);
        // Test if reaction or species node
        String nodeId = node.getIdentifier();
        String nodeType = (String) nodeAttributes.getAttribute(nodeId, CySBMLConstants.ATT_TYPE);
        if (nodeType!=null){
          if (nodeType.equals(CySBMLConstants.NODETYPE_REACTION) || nodeType.equals(CySBMLConstants.NODETYPE_SPECIES)){
           
            double xpos = nodeView.getXPosition();
          double ypos = nodeView.getYPosition();
          double zpos = 0.0;
          double height = nodeView.getHeight();
          double width = nodeView.getWidth();
          double depth = 0.0;
          Dimensions dim = new Dimensions(width, height, depth, level, version);
          Point point = new Point(xpos, ypos, zpos, level, version);
         
          BoundingBox box = new BoundingBox();
View Full Code Here

Examples of org.freeplane.view.swing.map.NodeView

  public void drop(final DropTargetDropEvent dtde) {
    try {
      int dropAction = dtde.getDropAction();
      final Transferable t = dtde.getTransferable();
      final MainView mainView = (MainView) dtde.getDropTargetContext().getComponent();
      final NodeView targetNodeView = mainView.getNodeView();
      final MapView mapView = targetNodeView.getMap();
      mapView.select();
      final NodeModel targetNode = targetNodeView.getModel();
      final Controller controller = Controller.getCurrentController();
      if (dtde.isLocalTransfer() && t.isDataFlavorSupported(MindMapNodesSelection.dropActionFlavor)) {
        final String sourceAction = (String) t.getTransferData(MindMapNodesSelection.dropActionFlavor);
        if (sourceAction.equals("LINK")) {
          dropAction = DnDConstants.ACTION_LINK;
View Full Code Here

Examples of org.freeplane.view.swing.map.NodeView

      if(popupmenu.isShowing()){
        return;
      }
    }
    final MainView component = (MainView) e.getComponent();
    NodeView nodeView = component.getNodeView();
    if (nodeView == null)
      return;

    final NodeModel node = nodeView.getModel();
    final boolean plainEvent = Compat.isPlainEvent(e);
    final boolean inside = nodeSelector.isInside(e);
    final MapController mapController = mc.getMapController();
    if(e.getButton() == 1){
      if(plainEvent){
View Full Code Here

Examples of org.freeplane.view.swing.map.NodeView

  private void showFoldingPopup(MouseEvent e) {
    ModeController mc = Controller.getCurrentController().getModeController();
    final FoldingController foldingController = mc.getExtension(FoldingController.class);
    if(foldingController == null)
      return;
    final NodeView nodeView = nodeSelector.getRelatedNodeView(e);
    final JPopupMenu popupmenu = foldingController.createFoldingPopupMenu(nodeView.getModel());
    AutoHide.start(popupmenu);
    new NodePopupMenuDisplayer().showMenuAndConsumeEvent(popupmenu, e);
    }
View Full Code Here

Examples of org.freeplane.view.swing.map.NodeView

  @Override
  protected void add(final NodeModel node, final IExtension extension) {
    final ExternalResource preview = (ExternalResource) extension;
    for(NodeModel nodeClone : node.clones()){
      for (final INodeView iNodeView : nodeClone.getViewers()) {
        final NodeView view = (NodeView) iNodeView;
        createViewer(preview, view);
      }
    }
    super.add(node, extension);
  }
View Full Code Here

Examples of org.freeplane.view.swing.map.NodeView

  protected Class<ExternalResource> getExtensionClass() {
    return ExternalResource.class;
  }

  public void onViewCreated(final Container container) {
    final NodeView nodeView = (NodeView) container;
    final ExternalResource previewUri = nodeView.getModel().getExtension(ExternalResource.class);
    if (previewUri == null) {
      return;
    }
    createViewer(previewUri, nodeView);
  }
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.