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