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


Java ScrollPolicy.HORIZONTAL_BAR_AS_NEEDED属性代码示例

本文整理汇总了Java中edu.mit.blocks.codeblockutil.CScrollPane.ScrollPolicy.HORIZONTAL_BAR_AS_NEEDED属性的典型用法代码示例。如果您正苦于以下问题:Java ScrollPolicy.HORIZONTAL_BAR_AS_NEEDED属性的具体用法?Java ScrollPolicy.HORIZONTAL_BAR_AS_NEEDED怎么用?Java ScrollPolicy.HORIZONTAL_BAR_AS_NEEDED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在edu.mit.blocks.codeblockutil.CScrollPane.ScrollPolicy的用法示例。


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

示例1: setDrawersCard

/**
 * Reassigns the set of canvases that this explorer controls.
 * Though the collection of canvas mnay be empty, it may not be null.
 * @param items
 *
 * @requires items != null &&
 * 			 for each element in item, element!= null
 */
public void setDrawersCard(List<? extends Canvas> items) {
    canvases.clear();
    buttonPane.removeAll();
    for (int i = 0; i < items.size(); i++) {
        final int index = i;
        Canvas item = items.get(i);
        //final CButton button = new CButton(item.getColor(), item.getColor().brighter().brighter().brighter(),item.getName());
        CButton button = new CBorderlessButton(item.getName());
        JComponent scroll = new CHoverScrollPane(
                item.getJComponent(),
                ScrollPolicy.VERTICAL_BAR_AS_NEEDED,
                ScrollPolicy.HORIZONTAL_BAR_AS_NEEDED,
                18, item.getColor(), Color.darkGray);
        button.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                selectCanvas(index);
            }
        });
        canvases.add(scroll);
        buttonPane.add(button);
    }
}
 
开发者ID:heqichen,项目名称:openblocks,代码行数:31,代码来源:MagicExplorer.java

示例2: CardPane

/** Constructor */
private CardPane() {
    super(new BorderLayout());
    this.setOpaque(false);
    this.scroll = new CHoverScrollPane(
            canvas.getJComponent(),
            ScrollPolicy.VERTICAL_BAR_AS_NEEDED,
            ScrollPolicy.HORIZONTAL_BAR_AS_NEEDED,
            18, canvas.getColor(), new Color(100, 100, 100, 100));
    this.label = new CardLabel();
    this.add(label, BorderLayout.NORTH);
    this.add(scroll, BorderLayout.CENTER);
}
 
开发者ID:heqichen,项目名称:openblocks,代码行数:13,代码来源:StackCard.java

示例3: setDrawersCard

/**
 * Reassigns the set of canvases that this explorer controls.
 * Though the collection of canvas mnay be empty, it may not be null.
 * @param items
 *
 * @requires items != null &&
 * 			 for each element in item, element!= null
 */
public void setDrawersCard(List<? extends Canvas> items) {
    canvases.clear();
    buttonPane.removeAll();
    int size = items.size();
    if (size % 2 == 1) {
        size++;
    }
    size = buttonHeight * size;
    buttonPane.setPreferredSize(new Dimension(6, size));
    for (int i = 0; i < items.size(); i++) {
        final int index = i;
        Canvas item = items.get(i);
        //final CButton button = new CButton(item.getColor(), item.getColor().brighter().brighter().brighter(),item.getName());
        CButton button = new CBorderlessButton(item.getName());
        JComponent scroll = new CHoverScrollPane(
                item.getJComponent(),
                ScrollPolicy.VERTICAL_BAR_AS_NEEDED,
                ScrollPolicy.HORIZONTAL_BAR_AS_NEEDED,
                18, item.getColor(), Color.darkGray);
        canvases.add(scroll);
        button.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                selectCanvas(index);
            }
        });
        buttonPane.add(button);
    }
    if (!canvases.isEmpty()) {
        canvasPane.add(canvases.get(0));
    }
    this.revalidate();

}
 
开发者ID:heqichen,项目名称:openblocks,代码行数:42,代码来源:WindowExplorer.java

示例4: CTable

/**
 * Create a new Table instance with an empty domain
 * @param i - thumb width
 */
public CTable(int i) {
    super(new BorderLayout());
    this.columns = new String[]{};
    this.columnLabels = new JLabel[]{};
    this.data = new ArrayList<double[]>();
    view = new JPanel();
    view.setBackground(foreground);
    scroll = new CTracklessScrollPane(
            view,
            ScrollPolicy.VERTICAL_BAR_AS_NEEDED,
            ScrollPolicy.HORIZONTAL_BAR_AS_NEEDED,
            i, CGraphite.blue, new Color(100, 100, 100));
    this.add(scroll, BorderLayout.CENTER);
}
 
开发者ID:heqichen,项目名称:openblocks,代码行数:18,代码来源:CTable.java


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