当前位置: 首页>>代码示例>>Java>>正文


Java AbstractLayoutCache类代码示例

本文整理汇总了Java中javax.swing.tree.AbstractLayoutCache的典型用法代码示例。如果您正苦于以下问题:Java AbstractLayoutCache类的具体用法?Java AbstractLayoutCache怎么用?Java AbstractLayoutCache使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AbstractLayoutCache类属于javax.swing.tree包,在下文中一共展示了AbstractLayoutCache类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DefaultOutlineModel

import javax.swing.tree.AbstractLayoutCache; //导入依赖的package包/类
/** Creates a new instance of DefaultOutlineModel.  <strong><b>Note</b> 
 * Do not fire table structure changes from the wrapped TableModel (value
 * changes are okay).  Changes that affect the number of rows must come
 * from the TreeModel.
 * @param treeModel The tree model
 * @param tableModel The table model
 * @param largeModel <code>true</code> if it's a large model tree, <code>false</code> otherwise.
 * @param nodesColumnLabel Label of the node's column
 */
protected DefaultOutlineModel(TreeModel treeModel, TableModel tableModel, boolean largeModel, String nodesColumnLabel) {
    this.treeModel = treeModel;
    this.tableModel = tableModel;
    if (nodesColumnLabel != null) {
        this.nodesColumnLabel = nodesColumnLabel;
    }
    
    layout = largeModel ? (AbstractLayoutCache) new FixedHeightLayoutCache() 
        : (AbstractLayoutCache) new VariableHeightLayoutCache();
        
    broadcaster = new EventBroadcaster (this);
    
    layout.setRootVisible(true);
    layout.setModel(this);
    treePathSupport = new TreePathSupport(this, layout);
    treePathSupport.addTreeExpansionListener(broadcaster);
    treePathSupport.addTreeWillExpandListener(broadcaster);
    treeModel.addTreeModelListener(broadcaster);
    tableModel.addTableModelListener(broadcaster);
    if (tableModel instanceof ProxyTableModel) {
        ((ProxyTableModel) tableModel).setOutlineModel(this);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:DefaultOutlineModel.java

示例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);
            int containerWidth = tree.getParent() instanceof JViewport
                    ? tree.getParent().getWidth() : tree.getWidth();

            dimensions.width = containerWidth - getRowX(row, depth);

            return dimensions;
        }
    };
}
 
开发者ID:mathieulegoc,项目名称:SmartTokens,代码行数:18,代码来源:SourceListTreeUI.java

示例3: getIcon

