本文整理匯總了Java中com.rapidminer.gui.tools.ExtendedJComboBox類的典型用法代碼示例。如果您正苦於以下問題:Java ExtendedJComboBox類的具體用法?Java ExtendedJComboBox怎麽用?Java ExtendedJComboBox使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ExtendedJComboBox類屬於com.rapidminer.gui.tools包,在下文中一共展示了ExtendedJComboBox類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: DefaultPropertyValueCellEditor
import com.rapidminer.gui.tools.ExtendedJComboBox; //導入依賴的package包/類
public DefaultPropertyValueCellEditor(final ParameterTypeCategory type) {
super(new ExtendedJComboBox(type.getValues()));
useEditorAsRenderer = true;
((JComboBox) editorComponent).removeItemListener(this.delegate);
this.delegate = new EditorDelegate() {
private static final long serialVersionUID = -2104662561680969750L;
@Override
public void setValue(Object x) {
if (x == null) {
super.setValue(null);
((JComboBox) editorComponent).setSelectedIndex(-1);
} else {
try {
Integer index = Integer.valueOf(x.toString());
super.setValue(index);
((JComboBox) editorComponent).setSelectedIndex(index);
} catch (NumberFormatException e) {
// try to get index from string...
int index = type.getIndex(x.toString());
super.setValue(index);
((JComboBox) editorComponent).setSelectedIndex(index);
}
}
}
@Override
public Object getCellEditorValue() {
return ((JComboBox) editorComponent).getSelectedItem();
}
};
((JComboBox) editorComponent).addItemListener(delegate);
}
示例2: DefaultPropertyValueCellEditor
import com.rapidminer.gui.tools.ExtendedJComboBox; //導入依賴的package包/類
public DefaultPropertyValueCellEditor(final ParameterTypeCategory type) {
super(new ExtendedJComboBox<>(type.getValues()));
useEditorAsRenderer = true;
((JComboBox<?>) editorComponent).removeItemListener(this.delegate);
this.delegate = new EditorDelegate() {
private static final long serialVersionUID = -2104662561680969750L;
@Override
public void setValue(Object x) {
if (x == null) {
super.setValue(null);
((JComboBox<?>) editorComponent).setSelectedIndex(-1);
} else {
try {
Integer index = Integer.valueOf(x.toString());
super.setValue(index);
((JComboBox<?>) editorComponent).setSelectedIndex(index);
} catch (NumberFormatException e) {
// try to get index from string...
int index = type.getIndex(x.toString());
super.setValue(index);
((JComboBox<?>) editorComponent).setSelectedIndex(index);
}
}
}
@Override
public Object getCellEditorValue() {
return ((JComboBox<?>) editorComponent).getSelectedItem();
}
};
((JComboBox<?>) editorComponent).addItemListener(delegate);
}
示例3: TransitionGraphCreator
import com.rapidminer.gui.tools.ExtendedJComboBox; //導入依賴的package包/類
public TransitionGraphCreator(TransitionGraph transitionGraph, ExampleSet exampleSet) {
this.sourceAttribute = exampleSet.getAttributes().get(transitionGraph.getSourceAttribute());
this.targetAttribute = exampleSet.getAttributes().get(transitionGraph.getTargetAttribute());
if (transitionGraph.getStrengthAttribute() != null)
this.strengthAttribute = exampleSet.getAttributes().get(transitionGraph.getStrengthAttribute());
if (transitionGraph.getTypeAttribute() != null)
this.typeAttribute = exampleSet.getAttributes().get(transitionGraph.getTypeAttribute());
this.exampleSet = exampleSet;
this.nodeDescription = transitionGraph.getNodeDescription();
SortedSet<SourceId> sourceNames = new TreeSet<SourceId>();
// Attribute idAttribute = exampleSet.getAttributes().getId();
for (Example example : exampleSet) {
Object id = example.getValue(sourceAttribute);
if (sourceAttribute.isNominal())
id = example.getValueAsString(sourceAttribute);
String description = getNodeDescription(id);
if (description == null) {
sourceNames.add(new SourceId(id.toString(), id.toString()));
} else {
sourceNames.add(new SourceId(id.toString(), description));
}
}
sourceFilter = new ExtendedJComboBox(200);
sourceFilter.addItem(new SourceId("None", "None"));
for (SourceId sourceId : sourceNames) {
sourceFilter.addItem(sourceId);
}
objectViewer = new DefaultObjectViewer(exampleSet);
}
示例4: TransitionGraphCreator
import com.rapidminer.gui.tools.ExtendedJComboBox; //導入依賴的package包/類
public TransitionGraphCreator(TransitionGraph transitionGraph, ExampleSet exampleSet) {
this.sourceAttribute = exampleSet.getAttributes().get(transitionGraph.getSourceAttribute());
this.targetAttribute = exampleSet.getAttributes().get(transitionGraph.getTargetAttribute());
if (transitionGraph.getStrengthAttribute() != null) {
this.strengthAttribute = exampleSet.getAttributes().get(transitionGraph.getStrengthAttribute());
}
if (transitionGraph.getTypeAttribute() != null) {
this.typeAttribute = exampleSet.getAttributes().get(transitionGraph.getTypeAttribute());
}
this.exampleSet = exampleSet;
this.nodeDescription = transitionGraph.getNodeDescription();
SortedSet<SourceId> sourceNames = new TreeSet<SourceId>();
// Attribute idAttribute = exampleSet.getAttributes().getId();
for (Example example : exampleSet) {
Object id = example.getValue(sourceAttribute);
if (sourceAttribute.isNominal()) {
id = example.getValueAsString(sourceAttribute);
}
String description = getNodeDescription(id);
if (description == null) {
sourceNames.add(new SourceId(id.toString(), id.toString()));
} else {
sourceNames.add(new SourceId(id.toString(), description));
}
}
sourceFilter = new ExtendedJComboBox(200);
sourceFilter.putClientProperty(RapidLookTools.PROPERTY_INPUT_BACKGROUND_DARK, true);
sourceFilter.setPreferredSize(new Dimension(sourceFilter.getPreferredSize().width,
PropertyPanel.VALUE_CELL_EDITOR_HEIGHT));
sourceFilter.addItem(new SourceId("None", "None"));
for (SourceId sourceId : sourceNames) {
sourceFilter.addItem(sourceId);
}
this.numberOfHops = new JSpinner(new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1));
this.numberOfHops.setPreferredSize(new Dimension(this.numberOfHops.getPreferredSize().width,
PropertyPanel.VALUE_CELL_EDITOR_HEIGHT));
objectViewer = new DefaultObjectViewer(exampleSet);
}
示例5: TransitionGraphCreator
import com.rapidminer.gui.tools.ExtendedJComboBox; //導入依賴的package包/類
public TransitionGraphCreator(TransitionGraph transitionGraph, ExampleSet exampleSet) {
this.sourceAttribute = exampleSet.getAttributes().get(transitionGraph.getSourceAttribute());
this.targetAttribute = exampleSet.getAttributes().get(transitionGraph.getTargetAttribute());
if (transitionGraph.getStrengthAttribute() != null) {
this.strengthAttribute = exampleSet.getAttributes().get(transitionGraph.getStrengthAttribute());
}
if (transitionGraph.getTypeAttribute() != null) {
this.typeAttribute = exampleSet.getAttributes().get(transitionGraph.getTypeAttribute());
}
this.exampleSet = exampleSet;
this.nodeDescription = transitionGraph.getNodeDescription();
SortedSet<SourceId> sourceNames = new TreeSet<SourceId>();
for (Example example : exampleSet) {
Object id = example.getValue(sourceAttribute);
if (sourceAttribute.isNominal()) {
id = example.getValueAsString(sourceAttribute);
}
String description = getNodeDescription(id);
if (description == null) {
sourceNames.add(new SourceId(id.toString(), id.toString()));
} else {
sourceNames.add(new SourceId(id.toString(), description));
}
}
sourceFilter = new ExtendedJComboBox<>(200);
sourceFilter.putClientProperty(RapidLookTools.PROPERTY_INPUT_BACKGROUND_DARK, true);
sourceFilter.setPreferredSize(
new Dimension(sourceFilter.getPreferredSize().width, PropertyPanel.VALUE_CELL_EDITOR_HEIGHT));
sourceFilter.addItem(new SourceId("None", "None"));
for (SourceId sourceId : sourceNames) {
sourceFilter.addItem(sourceId);
}
this.numberOfHops = new JSpinner(new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1));
this.numberOfHops.setPreferredSize(
new Dimension(this.numberOfHops.getPreferredSize().width, PropertyPanel.VALUE_CELL_EDITOR_HEIGHT));
if (exampleSet.getAttributes().getId() != null) {
objectViewer = new DefaultObjectViewer(exampleSet);
} else {
objectViewer = null;
}
}