Java 类javax.swing.plaf.basic.BasicTreeUI 实例源码

项目:incubator-netbeans    文件:BeanTreeView.java   
/** 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);
        if (rect.y >= 0) { //#197514 - do not scroll to negative y values
            tree.scrollRectToVisible(rect);
        }
    }
}
项目:incubator-netbeans    文件:TreeTable.java   
private boolean isLocationInExpandControl( TreePath path, Point location ) {
   if( tree.getModel().isLeaf( path.getLastPathComponent() ) )
       return false;

   Rectangle r = tree.getPathBounds(path);
   int boxWidth = 8;
   Insets i = tree.getInsets();
   int indent = 0;

   if( tree.getUI() instanceof BasicTreeUI ) {
       BasicTreeUI ui = (BasicTreeUI)tree.getUI();
       if( null != ui.getExpandedIcon() )
           boxWidth = ui.getExpandedIcon().getIconWidth();

       indent = ui.getLeftChildIndent();
   }
   int boxX;
   if( tree.getComponentOrientation().isLeftToRight() ) {
       boxX = r.x - positionX - indent - boxWidth;
   } else {
       boxX = r.x - positionX + indent + r.width;
   }
   return location.getX() >= boxX && location.getX() <= (boxX + boxWidth);
}
项目:incubator-netbeans    文件:TemplatesPanelGUI.java   
/** 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);
        }
    }
}
项目:incubator-netbeans    文件:ProfilerTreeTable.java   
public void setUI(TreeUI ui) {
    if (ui instanceof SynthTreeUI) {
        if (synthLikeUI == null) {
            super.setUI(ui);
            SynthTreeUI synthUI = (SynthTreeUI)ui;
            int left = synthUI.getLeftChildIndent();
            int right = synthUI.getRightChildIndent();

            synthLikeUI = new SynthLikeTreeUI();
            super.setUI(synthLikeUI);

            boolean nimbus = UIUtils.isNimbusLookAndFeel();
            synthLikeUI.setLeftChildIndent(left + (nimbus ? 4 : 6));
            synthLikeUI.setRightChildIndent(right);
        } else {
            super.setUI(synthLikeUI);
        }
    } else {
        super.setUI(ui);

        // #269500 - performance workaround for BasicTreeUI
        if (!DISABLE_TREEUI_FIX && ui instanceof BasicTreeUI)
            workaroundVerticalLines = UIManager.getBoolean("Tree.paintLines"); // NOI18N
    }
}
项目:JavaGraph    文件:CheckboxTree.java   
/**
 * Constructs a tree, with cell renderer and editor set by
 * {@link #createRenderer()} and {@link #createEditor()}.
 */
public CheckboxTree() {
    setCellRenderer(createRenderer());
    setCellEditor(createEditor());
    setEditable(true);
    setRootVisible(false);
    setShowsRootHandles(true);
    // make sure the checkbox never selects the label
    // note that the BasicTreeUI may not be what is used in the current LAF,
    // but I don't know any other way to modify the selection behaviour
    BasicTreeUI ui = new BasicTreeUI() {
        @Override
        protected void selectPathForEvent(TreePath path, MouseEvent event) {
            if (!isOverCheckBox(path, event.getPoint().x)) {
                super.selectPathForEvent(path, event);
            }
        }
    };
    setUI(ui);
    // initialise the tree model
    this.topNode = new DefaultMutableTreeNode();
    this.treeModel = new DefaultTreeModel(this.topNode);
    setModel(this.treeModel);
    // set selection mode
    getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
}
项目:bisis-v4    文件:RecordTree.java   
public void createRecordTree(){     
    model = new RecordTreeModel();
    this.setModel(model);       
    renderer = new RecordTreeCellRenderer();            
    renderer.setLeafIcon(null);
    renderer.setClosedIcon(null);
    renderer.setOpenIcon(null);       
    this.setCellRenderer(renderer);
    renderer.setIcon(null);
    renderer.setOpenIcon(null);
    renderer.setClosedIcon(null);       
    editor = new RecordTreeCellEditor(this,renderer);       
    this.setCellEditor(editor);         
    this.setEditable(true);
    this.setRootVisible(false);     
    this.putClientProperty("JTree.lineStyle", "None");
    ((BasicTreeUI)this.getUI()).setCollapsedIcon(null);
    ((BasicTreeUI)this.getUI()).setExpandedIcon(null);      
    this.setScrollsOnExpand(true);
    this.setExpandsSelectedPaths(true); 
}
项目:bisis-v4    文件:EditorFrame.java   
private void handleKeys(Component comp,KeyEvent e){
  if(e.getKeyCode()==KeyEvent.VK_L && e.getModifiers()== InputEvent.CTRL_MASK)
    listiciButton.doClick();
  if(e.getKeyCode()==KeyEvent.VK_V && e.getModifiers()== InputEvent.CTRL_MASK)
    validateRecord.doClick();
  /*if(e.getKeyCode()==KeyEvent.VK_NUMPAD7)
    addUField.doClick();  */
  if(e.getKeyCode()==KeyEvent.VK_ESCAPE){
    if(comp.equals(zapisPanel.getRecordTree())){
      if(!((BasicTreeUI)zapisPanel.getRecordTree().getUI()).isEditing(zapisPanel.getRecordTree()))
        handleCloseEditor();
    }else
      handleCloseEditor();
  }
  if(e.getKeyCode()== KeyEvent.VK_S){
     saveRecord.doClick();
  }
  if(e.getKeyCode()==KeyEvent.VK_F6 
         && e.getModifiers()== InputEvent.CTRL_MASK){        
     BisisApp.getMainFrame().selectNextInternalFrame();
  }
}
项目:intellij-ce-playground    文件:UsageViewImpl.java   
private void clearRendererCache() {
  // clear renderer cache of node preferred size
  TreeUI ui = myTree.getUI();
  if (ui instanceof BasicTreeUI) {
    AbstractLayoutCache treeState = ReflectionUtil.getField(BasicTreeUI.class, ui, AbstractLayoutCache.class, "treeState");
    Rectangle visibleRect = myTree.getVisibleRect();
    int rowForLocation = myTree.getClosestRowForLocation(0, visibleRect.y);
    int visibleRowCount = getVisibleRowCount();
    for (int i = rowForLocation + visibleRowCount + 1; i >= rowForLocation; i--) {
      final TreePath eachPath = myTree.getPathForRow(i);
      if (eachPath == null) continue;

      treeState.invalidatePathBounds(eachPath);
    }
    myTree.repaint(visibleRect);
  }
  else {
    myTree.setCellRenderer(myUsageViewTreeCellRenderer);
  }
}
项目:intellij-ce-playground    文件:Tree.java   
private boolean isLocationInExpandControl(final TreePath path, final int x, final int y) {
  final TreeUI ui = getUI();
  if (!(ui instanceof BasicTreeUI)) return false;

  try {
    Class aClass = ui.getClass();
    while (BasicTreeUI.class.isAssignableFrom(aClass) && !BasicTreeUI.class.equals(aClass)) {
      aClass = aClass.getSuperclass();
    }
    final Method method = ReflectionUtil.getDeclaredMethod(aClass, "isLocationInExpandControl", TreePath.class, int.class, int.class);
    if (method != null) {
      return (Boolean)method.invoke(ui, path, x, y);
    }
  }
  catch (Throwable ignore) { }

  return false;
}
项目:intellij-ce-playground    文件:Tree.java   
protected boolean isLocationInExpandControl(@Nullable TreePath path, int mouseX) {
  if (path == null) return false;
  TreeUI ui = getUI();
  if (!(ui instanceof BasicTreeUI)) return false;
  BasicTreeUI treeUI = (BasicTreeUI)ui;
  if (!treeModel.isLeaf(path.getLastPathComponent())) {
    Insets insets = this.getInsets();
    int boxWidth = treeUI.getExpandedIcon() != null ? treeUI.getExpandedIcon().getIconWidth() : 8;
    int boxLeftX = treeUI.getLeftChildIndent() + treeUI.getRightChildIndent() * (path.getPathCount() - 1);
    if (getComponentOrientation().isLeftToRight()) {
      boxLeftX = boxLeftX + insets.left - treeUI.getRightChildIndent() + 1;
    }
    else {
      boxLeftX = getWidth() - boxLeftX - insets.right + treeUI.getRightChildIndent() - 1;
    }
    boxLeftX -= getComponentOrientation().isLeftToRight() ? (int)Math.ceil(boxWidth / 2.0) : (int)Math.floor(boxWidth / 2.0);
    return mouseX >= boxLeftX && mouseX < boxLeftX + boxWidth;
  }
  return false;
}
项目:tools-idea    文件:Tree.java   
private boolean isLocationInExpandControl(final TreePath path, final int x, final int y) {
  final TreeUI ui = getUI();
  if (!(ui instanceof BasicTreeUI)) return false;

  try {
    Class aClass = ui.getClass();
    while (BasicTreeUI.class.isAssignableFrom(aClass) && !BasicTreeUI.class.equals(aClass)) {
      aClass = aClass.getSuperclass();
    }
    final Method method = ReflectionUtil.getDeclaredMethod(aClass, "isLocationInExpandControl", TreePath.class, int.class, int.class);
    if (method != null) {
      method.setAccessible(true);
      return (Boolean)method.invoke(ui, path, x, y);
    }
  }
  catch (Throwable ignore) { }

  return false;
}
项目:tools-idea    文件:Tree.java   
protected boolean isLocationInExpandControl(@Nullable TreePath path, int mouseX) {
  if (path == null) return false;
  TreeUI ui = getUI();
  if (!(ui instanceof BasicTreeUI)) return false;
  BasicTreeUI treeUI = (BasicTreeUI)ui;
  if (!treeModel.isLeaf(path.getLastPathComponent())) {
    Insets insets = Tree.this.getInsets();
    int boxWidth = treeUI.getExpandedIcon() != null ? treeUI.getExpandedIcon().getIconWidth() : 8;
    int boxLeftX = treeUI.getLeftChildIndent() + treeUI.getRightChildIndent() * (path.getPathCount() - 1);
    if (getComponentOrientation().isLeftToRight()) {
      boxLeftX = boxLeftX + insets.left - treeUI.getRightChildIndent() + 1;
    }
    else {
      boxLeftX = getWidth() - boxLeftX - insets.right + treeUI.getRightChildIndent() - 1;
    }
    boxLeftX -= (getComponentOrientation().isLeftToRight() ? (int)Math.ceil(boxWidth / 2.0) : (int)Math.floor(boxWidth / 2.0));
    return (mouseX >= boxLeftX && mouseX < (boxLeftX + boxWidth));
  }
  return false;
}
项目:consulo    文件:UsageViewImpl.java   
private void clearRendererCache() {
  ApplicationManager.getApplication().assertIsDispatchThread();
  if (expandingAll) return; // to avoid quadratic row enumeration
  // clear renderer cache of node preferred size
  TreeUI ui = myTree.getUI();
  if (ui instanceof BasicTreeUI) {
    AbstractLayoutCache treeState = ReflectionUtil.getField(BasicTreeUI.class, ui, AbstractLayoutCache.class, "treeState");
    Rectangle visibleRect = myTree.getVisibleRect();
    int rowForLocation = myTree.getClosestRowForLocation(0, visibleRect.y);
    int visibleRowCount = getVisibleRowCount();
    for (int i = rowForLocation + visibleRowCount + 1; i >= rowForLocation; i--) {
      final TreePath eachPath = myTree.getPathForRow(i);
      if (eachPath == null) continue;

      treeState.invalidatePathBounds(eachPath);
    }
    myTree.repaint(visibleRect);
  }
  else {
    myTree.setCellRenderer(myUsageViewTreeCellRenderer);
  }
}
项目:consulo    文件:Tree.java   
private boolean isLocationInExpandControl(final TreePath path, final int x, final int y) {
  final TreeUI ui = getUI();
  if (!(ui instanceof BasicTreeUI)) return false;

  try {
    Class aClass = ui.getClass();
    while (BasicTreeUI.class.isAssignableFrom(aClass) && !BasicTreeUI.class.equals(aClass)) {
      aClass = aClass.getSuperclass();
    }
    final Method method = ReflectionUtil.getDeclaredMethod(aClass, "isLocationInExpandControl", TreePath.class, int.class, int.class);
    if (method != null) {
      return (Boolean)method.invoke(ui, path, x, y);
    }
  }
  catch (Throwable ignore) { }

  return false;
}
项目:incubator-netbeans    文件:JTreeTable.java   
private void setTreeUIVariables() {
    if (tree.getUI() instanceof BasicTreeUI) {
        BasicTreeUI treeUI = (BasicTreeUI) tree.getUI();
        treeSignExtent = treeUI.getExpandedIcon().getIconWidth() / 2;
        treeSignRightMargin = treeUI.getRightChildIndent();
    }
}
项目:incubator-netbeans    文件:DebugTreeView.java   
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) {}
   }
}
项目:featurea    文件:MyTreeTableCellRenderer.java   
public MyTreeTableCellRenderer(MyTreeTable treeTable, TreeModel model) {
    super(model);
    setUI(new BasicTreeUI());

    this.treeTable = treeTable;

    // Setzen der Zeilenhoehe fuer die JTable
    // Muss explizit aufgerufen werden, weil treeTable noch
    // null ist, wenn super(model) setRowHeight aufruft!
    setRowHeight(getRowHeight());
}
项目:jdk8u-jdk    文件:bug8003830.java   
public void testNPEAtActionsPage() {
    JTree tree = new JTree();
    BasicTreeUI ui = new NullReturningTreeUI();
    tree.setUI(ui);
    BasicTreeUI.TreePageAction tpa = ui.new TreePageAction(0, "down");
    tpa.actionPerformed(new ActionEvent(tree, 0, ""));
}
项目:openjdk-jdk10    文件:bug8003830.java   
public void testNPEAtActionsPage() {
    JTree tree = new JTree();
    BasicTreeUI ui = new NullReturningTreeUI();
    tree.setUI(ui);
    BasicTreeUI.TreePageAction tpa = ui.new TreePageAction(0, "down");
    tpa.actionPerformed(new ActionEvent(tree, 0, ""));
}
项目:openjdk9    文件:bug8003830.java   
public void testNPEAtActionsPage() {
    JTree tree = new JTree();
    BasicTreeUI ui = new NullReturningTreeUI();
    tree.setUI(ui);
    BasicTreeUI.TreePageAction tpa = ui.new TreePageAction(0, "down");
    tpa.actionPerformed(new ActionEvent(tree, 0, ""));
}
项目:bisis-v4    文件:ProcessTypeFrame.java   
private void createPubTypeTree(){
    treeModel = new PubTypeTreeModel(1);
    pubTypeTree = new JTree(treeModel);
    pubTypeTree.putClientProperty("JTree.lineStyle", "None"); //$NON-NLS-1$ //$NON-NLS-2$
    pubTypeTree.setRootVisible(false);
    ((BasicTreeUI)pubTypeTree.getUI()).setCollapsedIcon(null);
    ((BasicTreeUI)pubTypeTree.getUI()).setExpandedIcon(null);
    treeCellRenderer = new PubTypeTreeCellRenderer();
    pubTypeTree.setCellRenderer(treeCellRenderer);
    treeScrollPane = new JScrollPane(pubTypeTree);      
}
项目:bisis-v4    文件:FormatTree.java   
private void createTree(){
    model = new FormatTreeModel();
    setModel(model);        
    //setRootVisible(false);
    renderer = new FormatTreeCellRenderer();
    putClientProperty("JTree.lineStyle", "None");
    ((BasicTreeUI)this.getUI()).setCollapsedIcon(null);
    ((BasicTreeUI)this.getUI()).setExpandedIcon(null);
    setCellRenderer(renderer);      
}
项目:jdk8u_jdk    文件:bug8003830.java   
public void testNPEAtActionsPage() {
    JTree tree = new JTree();
    BasicTreeUI ui = new NullReturningTreeUI();
    tree.setUI(ui);
    BasicTreeUI.TreePageAction tpa = ui.new TreePageAction(0, "down");
    tpa.actionPerformed(new ActionEvent(tree, 0, ""));
}
项目:taxonaut    文件:AlignableFixedHeightLayoutCache.java   
public AlignableFixedHeightLayoutCache(BasicTreeUI ui,
                   LayoutCacheAligner aligner)
   {
super();
setUI(ui);
setAligner(aligner);
   }
项目:taxonaut    文件:AlignableVariableHeightLayoutCache.java   
public AlignableVariableHeightLayoutCache(BasicTreeUI ui,
                      LayoutCacheAligner aligner)
   {
super();
setUI(ui);
setAligner(aligner);
setAlignable(true);
   }
项目:taxonaut    文件:AlignableVariableHeightLayoutCache.java   
public synchronized void setUI(BasicTreeUI ui)
   {
this.ui = ui;
if(ui instanceof AlignableTreeUI)
    alignable = (AlignableTreeUI)ui;
else
    alignable = null;
   }
项目:taxonaut    文件:TreeHeaderRenderer.java   
public void setCollapsedIcon(Icon icon)
   {
if(tree instanceof NameTree)
    ((NameTree)tree).setCollapsedIcon(icon);
else
    ((BasicTreeUI)tree.getUI()).setCollapsedIcon(icon);
   }
项目:taxonaut    文件:TreeHeaderRenderer.java   
public void setExpandedIcon(Icon icon)
   {
if(tree instanceof NameTree)
    ((NameTree)tree).setExpandedIcon(icon);
else
    ((BasicTreeUI)tree.getUI()).setExpandedIcon(icon);
   }
项目:lookaside_java-1.8.0-openjdk    文件:bug8003830.java   
public void testNPEAtActionsPage() {
    JTree tree = new JTree();
    BasicTreeUI ui = new NullReturningTreeUI();
    tree.setUI(ui);
    BasicTreeUI.TreePageAction tpa = ui.new TreePageAction(0, "down");
    tpa.actionPerformed(new ActionEvent(tree, 0, ""));
}
项目:intellij-ce-playground    文件:SimpleTree.java   
private static int getBoxWidth(JTree tree) {
  BasicTreeUI basicTreeUI = (BasicTreeUI)tree.getUI();
  int boxWidth;
  if (basicTreeUI.getExpandedIcon() != null) {
    boxWidth = basicTreeUI.getExpandedIcon().getIconWidth();
  }
  else {
    boxWidth = 8;
  }
  return boxWidth;
}
项目:intellij-ce-playground    文件:TreeUtil.java   
@Nullable
public static Range<Integer> getExpandControlRange(@NotNull final JTree aTree, @Nullable final TreePath path) {
  TreeModel treeModel = aTree.getModel();

  final BasicTreeUI basicTreeUI = (BasicTreeUI)aTree.getUI();
  Icon expandedIcon = basicTreeUI.getExpandedIcon();


  Range<Integer> box = null;
  if (path != null && !treeModel.isLeaf(path.getLastPathComponent())) {
    int boxWidth;
    Insets i = aTree.getInsets();

    if (expandedIcon != null) {
      boxWidth = expandedIcon.getIconWidth();
    }
    else {
      boxWidth = 8;
    }

    int boxLeftX = i != null ? i.left : 0;

    boolean leftToRight = aTree.getComponentOrientation().isLeftToRight();
    int depthOffset = getDepthOffset(aTree);
    int totalChildIndent = basicTreeUI.getLeftChildIndent() + basicTreeUI.getRightChildIndent();

    if (leftToRight) {
      boxLeftX += (path.getPathCount() + depthOffset - 2) * totalChildIndent + basicTreeUI.getLeftChildIndent() -
          boxWidth / 2;
    }
    int boxRightX = boxLeftX + boxWidth;

    box = new Range<Integer>(boxLeftX, boxRightX);
  }
  return box;
}
项目:intellij-ce-playground    文件:XDebuggerTreeRenderer.java   
public void customizeCellRenderer(@NotNull final JTree tree,
                                  final Object value,
                                  final boolean selected,
                                  final boolean expanded,
                                  final boolean leaf,
                                  final int row,
                                  final boolean hasFocus) {
  myHaveLink = false;
  myLink.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
  XDebuggerTreeNode node = (XDebuggerTreeNode)value;
  node.appendToComponent(this);
  setIcon(node.getIcon());

  Rectangle treeVisibleRect = tree.getVisibleRect();
  TreePath path = tree.getPathForRow(row);
  int rowX = path != null ? getRowX((BasicTreeUI)tree.getUI(), row, path.getPathCount() - 1) : 0;

  if (myHaveLink) {
    setupLinkDimensions(treeVisibleRect, rowX);
  }
  else {
    if (rowX + super.getPreferredSize().width > treeVisibleRect.x + treeVisibleRect.width) {
      // text does not fit visible area - show link
      if (node instanceof XValueNodeImpl) {
        final String rawValue = DebuggerUIUtil.getNodeRawValue((XValueNodeImpl)node);
        if (!StringUtil.isEmpty(rawValue)) {
          myLongTextLink.setupComponent(rawValue, ((XDebuggerTree)tree).getProject());
          append(myLongTextLink.getLinkText(), myLongTextLink.getTextAttributes(), myLongTextLink);
          setupLinkDimensions(treeVisibleRect, rowX);
          myLinkWidth = 0;
        }
      }
    }
  }
  putClientProperty(AbstractExpandableItemsHandler.DISABLE_EXPANDABLE_HANDLER, myHaveLink ? true : null);
}
项目:intellij-ce-playground    文件:CommittedChangeListRenderer.java   
public static int getRowX(JTree tree, int depth) {
  if (tree == null) return 0;
  final TreeUI ui = tree.getUI();
  if (ui instanceof BasicTreeUI) {
    final BasicTreeUI treeUI = ((BasicTreeUI)ui);
    return (treeUI.getLeftChildIndent() + treeUI.getRightChildIndent()) * depth;
  }

  final int leftIndent = UIUtil.getTreeLeftChildIndent();
  final int rightIndent = UIUtil.getTreeRightChildIndent();

  return (leftIndent + rightIndent) * depth;
}
项目:swingx    文件:JXTreeTable.java   
/**
 * If a negative number is returned, then all events that occur in the
 * leading margin will be forwarded to the tree and consumed.
 * 
 * @return the width of the tree handle if it can be determined, else -1
 */
protected int getTreeHandleWidth() {
    if (renderer.getUI() instanceof BasicTreeUI) {
        BasicTreeUI ui = (BasicTreeUI) renderer.getUI();
        return ui.getLeftChildIndent() + ui.getRightChildIndent();
    } else {
        return -1;
    }
}
项目:infobip-open-jdk-8    文件:bug8003830.java   
public void testNPEAtActionsPage() {
    JTree tree = new JTree();
    BasicTreeUI ui = new NullReturningTreeUI();
    tree.setUI(ui);
    BasicTreeUI.TreePageAction tpa = ui.new TreePageAction(0, "down");
    tpa.actionPerformed(new ActionEvent(tree, 0, ""));
}
项目:jdk8u-dev-jdk    文件:bug8003830.java   
public void testNPEAtActionsPage() {
    JTree tree = new JTree();
    BasicTreeUI ui = new NullReturningTreeUI();
    tree.setUI(ui);
    BasicTreeUI.TreePageAction tpa = ui.new TreePageAction(0, "down");
    tpa.actionPerformed(new ActionEvent(tree, 0, ""));
}
项目:OLD-OpenJDK8    文件:bug8003830.java   
public void testNPEAtActionsPage() {
    JTree tree = new JTree();
    BasicTreeUI ui = new NullReturningTreeUI();
    tree.setUI(ui);
    BasicTreeUI.TreePageAction tpa = ui.new TreePageAction(0, "down");
    tpa.actionPerformed(new ActionEvent(tree, 0, ""));
}
项目:jpexs-decompiler    文件:GenericTagTreePanel.java   
public MyTree() {
    setBackground(Color.white);
    setUI(new BasicTreeUI() {
        @Override
        public void paint(Graphics g, JComponent c) {
            setHashColor(Color.gray);
            super.paint(g, c);
        }
    });
    setCellRenderer(new MyTreeCellRenderer());
    setCellEditor(new MyTreeCellEditor(this));
    setInvokesStopCellEditing(true);

}
项目:jpexs-decompiler    文件:TagTree.java   
public TagTree(TagTreeModel treeModel, MainPanel mainPanel) {
    super(treeModel);
    this.mainPanel = mainPanel;
    setCellRenderer(new TagTreeCellRenderer());
    setRootVisible(false);
    setBackground(Color.white);
    setRowHeight(Math.max(getFont().getSize() + 5, 16));
    setLargeModel(true);
    setUI(new BasicTreeUI() {
        {
            setHashColor(Color.gray);
        }
    });
}
项目:jpexs-decompiler    文件:DumpTree.java   
public DumpTree(DumpTreeModel treeModel, MainPanel mainPanel) {
    super(treeModel);
    this.mainPanel = mainPanel;
    setCellRenderer(new DumpTreeCellRenderer());
    setRootVisible(false);
    setBackground(Color.white);
    setUI(new BasicTreeUI() {
        {
            setHashColor(Color.gray);
        }
    });
}