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

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

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

JTree.getComponentOrientation介绍

暂无

代码示例

代码示例来源:origin: org.swinglabs.swingx/swingx-all

/**
 * @return
 */
private boolean isRightToLeft() {
  return (tree != null) && (!tree.getComponentOrientation().isLeftToRight());
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

protected void applyComponentOrientation() {
  if (tree != null) {
    editingContainer.applyComponentOrientation(tree.getComponentOrientation());
  }
  
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

/**
 * @return
 */
private boolean isRightToLeft() {
  return (tree != null) && (!tree.getComponentOrientation().isLeftToRight());
}

代码示例来源:origin: org.swinglabs.swingx/swingx-all

protected void applyComponentOrientation() {
  if (tree != null) {
    editingContainer.applyComponentOrientation(tree.getComponentOrientation());
  }
  
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-desktop

/**
 * @return
 */
private boolean isRightToLeft() {
  return (tree != null) && (!tree.getComponentOrientation().isLeftToRight());
}

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

protected void applyComponentOrientation() {
  if (tree != null) {
    editingContainer.applyComponentOrientation(tree.getComponentOrientation());
  }
  
}

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

/**
 * @return
 */
private boolean isRightToLeft() {
  return (tree != null) && (!tree.getComponentOrientation().isLeftToRight());
}

代码示例来源:origin: org.swinglabs.swingx/swingx-core

protected void applyComponentOrientation() {
  if (tree != null) {
    editingContainer.applyComponentOrientation(tree.getComponentOrientation());
  }
  
}

代码示例来源:origin: org.swinglabs.swingx/swingx-core

/**
 * @return
 */
private boolean isRightToLeft() {
  return (tree != null) && (!tree.getComponentOrientation().isLeftToRight());
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-desktop

protected void applyComponentOrientation() {
  if (tree != null) {
    editingContainer.applyComponentOrientation(tree.getComponentOrientation());
  }
  
}

代码示例来源:origin: khuxtable/seaglass

private int findCenteredX(int x, int iconWidth) {
  return tree.getComponentOrientation().isLeftToRight() ? x - (int) Math.ceil(iconWidth / 2.0) : x
      - (int) Math.floor(iconWidth / 2.0);
}

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

public void setBounds(int x, int y, int w, int h) {
  Rectangle node = tree.getRowBounds(row);
  if (tree.getComponentOrientation().isLeftToRight()) {
    x = node.x;
    w -= node.x;
  } else {
    w = node.x + node.width;
  }
  component.setBounds(0, 0, w, h);
  super.setBounds(x, y, w, h);
}

代码示例来源:origin: nz.ac.waikato.cms.weka.thirdparty/bounce

/**
 * Configures the renderer based on the passed in components.
 * The value is set from messaging the tree with
 * <code>convertValueToText</code>, which ultimately invokes
 * <code>toString</code> on <code>value</code>.
 * The foreground color is set based on the selection and the icon
 * is set based on on leaf and expanded.
 */
public Component getTreeCellRendererComponent( JTree tree, Object value,
           boolean selected, boolean expanded, boolean leaf, 
           int row,  boolean hasFocus) {
           
  this.selected = selected;
  
  if (value instanceof NodeTreeNode) {
    this.node = (NodeTreeNode)value;
    
    if (selected) {
      setForeground(UIManager.getColor("Tree.selectionForeground"));
    } else  {
      setForeground(UIManager.getColor("Tree.textForeground"));
    }
    
    setComponentOrientation(tree.getComponentOrientation());
  } 
  return this;
}

代码示例来源:origin: com.github.insubstantial/substance

@Override
public Rectangle getPathBounds(JTree tree, TreePath path) {
  Rectangle result = super.getPathBounds(tree, path);
  if (result != null) {
    if (!tree.getComponentOrientation().isLeftToRight()) {
      int delta = result.x - tree.getInsets().left;
      result.x -= delta;
      result.width += delta;
    }
  }
  return result;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-propertyeditors

rightLabel.setBackground(backgroundNonSelectionColor);
setComponentOrientation(tree.getComponentOrientation());
node = (DefaultMutableTreeNode)value;
String[] labels;

代码示例来源:origin: RPTools/maptool

public Component getTreeCellRendererComponent(JTree tree, Object value,
    boolean sel, boolean expanded, boolean leaf, int row,
    boolean hasFocus) {
  node = (DefaultMutableTreeNode) value;
  mtnode = (MaptoolNode) node.getUserObject();
  setText(mtnode.toString());
  setBackground(tree.getBackground());
  setEnabled(tree.isEnabled());
  setComponentOrientation(tree.getComponentOrientation());
  return this;
}

代码示例来源:origin: org.java.net.substance/substance

@Override
public Rectangle getPathBounds(JTree tree, TreePath path) {
  Rectangle result = super.getPathBounds(tree, path);
  if (result != null) {
    if (tree.getComponentOrientation().isLeftToRight()) {
      result.width = tree.getWidth() - tree.getInsets().right
          - result.x;
    } else {
      int delta = result.x - tree.getInsets().left;
      result.x -= delta;
      result.width += delta;
    }
  }
  return result;
}

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

private boolean dispatchToTree(MouseEvent e) {
  switch (e.getID()) {
  case MouseEvent.MOUSE_ENTERED:
  case MouseEvent.MOUSE_EXITED:
    return false;
  }
  int hier = treeTable.getHierarchicalColumn();
  if (hier < 0)
    return false;
  Point pt = e.getPoint();
  int col = table.columnAtPoint(pt);
  if (col != hier)
    return false;
  int row = table.rowAtPoint(pt);
  if (row < 0)
    return false;
  TreePath path = tree.getPathForRow(row);
  if (!hasTreeHandle(treeTable, path))
    return false;
  if (isOverTreeHandle(tree.getComponentOrientation().isLeftToRight(),
      tree.getPathBounds(path), getTreeHandleWidth(), e.getX()-tree.getX())) {
    dispatchMouseEvent(e, tree);
    e.consume();
    return true;
  }
  return false;
}

代码示例来源:origin: google/sagetv

public java.awt.Component getTreeCellRendererComponent(javax.swing.JTree tree,
  Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean inHasFocus)
{
 currValue = value;
 String stringValue = (tree instanceof OracleTree) ?
   ((OracleTree) tree).convertValueToText(value, sel, expanded, leaf, row, hasFocus, true) :
    tree.convertValueToText(value, sel, expanded, leaf, row, hasFocus);
   hasFocus = inHasFocus;
   setText(stringValue);
   calculateSize();
   if(sel)
   {
    setForeground(getTextSelectionColor());
   }
   else
   {
    setForeground(getTextNonSelectionColor());
   }
   setComponentOrientation(tree.getComponentOrientation());
   selected = sel;
   return this;
}

代码示例来源:origin: com.jidesoft/jide-oss

applyComponentOrientation(tree.getComponentOrientation());

相关文章

JTree类方法