import javax.swing.tree.AbstractLayoutCache; //导入依赖的package包/类
public javax.swing.Icon getIcon(Object o) {
    if (!showIcons) {
        return emptyIcon;
    }
    Node n = Visualizer.findNode(o);
    if (n == null) {
        throw new IllegalStateException("TreeNode must be VisualizerNode but was: " + o + " of class " + o.getClass().getName());
    }
    boolean expanded = false;
    if (o instanceof TreeNode) {
        TreeNode tn = (TreeNode)o;
        ArrayList<TreeNode> al = new ArrayList<TreeNode> ();
        while (tn != null) {
            al.add(tn);
            tn = tn.getParent();
        }
        Collections.reverse(al);
        TreePath tp = new TreePath(al.toArray());
        AbstractLayoutCache layout = table.getLayoutCache();
        expanded = layout.isExpanded(tp);
    }
    java.awt.Image image = null;
    if (expanded) {
        image = n.getOpenedIcon(java.beans.BeanInfo.ICON_COLOR_16x16);
    } else {
        image = n.getIcon(java.beans.BeanInfo.ICON_COLOR_16x16);
    }
    return new ImageIcon(image);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:NodeRenderDataProvider.java

示例4: getLayoutCache

import javax.swing.tree.AbstractLayoutCache; //导入依赖的package包/类
/** Get the layout cache which manages layout data for the Outline.
 * <strong>Under no circumstances directly call the methods on the
 * layout cache which change the expanded state - such changes will not
 * be propagated into the table model, and will leave the model and
 * its layout in inconsistent states.  Any calls that affect expanded
 * state must go through <code>getTreePathSupport()</code>.</strong> */
public final AbstractLayoutCache getLayoutCache () {
    OutlineModel mdl = getOutlineModel();
    if (mdl != null) {
        return mdl.getLayout();
    } else {
        return null;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:Outline.java

示例5: setModel

import javax.swing.tree.AbstractLayoutCache; //导入依赖的package包/类
/** Overridden to throw an exception if the passed model is not an instance
 * of <code>OutlineModel</code> (with the exception of calls from the 
 * superclass constructor) */
@Override
public void setModel (TableModel mdl) {
    if (initialized && (!(mdl instanceof OutlineModel))) {
        throw new IllegalArgumentException (
            "Table model for an Outline must be an instance of " +
            "OutlineModel"); //NOI18N
    }
    if (mdl instanceof OutlineModel) {
        AbstractLayoutCache layout = ((OutlineModel) mdl).getLayout();
        if (cachedRootVisible != null) {
            
            layout.setRootVisible(
                cachedRootVisible.booleanValue());
            
        }
        
        layout.setRowHeight(getRowHeight());
        
        if (((OutlineModel) mdl).isLargeModel()) {
            addComponentListener (getComponentListener());
            layout.setNodeDimensions(new ND());
        } else {
            if (componentListener != null) {
                removeComponentListener (componentListener);
                componentListener = null;
            }
        }
    }
    
    super.setModel(mdl);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:35,代码来源:Outline.java

示例6: setAligner

import javax.swing.tree.AbstractLayoutCache; //导入依赖的package包/类
/**
    * Sets <CODE>aligner</CODE> as the
    * <CODE>AbstractLayoutCache</CODE> to be used
    * to align nodes, or null to disable
    * node alignment
    *
    * @param aligner <CODE>AbstractLayoutCache</CODE> to be
    * used to align nodes, or null to disable node alignment
    */
   public synchronized void setAligner(AbstractLayoutCache aligner)
   {
if(this.aligner == aligner)
    return;

this.aligner = aligner;
if(aligner != null && mapper == null) {
    TreeModel model = aligner.getModel();
    if(model instanceof NodeMapper)
	setMapper((NodeMapper)model);
}
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:22,代码来源:LayoutCacheAligner.java

示例7: createLayoutCache

import javax.swing.tree.AbstractLayoutCache; //导入依赖的package包/类
protected AbstractLayoutCache createLayoutCache()
   {
if(isLargeModel() && getRowHeight() > 0)
    return new AlignableFixedHeightLayoutCache(this);

return new AlignableVariableHeightLayoutCache(this);
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:8,代码来源:MetalAlignableTreeUI.java

示例8: createLayoutCache

import javax.swing.tree.AbstractLayoutCache; //导入依赖的package包/类
protected AbstractLayoutCache createLayoutCache()
   {
if(isLargeModel() && getRowHeight() > 0) {
    return new AlignableFixedHeightLayoutCache(this);
}

return new AlignableVariableHeightLayoutCache(this);
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:9,代码来源:BasicAlignableTreeUI.java

示例9: 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;
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ColumnTreeBuilder.java

示例10: 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;
		}
	};
}
 
开发者ID:CollapsedDom,项目名称:Stud.IP-Client,代码行数:12,代码来源:TreeCellListRenderer.java

示例11: 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();
}
 
开发者ID:iig-uni-freiburg,项目名称:WOLFGANG,代码行数:9,代码来源:PNPropertiesTreeUI.java

示例12: 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;
    }
  };
}
 
开发者ID:Orange-OpenSource,项目名称:matos-profiles,代码行数:13,代码来源:JClassView.java

示例13: getLayout

import javax.swing.tree.AbstractLayoutCache; //导入依赖的package包/类
@Override
public final AbstractLayoutCache getLayout() {
    return layout;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:DefaultOutlineModel.java

示例14: getLayout

import javax.swing.tree.AbstractLayoutCache; //导入依赖的package包/类
/** Convenience getter for the proxied model's layout cache */
private AbstractLayoutCache getLayout() {
    return getModel().getLayout();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:EventBroadcaster.java

示例15: TreePathSupport

import javax.swing.tree.AbstractLayoutCache; //导入依赖的package包/类
/** Creates a new instance of TreePathSupport */
public TreePathSupport(OutlineModel mdl, AbstractLayoutCache layout) {
    this.layout = layout;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:TreePathSupport.java


注:本文中的javax.swing.tree.AbstractLayoutCache类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。