Java 类javax.swing.plaf.basic.BasicListUI 实例源码
项目:intellij-ce-playground
文件:PaletteItemsComponent.java
@Override
public void updateUI() {
setUI(new BasicListUI() {
MouseListener myListener;
@Override
protected void updateLayoutState() {
super.updateLayoutState();
Insets insets = list.getInsets();
int listWidth = list.getWidth() - (insets.left + insets.right);
if (listWidth >= cellWidth) {
int columnCount = listWidth / cellWidth;
cellWidth = (columnCount == 0) ? 1 : listWidth / columnCount;
}
}
@Override
protected void installListeners() {
addMouseListener(myListener = new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
myBeforeClickSelectedRow = list.getSelectedIndex();
}
});
super.installListeners();
}
@Override
protected void uninstallListeners() {
if (myListener != null) {
removeMouseListener(myListener);
}
super.uninstallListeners();
}
});
invalidate();
}
项目:tools-idea
文件:PaletteItemsComponent.java
@Override
public void updateUI() {
setUI(new BasicListUI() {
MouseListener myListener;
@Override
protected void updateLayoutState() {
super.updateLayoutState();
Insets insets = list.getInsets();
int listWidth = list.getWidth() - (insets.left + insets.right);
if (listWidth >= cellWidth) {
int columnCount = listWidth / cellWidth;
cellWidth = (columnCount == 0) ? 1 : listWidth / columnCount;
}
}
@Override
protected void installListeners() {
addMouseListener(myListener = new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
myBeforeClickSelectedRow = list.getSelectedIndex();
}
});
super.installListeners();
}
@Override
protected void uninstallListeners() {
if (myListener != null) {
removeMouseListener(myListener);
}
super.uninstallListeners();
}
});
invalidate();
}
项目:cordovastudio
文件:PaletteItemsComponent.java
@Override
public void updateUI() {
setUI(new BasicListUI() {
MouseListener myListener;
@Override
protected void updateLayoutState() {
super.updateLayoutState();
Insets insets = list.getInsets();
int listWidth = list.getWidth() - (insets.left + insets.right);
if (listWidth >= cellWidth) {
int columnCount = listWidth / cellWidth;
cellWidth = (columnCount == 0) ? 1 : listWidth / columnCount;
}
}
@Override
protected void installListeners() {
addMouseListener(myListener = new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
myBeforeClickSelectedRow = list.getSelectedIndex();
}
});
super.installListeners();
}
@Override
protected void uninstallListeners() {
if (myListener != null) {
removeMouseListener(myListener);
}
super.uninstallListeners();
}
});
invalidate();
}
项目:pdfxtk
文件:MultiColumnListUI.java
/**
* Returns a new instance of BasicListUI. BasicListUI delegates are
* allocated one per JList.
*
* @return A new ListUI implementation for the Windows look and feel.
*/
public static ComponentUI createUI(JComponent list) {
return new BasicListUI();
}