当前位置: 首页>>代码示例>>Java>>正文


Java ButtonModel.setRollover方法代码示例

本文整理汇总了Java中javax.swing.ButtonModel.setRollover方法的典型用法代码示例。如果您正苦于以下问题:Java ButtonModel.setRollover方法的具体用法?Java ButtonModel.setRollover怎么用?Java ButtonModel.setRollover使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.ButtonModel的用法示例。


在下文中一共展示了ButtonModel.setRollover方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configureState

import javax.swing.ButtonModel; //导入方法依赖的package包/类
@Override
protected void configureState(CellContext context) {
	ButtonModel model = this.rendererComponent.getButtonModel();

	if (model != null && context.getComponent() != null) {
		Point p = (Point) context.getComponent().getClientProperty(
				RolloverProducer.ROLLOVER_KEY);
		if (/* hasFocus || */(p != null && (p.x >= 0)
				&& (p.x == context.getColumn()) && (p.y == context.getRow()))) {
			if (!model.isRollover())
				model.setRollover(true);
		} else {
			if (model.isRollover())
				model.setRollover(false);
		}
	}
}
 
开发者ID:sing-group,项目名称:aibench-project,代码行数:18,代码来源:PluginActionProvider.java

示例2: mouseEntered

import javax.swing.ButtonModel; //导入方法依赖的package包/类
/**
 * Accept a mouse enter event and set the button's "rollover" property to
 * <code>true</code>, if the button's "rolloverEnabled" property is
 * <code>true</code>. If the button is currently armed and the mouse
 * button is not held down, this enter event will also disarm the model.
 *
 * @param e The mouse enter event to accept
 */
public void mouseEntered(MouseEvent e)
{
  if (e.getSource() instanceof AbstractButton)
    {
      AbstractButton button = (AbstractButton) e.getSource();
      ButtonModel model = button.getModel();
      if (button.isRolloverEnabled()
          && ! SwingUtilities.isLeftMouseButton(e))
        model.setRollover(true);

      if (model.isPressed())
        model.setArmed(true);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:23,代码来源:BasicButtonListener.java

示例3: mouseExited

import javax.swing.ButtonModel; //导入方法依赖的package包/类
/**
 * Accept a mouse exit event and set the button's model's "rollover"
 * property to <code>false</code>, if it's "rolloverEnabled" property is
 * <code>true</code>. Also disarm the button.
 *
 * @param e The mouse exit event to accept
 */
public void mouseExited(MouseEvent e)
{
  if (e.getSource() instanceof AbstractButton)
    {
      AbstractButton button = (AbstractButton) e.getSource();
      ButtonModel model = button.getModel();
      if (button.isRolloverEnabled())
        model.setRollover(false);
      model.setArmed(false);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:19,代码来源:BasicButtonListener.java

示例4: mouseExited

import javax.swing.ButtonModel; //导入方法依赖的package包/类
public void mouseExited(MouseEvent evt) {
	super.mouseExited(evt);

	JMenu menu = (JMenu)evt.getSource();
	ButtonModel model = menu.getModel();
	if (menu.isRolloverEnabled()) {
		model.setRollover(false);
		menuItem.repaint();
	}
}
 
开发者ID:JackJiang2011,项目名称:beautyeye,代码行数:11,代码来源:BEMenuUI.java

示例5: mouseExited

import javax.swing.ButtonModel; //导入方法依赖的package包/类
@Override
public void mouseExited(MouseEvent evt) {
    super.mouseExited(evt);

    JMenuItem menu = (JMenuItem)evt.getSource();
    ButtonModel model = menu.getModel();
    if (menu.isRolloverEnabled()) {
        model.setRollover(false);
        menuItem.repaint();
    }
}
 
开发者ID:R3d-Dragon,项目名称:jMovieManager,代码行数:12,代码来源:MyBasicMenuItemUI.java

示例6: dragDropEnd

import javax.swing.ButtonModel; //导入方法依赖的package包/类
@Override
public void dragDropEnd(DragSourceDropEvent dsde) {
    //when the drag finishes, then repaint the DnDButton
    //so it doesn't look like it has still been pressed down
    ButtonModel m = DnDButton.this.getModel();
    m.setPressed(false);
    m.setRollover(false);
    m.setSelected(false);
    revalidate();
    repaint();
}
 
开发者ID:chhh,项目名称:batmass,代码行数:12,代码来源:DnDButton.java


注:本文中的javax.swing.ButtonModel.setRollover方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。