Ejemplo n.º 1
0
  /**
   * Change the status This is the master function which may change the status of one or more
   * instances.
   */
  public static void changeStatus(int status, String messageText) {
    if (Preferences.getBoolean("jeti", "statusLinked", true)) {
      for (Iterator i = subInstances.iterator(); i.hasNext(); ) {
        StatusButton sub = (StatusButton) i.next();
        sub.changeInstanceStatus(status, messageText);
      }
      master.changeInstanceStatus(status, messageText);

    } else {
      if (currentParent == master || currentParent == null) {
        for (Iterator i = subInstances.iterator(); i.hasNext(); ) {
          StatusButton sub = (StatusButton) i.next();
          if (sub.status == master.status
              && ((sub.message == null && master.message == null)
                  || (sub.message != null && sub.message.equals(master.message)))) {
            sub.changeInstanceStatus(status, messageText);
          }
        }
      }
      if (currentParent != null) {
        currentParent.changeInstanceStatus(status, messageText);
      } else {
        master.changeInstanceStatus(status, messageText);
      }
    }
  }
Ejemplo n.º 2
0
 public MacRenderer() {
   renderer = new JLabel();
   renderer.setOpaque(Preferences.getBoolean("jeti", "bmw", true));
   renderer.setBackground(UIManager.getColor("Tree.selectionBackground"));
   renderer.setForeground(UIManager.getColor("Tree.textForeground"));
   renderer.setFont(UIManager.getFont("Tree.font"));
 }
Ejemplo n.º 3
0
 /** Create a submenu with teh different messages for one status. */
 private static JMenu createSubMenu(final int status) {
   JMenu subMenu = new JMenu();
   I18N.setTextAndMnemonic(Presence.getI18NKey(status), subMenu);
   subMenu.setIcon(StatusIcons.getStatusIcon(status));
   List messages = Preferences.getStatusMessages(status);
   for (Iterator it = messages.iterator(); it.hasNext(); ) {
     final String messageText = (String) it.next();
     JMenuItem menuItem = new JMenuItem(messageText);
     menuItem.addActionListener(
         new java.awt.event.ActionListener() {
           public void actionPerformed(ActionEvent e) {
             changeStatus(status, messageText);
           }
         });
     subMenu.add(menuItem);
   }
   return subMenu;
 }