📄 operatorpanel.java
字号:
/*
* 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 2 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, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package eti.bi.alphaminer.ui;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseListener;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JPopupMenu;
import eti.bi.common.Locale.Resource;
import eti.bi.exception.SysException;
/**
* OperatorPanel is an interface of JPanel.
*/
public abstract interface OperatorPanel {
/**
* Creates an OperatorPanel.
* @throws SysException
*/
public void createOperatorPanel() throws SysException;
/**
* Add MouseListener to buttons in the OperatorPanel.
* @param a_Listener the MouseListener to be added.
*/
public void addOperatorMouseListener(MouseListener a_Listener);
}
/**
* FloatMenu is a right-click popup menu of an OperatorPanel.
*/
class OperatorsFloatMenu extends JPopupMenu implements ItemListener {
/**
*
*/
private static final long serialVersionUID = 1L;
@SuppressWarnings("unused")
private CaseWindow m_CaseWindow;
private JCheckBoxMenuItem m_Float = new JCheckBoxMenuItem(Resource.srcStr("m_FloatOperators"));
/**
* Constructs a FloatMenu for a specific CaseWindow.
* @param a_CaseWindow the specific CaseWindow that this FloatMenu belongs to.
*/
public OperatorsFloatMenu(CaseWindow a_CaseWindow) {
super();
m_CaseWindow = a_CaseWindow;
add(m_Float);
addSeparator();
m_Float.addItemListener(this);
}
/**
* Sets floating status of the FloatMenu.
* @param m_IsFloat true to set it float, false to dock it onto the CaseWindow
* it belongs to.
*/
public void setIsFloat(boolean m_IsFloat) {
m_Float.setSelected(m_IsFloat);
}
/**
* @see java.awt.event.ItemListener#itemStateChanged(ItemEvent)
*/
public void itemStateChanged(ItemEvent e) {
//m_CaseWindow.setOperatorPanelFloat(m_Float.isSelected());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -