Package weka.gui.hierarchyvisualizer

Examples of weka.gui.hierarchyvisualizer.HierarchyVisualizer$Node


  }


  @Override
  public void process(NodeContainer nodeContainer) {
    Node node = nodeContainer.getEntity();

    if (nodesSeen) {
      left = Math.min(left, node.getLongitude());
      right = Math.max(right, node.getLongitude());

      bottom = Math.min(bottom, node.getLatitude());
      top = Math.max(top, node.getLatitude());
    } else {
      left = node.getLongitude();
      right = node.getLongitude();
      top = node.getLatitude();
      bottom = node.getLatitude();
      nodesSeen = true;
    }

    objects.add(nodeContainer);
  }
View Full Code Here


    DatasetContext dsCtx = dataset.createReader();
   
    try {
      EntityManager<Node> nodeManager = dsCtx.getNodeManager();
      OsmUser user;
      Node node;
     
      // Create the user for edits to be performed under. This is an existing user with an
      // updated name.
      user = new OsmUser(10, "user10b");
     
      // Modify node 1 to add a new tag.
      node = nodeManager.getEntity(1).getWriteableInstance();
      node.setUser(user);
      node.getTags().add(new Tag("change", "new tag"));
      nodeManager.modifyEntity(node);
     
      // Delete node 6.
      nodeManager.removeEntity(6);
     
      // Add node 7 using the NONE user.
      node = new Node(new CommonEntityData(7, 16, buildDate("2008-01-02 18:19:20"), OsmUser.NONE, 93), -11, -12);
      node.getTags().addAll(
          Arrays.asList(new Tag[]{new Tag("created_by", "Me7"), new Tag("change", "new node")}));
      nodeManager.addEntity(node);
     
      dsCtx.complete();
     
View Full Code Here

  @Test
  public void badSortOrderVersion() throws Exception {
    ChangeSimplifier simplifier = new ChangeSimplifier();
    simplifier.setChangeSink(new NullChangeWriter());
    simplifier.initialize(new HashMap<String, Object>());
    Node node;

    node = new Node(new CommonEntityData(1, 2, new Date(), OsmUser.NONE, 2), 1, 1);
    simplifier.process(new ChangeContainer(new NodeContainer(node), ChangeAction.Modify));

    try {
      node = new Node(new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1);
      simplifier.process(new ChangeContainer(new NodeContainer(node), ChangeAction.Modify));
    } catch (OsmosisRuntimeException e) {
      if (e.getMessage().startsWith("Pipeline entities are not sorted")) {
        return;
      }
View Full Code Here

  @Test
  public void badSortOrderId() throws Exception {
    ChangeSimplifier simplifier = new ChangeSimplifier();
    simplifier.setChangeSink(new NullChangeWriter());
    simplifier.initialize(new HashMap<String, Object>());
    Node node;

    node = new Node(new CommonEntityData(2, 2, new Date(), OsmUser.NONE, 2), 1, 1);
    simplifier.process(new ChangeContainer(new NodeContainer(node), ChangeAction.Modify));

    try {
      node = new Node(new CommonEntityData(1, 2, new Date(), OsmUser.NONE, 1), 1, 1);
      simplifier.process(new ChangeContainer(new NodeContainer(node), ChangeAction.Modify));
    } catch (OsmosisRuntimeException e) {
      if (e.getMessage().startsWith("Pipeline entities are not sorted")) {
        return;
      }
View Full Code Here

  @Test
  public void badSortOrderType() throws Exception {
    ChangeSimplifier simplifier = new ChangeSimplifier();
    simplifier.setChangeSink(new NullChangeWriter());
    simplifier.initialize(new HashMap<String, Object>());
    Node node;
    Way way;
   
    way = new Way(new CommonEntityData(2, 2, new Date(), OsmUser.NONE, 2));
    simplifier.process(new ChangeContainer(new WayContainer(way), ChangeAction.Modify));

    try {
      node = new Node(new CommonEntityData(1, 2, new Date(), OsmUser.NONE, 1), 1, 1);
      simplifier.process(new ChangeContainer(new NodeContainer(node), ChangeAction.Modify));
    } catch (OsmosisRuntimeException e) {
      if (e.getMessage().startsWith("Pipeline entities are not sorted")) {
        return;
      }
View Full Code Here

            }
          }
          continue;
        }

        Node node = (Node)inode;
        if(node.getIndex() != index) continue;
        Attribute [] attrs = inode.getAttributes();
        if(attrs == null || attrs.length < 1) {
          list.add(item);
        } else {
          String data = (String)item.getData();
View Full Code Here

    }
        });
      jf.setVisible(true);
      tv.fitToScreen();
    } else if (graphString.startsWith("Newick:")) {
      HierarchyVisualizer tv = new HierarchyVisualizer(graphString.substring(7));
      jf.getContentPane().add(tv, BorderLayout.CENTER);
      jf.addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(java.awt.event.WindowEvent e) {
          jf.dispose();
        }
      });
      jf.setVisible(true);
      tv.fitToScreen();
    }
  }
View Full Code Here

      });

      jf.setVisible(true);
      tv.fitToScreen();
    } else if (graphString.startsWith(Messages.getInstance().getString("ClustererPanel_VisualizeTree_GraphStringStartsWith_Text"))) {
      HierarchyVisualizer tv = new HierarchyVisualizer(graphString.substring(7));
      jf.getContentPane().add(tv, BorderLayout.CENTER);
      jf.addWindowListener(new java.awt.event.WindowAdapter() {
          public void windowClosing(java.awt.event.WindowEvent e) {
                  jf.dispose();
          }
      });
      jf.setVisible(true);
      tv.fitToScreen();
    }
  }
View Full Code Here

        JInternalFrame visualizationWindow = new JInternalFrame(
            clusterNumber, true, true, true, true);
        visualizationWindow.setSize(600, 500);
        visualizationWindow.setLayout(new BorderLayout());

        HierarchyVisualizer visualizer = new HierarchyVisualizer(c);
        visualizationWindow.add(visualizer, BorderLayout.CENTER);
        visualizer.fitToScreen();

        // Text field with the clustering result in Newick format
        JTextField data = new JTextField(c);
        visualizationWindow.add(data, BorderLayout.SOUTH);
        visualizationWindow.setVisible(true);
View Full Code Here

    }
        });
      jf.setVisible(true);
      tv.fitToScreen();
    } else if (graphString.startsWith("Newick:")) {
      HierarchyVisualizer tv = new HierarchyVisualizer(graphString.substring(7));
      jf.getContentPane().add(tv, BorderLayout.CENTER);
      jf.addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(java.awt.event.WindowEvent e) {
          jf.dispose();
        }
      });
      jf.setVisible(true);
      tv.fitToScreen();
    }
  }
View Full Code Here

TOP

Related Classes of weka.gui.hierarchyvisualizer.HierarchyVisualizer$Node

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.