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


Java ExtendedJComboBox类代码示例

本文整理汇总了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);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:35,代码来源:DefaultPropertyValueCellEditor.java

示例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);
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:35,代码来源:DefaultPropertyValueCellEditor.java

示例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);
	}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:34,代码来源:TransitionGraphCreator.java

示例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);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:44,代码来源:TransitionGraphCreator.java

示例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;
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:47,代码来源:TransitionGraphCreator.java


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