?? mainbasepanel.java
字號:
package jp.co.ntl.swing.ext;
import java.awt.AWTEventMulticaster;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import javax.swing.JApplet;
import javax.swing.JFrame;
import javax.swing.JPanel;
import jp.co.ntl.Net;
import jp.co.ntl.server.ServerInfo;
import jp.co.ntl.Util;
public class MainBasePanel extends JPanel {
/**
*
*/
private static final long serialVersionUID = 1L;
public static final int ADMIN = 0;
public static final int USER = 1;
public static final int CPP = 2;
public static final String ACTCMD_CLOSE_DIALOG = "closeDialog";
public static final String ACTCMD_REFRESH_SCREEN = "Refresh.Screen";
protected JFrame frame;
protected JApplet applet;
protected Net net;
protected ServerInfo serverInfo;
protected boolean admin = false;
protected int kind = ADMIN;
protected static DialogManager dlgMan;
protected String actionCommand = ACTCMD_CLOSE_DIALOG;
transient ActionListener actionListener;
protected MainBasePanel(JFrame frame, int kind) {
this.frame = frame;
commonConstractor(kind);
}
protected MainBasePanel(JApplet applet, int kind) {
this.applet = applet;
commonConstractor(kind);
}
private void commonConstractor(int kind) {
this.kind = kind;
dlgMan = new DialogManager(this);
/// buildComponents();
}
protected void buildComponents() {
Resource.load(Util.getCurrentLocale());
serverInfo = new ServerInfo();
/* try {
serverInfo.readFromFile();
} catch (IOException e) {
;
}
*/
if (applet == null) {
net = Net.makeInstance(serverInfo.getDocBase());
} else {
net = Net.makeInstance(applet);
}
}
public ServerInfo getServerInfo() {
return serverInfo;
}
public void setActionCommand(String command) {
actionCommand = command;
}
public String getActionCommand() {
return actionCommand;
}
public synchronized void addActionListener(ActionListener al) {
actionListener = AWTEventMulticaster.add(actionListener, al);
}
public synchronized void removeActionListener(ActionListener al) {
actionListener = AWTEventMulticaster.remove(actionListener, al);
}
public void sendActionEvent(String command) {
if (actionListener != null) {
actionCommand = command;
actionListener.actionPerformed(
new ActionEvent(this, ActionEvent.ACTION_PERFORMED, actionCommand));
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -