本文整理汇总了Java中javax.swing.tree.AbstractLayoutCache.NodeDimensions方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractLayoutCache.NodeDimensions方法的具体用法?Java AbstractLayoutCache.NodeDimensions怎么用?Java AbstractLayoutCache.NodeDimensions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.tree.AbstractLayoutCache
的用法示例。
在下文中一共展示了AbstractLayoutCache.NodeDimensions方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createNodeDimensions
import javax.swing.tree.AbstractLayoutCache; //导入方法依赖的package包/类
@Override
protected AbstractLayoutCache.NodeDimensions createNodeDimensions() {
return new NodeDimensionsHandler() {
@Override
public Rectangle getNodeDimensions(
Object value, int row, int depth, boolean expanded, Rectangle size) {
Rectangle dimensions = super.getNodeDimensions(value, row, depth, expanded, size);
int containerWidth = tree.getParent() instanceof JViewport
? tree.getParent().getWidth() : tree.getWidth();
dimensions.width = containerWidth - getRowX(row, depth);
return dimensions;
}
};
}
示例2: createNodeDimensions
import javax.swing.tree.AbstractLayoutCache; //导入方法依赖的package包/类
@Override
protected AbstractLayoutCache.NodeDimensions createNodeDimensions() {
return new NodeDimensionsHandler() {
@Override
public Rectangle getNodeDimensions(Object value, int row, int depth, boolean expanded, Rectangle size) {
Rectangle dimensions = super.getNodeDimensions(value, row, depth, expanded, size);
dimensions.width = tree.getWidth() - getRowX(row, depth);
return dimensions;
}
};
}
示例3: createNodeDimensions
import javax.swing.tree.AbstractLayoutCache; //导入方法依赖的package包/类
@Override
protected AbstractLayoutCache.NodeDimensions createNodeDimensions() {
return new NodeDimensionsHandler() {
@Override
public Rectangle getNodeDimensions(Object value, int row, int depth, boolean expanded, Rectangle size) {
Rectangle dimensions = super.getNodeDimensions(value, row, depth, expanded, size);
dimensions.width = parent.getWidth() - getRowX(row, depth);
return dimensions;
}
};
}
示例4: createNodeDimensions
import javax.swing.tree.AbstractLayoutCache; //导入方法依赖的package包/类
@Override
/**
* Creates an instance of NodeDimensions that is able to determine
* the size of a given node in the tree.
*/
protected AbstractLayoutCache.NodeDimensions createNodeDimensions() {
return new PNNodeDimensionsHandler();
}
示例5: createNodeDimensions
import javax.swing.tree.AbstractLayoutCache; //导入方法依赖的package包/类
@Override
protected AbstractLayoutCache.NodeDimensions createNodeDimensions() {
return new NodeDimensionsHandler() {
@Override
public Rectangle getNodeDimensions(Object value, int row, int depth, boolean expanded, Rectangle size) {
Rectangle dimensions = super.getNodeDimensions(value, row, depth, expanded, size);
Insets insets = tree.getInsets();
dimensions.width = tree.getWidth() - getRowX(row, depth) - insets.left - insets.right;
return dimensions;
}
};
}
示例6: createNodeDimensions
import javax.swing.tree.AbstractLayoutCache; //导入方法依赖的package包/类
protected AbstractLayoutCache.NodeDimensions createNodeDimensions() {
return new NodeDimensionsHandler();
}
示例7: createNodeDimensions
import javax.swing.tree.AbstractLayoutCache; //导入方法依赖的package包/类
/**
* Creates an instance of NodeDimensions that is able to determine the size of
* a given node in the tree. The node dimensions must be created before
* configuring the layout cache.
*
* @return the NodeDimensions of a given node in the tree
*/
protected AbstractLayoutCache.NodeDimensions createNodeDimensions()
{
return new NodeDimensionsHandler();
}
示例8: createNodeDimensions
import javax.swing.tree.AbstractLayoutCache; //导入方法依赖的package包/类
/**
* Creates an instance of NodeDimensions that is able to determine the size of
* a given node in the tree. The node dimensions must be created before
* configuring the layout cache.
*
* @return the NodeDimensions of a given node in the tree
*/
protected AbstractLayoutCache.NodeDimensions createNodeDimensions()
{
return new NodeDimensionsHandler();
}