001package icy.swimmingPool; 002 003import java.awt.GridBagConstraints; 004import java.awt.GridBagLayout; 005import java.awt.Insets; 006import java.awt.event.ActionEvent; 007import java.awt.event.ActionListener; 008 009import javax.swing.BoxLayout; 010import javax.swing.JButton; 011import javax.swing.JLabel; 012import javax.swing.JPanel; 013import javax.swing.JScrollPane; 014import javax.swing.SwingConstants; 015import javax.swing.border.BevelBorder; 016import javax.swing.border.SoftBevelBorder; 017 018public class SwimmingPoolViewerPanel extends JPanel { 019 020 private JButton deleteAllButton; 021 private JPanel scrollPanel; 022 private JScrollPane scrollPane; 023 private JLabel numberOfSwimmingObjectLabel; 024 private JPanel panel_1; 025 private JLabel lblDate; 026 private JLabel lblNewLabel; 027 private JLabel lblNewLabel_1; 028 029 public JScrollPane getScrollPane() { 030 return scrollPane; 031 } 032 033 public JPanel getScrollPanel() { 034 return scrollPanel; 035 } 036 037 public JButton getDeleteAllButton() { 038 return deleteAllButton; 039 } 040 041 public JLabel getNumberOfSwimmingObjectLabel() { 042 return numberOfSwimmingObjectLabel; 043 } 044 045 /** 046 * Create the panel. 047 */ 048 public SwimmingPoolViewerPanel() { 049 GridBagLayout gridBagLayout = new GridBagLayout(); 050 gridBagLayout.columnWidths = new int[]{482, 0}; 051 gridBagLayout.rowHeights = new int[]{40, 40, 1, 0}; 052 gridBagLayout.columnWeights = new double[]{1.0, Double.MIN_VALUE}; 053 gridBagLayout.rowWeights = new double[]{0.0, 0.0, 1.0, Double.MIN_VALUE}; 054 setLayout(gridBagLayout); 055 056 JPanel panel = new JPanel(); 057 GridBagConstraints gbc_panel = new GridBagConstraints(); 058 gbc_panel.anchor = GridBagConstraints.NORTH; 059 gbc_panel.fill = GridBagConstraints.HORIZONTAL; 060 gbc_panel.insets = new Insets(0, 0, 5, 0); 061 gbc_panel.gridx = 0; 062 gbc_panel.gridy = 0; 063 add(panel, gbc_panel); 064 GridBagLayout gbl_panel = new GridBagLayout(); 065 gbl_panel.columnWidths = new int[]{1, 100, 0}; 066 gbl_panel.rowHeights = new int[]{40, 0}; 067 gbl_panel.columnWeights = new double[]{1.0, 0.0, Double.MIN_VALUE}; 068 gbl_panel.rowWeights = new double[]{0.0, Double.MIN_VALUE}; 069 panel.setLayout(gbl_panel); 070 071 numberOfSwimmingObjectLabel = new JLabel("Swimming pool"); 072 numberOfSwimmingObjectLabel.setHorizontalAlignment(SwingConstants.CENTER); 073 GridBagConstraints gbc_numberOfSwimmingObjectLabel = new GridBagConstraints(); 074 gbc_numberOfSwimmingObjectLabel.fill = GridBagConstraints.BOTH; 075 gbc_numberOfSwimmingObjectLabel.insets = new Insets(0, 0, 0, 5); 076 gbc_numberOfSwimmingObjectLabel.gridx = 0; 077 gbc_numberOfSwimmingObjectLabel.gridy = 0; 078 panel.add(numberOfSwimmingObjectLabel, gbc_numberOfSwimmingObjectLabel); 079 080 deleteAllButton = new JButton("delete all"); 081 deleteAllButton.addActionListener(new ActionListener() { 082 public void actionPerformed(ActionEvent arg0) { 083 } 084 }); 085 GridBagConstraints gbc_deleteAllButton = new GridBagConstraints(); 086 gbc_deleteAllButton.fill = GridBagConstraints.BOTH; 087 gbc_deleteAllButton.gridx = 1; 088 gbc_deleteAllButton.gridy = 0; 089 panel.add(deleteAllButton, gbc_deleteAllButton); 090 091 panel_1 = new JPanel(); 092 panel_1.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null)); 093 GridBagConstraints gbc_panel_1 = new GridBagConstraints(); 094 gbc_panel_1.fill = GridBagConstraints.BOTH; 095 gbc_panel_1.insets = new Insets(0, 0, 5, 0); 096 gbc_panel_1.gridx = 0; 097 gbc_panel_1.gridy = 1; 098 add(panel_1, gbc_panel_1); 099 GridBagLayout gbl_panel_1 = new GridBagLayout(); 100 gbl_panel_1.columnWidths = new int[]{200, 0, 100, 0}; 101 gbl_panel_1.rowHeights = new int[]{10, 0}; 102 gbl_panel_1.columnWeights = new double[]{0.0, 1.0, 0.0, Double.MIN_VALUE}; 103 gbl_panel_1.rowWeights = new double[]{1.0, Double.MIN_VALUE}; 104 panel_1.setLayout(gbl_panel_1); 105 106 lblNewLabel_1 = new JLabel("Creation date"); 107 GridBagConstraints gbc_lblNewLabel_1 = new GridBagConstraints(); 108 gbc_lblNewLabel_1.fill = GridBagConstraints.VERTICAL; 109 gbc_lblNewLabel_1.insets = new Insets(0, 0, 0, 5); 110 gbc_lblNewLabel_1.gridx = 0; 111 gbc_lblNewLabel_1.gridy = 0; 112 panel_1.add(lblNewLabel_1, gbc_lblNewLabel_1); 113 114 lblNewLabel = new JLabel("Name"); 115 GridBagConstraints gbc_lblNewLabel = new GridBagConstraints(); 116 gbc_lblNewLabel.fill = GridBagConstraints.BOTH; 117 gbc_lblNewLabel.insets = new Insets(0, 0, 0, 5); 118 gbc_lblNewLabel.gridx = 1; 119 gbc_lblNewLabel.gridy = 0; 120 panel_1.add(lblNewLabel, gbc_lblNewLabel); 121 122 lblDate = new JLabel("Action"); 123 lblDate.setHorizontalAlignment(SwingConstants.CENTER); 124 GridBagConstraints gbc_lblDate = new GridBagConstraints(); 125 gbc_lblDate.fill = GridBagConstraints.BOTH; 126 gbc_lblDate.gridx = 2; 127 gbc_lblDate.gridy = 0; 128 panel_1.add(lblDate, gbc_lblDate); 129 130 scrollPane = new JScrollPane(); 131 GridBagConstraints gbc_scrollPane = new GridBagConstraints(); 132 gbc_scrollPane.fill = GridBagConstraints.BOTH; 133 gbc_scrollPane.gridx = 0; 134 gbc_scrollPane.gridy = 2; 135 add(scrollPane, gbc_scrollPane); 136 137 scrollPanel = new JPanel(); 138 scrollPane.setViewportView(scrollPanel); 139 scrollPanel.setLayout(new BoxLayout(scrollPanel, BoxLayout.PAGE_AXIS)); 140 141 } 142 143}