?? updatefreqselectionpanel.java
字號:
package com.power.pipeengine.EngineUI;/** * <p>Title: PIPE Engine</p> * <p>Description: Global Planning Optimization Engine</p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: Paraster, Inc.</p> * @author Wei Tan * @version 1.0 */import java.awt.*;import javax.swing.*;import java.awt.event.*;import com.power.pipeengine.*;import java.util.ResourceBundle;/** * ObjectiveValue is a one line JPanel that displays current iteration number * and objective value from the LP engine. It has a label and a field for the * iteration and objective value. * It is a singular class. */public class UpdateFreqSelectionPanel extends JPanel { static ResourceBundle res = ResourceBundle.getBundle("com.power.pipeengine.Res", EngineConfig.getInstance().getLocale() ); private JLabel _selectionLabel = new JLabel( res.getString("Choose_an_update") ); private String[] _objFunctions = { res.getString("Very_High"), res.getString("High"), res.getString("Medium"), res.getString("Low"), res.getString("Very_Low") }; private JComboBox _selectionComboBox = new JComboBox( _objFunctions ); private static final UpdateFreqSelectionPanel INSTANCE = new UpdateFreqSelectionPanel(); /** * class constructor */ private UpdateFreqSelectionPanel() { init(); } /** * Gets the global instance of the singular class object. * @return the global instance. */ public static UpdateFreqSelectionPanel getInstance( ) { return INSTANCE; } //initialize the class private void init() { _selectionComboBox.setSelectedIndex( 1 ); //show "High" _selectionComboBox.setEditable( false ); _selectionComboBox.setEnabled( true ); _selectionComboBox.addActionListener( new ActionListener() { public void actionPerformed( ActionEvent e ) { int selectedIndex = _selectionComboBox.getSelectedIndex(); EngineConfig.getInstance().setUpdateFrequency( selectedIndex ); } }); this.setLayout( new FlowLayout() ); //this.add( _selectionLabel ); this.setBorder( BorderFactory.createTitledBorder( res.getString("Update_frequency") )); this.setToolTipText( res.getString("Choose_an_update1") ); this.add( _selectionComboBox ); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -