/** * Specialized constructor for creating a "dummy" result panel. This should only be called once at * search window creation-time. */ SearchResultMediator(JPanel overlay) { super(SEARCH_TABLE); setupFakeTable(overlay); SEARCH_INFO = SearchInformation.createKeywordSearch("", null, MediaType.getAnyTypeMediaType()); FILTER = null; this.token = 0; this.searchTokens = null; setButtonEnabled(SearchButtons.TORRENT_DETAILS_BUTTON_INDEX, false); // disable dnd for overlay panel TABLE.setDragEnabled(false); TABLE.setTransferHandler(null); SOUTH_PANEL.setVisible(false); }
// создание панели с кнопками истории звонков public void HistoryList() { listBox = Box.createVerticalBox(); listBox.setVisible(false); JLabel labelForList = new JLabel("История звонков"); labelForList.setFont(new Font("TimesRoman", Font.PLAIN, 35)); butPanel = new JPanel(); butPanel.setPreferredSize(new Dimension(310, 760)); butPanel.setMaximumSize(new Dimension(310, 760)); butPanel.setMinimumSize(new Dimension(310, 760)); butPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK)); listBox.add(Box.createVerticalGlue()); listBox.add(Box.createVerticalStrut(10)); labelForList.setAlignmentX(JComponent.CENTER_ALIGNMENT); listBox.add(labelForList); listBox.add(butPanel); listBox.add(Box.createVerticalGlue()); }
/** * Set up the expander button to display qualifier values. * * @param butt - expander button * @param qualifier - the qualifer that is being displayed * @param qualifierValueBox - Box containing the values * @param qualifierNameCheckBox - JCheckBox for the given qualifier * @param pane * @return */ private Vector<JCheckBox> setExpanderButton( final JButton butt, final Qualifier qualifier, final Box qualifierValueBox, final JCheckBox qualifierNameCheckBox) { butt.setMargin(new Insets(0, 0, 0, 0)); butt.setHorizontalAlignment(SwingConstants.RIGHT); butt.setHorizontalTextPosition(SwingConstants.RIGHT); butt.setBorderPainted(false); butt.setFont(butt.getFont().deriveFont(Font.BOLD)); butt.setForeground(TransferAnnotationTool.STEEL_BLUE); butt.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { if (butt.getText().equals("+")) butt.setText("-"); else butt.setText("+"); qualifierValueBox.setVisible(butt.getText().equals("-")); revalidate(); } }); // set-up qualifier values list qualifierValueBox.setVisible(false); final Vector<JCheckBox> qualifierValuesCheckBox = new Vector<JCheckBox>(); final StringVector values = qualifier.getValues(); if (values != null) { for (int i = 0; i < values.size(); i++) { final JCheckBox cb = new JCheckBox(values.get(i), qualifierNameCheckBox.isSelected()); cb.setFont(cb.getFont().deriveFont(Font.ITALIC)); qualifierValueBox.add(cb); qualifierValuesCheckBox.add(cb); } } return qualifierValuesCheckBox; }