use of javax.swing.tree.DefaultMutableTreeNode in project binnavi by google.
the class TypesTreeModelTests method getNodesByLevel.
// Returns a mapping that associates a level (distance from root) with each node in the default
// tree model.
private static Multimap<Integer, DefaultMutableTreeNode> getNodesByLevel(final DefaultMutableTreeNode root) {
final Multimap<Integer, DefaultMutableTreeNode> nodesByLevel = HashMultimap.create();
for (final Enumeration<?> e = root.breadthFirstEnumeration(); e.hasMoreElements(); ) {
final DefaultMutableTreeNode node = (DefaultMutableTreeNode) e.nextElement();
nodesByLevel.put(node.getLevel(), node);
}
return nodesByLevel;
}
use of javax.swing.tree.DefaultMutableTreeNode in project binnavi by google.
the class TypesTreeModelTests method testAtomicTypeAdded.
@Test
public void testAtomicTypeAdded() throws CouldntSaveDataException {
final DefaultMutableTreeNode root = createModel();
final BaseType newType = typeManager.createAtomicType("new_type", 32, true);
Assert.assertTrue(hasBaseTypeChildNode(root, newType));
verifySorted(root);
}
use of javax.swing.tree.DefaultMutableTreeNode in project binnavi by google.
the class CDebuggerContainerNodeTest method setUp.
@Before
public void setUp() throws IllegalArgumentException, SecurityException, FileReadException {
ConfigManager.instance().read();
m_database = new MockDatabase(m_provider);
final CProjectTreeModel model = new CProjectTreeModel(m_tree);
model.setRoot(new DefaultMutableTreeNode());
m_tree.setModel(model);
}
use of javax.swing.tree.DefaultMutableTreeNode in project binnavi by google.
the class CModuleNodeTest method setUp.
@Before
public void setUp() throws IllegalArgumentException, SecurityException, FileReadException {
ConfigManager.instance().read();
m_database = new MockDatabase(m_provider);
final CRawModule rawModule = new CRawModule(1, "", 0, false, m_provider);
m_module = new CModule(123, "Name", "Comment", new Date(), new Date(), "12345678123456781234567812345678", "1234567812345678123456781234567812345678", 55, 66, new CAddress(0x555), new CAddress(0x666), new DebuggerTemplate(1, "Mock Debugger", "localhaus", 88, m_provider), rawModule, Integer.MAX_VALUE, false, m_provider);
final CProjectTreeModel model = new CProjectTreeModel(m_tree);
model.setRoot(new DefaultMutableTreeNode());
m_tree.setModel(model);
}
use of javax.swing.tree.DefaultMutableTreeNode in project binnavi by google.
the class CModuleNodeTest method testChangingName.
@Test
public void testChangingName() throws CouldntSaveDataException {
final CModuleNode node = new CModuleNode(m_tree, new DefaultMutableTreeNode(), m_database, m_module, new CModuleContainer(m_database, m_module));
assertEquals("Name (55/66)", node.toString());
m_module.getConfiguration().setName("Hannes");
assertEquals("Hannes (55/66)", node.toString());
}
Aggregations