@Override public void setFont(Font font) { FontMetrics fm = getFontMetrics(font); lineHeight = fm.getHeight(); charWidth = fm.charWidth('0'); super.setFont(font); }
/** * Sets the font property. * * @param font the new font */ public void setFont(Font font) { super.setFont(font); if (dayChooser != null) { dayChooser.setFont(font); monthChooser.setFont(font); yearChooser.setFont(font); } }
public TestHTML() { int d = (Frame.getFrames().length == 0) ? JFrame.EXIT_ON_CLOSE : JFrame.DISPOSE_ON_CLOSE; JPanel pan = new JPanel(); pan.setLayout(new BorderLayout(GAP, GAP - 4)); pan.setBorder(new EmptyBorder(GAP, GAP, GAP, GAP)); pan.setBackground(COL); pan.setFont(font); lab = new JLabel(MSG); // , SwingConstants.CENTER); lab.setName("title"); lab.setFont(new Font("Serif", 3, 16)); // lab.setForeground(Color.black); pan.add(lab, "North"); text = new JTextArea("JTextArea\n"); text.setName("area"); text.setLineWrap(true); text.setFont(font); JScrollPane scr1 = new JScrollPane(text); scr1.setPreferredSize(new Dimension(300, 500)); pan.add(scr1, "Center"); html = new JEditorPane(); html.setContentType("text/html"); html.setEditable(false); html.addMouseListener(this); html.addMouseMotionListener(this); JScrollPane scr2 = new JScrollPane(html); scr2.setPreferredSize(new Dimension(350, 500)); pan.add(scr2, "East"); but = new JButton("Copy text from JTextArea to JEditorPane"); but.addActionListener(this); pan.add(but, "South"); frm = new JFrame(MSG); frm.setContentPane(pan); frm.setDefaultCloseOperation(d); frm.setLocation(100, 150); frm.pack(); frm.setVisible(true); }
/** * Component initialization. * * @throws java.lang.Exception */ private void jbInit() throws Exception { contentPane = (JPanel) getContentPane(); contentPane.setLayout(null); this.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); setSize(new Dimension(400, 621)); setTitle("实时通讯模块测试程序"); jButton1.setBounds(new Rectangle(11, 412, 82, 26)); jButton1.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton1.setText("召测接口"); jButton1.addActionListener(new RealTimeTestFrame_jButton1_actionAdapter(this)); jButton2.setBounds(new Rectangle(10, 366, 83, 26)); jButton2.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton2.setText("创建对象"); jButton2.addActionListener(new RealTimeTestFrame_jButton2_actionAdapter(this)); jLabel1.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel1.setText("接入IP:"); jLabel1.setBounds(new Rectangle(23, 22, 63, 16)); jLabel2.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel2.setText("接入端口:"); jLabel2.setBounds(new Rectangle(23, 67, 63, 16)); jTextField1.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jTextField1.setText("172.19.74.13"); txt_port.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_port.setText("3000"); txt_port.setBounds(new Rectangle(84, 64, 88, 22)); jLabel3.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel3.setText("AppID:"); jLabel3.setBounds(new Rectangle(23, 113, 63, 16)); contentPane.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel4.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel4.setText("ZDLJDZ:"); jLabel4.setBounds(new Rectangle(23, 158, 63, 16)); jLabel5.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel5.setText("规约号:"); jLabel5.setBounds(new Rectangle(23, 186, 63, 16)); jLabel6.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel6.setText("发送内容:"); jLabel6.setBounds(new Rectangle(23, 333, 63, 16)); jLabel7.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel7.setText("通讯方式:"); jLabel7.setBounds(new Rectangle(21, 219, 63, 16)); txt_AppID.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_AppID.setText("25"); txt_AppID.setBounds(new Rectangle(84, 110, 83, 22)); txt_zdljdz.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_zdljdz.setText("91010022"); txt_zdljdz.setBounds(new Rectangle(84, 155, 88, 22)); txt_gyh.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_gyh.setText("100"); txt_gyh.setBounds(new Rectangle(84, 183, 63, 22)); txt_txfs.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_txfs.setText("40"); txt_txfs.setBounds(new Rectangle(84, 218, 63, 22)); jTextField7.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_ip.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); InetAddress localhost = java.net.InetAddress.getLocalHost(); String hostIP = localhost.getHostAddress(); txt_ip.setText(hostIP); txt_ip.setBounds(new Rectangle(84, 19, 159, 22)); txt_content.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_content.setText("6000000100111107"); txt_content.setBounds(new Rectangle(84, 330, 298, 22)); txt_content.addActionListener(new RealTimeTestFrame_txt_content_actionAdapter(this)); jButton3.setBounds(new Rectangle(200, 412, 89, 26)); jButton3.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton3.setText("发送短信"); jButton3.addActionListener(new RealTimeTestFrame_jButton3_actionAdapter(this)); jButton4.setBounds(new Rectangle(295, 366, 96, 26)); jButton4.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton4.setText("自定义命令"); jButton4.addActionListener(new RealTimeTestFrame_jButton4_actionAdapter(this)); lab_yxj.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); lab_yxj.setText("优先级:"); lab_yxj.setBounds(new Rectangle(23, 287, 61, 16)); txt_gnm.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_gnm.setText("0D"); txt_gnm.setBounds(new Rectangle(84, 251, 63, 22)); jLabel9.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel9.setText("手机号码:"); jLabel9.setBounds(new Rectangle(190, 67, 67, 16)); txt_sjhm.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_sjhm.setText("13800571505"); txt_sjhm.setBounds(new Rectangle(250, 64, 111, 22)); jLabel10.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel10.setText("命令序号:"); jLabel10.setBounds(new Rectangle(190, 112, 73, 16)); txt_mlxh.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_mlxh.setText("1"); txt_mlxh.setBounds(new Rectangle(250, 109, 110, 22)); jButton5.setBounds(new Rectangle(105, 366, 83, 26)); jButton5.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton5.setText("连接"); jButton5.addActionListener(new RealTimeTestFrame_jButton5_actionAdapter(this)); jButton6.setBounds(new Rectangle(200, 366, 83, 26)); jButton6.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton6.setText("断开连接"); jButton6.addActionListener(new RealTimeTestFrame_jButton6_actionAdapter(this)); jLabel11.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel11.setText("终端逻辑地址:"); jLabel11.setBounds(new Rectangle(164, 199, 87, 16)); txt_listterminal.setText("12041234"); txt_listterminal.setBounds(new Rectangle(252, 196, 130, 22)); jButton8.setBounds(new Rectangle(170, 248, 90, 26)); jButton8.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton8.setText("加入队列"); jButton8.addActionListener(new RealTimeTestFrame_jButton8_actionAdapter(this)); jButton9.setBounds(new Rectangle(283, 248, 85, 26)); jButton9.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton9.setText("在线状态"); jButton9.addActionListener(new RealTimeTestFrame_jButton9_actionAdapter(this)); memo1.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); memo1.setToolTipText(""); memo1.setEditable(false); memo1.setLineWrap(true); memo1.setWrapStyleWord(true); memo1.setBounds(new Rectangle(17, 451, 361, 154)); jButton7.setBounds(new Rectangle(226, 289, 92, 26)); jButton7.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton7.setText("设置掉线"); jButton7.addActionListener(new RealTimeTestFrame_jButton7_actionAdapter(this)); jButton10.setBounds(new Rectangle(192, 155, 90, 23)); jButton10.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton10.setText("手工建档"); jButton10.addActionListener(new RealTimeTestFrame_jButton10_actionAdapter(this)); jLabel12.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel12.setText("功能码:"); jLabel12.setBounds(new Rectangle(23, 254, 61, 16)); txt_yxj.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_yxj.setText("08"); txt_yxj.setBounds(new Rectangle(84, 283, 63, 22)); jButton11.setBounds(new Rectangle(105, 412, 82, 26)); jButton11.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton11.setActionCommand(""); jButton11.setText("获取结果"); jButton11.addActionListener(new RealTimeTestFrame_jButton11_actionAdapter(this)); jButton12.setBounds(new Rectangle(301, 412, 87, 26)); jButton12.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton12.setText("批量测试"); jButton12.addActionListener(new RealTimeTestFrame_jButton12_actionAdapter(this)); contentPane.add(jLabel1); contentPane.add(jLabel2); contentPane.add(txt_port); contentPane.add(jLabel3); contentPane.add(jLabel4); contentPane.add(jTextField1); contentPane.add(txt_AppID); contentPane.add(txt_zdljdz); contentPane.add(jTextField7); contentPane.add(txt_ip); contentPane.add(txt_content); contentPane.add(jLabel6); contentPane.add(jLabel9); contentPane.add(txt_sjhm); contentPane.add(jLabel10); contentPane.add(txt_mlxh); contentPane.add(txt_listterminal); contentPane.add(jLabel11); contentPane.add(jButton8); contentPane.add(jButton9); contentPane.add(memo1); contentPane.add(jButton7); contentPane.add(jButton10); contentPane.add(txt_gnm); contentPane.add(txt_txfs); contentPane.add(txt_gyh); contentPane.add(jLabel5); contentPane.add(jLabel7); contentPane.add(jLabel12); contentPane.add(lab_yxj); contentPane.add(txt_yxj); contentPane.add(jButton2); contentPane.add(jButton5); contentPane.add(jButton6); contentPane.add(jButton4); contentPane.add(jButton1); contentPane.add(jButton11); contentPane.add(jButton3); contentPane.add(jButton12); }
/** * Initialize frame * * @throws java.lang.Exception */ private void initializeModulesFrame() throws Exception { // frame initialization this.setFont(new java.awt.Font("Arial", 0, 11)); this.setIconImage( Toolkit.getDefaultToolkit() .getImage( this.getClass().getResource("/keel/GraphInterKeel/resources/ico/logo/logo.gif"))); this.setSize(new Dimension(640, 480)); this.setTitle("Keel"); this.setResizable(false); // Create panel contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(null); // panel background fondo.setText(""); fondo.setBounds(new Rectangle(0, 0, 640, 480)); fondo.setFont(new java.awt.Font("Arial", 0, 11)); fondo.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/fondo.gif"))); exit.setText("Exit KEEL"); exit.setBounds(new Rectangle(294, 327, 129, 36)); exit.setFont(new java.awt.Font("Arial", 0, 11)); // labels associated to buttons labelSalir.setFont(new java.awt.Font("Arial", 1, 18)); labelSalir.setForeground(Color.white); labelSalir.setText("Exit KEEL"); labelSalir.setBounds(new Rectangle(40, 412, 595, 27)); labelSalir.setVisible(false); labelBack.setFont(new java.awt.Font("Arial", 1, 18)); labelBack.setForeground(Color.white); labelBack.setText("Back to Keel Suite Menu"); labelBack.setBounds(new Rectangle(40, 412, 595, 27)); labelBack.setVisible(false); labelLQD.setFont(new java.awt.Font("Arial", 1, 18)); labelLQD.setForeground(Color.white); labelLQD.setText("Experiments Design with Low Quality Data"); labelLQD.setBounds(new Rectangle(40, 412, 465, 27)); labelLQD.setVisible(false); labelImbalance.setFont(new java.awt.Font("Arial", 1, 18)); labelImbalance.setForeground(Color.white); labelImbalance.setText("Experiments with Imbalanced Datasets"); labelImbalance.setBounds(new Rectangle(40, 412, 465, 27)); labelImbalance.setVisible(false); labelNonParametric.setFont(new java.awt.Font("Arial", 1, 18)); labelNonParametric.setForeground(Color.white); labelNonParametric.setText("Non-Parametric Statistical Analysis"); labelNonParametric.setBounds(new Rectangle(40, 412, 465, 27)); labelNonParametric.setVisible(false); labelSSL.setFont(new java.awt.Font("Arial", 1, 18)); labelSSL.setForeground(Color.white); labelSSL.setText("Semi-Supervised Learning"); labelSSL.setBounds(new Rectangle(40, 412, 465, 27)); labelSSL.setVisible(false); labelMil.setFont(new java.awt.Font("Arial", 1, 17)); labelMil.setForeground(Color.white); labelMil.setText("Experiments with Multiple Instance Learning"); labelMil.setBounds(new Rectangle(40, 412, 465, 27)); labelMil.setVisible(false); contentPane.setFont(new java.awt.Font("Arial", 0, 11)); keel.setText(""); keel.setBounds(new Rectangle(160, 13, 336, 33)); keel.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/mod.png"))); logotipo.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/logotipo.png"))); logotipo.setBounds(new Rectangle(550, 13, 65, 43)); logotipo.addMouseListener(new FrameModules_logotipo_mouseAdapter(this)); logotipoSoft.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/Software.png"))); logotipoSoft.setBounds(new Rectangle(30, 13, 75, 43)); logotipoSoft.addMouseListener(new FrameModules_logotipoSoft_mouseAdapter(this)); barraExit.setBounds(new Rectangle(0, 401, 751, 50)); barraExit.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/exit.png"))); accionExit.setText("jLabel2"); accionExit.setBounds(new Rectangle(536, 409, 94, 38)); accionExit.addMouseListener(new FrameModules_accionExit_mouseAdapter(this)); back.setBounds(new Rectangle(406, 409, 110, 38)); back.addMouseListener(new FrameModules_back_mouseAdapter(this)); // lqd.setBounds(new Rectangle(50, 140, 244, 40)); lqd.setBounds(new Rectangle(50, 120, 244, 40)); lqd.addMouseListener(new Frame_lqd_mouseAdapter(this)); // imbalance.setBounds(new Rectangle(50, 200, 264, 38)); imbalance.setBounds(new Rectangle(50, 180, 264, 38)); imbalance.addMouseListener(new Frame_imbalance_mouseAdapter(this)); // nonParametric.setBounds(new Rectangle(50, 260, 400, 42)); nonParametric.setBounds(new Rectangle(50, 240, 400, 42)); nonParametric.addMouseListener(new Frame_nonParametric_mouseAdapter(this)); SSL.setBounds(new Rectangle(50, 300, 400, 42)); SSL.addMouseListener(new Frame_SSL_mouseAdapter(this)); // mil.setBounds(new Rectangle(50, 320, 400, 42)); mil.setBounds(new Rectangle(50, 360, 400, 42)); mil.addMouseListener(new Frame_mil_mouseAdapter(this)); lqd.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/lqd.png"))); imbalance.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/imbalance.png"))); nonParametric.setIcon( new ImageIcon( this.getClass() .getResource("/keel/GraphInterKeel/resources/imag/menu/nonParametric.png"))); SSL.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/SSL.png"))); mil.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/mil.png"))); back.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/back.png"))); contentPane.add(back, null); contentPane.add(labelBack, null); contentPane.add(labelSalir, null); contentPane.add(labelLQD2, null); contentPane.add(labelLQD, null); contentPane.add(labelImbalance, null); contentPane.add(labelNonParametric, null); contentPane.add(labelSSL, null); contentPane.add(labelMil, null); // contentPane.add(lqd); contentPane.add(mil); contentPane.add(imbalance); contentPane.add(nonParametric); contentPane.add(SSL); contentPane.add(keel); contentPane.add(logotipo); contentPane.add(logotipoSoft); contentPane.add(barraExit); contentPane.add(fondo, null); contentPane.add(accionExit); }
private void flushWeekAndDayPanal(Calendar c) { // c.set c.set(Calendar.DAY_OF_MONTH, 1); c.setFirstDayOfWeek(0); int firstdayofWeek = c.get(Calendar.DAY_OF_WEEK); int lastdayofWeek = c.getActualMaximum(Calendar.DAY_OF_MONTH); String colname[] = {"日", "一", "二", "三", "四", "五", "六"}; int today = getNowCalendar().get(Calendar.DAY_OF_MONTH); // 璁剧疆鍥哄畾瀛椾綋锛屼互鍏嶈皟鐢ㄧ幆澧冩敼鍙樺奖鍝嶇晫闈㈢編瑙� dayPanel.setFont(new java.awt.Font("寰蒋闆呴粦", java.awt.Font.PLAIN, 12)); dayPanel.setLayout(new GridBagLayout()); dayPanel.setBackground(palletTableColor); JLabel cell; for (int i = 0; i < 7; i++) { cell = new JLabel(colname[i]); cell.setHorizontalAlignment(JLabel.CENTER); cell.setPreferredSize(new Dimension(25, 25)); if (i == 0 || i == 6) { cell.setForeground(weekendFontColor); } else { cell.setForeground(weekFontColor); } dayPanel.add( cell, new GridBagConstraints( i, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } int actionCommandId = 1; for (int i = 0; i < 6; i++) { for (int j = 0; j < 7; j++) { JButton numberButton = daysButton[i][j]; actionCommandId = Integer.parseInt(numberButton.getActionCommand()); if (actionCommandId == today) { numberButton.setBackground(todayBtnColor); } if ((actionCommandId + firstdayofWeek - 2) % 7 == 6 || (actionCommandId + firstdayofWeek - 2) % 7 == 0) { numberButton.setForeground(weekendFontColor); } else { numberButton.setForeground(dateFontColor); } if (actionCommandId <= lastdayofWeek) { int y = 0; if ((firstdayofWeek - 1) <= (j + firstdayofWeek - 1) % 7) { y = i + 1; } else { y = i + 2; } dayPanel.add( numberButton, new GridBagConstraints( (j + firstdayofWeek - 1) % 7, y, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } } } }
/** * Manage the associated panels design * * @param withparam * @param target * @param radius * @param rows */ protected void makeForm(boolean withparam, String target, String radius, int rows) { JPanel byword = null; // keyword panel JPanel fields = null; // fields panel JPanel parameters = null; // parameters panel JPanel lll = null; // 3 lists panel JPanel actions = null; // action panel int i; GridBagConstraints c = new GridBagConstraints(); // Form title setting titre = new MyLabel(DEFAULT_TITRE, Label.CENTER, PLAIN); titre.setBackground(Aladin.BLUE); fields = new JPanel(); fields.setLayout(new BorderLayout(3, 3)); byword = new JPanel(); byword.setBackground(Aladin.BLUE); byword.setLayout(new BorderLayout(3, 3)); byword.setFont(BOLD); // Construction // title panel and keyword query panel JPanel haut = new JPanel(); haut.setBackground(Aladin.BLUE); haut.setLayout(new BorderLayout(3, 3)); // Free keyword interrogation panel (author...) makeAdd(byword, new JLabel(KEYWORD), "West"); makeAdd(byword, tauthor, "Center"); // Window components are depending on if ((target == null && radius == null)) { // Target panel construction parameters = new JPanel(); GridBagLayout gridbag = new GridBagLayout(); parameters.setLayout(gridbag); parameters.setFont(BOLD); JLabel label = new JLabel("Target "); c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.gridwidth = 2; c.weightx = 1; c.weighty = 0.1; c.anchor = GridBagConstraints.SOUTH; c.insets = new Insets(5, 5, 5, 5); gridbag.setConstraints(label, c); parameters.add(label); // Target field c = new GridBagConstraints(); c.gridx = 2; c.gridy = 0; c.gridwidth = 4; c.weightx = 1; c.weighty = 0.1; c.ipadx = 50; c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(5, 5, 5, 5); gridbag.setConstraints(ttarget, c); parameters.add(ttarget); // Create and fill coordinate popup coordinate = new JComboBox(); coordinate.addItem("today"); coordinate.addItem("J2000"); coordinate.addItem("B1975"); coordinate.addItem("B1950"); coordinate.addItem("B1900"); coordinate.addItem("B1875"); coordinate.addItem("B1855"); coordinate.addItem("Galactic"); coordinate.addItem("Supergal."); coordinate.setSelectedItem("J2000"); // Coordinate field c = new GridBagConstraints(); c.gridx = 6; c.gridy = 0; c.gridwidth = 2; c.weightx = 1; c.weighty = 0.1; c.insets = new Insets(5, 5, 5, 5); gridbag.setConstraints(coordinate, c); parameters.add(coordinate); // Radius label label = new JLabel("Radius "); c = new GridBagConstraints(); c.gridx = 8; c.gridy = 0; c.gridwidth = 2; c.weightx = 1; c.weighty = 0.1; c.anchor = GridBagConstraints.SOUTH; c.insets = new Insets(5, 5, 5, 5); gridbag.setConstraints(label, c); parameters.add(label); // Radius field c = new GridBagConstraints(); c.gridx = 10; c.gridy = 0; c.gridwidth = 1; c.weightx = 0.1; c.weighty = 0.1; c.insets = new Insets(5, 5, 5, 5); gridbag.setConstraints(tradius, c); parameters.add(tradius); tradius.setText("10.0"); // default value // Radius panel construction unit = new JComboBox(); unit.addItem("deg"); unit.addItem(ARCMIN); unit.addItem(ARCSEC); // Set default unit to arcmin unit.setSelectedItem(ARCMIN); c = new GridBagConstraints(); c.gridx = 11; c.gridy = 0; c.gridwidth = 2; c.weightx = 1; c.weighty = 0.1; c.insets = new Insets(5, 5, 5, 5); gridbag.setConstraints(unit, c); parameters.add(unit); } else { if (radius != null) tradius.setText(radius); if (target != null) ttarget.setText(target); } // Keywords section panel construction lll = new JPanel(); GridBagLayout gridbag = new GridBagLayout(); lll.setLayout(gridbag); lll.setFont(BOLD); lll.setBackground(Aladin.BLUE); c = new GridBagConstraints(); lk = new JList[nSection]; JLabel label = null; for (int j = 0; j < nSection; j++) { label = new JLabel(); c = new GridBagConstraints(); c.gridx = j; c.gridy = 0; c.gridwidth = 1; c.weightx = 0.1; c.weighty = 0.1; c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.SOUTH; c.insets = new Insets(0, 0, 0, 0); gridbag.setConstraints(label, c); label.setText(getSectionName((String) vq.getNameKey().elementAt(j))); lll.add(label); Vector v = (Vector) vq.gethKey().get(vq.getNameKey().elementAt(j)); if (rows < 0) lk[j] = new JList(v); else { lk[j] = new JList(v); lk[j].setVisibleRowCount(rows); lk[j].setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); } // Enumeration e = v.elements(); // while( e.hasMoreElements() ) // lk[j].addItem((String)e.nextElement()); c = new GridBagConstraints(); c.gridx = j; c.gridy = 1; c.gridwidth = 1; c.weightx = 1; c.weighty = 1; c.fill = GridBagConstraints.BOTH; c.insets = new Insets(0, 2, 0, 2); JScrollPane jp = new JScrollPane(lk[j]); gridbag.setConstraints(jp, c); lll.add(jp); } // Change to a GridBagLayout to have non equal lists // Action button panel construction actions = new JPanel(); actions.setBackground(Aladin.BLUE); actions.setLayout(new FlowLayout(FlowLayout.RIGHT)); actions.setFont(BOLD); makeAdd(haut, titre, "North"); makeAdd(haut, byword, "Center"); if ((target == null && radius == null) && withparam == true) makeAdd(haut, parameters, "South"); // List and action panel JPanel bas = new JPanel(); bas.setBackground(Aladin.BLUE); bas.setLayout(new BorderLayout(3, 3)); makeAdd(bas, lll, "Center"); makeAdd(bas, actions, "South"); // Previous panels are added to the main frame makeAdd(this, haut, "North"); makeAdd(this, bas, "Center"); setTitre(this.target); }