本文整理汇总了Java中com.rapidminer.gui.actions.ToggleAction类的典型用法代码示例。如果您正苦于以下问题:Java ToggleAction类的具体用法?Java ToggleAction怎么用?Java ToggleAction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ToggleAction类属于com.rapidminer.gui.actions包,在下文中一共展示了ToggleAction类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SortByAction
import com.rapidminer.gui.actions.ToggleAction; //导入依赖的package包/类
public SortByAction(String i18n, RepositoryTree tree, RepositorySortingMethod method) {
super(true, i18n);
this.tree = tree;
this.method = method;
ToggleAction thisAction = this;
if (tree.getSortingMethod() != method) {
this.setSelected(false);
} else {
this.setSelected(true);
}
tree.addRepostorySortingMethodListener(new RepositorySortingMethodListener() {
@Override
public void changedRepositorySortingMethod(RepositorySortingMethod changedToMethod) {
if (changedToMethod != method) {
thisAction.setSelected(false);
} else {
thisAction.setSelected(true);
}
}
});
}
示例2: ToggleDropDownButton
import com.rapidminer.gui.actions.ToggleAction; //导入依赖的package包/类
public ToggleDropDownButton(Action action){
super(action);
if (action instanceof ToggleAction) {
((ToggleAction) action).addToggleActionListener(this);
}
mainButton.setText(null);
mainButton.setOpaque(false);
mainButton.setBorderPainted(false);
mainButton.setMargin(new Insets(0,0,0,0));
mainButton.getModel().addChangeListener(changeListener);
arrowButton.getModel().addChangeListener(changeListener);
arrowButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae){
JPopupMenu popup = getPopupMenu();
popup.addPopupMenuListener(popupMenuListener);
popup.show(mainButton, 0, mainButton.getHeight());
}
});
arrowButton.setMargin(new Insets(0, 0, 0, 0));
mainButton.addPropertyChangeListener("enabled", new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt){
arrowButton.setEnabled(mainButton.isEnabled());
}
});
}
示例3: ToggleDropDownButton
import com.rapidminer.gui.actions.ToggleAction; //导入依赖的package包/类
public ToggleDropDownButton(Action action) {
super(action);
if (action instanceof ToggleAction) {
((ToggleAction) action).addToggleActionListener(this);
}
mainButton.setText(null);
mainButton.setOpaque(false);
mainButton.setBorderPainted(false);
mainButton.setMargin(new Insets(0, 0, 0, 0));
mainButton.getModel().addChangeListener(changeListener);
arrowButton.getModel().addChangeListener(changeListener);
arrowButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
JPopupMenu popup = getPopupMenu();
popup.addPopupMenuListener(popupMenuListener);
popup.show(mainButton, 0, mainButton.getHeight());
}
});
arrowButton.setMargin(new Insets(0, 0, 0, 0));
mainButton.addPropertyChangeListener("enabled", new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
arrowButton.setEnabled(mainButton.isEnabled());
}
});
}
示例4: makeDropDownButton
import com.rapidminer.gui.actions.ToggleAction; //导入依赖的package包/类
public static ToggleDropDownButton makeDropDownButton(ToggleAction mainAction, Action... actions) {
final JPopupMenu menu = new JPopupMenu();
for (Action action : actions) {
menu.add(action);
}
return new ToggleDropDownButton(mainAction) {
private static final long serialVersionUID = -7359018188605409766L;
@Override
protected JPopupMenu getPopupMenu() {
return menu;
}
};
}
示例5: makeDropDownButton
import com.rapidminer.gui.actions.ToggleAction; //导入依赖的package包/类
public static ToggleDropDownButton makeDropDownButton(ToggleAction mainAction, Action ... actions) {
final JPopupMenu menu = new JPopupMenu();
for (Action action : actions) {
menu.add(action);
}
return new ToggleDropDownButton(mainAction) {
private static final long serialVersionUID = -7359018188605409766L;
@Override
protected JPopupMenu getPopupMenu() {
return menu;
}
};
}
示例6: getToggleAnnotationsAction
import com.rapidminer.gui.actions.ToggleAction; //导入依赖的package包/类
/**
* Returns the toggle action for workflow annotations.
*
* @return the action, never {@code null}
*/
public ToggleAction getToggleAnnotationsAction() {
return toggleAnnotations;
}