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


Java ActionEvent.ACTION_PERFORMED属性代码示例

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


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

示例1: notifyActionListeners

/**
 * Notifies all the action listeners of the event.
 *
 * @param command the command
 * @param body    the effected body
 */
private void notifyActionListeners(String command, SandboxBody body) {
    ActionListener[] listeners = this.getListeners(ActionListener.class);
    int size = listeners.length;
    BodyActionEvent event = new BodyActionEvent(this, ActionEvent.ACTION_PERFORMED, command, body);
    for (int i = 0; i < size; i++) {
        listeners[i].actionPerformed(event);
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:14,代码来源:SimulationTreePanel.java

示例2: fireActionPerformed

/**
 * Notifies all registered listeners about the event.
 *
 * @param event The event to be fired
 */
private void fireActionPerformed(boolean committed) {
    if (listenerList == null) {
        return;
    }

    CellEditorActionEvent event = new CellEditorActionEvent(this,
                                                            ActionEvent.ACTION_PERFORMED,
                                                            getActionCommand(),
                                                            committed);

    Object[] listeners = listenerList.getListenerList();

    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == ActionListener.class) {
            ((ActionListener) listeners[i + 1]).actionPerformed(event);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:EditablePropertyDisplayer.java

示例3: actionPerformed

public void actionPerformed (ActionEvent ae) {
    JComponent item = (JComponent) ae.getSource();
    String actionCommand = (String) item.getClientProperty(KEY_ACTION);
    String context = (String) item.getClientProperty(KEY_CONTAINERCTX);
    
    getEngine().notifyWillPerform (actionCommand, context);
    
    Action action = getEngine().getAction(context, actionCommand); 
    
    if (action.isEnabled()) {
        ActionEvent event = new ActionEvent (item, 
        ActionEvent.ACTION_PERFORMED, actionCommand);
        action.actionPerformed(event);
    }
    
    getEngine().notifyPerformed (actionCommand, context);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:AbstractToolbarFactory.java

示例4: trackEvent

private static boolean trackEvent(int eventID, Component comp, Runnable action, int time, boolean printEvent) {
    EventListener listener = null;

    switch (eventID) {
    case WindowEvent.WINDOW_GAINED_FOCUS:
        listener = wgfListener;
        break;
    case FocusEvent.FOCUS_GAINED:
        listener = fgListener;
        break;
    case ActionEvent.ACTION_PERFORMED:
        listener = apListener;
        break;
    }

    listener.listen(comp, printEvent);
    action.run();
    return Util.waitForCondition(listener.getNotifier(), time);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:Util.java

示例5: keyPressed

public void keyPressed(KeyEvent e) {
    int keyc = e.getKeyCode();
    if (keyc == KeyEvent.VK_UP || keyc == KeyEvent.VK_DOWN
            || keyc == KeyEvent.VK_LEFT || keyc == KeyEvent.VK_RIGHT) {
        // System.err.println("arrow key released");
        ActionEvent action = new ActionEvent(e.getSource(),
                ActionEvent.ACTION_PERFORMED, InputGUI.GRAMSEL);
        g.actionPerformed(action);
    }
}
 
开发者ID:spetitjean,项目名称:TuLiPA-frames,代码行数:10,代码来源:InputGUI.java

示例6: createActionEvent

private static ActionEvent createActionEvent (Action action) {
    Object evSource = null;
    int evId = ActionEvent.ACTION_PERFORMED;

    // text (editor) actions
    if (action instanceof TextAction) {
        EditorCookie ec = Utilities.actionsGlobalContext().lookup(EditorCookie.class);
        if (ec == null) {
            return null;
        }

        JEditorPane[] editorPanes = ec.getOpenedPanes();
        if (editorPanes == null || editorPanes.length <= 0) {
            return null;
        }
        evSource = editorPanes[0];
    }

    if (evSource == null) {
        evSource = TopComponent.getRegistry().getActivated();
    }
    if (evSource == null) {
        evSource = WindowManager.getDefault().getMainWindow();
    }

    
    return new ActionEvent(evSource, evId, null);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:ActionsSearchProvider.java

示例7: performAction

private static boolean performAction (Action a) {
    if (a == null) {
        return false;
    }
    ActionEvent ae = new ActionEvent(ProjectUtilities.class, ActionEvent.ACTION_PERFORMED, "command");  // NOI18N
    try {
        a.actionPerformed(ae);
        return true;
    } catch (Exception e) {
        LOG.log(Level.WARNING, null, e);
        return false;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:ProjectUtilities.java

示例8: SlideBarActionEvent

public SlideBarActionEvent(Object source, String command, SlideOperation operation,
                            MouseEvent mouseEvent, int tabIndex) {
    super(source, ActionEvent.ACTION_PERFORMED, command);
    this.tabIndex = tabIndex;
    this.mouseEvent = mouseEvent;
    this.slideOperation = operation;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:SlideBarActionEvent.java

示例9: propertyChange

@Override
public void propertyChange(PropertyChangeEvent e) {
    ActionListener[] listeners = this.getListeners(ActionListener.class);
    ActionEvent event = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "changed");
    // forward the event to the listeners on this class
    for (ActionListener listener : listeners) {
        listener.actionPerformed(event);
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:9,代码来源:PointPanel.java

示例10: afterInsert

@Override
public void afterInsert(Context context) throws BadLocationException {
    if (isJavadocTouched) {
        Lookup.Result<TextAction> res = MimeLookup.getLookup(MimePath.parse("text/x-javadoc")).lookupResult(TextAction.class); // NOI18N
        ActionEvent newevt = new ActionEvent(context.getComponent(), ActionEvent.ACTION_PERFORMED, "fix-javadoc"); // NOI18N
        for (TextAction action : res.allInstances()) {
            action.actionPerformed(newevt);
        }
        isJavadocTouched = false;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:JavaKit.java

示例11: mouseClicked

public void mouseClicked(MouseEvent e) {
    // hide the balloon by any click
    hide();
    if (e.getButton() == MouseEvent.BUTTON1) {
        ActionEvent aev = new ActionEvent(target, ActionEvent.ACTION_PERFORMED,
                                          liveArguments.getActionCommand(),
                                          e.getWhen(), e.getModifiers());
        XToolkit.postEvent(XToolkit.targetToAppContext(aev.getSource()), aev);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:InfoWindow.java

示例12: eventEnabled

boolean eventEnabled(AWTEvent e) {
    if (e.id == ActionEvent.ACTION_PERFORMED) {
        if ((eventMask & AWTEvent.ACTION_EVENT_MASK) != 0 ||
            actionListener != null) {
            return true;
        }
        return false;
    }
    return super.eventEnabled(e);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:MenuItem.java

示例13: postToolTip

public static void postToolTip(JComponent comp) {
	Action action = comp.getActionMap().get("postTip");
	if (action == null) {
		return;
	}
	ActionEvent ae = new ActionEvent(comp, ActionEvent.ACTION_PERFORMED, "postTip", EventQueue.getMostRecentEventTime(),
			0);
	action.actionPerformed(ae);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:9,代码来源:ExtendedJSliderToolTips.java

示例14: hideToolTip

public static void hideToolTip(JComponent comp) {
	Action action = comp.getActionMap().get("hideTip");
	if (action == null) {
		return;
	}
	ActionEvent ae = new ActionEvent(comp, ActionEvent.ACTION_PERFORMED, "hideTip", EventQueue.getMostRecentEventTime(),
			0);
	action.actionPerformed(ae);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:9,代码来源:ExtendedJSliderToolTips.java

示例15: actionPerformed

@Override
public void actionPerformed(ActionEvent e) {
    int row = table.convertRowIndexToModel(table.getEditingRow());
    fireEditingStopped();

    //  Invoke the Action
    ActionEvent event = new ActionEvent(
            table,
            ActionEvent.ACTION_PERFORMED,
            Integer.toString(row));
    action.actionPerformed(event);
}
 
开发者ID:takun2s,项目名称:smile_1.5.0_java7,代码行数:12,代码来源:ButtonCellRenderer.java


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