本文整理汇总了Java中javax.swing.plaf.ListUI类的典型用法代码示例。如果您正苦于以下问题:Java ListUI类的具体用法?Java ListUI怎么用?Java ListUI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ListUI类属于javax.swing.plaf包,在下文中一共展示了ListUI类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUI
import javax.swing.plaf.ListUI; //导入依赖的package包/类
@Override
public void setUI(ListUI ui) {
if (Util.getUseSubstanceRenderers() &&
SUBSTANCE_LIST_UI.equals(ui.getClass().getName())) {
// Substance requires its special ListUI be installed for
// its renderers to actually render (!), but long completion
// lists (e.g. PHPCompletionProvider in RSTALanguageSupport)
// will simply populate too slowly on initial display (when
// calculating preferred size of all items), so in this case
// we give a prototype cell value.
CompletionProvider p = ac.getCompletionProvider();
BasicCompletion bc = new BasicCompletion(p, "Hello world");
setPrototypeCellValue(bc);
}
else {
// Our custom UI that is faster for long HTML completion lists.
ui = new FastListUI();
setPrototypeCellValue(null);
}
super.setUI(ui);
}
示例2: setUI
import javax.swing.plaf.ListUI; //导入依赖的package包/类
@Override
public void setUI(ListUI ui) {
if (Util.getUseSubstanceRenderers() && SUBSTANCE_LIST_UI.equals(ui.getClass().getName())) {
// Substance requires its special ListUI be installed for
// its renderers to actually render (!), but long completion
// lists (e.g. PHPCompletionProvider in RSTALanguageSupport)
// will simply populate too slowly on initial display (when
// calculating preferred size of all items), so in this case
// we give a prototype cell value.
CompletionProvider p = ac.getCompletionProvider();
BasicCompletion bc = new BasicCompletion(p, "Hello world");
setPrototypeCellValue(bc);
} else {
// Our custom UI that is faster for long HTML completion lists.
ui = new FastListUI();
setPrototypeCellValue(null);
}
super.setUI(ui);
}
示例3: locationToIndex
import javax.swing.plaf.ListUI; //导入依赖的package包/类
/**
* Invokes the <code>locationToIndex</code> method on each UI handled by this object.
*
* @return the value obtained from the first UI, which is
* the UI obtained from the default <code>LookAndFeel</code>
*/
public int locationToIndex(JList a, Point b) {
int returnValue =
((ListUI) (uis.elementAt(0))).locationToIndex(a,b);
for (int i = 1; i < uis.size(); i++) {
((ListUI) (uis.elementAt(i))).locationToIndex(a,b);
}
return returnValue;
}
示例4: indexToLocation
import javax.swing.plaf.ListUI; //导入依赖的package包/类
/**
* Invokes the <code>indexToLocation</code> method on each UI handled by this object.
*
* @return the value obtained from the first UI, which is
* the UI obtained from the default <code>LookAndFeel</code>
*/
public Point indexToLocation(JList a, int b) {
Point returnValue =
((ListUI) (uis.elementAt(0))).indexToLocation(a,b);
for (int i = 1; i < uis.size(); i++) {
((ListUI) (uis.elementAt(i))).indexToLocation(a,b);
}
return returnValue;
}
示例5: getCellBounds
import javax.swing.plaf.ListUI; //导入依赖的package包/类
/**
* Invokes the <code>getCellBounds</code> method on each UI handled by this object.
*
* @return the value obtained from the first UI, which is
* the UI obtained from the default <code>LookAndFeel</code>
*/
public Rectangle getCellBounds(JList a, int b, int c) {
Rectangle returnValue =
((ListUI) (uis.elementAt(0))).getCellBounds(a,b,c);
for (int i = 1; i < uis.size(); i++) {
((ListUI) (uis.elementAt(i))).getCellBounds(a,b,c);
}
return returnValue;
}
示例6: locationToIndex
import javax.swing.plaf.ListUI; //导入依赖的package包/类
/**
* Invokes the <code>locationToIndex</code> method on each UI handled by this object.
*
* @return the value obtained from the first UI, which is
* the UI obtained from the default <code>LookAndFeel</code>
*/
public int locationToIndex(JList<?> a, Point b) {
int returnValue =
((ListUI) (uis.elementAt(0))).locationToIndex(a,b);
for (int i = 1; i < uis.size(); i++) {
((ListUI) (uis.elementAt(i))).locationToIndex(a,b);
}
return returnValue;
}
示例7: indexToLocation
import javax.swing.plaf.ListUI; //导入依赖的package包/类
/**
* Invokes the <code>indexToLocation</code> method on each UI handled by this object.
*
* @return the value obtained from the first UI, which is
* the UI obtained from the default <code>LookAndFeel</code>
*/
public Point indexToLocation(JList<?> a, int b) {
Point returnValue =
((ListUI) (uis.elementAt(0))).indexToLocation(a,b);
for (int i = 1; i < uis.size(); i++) {
((ListUI) (uis.elementAt(i))).indexToLocation(a,b);
}
return returnValue;
}
示例8: getCellBounds
import javax.swing.plaf.ListUI; //导入依赖的package包/类
/**
* Invokes the <code>getCellBounds</code> method on each UI handled by this object.
*
* @return the value obtained from the first UI, which is
* the UI obtained from the default <code>LookAndFeel</code>
*/
public Rectangle getCellBounds(JList<?> a, int b, int c) {
Rectangle returnValue =
((ListUI) (uis.elementAt(0))).getCellBounds(a,b,c);
for (int i = 1; i < uis.size(); i++) {
((ListUI) (uis.elementAt(i))).getCellBounds(a,b,c);
}
return returnValue;
}
示例9: getUI
import javax.swing.plaf.ListUI; //导入依赖的package包/类
/**
* Maps {@code JList.getUI()} through queue
*/
public ListUI getUI() {
return (runMapping(new MapAction<ListUI>("getUI") {
@Override
public ListUI map() {
return ((JList) getSource()).getUI();
}
}));
}
示例10: setUI
import javax.swing.plaf.ListUI; //导入依赖的package包/类
/**
* Maps {@code JList.setUI(ListUI)} through queue
*/
public void setUI(final ListUI listUI) {
runMapping(new MapVoidAction("setUI") {
@Override
public void map() {
((JList) getSource()).setUI(listUI);
}
});
}
示例11: getCellBounds
import javax.swing.plaf.ListUI; //导入依赖的package包/类
/**
* Returns the bounds of the rectangle that encloses both list cells
* with index0 and index1.
*
* @param index0 the index of the first cell
* @param index1 the index of the second cell
*
* @return the bounds of the rectangle that encloses both list cells
* with index0 and index1, <code>null</code> if one of the indices is
* not valid
*/
public Rectangle getCellBounds(int index0, int index1)
{
ListUI ui = getUI();
Rectangle bounds = null;
if (ui != null)
{
bounds = ui.getCellBounds(this, index0, index1);
}
// When the UI is null, this method also returns null in the RI.
return bounds;
}
示例12: updateUI
import javax.swing.plaf.ListUI; //导入依赖的package包/类
/**
* {@inheritDoc} <p>
*
* Overridden to update renderer and Highlighters.
*/
@Override
public void updateUI() {
// PENDING JW: temporary during dev to quickly switch between default and custom ui
if (getUIClassID() == super.getUIClassID()) {
super.updateUI();
} else {
setUI((ListUI) LookAndFeelAddons.getUI(this, ListUI.class));
}
updateRendererUI();
updateHighlighterUI();
}
示例13: buildChooser
import javax.swing.plaf.ListUI; //导入依赖的package包/类
@Override
protected void buildChooser() {
initComponents();
setUI(PalettePanelUI.createUI(this));
jList.setUI((ListUI) PaletteListUI.createUI(jList));
Object[] byRows=HSB_COLORS_AS_RGB.toArray();
Object[] byColumns=new Object[byRows.length];
for (int y=0,my=byRows.length/HSB_COLORS_AS_RGB_COLUMN_COUNT;y<my;y++) {
for (int x=0;x< HSB_COLORS_AS_RGB_COLUMN_COUNT;x++) {
if (x*my+y<byColumns.length)
byColumns[x*my+y]=byRows[y*HSB_COLORS_AS_RGB_COLUMN_COUNT+x];
}
}
byColumns[byColumns.length-1]=byRows[byRows.length-1];
jList.setListData(byColumns);
jList.setVisibleRowCount(HSB_COLORS_AS_RGB.size() / HSB_COLORS_AS_RGB_COLUMN_COUNT);
jList.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
if (updateRecursion++ == 0) {
ColorIcon item = (ColorIcon) jList.getSelectedValue();
setColorToModel(item == null ? null : item.getColor());
}
updateRecursion--;
}
});
}