public OntologyBrowser(OWLOntology ontology, Set<String> rootsToRemove) { super(); this.ontology = ontology; this.rootConcept = "Thing"; this.buildTreeModel(); for (String concept : rootsToRemove) { DefaultMutableTreeNode node = getNodeFromName(concept); this.dtm.removeNodeFromParent(node); } this.setModel(this.dtm); // set the tree selection model DefaultTreeSelectionModel dtsm = new DefaultTreeSelectionModel(); dtsm.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); this.setSelectionModel(dtsm); // set the tree renderer OntologyRenderer myRenderer = new OntologyRenderer(); this.setCellRenderer(myRenderer); this.setRootVisible(false); }
public OntologyBrowser(OWLOntology ontology, ImageIcon closedIcon, ImageIcon openedIcon) { super(); this.ontology = ontology; this.buildTreeModel(); this.setModel(this.dtm); // set the tree selection model DefaultTreeSelectionModel dtsm = new DefaultTreeSelectionModel(); dtsm.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); this.setSelectionModel(dtsm); this.setRootVisible(false); // set the tree renderer OntologyRenderer myRenderer = new OntologyRenderer(); // Change the icon for closed nodes. myRenderer.setClosedIcon(closedIcon); // Change the icon for opened nodes. myRenderer.setOpenIcon(openedIcon); this.setCellRenderer(myRenderer); }
/** * */ private void buildTree() { DefaultMutableTreeNode root = new DefaultMutableTreeNode("user"); tree = new JTree(root); tree.putClientProperty("JTree.lineStyle", "Angled"); tree.setCellRenderer(new NavigationTreeCellRenderer()); tree.setShowsRootHandles(true); DefaultTreeSelectionModel model = new DefaultTreeSelectionModel(); model.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); graphsCategory = new DefaultMutableTreeNode("graphs"); mouseAdapter = new MouseAdapter() { public void mouseClicked(MouseEvent e) { itemSelected(e); } }; tree.addMouseListener(mouseAdapter); root.add(graphsCategory); loadGraphs(); }
/** * Creates a new <code>JTree</code> object. * * @param model the model to use */ public JTree(TreeModel model) { setRootVisible(true); setSelectionModel( new DefaultTreeSelectionModel() ); // The root node appears expanded by default. nodeStates = new Hashtable(); // The cell renderer gets set by the UI. cellRenderer = null; // Install the UI before installing the model. This way we avoid double // initialization of lots of UI and model stuff inside the UI and related // classes. The necessary UI updates are performed via property change // events to the UI. updateUI(); setModel(model); }
public PullRequestsTreeModel() { super(null); this.root = new PRTreeNode(TfPluginBundle.message(TfPluginBundle.KEY_VCS_PR_TITLE)); setRoot(root); this.requestedByMeRoot = new PRTreeNode(TfPluginBundle.message(TfPluginBundle.KEY_VCS_PR_REQUESTED_BY_ME)); root.insert(requestedByMeRoot, 0); this.assignedToMeRoot = new PRTreeNode(TfPluginBundle.message(TfPluginBundle.KEY_VCS_PR_ASSIGNED_TO_ME)); root.insert(assignedToMeRoot, 1); allRequestedByMePullRequests = new ArrayList<GitPullRequest>(); allAssignedToMePullRequests = new ArrayList<GitPullRequest>(); selectionModel = new DefaultTreeSelectionModel(); selectionModel.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION); }
/** Creates new form OlapBrowser */ public OlapBrowser() { initComponents(); DefaultMutableTreeNode root = new DefaultMutableTreeNode(); jTree1.setModel(new DefaultTreeModel(root)); jTree1.setCellRenderer( new OlapTreeCellRenderer()); jComboBoxType.addItem(new Tag("java.lang.String",I18n.getString("OlapBrowser.ComboBox.Text"))); jComboBoxType.addItem(new Tag("java.lang.Number", I18n.getString("OlapBrowser.ComboBox.Numeric"))); jComboBoxType.addItem(new Tag("java.util.Date", I18n.getString("Global.List.Date"))); jComboBoxType.addItem(new Tag("java.util.Date", I18n.getString("OlapBrowser.ComboBox.Boolean"))); jComboBoxType.setSelectedIndex(0); //applyI18n(); ((DefaultTreeSelectionModel)jTree1.getSelectionModel()).setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION ); }
public MappingPanel(GraphPanel<?, ?> graphpanel) { super(graphpanel); // Allow multiple roots, the virtual networks. getTree().setRootVisible(false); getTree().setShowsRootHandles(true); listener = new MappingTreeChangeListener(this); // Add context menu. getTree().addMouseListener(new MappingPanelMouseAdapter()); setToolTipText("Right click to open context menu"); // Selection. getTree().getSelectionModel().setSelectionMode( DefaultTreeSelectionModel.SINGLE_TREE_SELECTION); getTree().addTreeSelectionListener( new MappingTreeSelectionListener(this)); // Color highlighting of current selection. getTree().setCellRenderer(new MappingTreeCellRenderer()); }
/** Creates new form WorkbenchFetchModelDialog */ public WorkbenchFetchModelDialog(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); resetModelList(); resetVersions(); // Set single selection for tree TreeSelectionModel selModel = new DefaultTreeSelectionModel(); selModel.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION); modelTree.setSelectionModel(selModel); // Set default server ip Configuration conf = Configuration.getInstance(); serverUriTextField.setText(conf.getProperty(WorkbenchConnectToServerDialog.CONF_SERVER_URI, "http://localhost:1205")); userName.setText(conf.getProperty(WorkbenchConnectToServerDialog.CONF_SERVER_USER,"root")); userPassword.setText(conf.getProperty(WorkbenchConnectToServerDialog.CONF_SERVER_PASSWORD,"inubit")); connectToServerAction(); }
private void init() { editor = new ProcessEditor(); editor.setModel(form); editor.setAnimationEnabled(true); editorPane.setLayout(new GridLayout(1,1)); editorPane.add(editor); transferHandler = new XFormsWizardTransferHandler(editor); editor.setTransferHandler(transferHandler); XFormsWizardTreeCellRenderer cr = new XFormsWizardTreeCellRenderer(); boTree.setCellRenderer(cr); boTree.setDragEnabled(true); boTree.setTransferHandler(transferHandler); DefaultTreeSelectionModel selModel = new DefaultTreeSelectionModel(); selModel.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION); boTree.setSelectionModel(selModel); actionTree.setCellRenderer(cr); actionTree.setDragEnabled(true); actionTree.setTransferHandler(transferHandler); actionTree.setRootVisible(false); }
private static void initTreeSelection(JTree tree, NamedElement tableElement, DefaultTreeModel treeModel) { TreeSelectionModel treeSelectionModel = new DefaultTreeSelectionModel(); List<Element> nodes = IfmlModelingHelper.getNodeElements(tableElement, new ArrayList<Element>(), true); for (Element node : nodes) { if (IfmlModelingHelper.isSelected(node)) { IfmlTreeNode treeNode = getTreeNode(node, treeModel); if (treeNode != null) { treeSelectionModel.addSelectionPath(new TreePath(treeNode.getPath())); } } } tree.setSelectionModel(treeSelectionModel); }
public void setModel(TreeTableModel treeTableModel){ // Create the tree. It will be used as a renderer and editor. tree = new TreeTableCellRenderer(treeTableModel); setModel(new TreeTableModelAdapter(treeTableModel, tree)); // Force the JTable and JTree to share their row selection models. tree.setSelectionModel(new DefaultTreeSelectionModel() { // Extend the implementation of the constructor, as if: /* public this() */{ setSelectionModel(listSelectionModel); } }); // Make the tree and table row heights the same. tree.setRowHeight(getRowHeight()); // Install the tree editor renderer and editor. setDefaultRenderer(TreeTableModel.class, tree); setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor()); setShowGrid(false); setIntercellSpacing(new Dimension(0, 0)); }
public MappingPanel(GraphPanel<?, ?> graphpanel, Scenario scenario) { super(graphpanel); // createTreeModel requires this.scenario, // therefore it cannot be called from super constructor. this.scenario = scenario; _createTreeModel(); // Allow multiple roots, the virtual networks. getTree().setRootVisible(false); getTree().setShowsRootHandles(true); listener = new MappingTreeChangeListener(this); // Add context menu. getTree().addMouseListener(new MappingPanelMouseAdapter()); setToolTipText("Right click to open context menu"); // Selection. getTree().getSelectionModel().setSelectionMode( DefaultTreeSelectionModel.SINGLE_TREE_SELECTION); getTree().addTreeSelectionListener( new MappingTreeSelectionListener(this)); // Color highlighting of current selection. getTree().setCellRenderer(new MappingTreeCellRenderer()); }
public JTreeTable(TreeTableModel treeTableModel) { super(); // Create the tree. It will be used as a renderer and editor. tree = new TreeTableCellRenderer(treeTableModel, this); // Install a tableModel representing the visible rows in the tree. super.setModel(new TreeTableModelAdapter(treeTableModel, tree)); // Force the JTable and JTree to share their row selection models. tree.setSelectionModel(new DefaultTreeSelectionModel() { // Extend the implementation of the constructor, as if: /* public this() */{ setSelectionModel(listSelectionModel); } }); // Make the tree and table row heights the same. tree.setRowHeight(getRowHeight()); // Install the tree editor renderer and editor. setDefaultRenderer(TreeTableModel.class, tree); setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor()); setShowGrid(false); setIntercellSpacing(new Dimension(0, 0)); cellRendererRedLeft = new CellRenderer(java.awt.Color.RED, false, null); cellRendererGreenLeft = new CellRenderer(java.awt.Color.GREEN, false, null); cellRendererRedRight = new CellRenderer(java.awt.Color.RED, true, null); cellRendererGreenRight = new CellRenderer(java.awt.Color.GREEN, true, null); cellRendererYellowLeft = new CellRenderer(java.awt.Color.YELLOW, false, null); cellRendererYellowRight = new CellRenderer(java.awt.Color.YELLOW, true, null); setPreferredScrollableViewportSize(new Dimension(1000, 500)); setFillsViewportHeight(true); setAutoCreateRowSorter(true); }
public OntologyBrowser(OWLOntology ontology) { super(); this.ontology = ontology; this.buildTreeModel(); this.setModel(this.dtm); // set the tree selection model DefaultTreeSelectionModel dtsm = new DefaultTreeSelectionModel(); dtsm.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); this.setSelectionModel(dtsm); // set the tree renderer OntologyRenderer myRenderer = new OntologyRenderer(); this.setCellRenderer(myRenderer); this.setRootVisible(false); }
public OntologyBrowser(OWLOntology ontology, String rootConcept) { super(); this.ontology = ontology; this.rootConcept = rootConcept; this.buildTreeModel(); this.setModel(this.dtm); // set the tree selection model DefaultTreeSelectionModel dtsm = new DefaultTreeSelectionModel(); dtsm.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); this.setSelectionModel(dtsm); // set the tree renderer OntologyRenderer myRenderer = new OntologyRenderer(); this.setCellRenderer(myRenderer); this.setRootVisible(false); }
public JTree(TreeModel newModel) { super(); visibleRowCount = 15; rootVisible = true; selectionModel = new DefaultTreeSelectionModel(); cellRenderer = null; // { // LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); // defaultLinearLayout.addView(rootScrollView, lp); // } // setPeerAdAPI(defaultLinearLayout); setModel(newModel); updateUI(); }
/** * Creates a new tree object. * * @param parent Parent window used for dialogs. * @param graph Graph shown in the window. * @param manager Provides tag information. */ public CTagsTree(final JFrame parent, final ZyGraph graph, final ITagManager manager) { m_parent = Preconditions.checkNotNull(parent, "IE02308: Perent argument can not be null"); m_graph = Preconditions.checkNotNull(graph, "IE01776: Graph can not be null"); m_tagManager = Preconditions.checkNotNull(manager, "IE01777: Manager argument can not be null"); m_model = new CTagsTreeModel(this); setModel(m_model); getModel().addTreeModelListener(new InternalModelListener()); addMouseListener(m_mouseListener); m_graph.addListener(m_graphSelectionListener); m_graph.addListener(m_graphVisibilityListener); setRootVisible(false); m_rootNode = new CRootTagTreeNode(parent, this, graph, m_tagManager); m_model.setRoot(m_rootNode); setCellRenderer(new CTagTreeCellRenderer()); // ATTENTION: UNDER NO CIRCUMSTANCES MOVE THIS LINE // ABOVE THE SETROOT LINE m_model.nodeStructureChanged(m_rootNode); final List<IDropHandler> handlers = new ArrayList<IDropHandler>(); handlers.add(new CTagSortingHandler()); new CDefaultTransferHandler(this, DnDConstants.ACTION_COPY_OR_MOVE, handlers); final DefaultTreeSelectionModel selectionModel = new DefaultTreeSelectionModel(); selectionModel.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); setSelectionModel(selectionModel); final InputMap windowImap = getInputMap(JComponent.WHEN_FOCUSED); windowImap.put(HotKeys.DELETE_HK.getKeyStroke(), "DELETE"); getActionMap().put("DELETE", CActionProxy.proxy(new DeleteAction())); }
public TypesTree() { setRootVisible(false); setDragEnabled(true); setDropMode(DropMode.INSERT); // Dropped objects are inserted behind the drop location. setToggleClickCount(1); // Child nodes expand with a single click. final DefaultTreeSelectionModel selectionModel = new DefaultTreeSelectionModel(); selectionModel.setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); setSelectionModel(selectionModel); final IconNodeRenderer renderer = new IconNodeRenderer(); renderer.setFont(GuiHelper.MONOSPACED_FONT); setCellRenderer(renderer); }
/** * Frees allocated resources. */ public void dispose() { m_selectionHistory.removeHistoryListener(m_selectionHistoryListener); m_graph.removeListener(m_graphSelectionListener); m_tree.removeMouseListener(m_treeMouseListener); m_tree.removeTreeSelectionListener(m_treeSelectionListener); m_tree.setSelectionModel(new DefaultTreeSelectionModel()); }
public JTreeTable(TreeTableModel treeTableModel) { super(); // Create the tree. It will be used as a renderer and editor. tree = new TreeTableCellRenderer(treeTableModel); // Install a tableModel representing the visible rows in the tree. setModel(new TreeTableModelAdapter(treeTableModel, tree)); // Force the JTable and JTree to share their row selection models. tree.setSelectionModel(new DefaultTreeSelectionModel() { // Extend the implementation of the constructor, as if: /* public this() */ { setSelectionModel(listSelectionModel); } }); // Make the tree and table row heights the same. tree.setRowHeight(getRowHeight()); // Install the tree editor renderer and editor. setDefaultRenderer(TreeTableModel.class, tree); setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor()); // Install the boolean editor renderer and editor. //setDefaultEditor(Boolean.class, new BooleanTableCellEditor()); // look options setShowGrid(false); setIntercellSpacing(new Dimension(0, 0)); }
public MyTree(DefaultMutableTreeNode _root){ root = _root; Color foreColor = Color.WHITE; Color backColor = MyColor.getColor(); toggleClickCount = 2; setLayout(null); rowHeight = 16; visibleRowCount = 20; rootVisible = true; selectionModel = new DefaultTreeSelectionModel(); cellRenderer = null; scrollsOnExpand = true; setOpaque(true); // expandsSelectedPaths = true; updateUI(); controller = new CommoditySortController(); initTree(root, controller.show().get(0).ID); DefaultTreeModel model = new DefaultTreeModel(root, true); model.reload(); setModel(model); this.setForeground(foreColor); this.setBackground(backColor); DefaultTreeCellRenderer cellRender = new DefaultTreeCellRenderer(); cellRender.setBackgroundNonSelectionColor(backColor); cellRender.setBackgroundSelectionColor(Color.BLACK); cellRender.setBorderSelectionColor(Color.WHITE); cellRender.setTextSelectionColor(Color.WHITE); cellRender.setTextNonSelectionColor(Color.WHITE); this.setCellRenderer(cellRender); }
/** * Constructs a SelectionInTree on the given tree model. * * @param model - the initial tree model * @param selectionHolder - the selection holder */ public SelectionInTree(TreeModel model, ValueModel selectionHolder) { this.selectionHolder = selectionHolder; this.selectionModel = new DefaultTreeSelectionModel(); setTree(model); selectionModel.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); selectionModel.addTreeSelectionListener(treeSelectionHandler); selectionHolder.addValueChangeListener(selectionChangeHandler); }
public void testTreeSelectionRedirector() throws Exception { assertNull(tree.selectionRedirector); DefaultTreeSelectionModel model = (DefaultTreeSelectionModel) tree.getSelectionModel(); assertFalse(hasListener(model.getTreeSelectionListeners(), JTree.TreeSelectionRedirector.class)); final Marker marker = new Marker(); tree.addTreeSelectionListener(new TreeSelectionListener() { public void valueChanged(final TreeSelectionEvent e) { marker.setAuxiliary(e); } }); assertNotNull(tree.selectionRedirector); assertTrue(hasListener(model.getTreeSelectionListeners(), JTree.TreeSelectionRedirector.class)); TreePath path = new TreePath("root"); TreePath oldLead = new TreePath("old_lead"); TreePath newLead = new TreePath("new_lead"); tree.selectionRedirector.valueChanged(new TreeSelectionEvent("any_source", path, true, oldLead, newLead)); assertNotNull(marker.getAuxiliary()); TreeSelectionEvent redirectedEvent = (TreeSelectionEvent) marker.getAuxiliary(); assertSame(tree, redirectedEvent.getSource()); assertSame(path, redirectedEvent.getPath()); assertTrue(redirectedEvent.isAddedPath()); assertSame(oldLead, redirectedEvent.getOldLeadSelectionPath()); assertSame(newLead, redirectedEvent.getNewLeadSelectionPath()); DefaultTreeSelectionModel newModel = new DefaultTreeSelectionModel(); tree.setSelectionModel(newModel); assertTrue(hasListener(newModel.getTreeSelectionListeners(), JTree.TreeSelectionRedirector.class)); tree.setSelectionModel(null); assertTrue(hasListener(((DefaultTreeSelectionModel) tree.getSelectionModel()) .getTreeSelectionListeners(), JTree.TreeSelectionRedirector.class)); }
public void testSetGetSelectionModel() { assertTrue(ui.getSelectionModel() instanceof DefaultTreeSelectionModel); DefaultTreeSelectionModel m = new DefaultTreeSelectionModel(); ui.setSelectionModel(m); assertSame(m, ui.getSelectionModel()); assertSame(m, ui.treeSelectionModel); }
public void testInstallUninstallListeners() { if (!isHarmony()) { return; } assertTrue(hasListener(tree.getFocusListeners(), BasicTreeUI.FocusHandler.class)); assertTrue(hasListener(tree.getKeyListeners(), BasicTreeUI.KeyHandler.class)); assertTrue(hasListener(tree.getMouseListeners(), BasicTreeUI.MouseHandler.class)); assertTrue(hasListener(tree.getMouseMotionListeners(), BasicTreeUI.MouseHandler.class)); assertTrue(hasListener(tree.getPropertyChangeListeners(), BasicTreeUI.PropertyChangeHandler.class)); assertTrue(hasListener(tree.getTreeExpansionListeners(), BasicTreeUI.TreeExpansionHandler.class)); assertTrue(hasListener(((DefaultTreeModel) tree.getModel()).getTreeModelListeners(), BasicTreeUI.TreeModelHandler.class)); assertTrue(hasListener(((DefaultTreeSelectionModel) tree.getSelectionModel()) .getTreeSelectionListeners(), BasicTreeUI.TreeSelectionHandler.class)); assertTrue(hasListener(((DefaultTreeSelectionModel) tree.getSelectionModel()) .getPropertyChangeListeners(), BasicTreeUI.SelectionModelPropertyChangeHandler.class)); ui.uninstallListeners(); assertFalse(hasListener(tree.getFocusListeners(), BasicTreeUI.FocusHandler.class)); assertFalse(hasListener(tree.getKeyListeners(), BasicTreeUI.KeyHandler.class)); assertFalse(hasListener(tree.getMouseListeners(), BasicTreeUI.MouseHandler.class)); assertFalse(hasListener(tree.getMouseMotionListeners(), BasicTreeUI.MouseHandler.class)); assertFalse(hasListener(tree.getPropertyChangeListeners(), BasicTreeUI.PropertyChangeHandler.class)); assertFalse(hasListener(tree.getTreeExpansionListeners(), BasicTreeUI.TreeExpansionHandler.class)); assertFalse(hasListener(tree.getTreeSelectionListeners(), BasicTreeUI.TreeSelectionHandler.class)); assertFalse(hasListener(((DefaultTreeModel) tree.getModel()).getTreeModelListeners(), BasicTreeUI.TreeModelHandler.class)); assertFalse(hasListener(((DefaultTreeSelectionModel) tree.getSelectionModel()) .getTreeSelectionListeners(), BasicTreeUI.TreeSelectionHandler.class)); assertFalse(hasListener(((DefaultTreeSelectionModel) tree.getSelectionModel()) .getPropertyChangeListeners(), BasicTreeUI.SelectionModelPropertyChangeHandler.class)); }
public JTreeTable(TreeTableModel paramTreeTableModel) { this.tree = new TreeTableCellRenderer(paramTreeTableModel); super.setModel(new TreeTableModelAdapter(paramTreeTableModel, this.tree)); this.tree.setSelectionModel(new DefaultTreeSelectionModel() { }); this.tree.setRowHeight(getRowHeight()); setDefaultRenderer(TreeTableModel.class, this.tree); setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor()); setShowGrid(false); setIntercellSpacing(new Dimension(0, 0)); }
@Override public void setSelectionMode(int mode) { int oldMode = this.mode; this.mode = mode; if(oldMode != mode) propertyChanges.firePropertyChange(DefaultTreeSelectionModel.SELECTION_MODE_PROPERTY, oldMode, mode); }
public AttributePanel(Provider prv, int visibleRows) { provider = prv; try { attributes = provider.getAttributes(); } catch (Exception pe) { pe.printStackTrace(); } setLayout(new GridLayout(1, 1)); // Init tree node and model (attribute tree nodes) root = new AttributeRootNode(); model = new DefaultTreeModel(root); // Init tree view tree = new JTree(model); if (visibleRows != 0) tree.setVisibleRowCount(visibleRows); tree.putClientProperty("JTree.lineStyle", "Angled"); tree.setRootVisible(false); tree.setShowsRootHandles(true); smodel = new DefaultTreeSelectionModel(); smodel .setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); smodel .addTreeSelectionListener(slistener = new AttributeSelectionListener()); tree.setSelectionModel(smodel); tree.setCellRenderer(new AttributeCellRenderer()); tree.addMouseListener(new AttributePopup()); scrollPane = new JScrollPane(tree); scrollPane.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6)); add(scrollPane, BorderLayout.CENTER); // validate components tree.validate(); scrollPane.validate(); }
public QueryTree() { rootNode = new DefaultMutableTreeNode(); // cause each row to be queried for its height setRowHeight(-1); setModel(new DefaultTreeModel(rootNode)); setRootVisible(false); setEditable(false); setSelectionModel(new DefaultTreeSelectionModel()); getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); setCellRenderer(new QueryTreeRenderer()); }
public DebugTreeTable(TreeTableModel treeTableModel) { super(); mTreeTableModel = treeTableModel; // Create the tree. It will be used as a renderer and editor. tree = new TreeTableCellRenderer(treeTableModel); //tree = new DebugTreeCellRenderer(); // Install a tableModel representing the visible rows in the tree. super.setModel(new TreeTableModelAdapter(treeTableModel, tree)); // Force the JTable and JTree to share their row selection models. tree.setSelectionModel(new DefaultTreeSelectionModel() { { setSelectionModel(listSelectionModel); } }); // Make the tree and table row heights the same. tree.setRowHeight(getRowHeight()); // Install the tree editor renderer and editor. setDefaultRenderer(TreeTableModel.class, tree); this.setFont(SMALL_FONT); getColumnModel().getColumn(0).setPreferredWidth(50); getColumnModel().getColumn(0).setMinWidth(100); setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor()); setShowGrid(false); setIntercellSpacing(new Dimension(0, 0)); }