org.eclipse.swt.widgets.Tree.calculateWidth()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(125)

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

Tree.calculateWidth介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

int calculateWidth (TreeItem[] items, int index, GC gc, boolean recurse) {
  if (items == null) return 0;
  int width = 0;
  for (int i=0; i<items.length; i++) {
    TreeItem item = items [i];
    if (item != null) {
      int itemWidth = item.calculateWidth (index, gc);
      width = Math.max (width, itemWidth);
      if (recurse && item.getExpanded ()) {
        width = Math.max (width, calculateWidth (item.items, index, gc, recurse));
      }
    }
  }
  return width;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

void setScrollWidth (long /*int*/ column, TreeItem item) {
  if (columnCount != 0 || currentItem == item) return;
  int width = OS.gtk_tree_view_column_get_fixed_width (column);
  int itemWidth = calculateWidth (column, item.handle, true);
  if (width < itemWidth) {
    OS.gtk_tree_view_column_set_fixed_width (column, itemWidth);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

void setScrollWidth (int /*long*/ column, TreeItem item) {
  if (columnCount != 0 || currentItem == item) return;
  int width = OS.gtk_tree_view_column_get_fixed_width (column);
  int itemWidth = calculateWidth (column, item.handle, true);
  if (width < itemWidth) {
    OS.gtk_tree_view_column_set_fixed_width (column, itemWidth);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

void setScrollWidth (int /*long*/ column, TreeItem item) {
  if (columnCount != 0 || currentItem == item) return;
  int width = OS.gtk_tree_view_column_get_fixed_width (column);
  int itemWidth = calculateWidth (column, item.handle, true);
  if (width < itemWidth) {
    OS.gtk_tree_view_column_set_fixed_width (column, itemWidth);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

TreeItem item = parent.items [i];
  if (item != null && item.cached) {
    width = Math.max (width, parent.calculateWidth (handle, item.handle, true));
if (OS.gtk_tree_model_get_iter_first (parent.modelHandle, iter)) {
  do {
    width = Math.max (width, parent.calculateWidth (handle, iter, true));
  } while (OS.gtk_tree_model_iter_next(parent.modelHandle, iter));

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

TreeItem item = parent.items [i];
  if (item != null && item.cached) {
    width = Math.max (width, parent.calculateWidth (handle, item.handle, true));
if (OS.gtk_tree_model_get_iter_first (parent.modelHandle, iter)) {
  do {
    width = Math.max (width, parent.calculateWidth (handle, iter, true));
  } while (OS.gtk_tree_model_iter_next(parent.modelHandle, iter));

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

TreeItem item = parent.items [i];
  if (item != null && item.cached) {
    width = Math.max (width, parent.calculateWidth (handle, item.handle, true));
if (OS.gtk_tree_model_get_iter_first (parent.modelHandle, iter)) {
  do {
    width = Math.max (width, parent.calculateWidth (handle, iter, true));
  } while (OS.gtk_tree_model_iter_next(parent.modelHandle, iter));

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

width = Math.max(width, parent.calculateWidth(parent.items, parent.indexOf (this), gc, true));
gc.dispose ();
setWidth (width);

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

boolean setScrollWidth (boolean set, TreeItem[] items, boolean recurse) {
  if (items == null) return false;
  if (ignoreRedraw || !getDrawing()) return false;
  if (columnCount != 0) return false;
  GC gc = new GC (this);
  int newWidth = calculateWidth (items, 0, gc, recurse);
  gc.dispose ();
  if (!set) {
    int oldWidth = (int)firstColumn.width ();
    if (oldWidth >= newWidth) return false;
  }
  firstColumn.setWidth (newWidth);
  if (horizontalBar != null && horizontalBar.view != null) redrawWidget (horizontalBar.view, false);
  return true;
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

public Point computeSize (int wHint, int hHint, boolean changed) {
  checkWidget ();
  int width = 0, height = 0;
  if (wHint == SWT.DEFAULT) {
    if (columnCount != 0) {
      for (int i=0; i<columnCount; i++) {
        width += columns [i].getWidth ();
      }
    } else {
      GC gc = new GC (this);
      width = calculateWidth (items, 0, gc, true) + CELL_GAP;
      gc.dispose ();
    }
    if ((style & SWT.CHECK) != 0) width += getCheckColumnWidth ();
  } else {
    width = wHint;
  }
  if (hHint == SWT.DEFAULT) {
    height = (int)/*64*/((NSOutlineView) view).numberOfRows () * getItemHeight () + getHeaderHeight ();
  } else {
    height = hHint;
  }
  if (width <= 0) width = DEFAULT_WIDTH;
  if (height <= 0) height = DEFAULT_HEIGHT;
  Rectangle rect = computeTrim (0, 0, width, height);
  return new Point (rect.width, rect.height);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

boolean valid = OS.gtk_tree_model_iter_children (modelHandle, childIter, iter);
while (valid) {
  width = Math.max (width, calculateWidth (column, childIter, true));
  valid = OS.gtk_tree_model_iter_next (modelHandle, childIter);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

boolean valid = OS.gtk_tree_model_iter_children (modelHandle, childIter, iter);
while (valid) {
  width = Math.max (width, calculateWidth (column, childIter, true));
  valid = OS.gtk_tree_model_iter_next (modelHandle, childIter);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

boolean valid = OS.gtk_tree_model_iter_children (modelHandle, childIter, iter);
while (valid) {
  width = Math.max (width, calculateWidth (column, childIter, true));
  valid = OS.gtk_tree_model_iter_next (modelHandle, childIter);

相关文章

Tree类方法