本文整理汇总了Java中javax.swing.plaf.basic.BasicArrowButton类的典型用法代码示例。如果您正苦于以下问题:Java BasicArrowButton类的具体用法?Java BasicArrowButton怎么用?Java BasicArrowButton使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BasicArrowButton类属于javax.swing.plaf.basic包,在下文中一共展示了BasicArrowButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createArrowButton
import javax.swing.plaf.basic.BasicArrowButton; //导入依赖的package包/类
/**
* <pre>
* 重写下拉按钮,增加焦点颜色
*
* Rewrite the drop-down button to increase the focus color
* </pre>
*
* @return arrow button info
*/
protected JButton createArrowButton()
{
JButton button = new LuckComboBoxButton(BasicArrowButton.SOUTH)
{
private static final long serialVersionUID = -7259590635997077859L;
@Override
public LuckBorderField getBorderField()
{
return LuckComboBoxUI.this;
}
@Override
public JComponent getParentComp()
{
return LuckComboBoxUI.this.comboBox;
}
};
button.setName("ComboBox.arrowButton");
return button;
}
示例2: DatePicker
import javax.swing.plaf.basic.BasicArrowButton; //导入依赖的package包/类
public DatePicker(Date date) {
selectedDay = null;
selectedDate = null;
originalDate = null;
backButton = new BasicArrowButton(BasicArrowButton.WEST);//new JButton();
monthAndYear = new JLabel();
forwardButton = new BasicArrowButton(BasicArrowButton.EAST);//new JButton();
todayButton = new JButton();
cancelButton = new JButton();
if (date == null) {
selectedDate = getToday();
} else {
selectedDate = new GregorianCalendar();
selectedDate.setTime(date);
}
originalDate = new GregorianCalendar(selectedDate.get(Calendar.YEAR), selectedDate.get(Calendar.MONTH), selectedDate.get(Calendar.DAY_OF_MONTH));
init();
}
示例3: JDropDownButton
import javax.swing.plaf.basic.BasicArrowButton; //导入依赖的package包/类
public JDropDownButton(String text) {
super(text);
buttonPopupMenu = new JPopupMenu();
arrowButton = new BasicArrowButton(SwingConstants.SOUTH, null, null, Color.BLACK, null);
arrowButton.setBorder(BorderFactory.createEmptyBorder());
arrowButton.setFocusable(false);
setHorizontalAlignment(SwingConstants.LEFT);
setLayout(new BorderLayout());
add(arrowButton, BorderLayout.EAST);
arrowButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Rectangle r = getBounds();
buttonPopupMenu.show(JDropDownButton.this, r.x, r.y + r.height);
}
});
}
示例4: ArrowColumn
import javax.swing.plaf.basic.BasicArrowButton; //导入依赖的package包/类
/**
* Instantiates a new arrow column.
*
* @param table the table
* @param column the column
* @param direction the direction
*/
public ArrowColumn(JTable table, int column, int direction){
super(table, column);
renderButton = new BasicArrowButton(direction);
editButton = new BasicArrowButton(direction);
editButton.setText("arrow");
setButtons(renderButton, editButton);
}
示例5: ImageTable
import javax.swing.plaf.basic.BasicArrowButton; //导入依赖的package包/类
/**
* Instantiates a new image table.
*/
public ImageTable() {
super();
Object[][] data = new Object[defaultDomtype.length][columnNames.length];
for (int i = 0; i < defaultDomtype.length; i++) {
data[i][0] = defaultDomtype[i];
}
// table
tableModel = new MyTableModel(data, columnNames);
setModel(tableModel);
setBackground(new Color(169,169,169));
getTableHeader().setReorderingAllowed(false);
// mouse
addMouseListener(this);
setCellSelectionEnabled(true);
new ArrowColumn(this, colUpButton, BasicArrowButton.NORTH);
new ArrowColumn(this, colDownButton, BasicArrowButton.SOUTH);
new AddingColumn(this, colAddImage);
TableColumn column = (TableColumn) this.getColumnModel().getColumn(colAddImage);
column.setMaxWidth(50);
column = (TableColumn) getColumnModel().getColumn(colDownButton);
column.setMaxWidth(50);
column = (TableColumn) getColumnModel().getColumn(colUpButton);
column.setMaxWidth(50);
setVisible(true);
}
示例6: getColumnClass
import javax.swing.plaf.basic.BasicArrowButton; //导入依赖的package包/类
@Override
public Class<?> getColumnClass(int Column) {
switch (Column) {
case 0:
case 1:
return String.class;
case 2:
return JButton.class;
case 3:
case 4:
return BasicArrowButton.class;
default:
return Boolean.class;
}
}
示例7: createDecreaseButton
import javax.swing.plaf.basic.BasicArrowButton; //导入依赖的package包/类
@Override
protected JButton createDecreaseButton(int orientation) {
BasicArrowButton button = new BasicArrowButton(orientation,
UIManager.getColor("ScrollBar.thumb"),
UIManager.getColor("ScrollBar.thumbShadow"),
Color.WHITE,
UIManager.getColor("ScrollBar.thumbHighlight"));
button.setBackground(GUI.COLOR_UI_ELEMENT);
button.setForeground(Color.WHITE);
return button;
}
示例8: createIncreaseButton
import javax.swing.plaf.basic.BasicArrowButton; //导入依赖的package包/类
@Override
protected JButton createIncreaseButton(int orientation) {
JButton button = new BasicArrowButton(orientation,
UIManager.getColor("ScrollBar.thumb"),
UIManager.getColor("ScrollBar.thumbShadow"),
Color.WHITE,
UIManager.getColor("ScrollBar.thumbHighlight"));
button.setBackground(GUI.COLOR_UI_ELEMENT);
button.setForeground(Color.WHITE);
return button;
}
示例9: ArrowIcon
import javax.swing.plaf.basic.BasicArrowButton; //导入依赖的package包/类
/**
* Instantiates a new arrow icon.
*
* @param iconSize the icon size
* @param direction the direction
* @param isEnabled the is enabled
*/
public ArrowIcon(int iconSize, int direction, boolean isEnabled) {
this.size = iconSize / 2;
this.iconSize = iconSize;
this.direction = direction;
this.isEnabled = isEnabled;
iconRenderer = new BasicArrowButton(direction);
}
示例10: createArrowButton
import javax.swing.plaf.basic.BasicArrowButton; //导入依赖的package包/类
@Override
protected JButton createArrowButton() {
return new MyBasicArrowButton(
BasicArrowButton.SOUTH,
basicArrowButton_Background, //UIManager.getColor("ScrollBar.thumb"), //Background
basicArrowButton_Background, //UIManager.getColor("ScrollBar.thumbShadow"),
basicArrowButton_Foreground, //UIManager.getColor("ScrollBar.thumbDarkShadow"), //Rand unten Rechts , Pfeilfarbe
basicArrowButton_Background); //UIManager.getColor("ScrollBar.thumbHighlight"));
}
示例11: ArrowIcon
import javax.swing.plaf.basic.BasicArrowButton; //导入依赖的package包/类
public ArrowIcon(int iconSize, int direction, boolean isEnabled)
{
this.size = iconSize / 2;
this.iconSize = iconSize;
this.direction = direction;
this.isEnabled = isEnabled;
iconRenderer = new BasicArrowButton(direction);
}
示例12: createArrowButton
import javax.swing.plaf.basic.BasicArrowButton; //导入依赖的package包/类
@Override
protected JButton createArrowButton() {
final JButton button = new BasicArrowButton(SwingConstants.SOUTH, WidgetColors.COLOR_ENCLOSURE_BG,
WidgetColors.COLOR_ENCLOSURE_BG, WidgetColors.COLOR_LIST_FG, WidgetColors.COLOR_ENCLOSURE_BG);
button.setName("ComboBox.arrowButton");
return button;
}
示例13: isSupportedBy
import javax.swing.plaf.basic.BasicArrowButton; //导入依赖的package包/类
@Override
public boolean isSupportedBy(ComponentModel model) {
// skip fileChooser dialog.
WindowModel winModel = GUIModelExtractor.getWindowModel(model);
if (winModel != null && winModel.get("windowlisteners") != null
&& winModel.get("windowlisteners").indexOf("javax.swing.JFileChooser") >= 0) {
return false;
}
AccessibleAction aAction = JFCUtil.getAccessibleContext(model).getAccessibleAction();
Accessible accessibleObj = (Accessible) model.getRef();
if (aAction == null)
return false;
if (aAction.getAccessibleActionCount() == 0)
return false;
if (accessibleObj instanceof JMenuItem) {
return false; // should be handled by SelectionMenuEvent
}
if (accessibleObj instanceof JTextComponent) {
return false; // should be handled by EditableTextEvent
}
if (accessibleObj instanceof BasicArrowButton) {
return false; // should be handled by ValueEvnet
}
if (accessibleObj instanceof JComboBox) {
return false; // should be handled by SelectionEvent
}
if (accessibleObj instanceof JSpinner) {
return false; // should be handled by SelectionEvent
}
return true;
}
示例14: findTargetBtnComponent
import javax.swing.plaf.basic.BasicArrowButton; //导入依赖的package包/类
private ComponentModel findTargetBtnComponent(GUIModel root) {
for (Enumeration<GUIModel> enumuration = (Enumeration<GUIModel>) root.depthFirstEnumeration(); enumuration
.hasMoreElements();) {
GUIModel node = enumuration.nextElement();
Object userObj = node.getUserObject();
if (userObj instanceof ComponentModel) {
ComponentModel model = (ComponentModel) userObj;
AccessibleAction aAction = JFCUtil.getAccessibleContext(model).getAccessibleAction();
Accessible accessibleObj = (Accessible) model.getRef();
if (aAction == null)
continue;
if (aAction.getAccessibleActionCount() == 0)
continue;
if (accessibleObj instanceof JMenuItem) {
continue; // should be handled by SelectionMenuEvent
}
if (accessibleObj instanceof JTextComponent) {
continue; // should be handled by EditableTextEvent
}
if (accessibleObj instanceof BasicArrowButton) {
continue; // should be handled by ValueEvnet
}
if (accessibleObj instanceof JComboBox) {
continue; // should be handled by SelectionEvent
}
if (accessibleObj instanceof JSpinner) {
continue; // should be handled by SelectionEvent
}
String title = model.get("title");
if (title.equalsIgnoreCase(targetBtnName)) {
return model;
}
}
}
return null;
}
示例15: createArrowButton
import javax.swing.plaf.basic.BasicArrowButton; //导入依赖的package包/类
@Override
protected JButton createArrowButton() {
final Color bg = myComboBox.getBackground();
final Color fg = myComboBox.getForeground();
JButton button = new BasicArrowButton(SwingConstants.SOUTH, bg, fg, fg, fg) {
@Override
public void paint(Graphics g) {
Color borderColor = ModernUIUtil.getBorderColor(myComboBox);
GraphicsConfig config = new GraphicsConfig(g);
final int w = getWidth();
final int h = getHeight();
g.setColor(UIUtil.getControlColor());
g.fillRect(0, 0, w, h);
g.setColor(myComboBox.isEnabled() ? getForeground() : borderColor);
GraphicsUtil.setupAAPainting(g);
g.drawLine(JBUI.scale(3), JBUI.scale(7), JBUI.scale(7), JBUI.scale(11));
g.drawLine(JBUI.scale(7), JBUI.scale(11), JBUI.scale(11), JBUI.scale(7));
config.restore();
}
@Override
public Dimension getPreferredSize() {
int size = getFont().getSize() + JBUI.scale(4);
if (size % 2 == 1) size += JBUI.scale(1);
return new DimensionUIResource(size, size);
}
};
button.setBorder(BorderFactory.createEmptyBorder());
button.setOpaque(false);
return button;
}