當前位置: 首頁>>代碼示例>>Java>>正文


Java OutlineModel.getColumnAtIndex方法代碼示例

本文整理匯總了Java中com.trollworks.toolkit.ui.widget.outline.OutlineModel.getColumnAtIndex方法的典型用法代碼示例。如果您正苦於以下問題:Java OutlineModel.getColumnAtIndex方法的具體用法?Java OutlineModel.getColumnAtIndex怎麽用?Java OutlineModel.getColumnAtIndex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.trollworks.toolkit.ui.widget.outline.OutlineModel的用法示例。


在下文中一共展示了OutlineModel.getColumnAtIndex方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getPreferredWidth

import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入方法依賴的package包/類
/** @return The preferred width. */
public int getPreferredWidth() {
    Insets insets = getInsets();
    int width = insets.left + insets.right;
    OutlineModel outlineModel = mOutline.getModel();
    int count = outlineModel.getColumnCount();
    if (mOutline.shouldDrawColumnDividers()) {
        width += (count - 1) * Scale.get(this).scale(1);
    }
    for (int i = 0; i < count; i++) {
        Column column = outlineModel.getColumnAtIndex(i);
        width += column.getPreferredWidth(mOutline);
    }
    return width;
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:16,代碼來源:SingleOutlinePanel.java

示例2: layoutContainer

import com.trollworks.toolkit.ui.widget.outline.OutlineModel; //導入方法依賴的package包/類
@Override
public void layoutContainer(Container parent) {
    Insets insets = getInsets();
    Rectangle bounds = new Rectangle(insets.left, insets.top, getWidth() - (insets.left + insets.right), getHeight() - (insets.top + insets.bottom));
    int width = bounds.width;
    int height = mHeader.getPreferredSize().height;
    OutlineModel outlineModel = mOutline.getModel();
    int count = outlineModel.getColumnCount();
    ArrayList<Column> changed = new ArrayList<>();
    Column column;

    mHeader.setBounds(bounds.x, bounds.y, width, height);
    bounds.y += height;
    bounds.height -= height;
    mOutline.setBounds(bounds.x, bounds.y, width, bounds.height);

    for (int i = 0; i < count; i++) {
        column = outlineModel.getColumnAtIndex(i);
        if (column.getID() != 0) {
            int prefWidth = column.getPreferredWidth(mOutline);
            if (prefWidth != column.getWidth()) {
                column.setWidth(mOutline, prefWidth);
                changed.add(column);
            }
            width -= prefWidth;
        }
    }

    if (mOutline.shouldDrawColumnDividers()) {
        width -= count;
    }
    column = outlineModel.getColumnWithID(0);
    if (column.getWidth() != width) {
        column.setWidth(mOutline, width);
        changed.add(column);
    }
    mOutline.updateRowHeightsIfNeeded(changed);
    mOutline.revalidateView();
}
 
開發者ID:richardwilkes,項目名稱:gcs,代碼行數:40,代碼來源:TemplateOutlinePanel.java


注:本文中的com.trollworks.toolkit.ui.widget.outline.OutlineModel.getColumnAtIndex方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。