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