weka.gui.GenericObjectEditorHistory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of weka-dev Show documentation
Show all versions of weka-dev Show documentation
The Waikato Environment for Knowledge Analysis (WEKA), a machine
learning workbench. This version represents the developer version, the
"bleeding edge" of development, you could say. New functionality gets added
to this version.
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
/*
* ObjectHistory.java
* Copyright (C) 2009-2012 University of Waikato, Hamilton, New Zealand
*/
package weka.gui;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.Serializable;
import java.util.EventObject;
import java.util.Vector;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import weka.core.SerializedObject;
import weka.core.Utils;
/**
* A helper class for maintaining a history of objects selected in the GOE.
*
* @author fracpete (fracpete at waikato dot ac dot nz)
* @version $Revision: 10216 $
*/
public class GenericObjectEditorHistory implements Serializable {
/** for serialization. */
private static final long serialVersionUID = -1255734638729633595L;
/**
* Event that gets sent when a history item gets selected.
*
* @author fracpete (fracpete at waikato dot ac dot nz)
* @version $Revision: 10216 $
*/
public static class HistorySelectionEvent extends EventObject {
/** for serialization. */
private static final long serialVersionUID = 45824542929908105L;
/** the selected favorite. */
protected Object m_HistoryItem;
/**
* Initializes the event.
*
* @param source the object that triggered the event
* @param historyItem the selected history item
*/
public HistorySelectionEvent(Object source, Object historyItem) {
super(source);
m_HistoryItem = historyItem;
}
/**
* Returns the selected history item.
*
* @return the history item
*/
public Object getHistoryItem() {
return m_HistoryItem;
}
}
/**
* Interface for classes that listen to selections of history items.
*
* @author fracpete (fracpete at waikato dot ac dot nz)
* @version $Revision: 10216 $
*/
public static interface HistorySelectionListener {
/**
* Gets called when a history item gets selected.
*
* @param e the event
*/
public void historySelected(HistorySelectionEvent e);
}
/** the maximum entries in the history. */
public final static int MAX_HISTORY_COUNT = 10;
/** the maximum length of a caption in the history. */
public final static int MAX_HISTORY_LENGTH = 200;
/** the menu max line length. */
public final static int MAX_LINE_LENGTH = 80;
/** the history of objects. */
protected Vector
© 2015 - 2024 Weber Informatics LLC | Privacy Policy