forked from KNEMC/KLALB
制作图形界面
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
package org.kne.cloud.network.klalb;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JLabel;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.border.LineBorder;
|
||||
import java.awt.Font;
|
||||
|
||||
public class TPanel extends JPanel{
|
||||
private JLabel tname;
|
||||
private JLabel targ;
|
||||
private Tunnel tunnel;
|
||||
|
||||
public JLabel getTname() {
|
||||
return tname;
|
||||
}
|
||||
public JLabel getTarg() {
|
||||
return targ;
|
||||
}
|
||||
public TPanel (Tunnel t) {
|
||||
this(t.getName());
|
||||
this.tunnel=t;
|
||||
}
|
||||
/**
|
||||
* @wbp.parser.constructor
|
||||
*/
|
||||
public TPanel(String name) {
|
||||
setOpaque(false);
|
||||
setLayout(new BorderLayout(0, 0));
|
||||
|
||||
tname = new JLabel(name);
|
||||
tname.setFont(new Font("ËÎÌå", Font.BOLD, 20));
|
||||
add(tname, BorderLayout.WEST);
|
||||
|
||||
targ = new JLabel();
|
||||
targ.setFont(new Font("ËÎÌå", Font.PLAIN, 14));
|
||||
targ.setHorizontalAlignment(SwingConstants.TRAILING);
|
||||
targ.setForeground(Color.YELLOW);
|
||||
add(targ, BorderLayout.CENTER);
|
||||
|
||||
setBorder(new LineBorder(Color.BLACK));
|
||||
setSize(570, 30);
|
||||
setPreferredSize(getSize());
|
||||
}
|
||||
private long up,down,delay;
|
||||
|
||||
public long getUp() {
|
||||
return up;
|
||||
}
|
||||
public void setUp(long up) {
|
||||
this.up = up;
|
||||
targ.setText(up+"\u2191 "+down+"\u2193 "+delay/1000000+"ms");
|
||||
}
|
||||
public long getDown() {
|
||||
return down;
|
||||
}
|
||||
public void setDown(long down) {
|
||||
this.down = down;
|
||||
targ.setText(up+"\u2191 "+down+"\u2193 "+delay/1000000+"ms");
|
||||
}
|
||||
public long getDelay() {
|
||||
return delay;
|
||||
}
|
||||
public void setDelay(long delay) {
|
||||
this.delay = delay;
|
||||
targ.setText(up+"\u2191 "+down+"\u2193 "+delay/1000000+"ms");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user