📄 propertieswindow.java
字号:
package jim;
/**
* Insert the type's description here.
* Creation date: (11/20/2001 4:41:14 PM)
* @author:
*/
public class PropertiesWindow extends javax.swing.JFrame {
IvjEventHandler ivjEventHandler = new IvjEventHandler();
private javax.swing.JButton ivjJButton1 = null;
private javax.swing.JButton ivjJButton2 = null;
private javax.swing.JButton ivjJButton3 = null;
private javax.swing.JPanel ivjJFrameContentPane = null;
private javax.swing.JPanel ivjJPanel1 = null;
private javax.swing.JTabbedPane ivjJTabbedPane1 = null;
private javax.swing.JPanel ivjPage = null;
public java.util.Vector MessageVector = new java.util.Vector();
private Jim ivjJim = null;
class IvjEventHandler implements java.awt.event.ActionListener {
public void actionPerformed(java.awt.event.ActionEvent e) {
if (e.getSource() == PropertiesWindow.this.getJButton1())
connEtoC1(e);
if (e.getSource() == PropertiesWindow.this.getJButton2())
connEtoC2(e);
if (e.getSource() == PropertiesWindow.this.getJButton3())
connEtoC3(e);
};
};
/**
* PropertiesWindow constructor comment.
*/
public PropertiesWindow() {
super();
initialize();
}
/**
* PropertiesWindow constructor comment.
* @param title java.lang.String
*/
public PropertiesWindow(String title) {
super(title);
}
/**
* Comment
*/
public void applyChanges() {
PluginInterface[] plInterface = getJim().getPluginLoader().getPlugins();
for (int i = 0; i < plInterface.length; i++) {
javax.swing.JPanel propPanel = plInterface[i].getPropInst();
if(propPanel!=null){
plInterface[i].saveProperties();
}
}
return;
}
/**
* Comment
*/
public void closeWindow() {
this.dispose();
return;
}
/**
* connEtoC1: (JButton1.action.actionPerformed(java.awt.event.ActionEvent) --> PropertiesWindow.saveCloseWindow()V)
* @param arg1 java.awt.event.ActionEvent
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC1(java.awt.event.ActionEvent arg1) {
try {
// user code begin {1}
// user code end
this.saveCloseWindow();
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
* connEtoC2: (JButton2.action.actionPerformed(java.awt.event.ActionEvent) --> PropertiesWindow.applyChanges()V)
* @param arg1 java.awt.event.ActionEvent
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC2(java.awt.event.ActionEvent arg1) {
try {
// user code begin {1}
// user code end
this.applyChanges();
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
* connEtoC3: (JButton3.action.actionPerformed(java.awt.event.ActionEvent) --> PropertiesWindow.closeWindow()V)
* @param arg1 java.awt.event.ActionEvent
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC3(java.awt.event.ActionEvent arg1) {
try {
// user code begin {1}
// user code end
this.closeWindow();
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
* Return the JButton1 property value.
* @return javax.swing.JButton
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JButton getJButton1() {
if (ivjJButton1 == null) {
try {
ivjJButton1 = new javax.swing.JButton();
ivjJButton1.setName("JButton1");
ivjJButton1.setText("OK");
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjJButton1;
}
/**
* Return the JButton2 property value.
* @return javax.swing.JButton
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JButton getJButton2() {
if (ivjJButton2 == null) {
try {
ivjJButton2 = new javax.swing.JButton();
ivjJButton2.setName("JButton2");
ivjJButton2.setText("Apply");
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjJButton2;
}
/**
* Return the JButton3 property value.
* @return javax.swing.JButton
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JButton getJButton3() {
if (ivjJButton3 == null) {
try {
ivjJButton3 = new javax.swing.JButton();
ivjJButton3.setName("JButton3");
ivjJButton3.setText("Cancel");
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjJButton3;
}
/**
* Return the JFrameContentPane property value.
* @return javax.swing.JPanel
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JPanel getJFrameContentPane() {
if (ivjJFrameContentPane == null) {
try {
ivjJFrameContentPane = new javax.swing.JPanel();
ivjJFrameContentPane.setName("JFrameContentPane");
ivjJFrameContentPane.setLayout(new java.awt.BorderLayout());
getJFrameContentPane().add(getJPanel1(), "South");
getJFrameContentPane().add(getJTabbedPane1(), "Center");
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjJFrameContentPane;
}
/**
* Return the Jim property value.
* @return jim.Jim
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
public Jim getJim() {
if (ivjJim == null) {
try {
ivjJim = new jim.Jim();
ivjJim.setName("Jim");
ivjJim.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjJim;
}
/**
* Return the JPanel1 property value.
* @return javax.swing.JPanel
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JPanel getJPanel1() {
if (ivjJPanel1 == null) {
try {
ivjJPanel1 = new javax.swing.JPanel();
ivjJPanel1.setName("JPanel1");
ivjJPanel1.setLayout(new java.awt.FlowLayout());
getJPanel1().add(getJButton1(), getJButton1().getName());
getJPanel1().add(getJButton2(), getJButton2().getName());
getJPanel1().add(getJButton3(), getJButton3().getName());
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjJPanel1;
}
/**
* Return the JTabbedPane1 property value.
* @return javax.swing.JTabbedPane
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JTabbedPane getJTabbedPane1() {
if (ivjJTabbedPane1 == null) {
try {
ivjJTabbedPane1 = new javax.swing.JTabbedPane();
ivjJTabbedPane1.setName("JTabbedPane1");
ivjJTabbedPane1.insertTab("General", null, getPage(), null, 0);
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjJTabbedPane1;
}
/**
* Return the Page property value.
* @return javax.swing.JPanel
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JPanel getPage() {
if (ivjPage == null) {
try {
ivjPage = new javax.swing.JPanel();
ivjPage.setName("Page");
ivjPage.setLayout(null);
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjPage;
}
/**
* Called whenever the part throws an exception.
* @param exception java.lang.Throwable
*/
private void handleException(java.lang.Throwable exception) {
/* Uncomment the following lines to print uncaught exceptions to stdout */
// System.out.println("--------- UNCAUGHT EXCEPTION ---------");
// exception.printStackTrace(System.out);
}
/**
* Initializes connections
* @exception java.lang.Exception The exception description.
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void initConnections() throws java.lang.Exception {
// user code begin {1}
// user code end
getJButton1().addActionListener(ivjEventHandler);
getJButton2().addActionListener(ivjEventHandler);
getJButton3().addActionListener(ivjEventHandler);
}
/**
* Initialize the class.
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void initialize() {
try {
// user code begin {1}
// user code end
setName("PropertiesWindow");
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setSize(318, 265);
setTitle("JIM Properties");
setContentPane(getJFrameContentPane());
initConnections();
} catch (java.lang.Throwable ivjExc) {
handleException(ivjExc);
}
// user code begin {2}
// user code end
}
/**
* main entrypoint - starts the part when it is run as an application
* @param args java.lang.String[]
*/
public static void main(java.lang.String[] args) {
try {
PropertiesWindow aPropertiesWindow;
aPropertiesWindow = new PropertiesWindow();
aPropertiesWindow.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
System.exit(0);
};
});
aPropertiesWindow.show();
java.awt.Insets insets = aPropertiesWindow.getInsets();
aPropertiesWindow.setSize(aPropertiesWindow.getWidth() + insets.left + insets.right, aPropertiesWindow.getHeight() + insets.top + insets.bottom);
aPropertiesWindow.setVisible(true);
} catch (Throwable exception) {
System.err.println("Exception occurred in main() of javax.swing.JFrame");
exception.printStackTrace(System.out);
}
}
/**
* Comment
*/
public void saveCloseWindow() {
this.applyChanges();
this.dispose();
return;
}
/**
* Insert the method's description here.
* Creation date: (11/20/2001 4:56:23 PM)
* @param newJim jim.Jim
*/
public void setJim(Jim newJim) {
ivjJim = newJim;
}
/**
* Insert the method's description here.
* Creation date: (11/20/2001 4:52:00 PM)
*/
public void start() {
//InstantMessagePanel imPanel = new InstantMessagePanel("hi", "hi", (new aimplugin.AimPlugin(), this);
PluginInterface[] plInterface = getJim().getPluginLoader().getPlugins();
for (int i = 0; i < plInterface.length; i++) {
javax.swing.JPanel propPanel = plInterface[i].getProperties();
if(propPanel!=null){
MessageVector.addElement(propPanel);
getJTabbedPane1().insertTab(plInterface[i].getTreeName(), null, propPanel , null, 1);
}
}
/*
getJTabbedPane1().insertTab(from, plInterface.getTabIcon(), imPanel , null, 0);
*/
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -