private void jbInit() throws Exception { this.setSize(new Dimension(560, 293)); setTitle("Please select a contact to send"); _scrollPaneContactList.setBounds(15, 10, 530, 237); _listContactList.setOpaque(false); _listContactList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); _listContactList.setCellRenderer(new ContactListRenderer()); _listContactList.addListSelectionListener( new ListSelectionListener() { public void valueChanged(ListSelectionEvent listSelectionEvent) { _listContactList_valueChanged(listSelectionEvent); } }); _listContactList.setVisibleRowCount(JLIST_VISIBLE_ROW_COUNT); _scrollPaneContactList.addScrollUpButtonActionListener( new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { _scrollPaneContactList_scrollUp(actionEvent); } }); _scrollPaneContactList.addScrollDownButtonActionListener( new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { _scrollPaneContactList_scrollDown(actionEvent); } }); _scrollPaneContactList.addToViewport(_listContactList); _panelContent.add(_scrollPaneContactList, null); }
private void jbInit() throws Exception { this.setSize(new Dimension(560, 293)); _buttonSendMessage.setLocation(130, 70); _buttonSendMessage.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { _buttonSendMessage_actionPerformed(actionEvent); } }); /*- _buttonSendVoiceNote.setLocation(200, 70); _buttonSendVoiceNote.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { _buttonSendVoiceNote_actionPerformed(actionEvent); } }); -*/ _buttonLocateOnMap.setLocation(200, 70); _buttonLocateOnMap.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { _buttonLocateOnMap_actionPerformed(actionEvent); } }); _buttonAddRemoveToRoute.setLocation(270, 70); _buttonAddRemoveToRoute.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { _buttonAddRemoveToRoute_actionPerformed(actionEvent); } }); _buttonShowHideOnMap.setLocation(340, 70); _buttonShowHideOnMap.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { _buttonShowHideOnMap_actionPerformed(actionEvent); } }); /*- _buttonGotoSocialNetworkPage.setLocation(480, 70); _buttonGotoSocialNetworkPage.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { _buttonGotoSocialNetworkPage_actionPerformed(actionEvent); } }); -*/ _scrollPaneUserFeed.setBounds(20, 135, 515, 108); _scrollPaneUserFeed.addScrollDownButtonActionListener( new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { _scrollPaneUserFeed.scrollDown(_scrollPaneUserFeed.getHeight() / 4); } }); _scrollPaneUserFeed.addScrollUpButtonActionListener( new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { _scrollPaneUserFeed.scrollUp(_scrollPaneUserFeed.getHeight() / 4); } }); _htmlPaneUserFeed.addHyperlinkListener( new HyperlinkListener() { public void hyperlinkUpdate(HyperlinkEvent hyperlinkEvent) { _htmlPaneUserFeed_hyperlinkUpdate(hyperlinkEvent); } }); _scrollPaneUserFeed.addToViewport(_htmlPaneUserFeed); _labelDescription.setBounds(new Rectangle(140, 15, 455, 40)); _labelDescription.setVerticalAlignment(SwingConstants.TOP); _labelDescription.setVerticalTextPosition(SwingConstants.TOP); setTitle("Contact details of " + _itemVO.getName()); /*- Fix it setDataSourceLogo(Resources.getInstance().getImageIcon(Session.getInstance().getServiceDetails(_itemVO.getService().toLowerCase()).getServiceIconURI())); setDataSourceURL("http://www." + _itemVO.getService().toLowerCase() + ".com/"); -*/ _imagePanelContactPicture.setLocation(20, 15); _imagePanelContactPicture.setOpaque(false); BufferedImage bufferedImage = ImageFetcher.getInstance().getImage(_itemVO.getIconURL(), 96, 96, null); if (bufferedImage != null) _imagePanelContactPicture.setImage(bufferedImage); _labelDescription.setText("<html>" + _itemVO.getDescription().trim() + "</html>"); _panelContent.add(_labelDescription, null); _panelContent.add(_scrollPaneUserFeed, null); /*- _panelContent.add(_buttonGotoSocialNetworkPage, null); -*/ _panelContent.add(_buttonShowHideOnMap, null); _panelContent.add(_buttonAddRemoveToRoute, null); _panelContent.add(_buttonLocateOnMap, null); /*- _panelContent.add(_buttonSendVoiceNote, null); -*/ _panelContent.add(_buttonSendMessage, null); _panelContent.add(_imagePanelContactPicture, null); ItemVO[] feedItems = API.getInstance().getSocial().feedGet(_itemVO.getService(), _itemVO.getServiceItemID()); StringBuffer stringBuffer = new StringBuffer( "<html><body alink=\"#FF0000\" link=\"#EEFFEE\" text=\"#FFFFFF\" vlink=\"#EEFFEE\"><p>"); if (!_itemVO.getDescription().trim().equals("")) { stringBuffer.append("<b>About :</b>"); stringBuffer.append( _itemVO .getDescription() .trim() .replaceAll( "(http[s]?:\\/\\/[^\\s]+)", "<a style=\"color: #3BB9FF;\" href=\"$1\">$1</a>")); stringBuffer.append("</p><hr/>"); } for (int index = 0; index < feedItems.length; index++) { stringBuffer.append("<b>"); InfoMessageGetTypeVO infoVO = (InfoMessageGetTypeVO) feedItems[index].getInfo(); Format formatterDate = new SimpleDateFormat(Settings.getInstance().getDTO().getDateFormatPattern().getPattern()); Format formatterTime = new SimpleDateFormat(Settings.getInstance().getDTO().getTimeFormatPattern().getPattern()); stringBuffer.append(formatterDate.format(infoVO.getDateSent()).toString()); stringBuffer.append(" "); stringBuffer.append(formatterTime.format(infoVO.getDateSent()).toString()); stringBuffer.append(" : </b>"); stringBuffer.append( feedItems[index] .getDescription() .trim() .replaceAll( "(http[s]?:\\/\\/[^\\s]+)", "<a style=\"color: #3BB9FF;\" href=\"$1\">$1</a>")); stringBuffer.append("</p>"); if (index != feedItems.length - 1) stringBuffer.append("<hr/>"); } stringBuffer.append("</body></html>"); _htmlPaneUserFeed.setText(stringBuffer.toString()); if (Settings.getInstance().getDTO().isTTSContactFeed()) new Thread( new Runnable() { public void run() { try { TTSPlayer.getInstance() .loadPlayfile( API.getInstance() .getVoice() .tts( (Settings.getInstance().getDTO().isTTSCardHeader() ? _itemVO.getName() + ", " : "") + _infoVO.getStatusMessage().trim()) .getAudioURI()); } catch (Exception exception) { Debug.displayStack(this, exception); } } }) .start(); }