コード例 #1
0
    public IconButton(Icon[] icons) {
      this.icons = icons;
      super.setBorder(emptyBorder);
      setState(UP);
      setContentAreaFilled(false);

      addMouseListener(this);
    }
コード例 #2
0
 private void configure(Object value) {
   this.separator = (SeparatorList.Separator<Issue>) value;
   Issue issue = separator.first();
   if (issue == null) return; // handle 'late' rendering calls after this separator is invalid
   expandButton.setIcon(separator.getLimit() == 0 ? EXPANDED_ICON : COLLAPSED_ICON);
   nameLabel.setText(
       nameFormat.format(new Object[] {issue.getSubcomponent(), new Integer(separator.size())}));
 }
コード例 #3
0
 public void actionPerformed(ActionEvent e) {
   final Lock writeLock = separatorList.getReadWriteLock().writeLock();
   writeLock.lock();
   boolean collapsed;
   try {
     collapsed = separator.getLimit() == 0;
     separator.setLimit(collapsed ? Integer.MAX_VALUE : 0);
   } finally {
     writeLock.unlock();
   }
   expandButton.setIcon(collapsed ? COLLAPSED_ICON : EXPANDED_ICON);
 }
コード例 #4
0
 private void setState(int state) {
   this.state = state;
   super.setIcon(icons[state]);
 }
コード例 #5
0
 public void setIcons(Icon[] icons) {
   this.icons = icons;
   super.setIcon(this.icons[state]);
 }