@Override public void mouseClicked(MouseEvent me) { TreePath path = tree.getPathForLocation(me.getX(), me.getY()); if (path == null) { return; } if (me.getX() > tree.getPathBounds(path).x + hotspot) { return; } boolean selected = selectionModel.isPathSelected(path, true); selectionModel.removeTreeSelectionListener(this); try { if (selected) { selectionModel.removeSelectionPath(path); } else { selectionModel.addSelectionPath(path); } } finally { selectionModel.addTreeSelectionListener(this); treetable.repaint(); } }
/** * Sets the value of the <code>showsRootHandles</code> property for the tree * part. This property specifies whether the node handles should be displayed. * If handles are not supported by a particular look and feel, this property * may be ignored. * * @param visible true, if root handles should be shown; false, otherwise */ public void setShowsRootHandles(boolean visible) { renderer.setShowsRootHandles(visible); repaint(); }
/** * Sets the value of the <code>showsRootHandles</code> property for the tree * part. This property specifies whether the node handles should be displayed. * If handles are not supported by a particular look and feel, this property * may be ignored. * * @param visible true, if root handles should be shown; false, otherwise */ public void setShowsRootHandles(boolean visible) { renderer.setShowsRootHandles(visible); repaint(); }
/** * Sets the value of the <code>showsRootHandles</code> property for the tree * part. This property specifies whether the node handles should be displayed. * If handles are not supported by a particular look and feel, this property * may be ignored. * * @param visible true, if root handles should be shown; false, otherwise */ public void setShowsRootHandles(boolean visible) { renderer.setShowsRootHandles(visible); repaint(); }
/** * Sets the value of the <code>showsRootHandles</code> property for the tree * part. This property specifies whether the node handles should be displayed. * If handles are not supported by a particular look and feel, this property * may be ignored. * * @param visible true, if root handles should be shown; false, otherwise */ public void setShowsRootHandles(boolean visible) { renderer.setShowsRootHandles(visible); repaint(); }
/** * Sets the value of the <code>showsRootHandles</code> property for the tree * part. This property specifies whether the node handles should be displayed. * If handles are not supported by a particular look and feel, this property * may be ignored. * * @param visible true, if root handles should be shown; false, otherwise */ public void setShowsRootHandles(boolean visible) { renderer.setShowsRootHandles(visible); repaint(); }
/** * Determines whether or not the root node from the TreeModel is visible. * * @param visible true, if the root node is visible; false, otherwise */ public void setRootVisible(boolean visible) { renderer.setRootVisible(visible); // JW: the revalidate forces the root to appear after a // toggling a visible from an initially invisible root. // JTree fires a propertyChange on the ROOT_VISIBLE_PROPERTY // BasicTreeUI reacts by (ultimately) calling JTree.treeDidChange // which revalidate the tree part. // Might consider to listen for the propertyChange (fired only if there // actually was a change) instead of revalidating unconditionally. revalidate(); repaint(); }
/** * Determines whether or not the root node from the TreeModel is visible. * * @param visible true, if the root node is visible; false, otherwise */ public void setRootVisible(boolean visible) { renderer.setRootVisible(visible); // JW: the revalidate forces the root to appear after a // toggling a visible from an initially invisible root. // JTree fires a propertyChange on the ROOT_VISIBLE_PROPERTY // BasicTreeUI reacts by (ultimately) calling JTree.treeDidChange // which revalidate the tree part. // Might consider to listen for the propertyChange (fired only if there // actually was a change) instead of revalidating unconditionally. revalidate(); repaint(); }
/** * Determines whether or not the root node from the TreeModel is visible. * * @param visible true, if the root node is visible; false, otherwise */ public void setRootVisible(boolean visible) { renderer.setRootVisible(visible); // JW: the revalidate forces the root to appear after a // toggling a visible from an initially invisible root. // JTree fires a propertyChange on the ROOT_VISIBLE_PROPERTY // BasicTreeUI reacts by (ultimately) calling JTree.treeDidChange // which revalidate the tree part. // Might consider to listen for the propertyChange (fired only if there // actually was a change) instead of revalidating unconditionally. revalidate(); repaint(); }
/** * Determines whether or not the root node from the TreeModel is visible. * * @param visible true, if the root node is visible; false, otherwise */ public void setRootVisible(boolean visible) { renderer.setRootVisible(visible); // JW: the revalidate forces the root to appear after a // toggling a visible from an initially invisible root. // JTree fires a propertyChange on the ROOT_VISIBLE_PROPERTY // BasicTreeUI reacts by (ultimately) calling JTree.treeDidChange // which revalidate the tree part. // Might consider to listen for the propertyChange (fired only if there // actually was a change) instead of revalidating unconditionally. revalidate(); repaint(); }
/** * Determines whether or not the root node from the TreeModel is visible. * * @param visible true, if the root node is visible; false, otherwise */ public void setRootVisible(boolean visible) { renderer.setRootVisible(visible); // JW: the revalidate forces the root to appear after a // toggling a visible from an initially invisible root. // JTree fires a propertyChange on the ROOT_VISIBLE_PROPERTY // BasicTreeUI reacts by (ultimately) calling JTree.treeDidChange // which revalidate the tree part. // Might consider to listen for the propertyChange (fired only if there // actually was a change) instead of revalidating unconditionally. revalidate(); repaint(); }
@Override public void run() { if (jTable != null) { boolean active = isSequenceActive(); if (forceRepaint || wasSequenceActive || active) { jTable.repaint(); wasSequenceActive = active; } } JXTreeTable tree = jXTreeTable; TestSequenceInstance seq = selectedSequence; if (tree != null && tree.isVisible() && seq != null) { if (forceRepaint || seq.isSequenceActive()) { jXTreeTable.repaint(); } } } });
/** * Overriden to invoke repaint for the particular location if * the column contains the tree. This is done as the tree editor does * not fill the bounds of the cell, we need the renderer to paint * the tree in the background, and then draw the editor over it. * You should not need to call this method directly. <p> * * Additionally, there is tricksery involved to expand/collapse * the nodes. * * {@inheritDoc} */ @Override public boolean editCellAt(int row, int column, EventObject e) { getTreeTableHacker().hitHandleDetectionFromEditCell(column, e); // RG: Fix Issue 49! boolean canEdit = super.editCellAt(row, column, e); if (canEdit && isHierarchical(column)) { repaint(getCellRect(row, column, false)); } return canEdit; }
/** * Overriden to invoke repaint for the particular location if * the column contains the tree. This is done as the tree editor does * not fill the bounds of the cell, we need the renderer to paint * the tree in the background, and then draw the editor over it. * You should not need to call this method directly. <p> * * Additionally, there is tricksery involved to expand/collapse * the nodes. * * {@inheritDoc} */ @Override public boolean editCellAt(int row, int column, EventObject e) { getTreeTableHacker().hitHandleDetectionFromEditCell(column, e); // RG: Fix Issue 49! boolean canEdit = super.editCellAt(row, column, e); if (canEdit && isHierarchical(column)) { repaint(getCellRect(row, column, false)); } return canEdit; }
/** * Overriden to invoke repaint for the particular location if * the column contains the tree. This is done as the tree editor does * not fill the bounds of the cell, we need the renderer to paint * the tree in the background, and then draw the editor over it. * You should not need to call this method directly. <p> * * Additionally, there is tricksery involved to expand/collapse * the nodes. * * {@inheritDoc} */ @Override public boolean editCellAt(int row, int column, EventObject e) { getTreeTableHacker().hitHandleDetectionFromEditCell(column, e); // RG: Fix Issue 49! boolean canEdit = super.editCellAt(row, column, e); if (canEdit && isHierarchical(column)) { repaint(getCellRect(row, column, false)); } return canEdit; }
/** * Overriden to invoke repaint for the particular location if * the column contains the tree. This is done as the tree editor does * not fill the bounds of the cell, we need the renderer to paint * the tree in the background, and then draw the editor over it. * You should not need to call this method directly. <p> * * Additionally, there is tricksery involved to expand/collapse * the nodes. * * {@inheritDoc} */ @Override public boolean editCellAt(int row, int column, EventObject e) { getTreeTableHacker().hitHandleDetectionFromEditCell(column, e); // RG: Fix Issue 49! boolean canEdit = super.editCellAt(row, column, e); if (canEdit && isHierarchical(column)) { repaint(getCellRect(row, column, false)); } return canEdit; }
/** * Overriden to invoke repaint for the particular location if * the column contains the tree. This is done as the tree editor does * not fill the bounds of the cell, we need the renderer to paint * the tree in the background, and then draw the editor over it. * You should not need to call this method directly. <p> * * Additionally, there is tricksery involved to expand/collapse * the nodes. * * {@inheritDoc} */ @Override public boolean editCellAt(int row, int column, EventObject e) { getTreeTableHacker().hitHandleDetectionFromEditCell(column, e); // RG: Fix Issue 49! boolean canEdit = super.editCellAt(row, column, e); if (canEdit && isHierarchical(column)) { repaint(getCellRect(row, column, false)); } return canEdit; }