本文整理匯總了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;
}
示例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();
}