javax.swing.JTree.updateUI()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中javax.swing.JTree.updateUI()方法的一些代码示例,展示了JTree.updateUI()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.updateUI()方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:updateUI

JTree.updateUI介绍

暂无

代码示例

代码示例来源:origin: checkstyle/checkstyle

/**
 * UpdateUI is overridden to set the colors of the Tree's renderer
 * to match that of the table.
 */
@Override
public void updateUI() {
  super.updateUI();
  // Make the tree's cell renderer use the table's cell selection
  // colors.
  final TreeCellRenderer tcr = getCellRenderer();
  if (tcr instanceof DefaultTreeCellRenderer) {
    final DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) tcr;
    // For 1.1 uncomment this, 1.2 has a bug that will cause an
    // exception to be thrown if the border selection color is
    // null.
    // renderer.setBorderSelectionColor(null);
    renderer.setTextSelectionColor(UIManager.getColor("Table.selectionForeground"));
    renderer.setBackgroundSelectionColor(UIManager.getColor("Table.selectionBackground"));
  }
}

代码示例来源:origin: INRIA/spoon

@Override
  public void run() {
    TreePath path = new TreePath(node.getPath());
    if (!jTree.isExpanded(path)) {
      jTree.expandPath(path);
      jTree.updateUI();
    }
  }
});

代码示例来源:origin: Jamling/SmartIM

public void updateTrees(JTree... trees) {
  for (JTree tree : trees) {
    if (tree != null) {
      tree.updateUI();
    }
  }
}

代码示例来源:origin: Jamling/SmartIM

public void updateTrees(JTree... trees) {
  for (JTree tree : trees) {
    if (tree != null) {
      tree.updateUI();
    }
  }
}

代码示例来源:origin: MegaMek/mekhq

public void refreshOrganization() {
  javax.swing.SwingUtilities.invokeLater(() -> {
    orgTree.updateUI();
    // This seems like bad juju since it makes it annoying as hell to
    // add multiple units to a force if it's de-selected every single
    // time
    // So, commenting it out - ralgith
    // orgTree.setSelectionPath(null);
    refreshForceView();
  });
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

public void updateUI() {
  super.updateUI();
  setBorder (BorderFactory.createEmptyBorder());
}

代码示例来源:origin: org.fudaa.framework.ebli/ebli-2d

public void updateUI() {
 super.updateUI();
 setRowHeight(35);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

public void updateUI() {
  super.updateUI();
  setBorder (BorderFactory.createEmptyBorder());
}

代码示例来源:origin: com.fifesoft.rtext/fife.common

@Override
  public void updateUI() {
    super.updateUI();
    // Must set new cell renderer each time lnf changes as
    // DefaultTreeCellRenderer is "buggy" in that it caches
    // colors, fonts, icons, etc.
    setCellRenderer(createTreeCellRenderer());
  }
};

代码示例来源:origin: org.netbeans.api/org-openide-explorer

/** Expands all paths.
*/
public void expandAll() {
  TreeUI treeUI = tree.getUI();
  try {
    tree.setUI(null);
    TreeNode root = (TreeNode) tree.getModel().getRoot();
    expandOrCollapseAll(new TreePath(root), true);
  } finally {
    tree.setUI(treeUI);
    tree.updateUI();
  }
}

代码示例来源:origin: net.openhft/spoon-core

public void run() {
    TreePath path = new TreePath(node.getPath());
    if (!jTree.isExpanded(path)) {
      jTree.expandPath(path);
      jTree.updateUI();
    }
  }
});

代码示例来源:origin: protegeproject/protege

public void updateUI() {
  super.updateUI();
  setRowHeight(getFontMetrics(getFont()).getHeight() + 4);
}

代码示例来源:origin: edu.stanford.protege/protege-editor-owl

public void updateUI() {
  super.updateUI();
  setRowHeight(getFontMetrics(getFont()).getHeight() + 4);
}

代码示例来源:origin: org.protege/protege-editor-owl

public void updateUI() {
  super.updateUI();
  setRowHeight(getFontMetrics(getFont()).getHeight() + 4);
}

代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl

public void updateUI() {
  super.updateUI();
  setRowHeight(getFontMetrics(getFont()).getHeight() + 4);
}

代码示例来源:origin: thiagotts/CloudReports

/** 
 * Changes the working environment whenever the environments combo box value
 * is changed.
 *
 * @param   evt     an action event.
 * @since           1.0
 */     
private void environmentsBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_environmentsBoxItemStateChanged
  HibernateUtil.setActiveDatabase(environmentsBox.getSelectedItem().toString() + ".cre");
  getCloudTree().updateNodes();
  jTree.updateUI();
  cl.show(cardPanel, "logoPanel");
}//GEN-LAST:event_environmentsBoxItemStateChanged

代码示例来源:origin: org.netbeans.api/org-openide-explorer

@Override
public void updateUI() {
  super.updateUI();
  setBorder(BorderFactory.createEmptyBorder());
  if( getTransferHandler() != null && getTransferHandler() instanceof UIResource ) {
    //we handle drag and drop in our own way, so let's just fool the UI with a dummy
    //TransferHandler to ensure that multiple selection is not lost when drag starts
    setTransferHandler( new DummyTransferHandler() );
  }
}

代码示例来源:origin: de.sciss/jtreetable

public void updateUI() {
  sortWidth = -1;
  noFocusBorder = null;
  ltrBorder = null;
  rtlBorder = null;
  installDefaults();
  tree.updateUI();
  table.updateUI();
  defaultTreeCellRenderer.updateUI();
  updateTreeClientProperties(tree);
  treeTableCellRenderer = createCellRenderer();
  tree.setCellRenderer(treeTableCellRenderer);
}

代码示例来源:origin: aterai/java-swing-tips

@Override public void updateUI() {
  setCellRenderer(null);
  super.updateUI();
  setCellRenderer(new ChapterNumberingTreeCellRenderer());
  setRootVisible(false);
 }
};

代码示例来源:origin: org.cytoscape/swing-application-impl

@Override
  public void run() {
    ignoreTreeSelectionEvents = true;
    // apparently this doesn't fire valueChanged
    treeTable.getTree().collapsePath(new TreePath(new TreeNode[] { root }));
    
    treeTable.getTree().updateUI();
    final TreePath path = new TreePath(dmtn.getPath());
    
    treeTable.getTree().expandPath(path);
    treeTable.getTree().scrollPathToVisible(path);
    treeTable.doLayout();
    
    ignoreTreeSelectionEvents = false;
  }
});

相关文章

JTree类方法