javax.swing.plaf.TreeUI Java Examples

The following examples show how to use javax.swing.plaf.TreeUI. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TemplatesPanelGUI.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Make a path visible.
* @param path the path
*/
private void showPathWithoutExpansion(TreePath path) {
    Rectangle rect = tree.getPathBounds(path);
    if (rect != null) { //PENDING
        TreeUI tmp = tree.getUI();
        int correction = 0;
        if (tmp instanceof BasicTreeUI) {
            correction = ((BasicTreeUI) tmp).getLeftChildIndent();
            correction += ((BasicTreeUI) tmp).getRightChildIndent();
        }
        rect.x = Math.max(0, rect.x - correction);
        rect.y += rect.height;
        if (rect.y >= 0) { //#197514 - do not scroll to negative y values
            tree.scrollRectToVisible(rect);
        }
    }
}
 
Example #2
Source File: MultiTreeUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>stopEditing</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public boolean stopEditing(JTree a) {
    boolean returnValue =
        ((TreeUI) (uis.elementAt(0))).stopEditing(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).stopEditing(a);
    }
    return returnValue;
}
 
Example #3
Source File: MultiTreeUI.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getPathBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getPathBounds(JTree a, TreePath b) {
    Rectangle returnValue =
        ((TreeUI) (uis.elementAt(0))).getPathBounds(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getPathBounds(a,b);
    }
    return returnValue;
}
 
Example #4
Source File: DebugTreeView.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private static void clearDrawingCache(JTree tree) {
   TreeUI tui = tree.getUI();
   if (tui instanceof BasicTreeUI) {
       try {
           Field drawingCacheField = BasicTreeUI.class.getDeclaredField("drawingCache");
           drawingCacheField.setAccessible(true);
           Map table = (Map) drawingCacheField.get(tui);
           table.clear();
       } catch (Exception ex) {}
   }
}
 
Example #5
Source File: MultiTreeUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getClosestPathForLocation</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public TreePath getClosestPathForLocation(JTree a, int b, int c) {
    TreePath returnValue =
        ((TreeUI) (uis.elementAt(0))).getClosestPathForLocation(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getClosestPathForLocation(a,b,c);
    }
    return returnValue;
}
 
Example #6
Source File: MultiTreeUI.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getEditingPath</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public TreePath getEditingPath(JTree a) {
    TreePath returnValue =
        ((TreeUI) (uis.elementAt(0))).getEditingPath(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getEditingPath(a);
    }
    return returnValue;
}
 
Example #7
Source File: MultiTreeUI.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Invokes the <code>getPathBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getPathBounds(JTree a, TreePath b) {
    Rectangle returnValue =
        ((TreeUI) (uis.elementAt(0))).getPathBounds(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getPathBounds(a,b);
    }
    return returnValue;
}
 
Example #8
Source File: MultiTreeUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>isEditing</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public boolean isEditing(JTree a) {
    boolean returnValue =
        ((TreeUI) (uis.elementAt(0))).isEditing(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).isEditing(a);
    }
    return returnValue;
}
 
Example #9
Source File: MultiTreeUI.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Invokes the <code>getRowForPath</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int getRowForPath(JTree a, TreePath b) {
    int returnValue =
        ((TreeUI) (uis.elementAt(0))).getRowForPath(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getRowForPath(a,b);
    }
    return returnValue;
}
 
Example #10
Source File: MultiTreeUI.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Invokes the <code>getRowCount</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int getRowCount(JTree a) {
    int returnValue =
        ((TreeUI) (uis.elementAt(0))).getRowCount(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getRowCount(a);
    }
    return returnValue;
}
 
Example #11
Source File: MultiTreeUI.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Invokes the <code>getClosestPathForLocation</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public TreePath getClosestPathForLocation(JTree a, int b, int c) {
    TreePath returnValue =
        ((TreeUI) (uis.elementAt(0))).getClosestPathForLocation(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getClosestPathForLocation(a,b,c);
    }
    return returnValue;
}
 
Example #12
Source File: MultiTreeUI.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Invokes the <code>isEditing</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public boolean isEditing(JTree a) {
    boolean returnValue =
        ((TreeUI) (uis.elementAt(0))).isEditing(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).isEditing(a);
    }
    return returnValue;
}
 
Example #13
Source File: MultiTreeUI.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>isEditing</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public boolean isEditing(JTree a) {
    boolean returnValue =
        ((TreeUI) (uis.elementAt(0))).isEditing(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).isEditing(a);
    }
    return returnValue;
}
 
Example #14
Source File: MultiTreeUI.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getEditingPath</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public TreePath getEditingPath(JTree a) {
    TreePath returnValue =
        ((TreeUI) (uis.elementAt(0))).getEditingPath(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getEditingPath(a);
    }
    return returnValue;
}
 
