Tabnine Logo
GenericObjectEditor
Code IndexAdd Tabnine to your IDE (free)

How to use
GenericObjectEditor
in
weka.gui

Best Java code snippets using weka.gui.GenericObjectEditor (Showing top 20 results out of 315)

origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * returns the currently selected DataGenerator
 * 
 * @return        the current data generator
 */
public DataGenerator getGenerator() {
 return (DataGenerator) m_GeneratorEditor.getValue();
}
origin: nz.ac.waikato.cms.weka/weka-stable

 @Override
 public void actionPerformed(ActionEvent e) {
  m_AttributeEvaluatorEditor.setValue(eval);
  m_AttributeSearchEditor.setValue(search);
 }
});
origin: net.sf.meka/meka

/**
 * Returns a popup menu that allows the user to change the class of object.
 *
 * @return a JPopupMenu that when shown will let the user choose the class
 */
public JPopupMenu getChooseClassPopupMenu() {
  if (DEBUG)
    System.out.println("Objectnames: " + m_ObjectNames);
  return super.getChooseClassPopupMenu();
}
origin: nz.ac.waikato.cms.weka/weka-stable

 @Override
 public void propertyChange(PropertyChangeEvent e) {
  // user selected different class?
  if (!m_ResultMatrix.getClass().equals(
   m_ResultMatrixEditor.getValue().getClass())) {
   // if it's the preferred class, then automaticallly use the
   // Experimenter defaults
   if (m_ResultMatrixEditor.getValue().getClass()
    .equals(ExperimenterDefaults.getOutputFormat().getClass())) {
    m_ResultMatrix = ExperimenterDefaults.getOutputFormat();
    m_ResultMatrixEditor.setValue(ExperimenterDefaults
     .getOutputFormat());
   } else {
    m_ResultMatrix = (ResultMatrix) m_ResultMatrixEditor.getValue();
   }
   setData();
  }
  repaint();
 }
});
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Pops up generic object editor with list of conversion filters
 *
 * @param f the File
 */
private void converterQuery(final File f) {
 final GenericObjectEditor convEd = new GenericObjectEditor(true);
 try {
  convEd.setClassType(weka.core.converters.Loader.class);
  convEd.setValue(new weka.core.converters.CSVLoader());
  ((GenericObjectEditor.GOEPanel) convEd.getCustomEditor())
   .addOkListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
     tryConverter((Loader) convEd.getValue(), f);
    }
   });
 } catch (Exception ex) {
 }
 PropertyDialog pd;
 if (PropertyDialog.getParentDialog(this) != null)
  pd =
   new PropertyDialog(PropertyDialog.getParentDialog(this), convEd, -1, -1);
 else
  pd =
   new PropertyDialog(PropertyDialog.getParentFrame(this), convEd, -1, -1);
 pd.setVisible(true);
}
origin: Waikato/weka-trunk

