本文整理汇总了Java中edu.mit.blocks.codeblockutil.CScrollPane.ScrollPolicy.VERTICAL_BAR_AS_NEEDED属性的典型用法代码示例。如果您正苦于以下问题:Java ScrollPolicy.VERTICAL_BAR_AS_NEEDED属性的具体用法?Java ScrollPolicy.VERTICAL_BAR_AS_NEEDED怎么用?Java ScrollPolicy.VERTICAL_BAR_AS_NEEDED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类edu.mit.blocks.codeblockutil.CScrollPane.ScrollPolicy
的用法示例。
在下文中一共展示了ScrollPolicy.VERTICAL_BAR_AS_NEEDED属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GlassCard
/**
* constructor
* @param i
* @param canvas
* @param ex
*/
GlassCard(int i, Canvas canvas, GlassExplorer ex) {
this.index = i;
this.explorer = ex;
this.canvas = canvas;
this.button = new GlassButton(canvas.getColor(), canvas.getColor().brighter().brighter().brighter(), canvas.getName());
//this.button.setMaximumSize(new Dimension(0,10));
//this.button.setPreferredSize(new Dimension(0,10));
this.scroll = new CGlassScrollPane(
canvas.getJComponent(),
ScrollPolicy.VERTICAL_BAR_AS_NEEDED,
ScrollPolicy.HORIZONTAL_BAR_NEVER,
SCROLLBAR_WIDTH, canvas.getColor(),
new Color(100, 100, 100, 100));
canvas.getJComponent().setOpaque(false);
button.addActionListener(this);
canvas.getJComponent().addPropertyChangeListener(this);
this.scroll.setPreferredSize(
new Dimension(canvas.getJComponent().getPreferredSize().width + SCROLLBAR_WIDTH,
canvas.getJComponent().getPreferredSize().height));
}
示例2: 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);
}
}
示例3: 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);
}
示例4: 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();
}
示例5: CPopupMenu
CPopupMenu() {
super();
this.setLayout(new BorderLayout());
this.setBackground(background);
this.setOpaque(false);
this.removeAll();
this.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, CGraphite.blue));
view = new JPanel(new GridLayout(0, 1));
view.setBackground(background);
scroll = new CTracklessScrollPane(view,
ScrollPolicy.VERTICAL_BAR_AS_NEEDED,
ScrollPolicy.HORIZONTAL_BAR_NEVER,
9, CGraphite.blue, background);
this.add(scroll);
}
示例6: 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);
}