當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。