GenericObjectEditor.registerEditors();
GenericObjectEditor ce = new GenericObjectEditor(true);
ce.setClassType(weka.classifiers.Classifier.class);
Object initial = new weka.classifiers.rules.ZeroR();
if (args.length > 0) {
 ce.setClassType(WekaPackageClassLoaderManager.forName(args[0]));
 if (args.length > 1) {
  ce.setValue(initial);
 } else {
  ce.setDefaultValue();
 ce.setValue(initial);
origin: nz.ac.waikato.cms.weka/weka-stable

m_AssociatorEditor.setClassType(Associator.class);
m_AssociatorEditor.setValue(ExplorerDefaults.getAssociator());
m_AssociatorEditor.addPropertyChangeListener(new PropertyChangeListener() {
 @Override
 public void propertyChange(PropertyChangeEvent e) {
origin: fiji/Trainable_Segmentation

GenericObjectEditor m_ClassifierEditor = new GenericObjectEditor();
PropertyPanel m_CEPanel = new PropertyPanel(m_ClassifierEditor);
m_ClassifierEditor.setClassType(Classifier.class);
m_ClassifierEditor.setValue(wekaSegmentation.getClassifier());
Object c = (Object)m_ClassifierEditor.getValue();
String originalOptions = "";
String originalClassifierName = c.getClass().getName();
c = (Object)m_ClassifierEditor.getValue();
String options = "";
final String[] optionsArray = ((OptionHandler)c).getOptions();
origin: nz.ac.waikato.cms.weka/meka

public static void determineAllClasses() {
 weka.gui.GenericObjectEditor.determineClasses();
 try {
  GenericPropertiesCreator creator = new GenericPropertiesCreator();
origin: nz.ac.waikato.cms.weka/weka-stable

m_RPEditor.setClassType(ResultProducer.class);
m_RPEditor.setEnabled(false);
m_RPEditor.addPropertyChangeListener(new PropertyChangeListener() {
 @Override
 public void propertyChange(PropertyChangeEvent e) {
m_RLEditor.setClassType(ResultListener.class);
m_RLEditor.setEnabled(false);
m_RLEditor.addPropertyChangeListener(new PropertyChangeListener() {
 @Override
 public void propertyChange(PropertyChangeEvent e) {
origin: nz.ac.waikato.cms.weka/weka-stable

 m_Editor.setClassType(AbstractFileLoader.class);
 m_Editor.setValue(new weka.core.converters.ArffLoader());
} else {
 m_Editor.setClassType(AbstractFileSaver.class);
 m_Editor.setValue(new weka.core.converters.ArffSaver());
origin: nz.ac.waikato.cms.weka/weka-stable

 ((GenericObjectEditor) m_Editor).setClassType(m_ElementClass);
 m_Editor.setValue(GenericObjectEditor.makeCopy(m_ElementList
  .getSelectedValue()));
} catch (Exception ex) {
     || (!((GenericObjectEditor)m_Editor).wasCancelPressed())) {
  m_ListModel.set(m_ElementList.getSelectedIndex(),
      m_Editor.getValue());
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * creates the panel
 */
public DataGeneratorPanel() {
 setLayout(new BorderLayout());
  add(new PropertyPanel(m_GeneratorEditor), BorderLayout.CENTER);
 // editor
 m_GeneratorEditor.setClassType(DataGenerator.class);
 m_GeneratorEditor.addPropertyChangeListener(new PropertyChangeListener() {
  public void propertyChange(PropertyChangeEvent e) {
 repaint();
  }
 });
 
 // set default generator
 setGenerator(null);
}
origin: nz.ac.waikato.cms.weka/weka-stable

Hashtable<String, HierarchyPropertyParser> hpps = getClassesFromProperties();
HierarchyPropertyParser hpp = null;
Enumeration<HierarchyPropertyParser> enm = hpps.elements();
   setValue(WekaPackageClassLoaderManager.forName(defaultValue).newInstance());
origin: Waikato/weka-trunk

m_RPEditor.setValue(m_Exp.getResultProducer());
m_RPEditor.setEnabled(true);
m_RPEditorPanel.setEnabled(true);
m_RPEditorPanel.repaint();
m_RLEditor.setValue(m_Exp.getResultListener());
m_RLEditor.setEnabled(true);
m_RLEditorPanel.setEnabled(true);
m_RLEditorPanel.repaint();
origin: nz.ac.waikato.cms.weka/weka-stable

setAccessory(panel);
m_Editor = new GenericObjectEditor(false);
((GenericObjectEditor.GOEPanel) m_Editor.getCustomEditor())
 .addOkListener(new ActionListener() {
  @Override
((GenericObjectEditor.GOEPanel) m_Editor.getCustomEditor())
 .addCancelListener(new ActionListener() {
  @Override
origin: nz.ac.waikato.cms.weka/weka-stable

JButton chooseButton = createChooseClassButton();
JPanel top = new JPanel();
top.setLayout(new BorderLayout());
m_ObjectNames = getClassesFromProperties();
if (m_Object != null) {
 updateObjectNames();
 updateChildPropertySheet();
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Updates the list of selectable object names, adding any new names to the
 * list.
 */
protected void updateObjectNames() {
 if (m_ObjectNames == null) {
  m_ObjectNames = getClassesFromProperties();
 }
 if (m_Object != null) {
  String className = m_Object.getClass().getName();
  String root = getRootFromClass(className,
   new HierarchyPropertyParser().getSeperator());
  HierarchyPropertyParser hpp = m_ObjectNames.get(root);
  if (hpp != null) {
   if (!hpp.contains(className)) {
    hpp.add(className);
   }
  }
 }
}
origin: Waikato/weka-trunk

 @Override
 public void actionPerformed(ActionEvent e) {
  m_ChildPropertySheet.closingCancel();
  m_CancelWasPressed = true;
  if (m_Backup != null) {
   m_Object = copyObject(m_Backup);
   // To fire property change
   m_Support.firePropertyChange("", null, null);
   m_ObjectNames = getClassesFromProperties();
   updateObjectNames();
   updateChildPropertySheet();
  }
  if ((getTopLevelAncestor() != null)
   && (getTopLevelAncestor() instanceof Window)) {
   Window w = (Window) getTopLevelAncestor();
   w.dispose();
  }
 }
});
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Sets the class of values that can be edited.
 * 
 * @param type a value of type 'Class'
 */
public void setClassType(Class<?> type) {
 m_ClassType = type;
 m_ObjectNames = getClassesFromProperties();
}
weka.guiGenericObjectEditor

Javadoc

A PropertyEditor for objects. It can be used either in a static or a dynamic way.

In the static way (USE_DYNAMIC is false) the objects have been defined as editable in the GenericObjectEditor configuration file, which lists possible values that can be selected from, and themselves configured. The configuration file is called "GenericObjectEditor.props" and may live in either the location given by "user.home" or the current directory (this last will take precedence), and a default properties file is read from the Weka distribution. For speed, the properties file is read only once when the class is first loaded -- this may need to be changed if we ever end up running in a Java OS ;-).

If it is used in a dynamic way (the UseDynamic property of the GenericPropertiesCreator props file is set to true) then the classes to list are discovered by the GenericPropertiesCreator class (it checks the complete classpath).

Most used methods

  • <init>
    Constructor that allows specifying whether it is possible to change the class within the editor dial
  • determineClasses
  • getValue
    Gets the current Object.
  • setClassType
    Sets the class of values that can be edited.
  • setValue
    Sets the current Object. If the Object is in the Object chooser, this becomes the selected item (and
  • addPropertyChangeListener
    Adds a PropertyChangeListener who will be notified of value changes.
  • getChooseClassPopupMenu
    Returns a popup menu that allows the user to change the class of object.
  • getClassesFromProperties
    Called when the class of object being edited changes.
  • getCustomEditor
    Returns the array editing component.
  • setEnabled
    Sets whether the editor is "enabled", meaning that the current values will be painted.
  • addChildrenToTree
    Recursively builds a JTree from an object heirarchy. Also updates m_treeNodeOfCurrentObject if the c
  • classSelected
    Called when the user selects an class type to change to.
  • addChildrenToTree,
  • classSelected,
  • createChooseClassButton,
  • createTree,
  • getBackup,
  • getCapabilitiesFilter,
  • getClassnameFromPath,
  • getHistory,
  • getRootFromClass,
  • makeCopy

Popular in Java

  • Reactive rest calls using spring rest template
  • addToBackStack (FragmentTransaction)
  • getResourceAsStream (ClassLoader)
  • onRequestPermissionsResult (Fragment)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JCheckBox (javax.swing)
  • JComboBox (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now