private void _buttonShowHideOnMap_actionPerformed(ActionEvent actionEvent) {
   if (Settings.getInstance()
       .getDTO()
       .isHiddenContact(_itemVO.getServiceItemID(), _itemVO.getService()))
     Settings.getInstance().getDTO().showContact(_itemVO.getServiceItemID(), _itemVO.getService());
   else
     Settings.getInstance().getDTO().hideContact(_itemVO.getServiceItemID(), _itemVO.getService());
   ((MapViewPanel) getParentPanel()).buildMarkers();
   windowVisible();
 }
 private void _buttonAddRemoveToRoute_actionPerformed(ActionEvent actionEvent) {
   if (Settings.getInstance()
       .getDTO()
       .isHiddenContact(_itemVO.getServiceItemID(), _itemVO.getService())) {
     Settings.getInstance().getDTO().showContact(_itemVO.getServiceItemID(), _itemVO.getService());
     ((MapViewPanel) getParentPanel()).buildMarkers();
   }
   _buttonAddRemoveToRoute.setEnabled(false);
   ((MapViewPanel) getParentPanel()).addRoute(_itemVO);
 }
 private void _buttonLocateOnMap_actionPerformed(ActionEvent actionEvent) {
   if (Settings.getInstance()
       .getDTO()
       .isHiddenContact(_itemVO.getServiceItemID(), _itemVO.getService())) {
     Settings.getInstance().getDTO().showContact(_itemVO.getServiceItemID(), _itemVO.getService());
     ((MapViewPanel) getParentPanel()).buildMarkers();
   }
   ((MapViewPanel) getParentPanel()).setMapCenter(_itemVO.getPosition());
   getParentPanel().discardAllWindows();
 }
 private void jbInit() throws Exception {
   setTitle("Privacy Settings");
   this.setSize(new Dimension(480, 160));
   _separator.setBounds(new Rectangle(10, 60, 460, 1));
   _buttonCancel.setLocation(165, 70);
   _buttonCancel.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent actionEvent) {
           _buttonCancel_actionPerformed(actionEvent);
         }
       });
   _buttonOkay.setLocation(280, 70);
   _buttonOkay.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent actionEvent) {
           _buttonOkay_actionPerformed(actionEvent);
         }
       });
   _checkBoxInvisible.setBounds(new Rectangle(10, 15, 230, 35));
   _checkBoxUpdateLocation.setBounds(new Rectangle(245, 15, 230, 35));
   _panelContent.add(_checkBoxInvisible, null);
   _panelContent.add(_checkBoxUpdateLocation, null);
   _panelContent.add(_separator, null);
   _panelContent.add(_buttonOkay, null);
   _panelContent.add(_buttonCancel, null);
   _checkBoxInvisible.setChecked(!Session.getInstance().getUserInfo().isLocationIsVisible());
   _checkBoxUpdateLocation.setChecked(Settings.getInstance().getDTO().isUpdateMyLocation());
 }
 private void _buttonOkay_actionPerformed(ActionEvent actionEvent) {
   InfoUserTypeVO newInfoUserTypeVO = new InfoUserTypeVO();
   newInfoUserTypeVO.setLocationIsVisible(!_checkBoxInvisible.isChecked());
   try {
     API.getInstance().getUser().infoSet(Session.getInstance().getUserInfo(), newInfoUserTypeVO);
   } catch (Exception exception) {
     getParentPanel()
         .showWindow(
             new WarningWindow(
                 "Unable to save",
                 "Unable to save privacy settings. Please try it later.",
                 30,
                 "privacy-settings-unable-to-save-warning.wav"));
     return;
   }
   try {
     Session.getInstance().setUserInfo(API.getInstance().getUser().infoGet(null));
   } catch (Exception exception) {
     Debug.displayStack(this, exception);
   }
   Settings.getInstance().getDTO().setUpdateMyLocation(_checkBoxUpdateLocation.isChecked());
   Settings.getInstance().save();
   _buttonWindowClose_actionPerformed(null);
 }
 protected void windowVisible() {
   if (Settings.getInstance()
       .getDTO()
       .isHiddenContact(_itemVO.getServiceItemID(), _itemVO.getService()))
     _buttonShowHideOnMap.setIcons(
         "button-contact-show-on-the-map-up.png",
         "button-contact-show-on-the-map-down.png",
         "button-contact-show-on-the-map-disabled.png");
   else
     _buttonShowHideOnMap.setIcons(
         "button-contact-hide-on-the-map-up.png",
         "button-contact-hide-on-the-map-down.png",
         "button-contact-hide-on-the-map-disabled.png");
   _buttonLocateOnMap.setEnabled(_itemVO.getDisplay() == ItemDisplay.GEO);
   _buttonAddRemoveToRoute.setEnabled(_itemVO.getDisplay() == ItemDisplay.GEO);
   _buttonShowHideOnMap.setEnabled(_itemVO.getDisplay() == ItemDisplay.GEO);
   _buttonSendMessage.setEnabled(_allowSendMessage);
 }
 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();
 }