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


Java ScrollPolicy.HORIZONTAL_BAR_ALWAYS属性代码示例

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


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

示例1: BlockCanvas

/**
 * Constructs BlockCanvas and subscribes
 * this BlockCanvas to PageChange events
 */
public BlockCanvas(Workspace workspace) {
    this.workspace = workspace;
    this.canvas = new Canvas();
    this.scrollPane = new CHoverScrollPane(canvas,
            ScrollPolicy.VERTICAL_BAR_ALWAYS,
            ScrollPolicy.HORIZONTAL_BAR_ALWAYS,
            18, CGraphite.blue, null);
    scrollPane.setScrollingUnit(5);
    canvas.setLayout(null);
    canvas.setBackground(Color.gray);
    canvas.setOpaque(true);
    PageChangeEventManager.addPageChangeListener(this);
}
 
开发者ID:heqichen,项目名称:openblocks,代码行数:17,代码来源:BlockCanvas.java

示例2: CWheeler

public CWheeler(Collection<JComponent> items, boolean includeScrollbar, Color backgroundColor) {
    super(new BorderLayout());
    this.setBackground(backgroundColor);
    this.elements = items;
    if (includeScrollbar) {
        CArrowButton left = new CArrowButton(CArrowButton.Direction.WEST) {
            private static final long serialVersionUID = 328149080242L;
            @Override
            public void triggerAction() {
                scrollLeft();
            }
        };
        left.addActionListener(left);
        left.setPreferredSize(new Dimension(15, 15));
        CArrowButton right = new CArrowButton(CArrowButton.Direction.EAST) {
            private static final long serialVersionUID = 328149080243L;
            @Override
            public void triggerAction() {
                scrollRight();
            }
        };
        right.addActionListener(right);
        right.setPreferredSize(new Dimension(15, 15));
        this.view = new JPanel(null);
        this.view.setBackground(backgroundColor);
        this.scroll = new CHoverScrollPane(view,
                ScrollPolicy.VERTICAL_BAR_NEVER,
                ScrollPolicy.HORIZONTAL_BAR_ALWAYS,
                20, CGraphite.blue, new Color(0, 0, 50));

        JPanel leftPane = new JPanel(new BorderLayout());
        leftPane.setBackground(backgroundColor);
        leftPane.add(left, BorderLayout.SOUTH);
        this.add(leftPane, BorderLayout.WEST);
        JPanel rightPane = new JPanel(new BorderLayout());
        rightPane.setBackground(backgroundColor);
        rightPane.add(right, BorderLayout.SOUTH);
        this.add(rightPane, BorderLayout.EAST);
    } else {
        this.view = new JPanel(null);
        this.view.setBackground(backgroundColor);
        this.scroll = new CTracklessScrollPane(view,
                ScrollPolicy.VERTICAL_BAR_NEVER,
                ScrollPolicy.HORIZONTAL_BAR_NEVER,
                20, Color.blue, new Color(0, 0, 50));
    }
    for (JComponent element : elements) {
        view.add(element);
    }
    this.add(scroll, BorderLayout.CENTER);
    reformItems();
}
 
开发者ID:heqichen,项目名称:openblocks,代码行数:52,代码来源:CWheeler.java

示例3: CHoverScrollPane

/**
 * Constructs a custom CHoverScrollPane with the view port set to "view",
 * with both scroll bar policies set to "ALWAYS" (see
 * javax.swing.JScrollPane for a description on the use of
 * scroll bar policies).  Thumb will have  girth of 10 and an interior
 * color of black, hovering above a grayed-out transparant background.
 *
 * @param view
 *
 * @requires view != null
 * @effects constructs a CScrollPane as described in method overview
 */
public CHoverScrollPane(JComponent view) {
    this(view, ScrollPolicy.VERTICAL_BAR_ALWAYS,
            ScrollPolicy.HORIZONTAL_BAR_ALWAYS);
}
 
开发者ID:heqichen,项目名称:openblocks,代码行数:16,代码来源:CHoverScrollPane.java


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