Example #15
Source File: MultiTreeUI.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>stopEditing</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public boolean stopEditing(JTree a) {
    boolean returnValue =
        ((TreeUI) (uis.elementAt(0))).stopEditing(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).stopEditing(a);
    }
    return returnValue;
}
 
Example #16
Source File: JTreeOperator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Maps {@code JTree.getUI()} through queue
 */
public TreeUI getUI() {
    return (runMapping(new MapAction<TreeUI>("getUI") {
        @Override
        public TreeUI map() {
            return ((JTree) getSource()).getUI();
        }
    }));
}
 
Example #17
Source File: MultiTreeUI.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getClosestPathForLocation</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public TreePath getClosestPathForLocation(JTree a, int b, int c) {
    TreePath returnValue =
        ((TreeUI) (uis.elementAt(0))).getClosestPathForLocation(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getClosestPathForLocation(a,b,c);
    }
    return returnValue;
}
 
Example #18
Source File: MultiTreeUI.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getRowCount</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int getRowCount(JTree a) {
    int returnValue =
        ((TreeUI) (uis.elementAt(0))).getRowCount(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getRowCount(a);
    }
    return returnValue;
}
 
Example #19
Source File: MultiTreeUI.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getEditingPath</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public TreePath getEditingPath(JTree a) {
    TreePath returnValue =
        ((TreeUI) (uis.elementAt(0))).getEditingPath(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getEditingPath(a);
    }
    return returnValue;
}
 
Example #20
Source File: MultiTreeUI.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getPathForRow</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public TreePath getPathForRow(JTree a, int b) {
    TreePath returnValue =
        ((TreeUI) (uis.elementAt(0))).getPathForRow(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getPathForRow(a,b);
    }
    return returnValue;
}
 
Example #21
Source File: MultiTreeUI.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Invokes the <code>getEditingPath</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public TreePath getEditingPath(JTree a) {
    TreePath returnValue =
        ((TreeUI) (uis.elementAt(0))).getEditingPath(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getEditingPath(a);
    }
    return returnValue;
}
 
Example #22
Source File: MultiTreeUI.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Invokes the <code>stopEditing</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public boolean stopEditing(JTree a) {
    boolean returnValue =
        ((TreeUI) (uis.elementAt(0))).stopEditing(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).stopEditing(a);
    }
    return returnValue;
}
 
Example #23
Source File: MultiTreeUI.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Invokes the <code>isEditing</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public boolean isEditing(JTree a) {
    boolean returnValue =
        ((TreeUI) (uis.elementAt(0))).isEditing(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).isEditing(a);
    }
    return returnValue;
}
 
Example #24
Source File: MultiTreeUI.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Invokes the <code>getClosestPathForLocation</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public TreePath getClosestPathForLocation(JTree a, int b, int c) {
    TreePath returnValue =
        ((TreeUI) (uis.elementAt(0))).getClosestPathForLocation(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getClosestPathForLocation(a,b,c);
    }
    return returnValue;
}
 
Example #25
Source File: MultiTreeUI.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Invokes the <code>getRowCount</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int getRowCount(JTree a) {
    int returnValue =
        ((TreeUI) (uis.elementAt(0))).getRowCount(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getRowCount(a);
    }
    return returnValue;
}
 
Example #26
Source File: MultiTreeUI.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>isEditing</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public boolean isEditing(JTree a) {
    boolean returnValue =
        ((TreeUI) (uis.elementAt(0))).isEditing(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).isEditing(a);
    }
    return returnValue;
}
 
Example #27
Source File: JTreeOperator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Maps {@code JTree.setUI(TreeUI)} through queue
 */
public void setUI(final TreeUI treeUI) {
    runMapping(new MapVoidAction("setUI") {
        @Override
        public void map() {
            ((JTree) getSource()).setUI(treeUI);
        }
    });
}
 
Example #28
Source File: MultiTreeUI.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Invokes the <code>getPathBounds</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Rectangle getPathBounds(JTree a, TreePath b) {
    Rectangle returnValue =
        ((TreeUI) (uis.elementAt(0))).getPathBounds(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getPathBounds(a,b);
    }
    return returnValue;
}
 
Example #29
Source File: MultiTreeUI.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getEditingPath</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public TreePath getEditingPath(JTree a) {
    TreePath returnValue =
        ((TreeUI) (uis.elementAt(0))).getEditingPath(a);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getEditingPath(a);
    }
    return returnValue;
}
 
Example #30
Source File: MultiTreeUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Invokes the <code>getPathForRow</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public TreePath getPathForRow(JTree a, int b) {
    TreePath returnValue =
        ((TreeUI) (uis.elementAt(0))).getPathForRow(a,b);
    for (int i = 1; i < uis.size(); i++) {
        ((TreeUI) (uis.elementAt(i))).getPathForRow(a,b);
    }
    return returnValue;
}