📄 statusbar.java
字号:
package edu.whu.gui;import javax.swing.JPanel;import javax.swing.JLabel;import javax.swing.SwingConstants;import javax.swing.BorderFactory;import java.awt.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: </p> * @author Shijun Deng * @version 2.0 */public class StatusBar extends JPanel{ /** * File panel. */ JPanel filePan = new JPanel(); JPanel countPan = new JPanel(new FlowLayout(1, 0, 0)); JLabel fileNameLab = new JLabel(); JLabel countLab = new JLabel(); BorderLayout borderLayout2 = new BorderLayout(); BorderLayout borderLayout1 = new BorderLayout(); GridBagLayout gridlayout = new GridBagLayout(); public StatusBar() { try { jbInit(); } catch(Exception e) { } } /** * JBInit methods. * @throws java.lang.Exception Exception will be thrown. */ private void jbInit() throws Exception { //Status and the bar. fileNameLab.setFont(new java.awt.Font("DialogInput", 1, 11)); fileNameLab.setForeground(Color.black); fileNameLab.setAlignmentY((float) 0.0); fileNameLab.setText("GeoGrid Info Viewer"); fileNameLab.setBorder(BorderFactory.createLoweredBevelBorder()); countLab.setFont(new java.awt.Font("DialogInput", 1, 11)); countLab.setForeground(Color.black); countLab.setAlignmentY((float) 0.0); countLab.setHorizontalTextPosition(SwingConstants.CENTER); countLab.setText("1:1000"); countPan.setLayout(borderLayout1); countPan.setBorder(BorderFactory.createLoweredBevelBorder()); this.setLayout(gridlayout); this.add(filePan, new GridBagConstraints(0, 0, 1, 1, 1, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); filePan.setLayout(borderLayout2); filePan.add(fileNameLab, null); //this.add(countPan, BorderLayout.EAST); this.add(countPan, new GridBagConstraints(1, 0, 1, 1, 0.1, 0.0 , GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); countPan.add(countLab, BorderLayout.CENTER); } /** * Set the fileNameLab value. * @param value String value that will be shown on the screen. */ public void setStatusValue(String value) { fileNameLab.setText(value); } /** * Clear the status value. */ public void clearStatusValue() { fileNameLab.setText(""); } /** * Set the scale for the map. * @param scale Map scale. */ public void setScaleValue(int scale) { countLab.setText("1:" + scale); } /** * Set the scale for the map. * @param scale Map scale such as "1:1000" */ public void setScaleValue(String scale) { countLab.setText(scale); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -