package gov.nih.nci.ncicb.cadsr.loader.ui;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;


import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

import java.util.ArrayList;
import java.util.List;


public class AddButtonPanel extends JPanel implements ActionListener, PropertyChangeListener
{

  private JButton addButton;

  static final String ADD = "ADD";

  private ConceptEditorPanel conceptEditorPanel;

  public AddButtonPanel(ConceptEditorPanel p) {
    conceptEditorPanel = p;

    addButton = new JButton("Add");
    addButton.setActionCommand(ADD);
    addButton.addActionListener(this);

    this.add(addButton);

  }

  public void propertyChange(PropertyChangeEvent e) 
  {
    if(e.getPropertyName().equals(ADD)) {
      addButton.setEnabled((Boolean)e.getNewValue());
    }
  }

  public void actionPerformed(ActionEvent evt) {
    AbstractButton button = (AbstractButton)evt.getSource();

    if(button.getActionCommand().equals(ADD)) 
        conceptEditorPanel.addPressed();
    
  }


}

@@ -57,19 +57,24 @@
 awt.
-BorderLayou
+event.ActionEven
 t;%0Ai
@@ -92,17 +92,28 @@
 awt.
-Component
+event.ActionListener
 ;%0Aim
@@ -124,38 +124,37 @@
  java.awt.event.
-Action
+Mouse
 Event;%0Aimport ja
@@ -158,38 +158,37 @@
  java.awt.event.
-Action
+Mouse
 Listener;%0Aimport
@@ -173,32 +173,33 @@
 .MouseListener;%0A
+%0A
 import javax.swi
@@ -205,17 +205,16 @@
 ing.*;%0A%0A
-%0A
 import j
@@ -291,61 +291,8 @@
 r;%0A%0A
-import java.util.ArrayList;%0Aimport java.util.List;%0A%0A%0A
 publ
@@ -344,24 +344,8 @@
 ents
- ActionListener,
  Pro
@@ -367,12 +367,26 @@
 ener
+, MouseListener
 %0A%7B%0A
-%0A
   pr
@@ -391,17 +391,24 @@
 private 
-J
+DropDown
 Button a
@@ -448,18 +448,59 @@
 ADD = %22A
-DD
+dd%22,%0A    ADD_INHERITANCE = %22Add Inheritance
 %22;%0A%0A  pr
@@ -646,84 +646,288 @@
 new 
-JButton(%22Add%22);%0A    addButton.setActionCommand(ADD);%0A    addButton.addAction
+DropDownButton(ADD);%0A%0A    JLabel addLabel = new JLabel(ADD),%0A      addInheritanceLabel = new JLabel(ADD_INHERITANCE);%0A    %0A    addButton.addComponent(addLabel);%0A    addButton.addComponent(addInheritanceLabel);%0A%0A    addLabel.addMouseListener(this);%0A    addInheritanceLabel.addMouse
 List
@@ -1129,24 +1129,26 @@
 ;%0A    %7D%0A  %7D%0A
+  
 %0A  public vo
@@ -1154,202 +1154,1030 @@
 oid 
-actionPerformed(Action
+mouseClicked(Mouse
 Event e
-vt
 ) %7B%0A
+//
     
-AbstractButton button = (AbstractButton)evt.getSource();%0A%0A    if(button.getActionCommand().equals(ADD)) %0A        conceptEditorPanel.addPressed();%0A    
+ cadsrVDPanel.setBackground(Color.WHITE);%0A//     lvdPanel.setBackground(Color.WHITE);%0A    addButton.unfocus();%0A    if(((JLabel)e.getSource()).getText().equals(ADD))%0A      conceptEditorPanel.addPressed();%0A    else if(((JLabel)e.getSource()).getText().equals(ADD_INHERITANCE))%0A      conceptEditorPanel.addInheritancePressed();%0A  %7D%0A%0A  public void mousePressed(MouseEvent e) %7B%7D%0A  public void mouseReleased(MouseEvent e) %7B%7D%0A  public void mouseEntered(MouseEvent e) %7B%0A//     if(((JLabel)e.getSource()).getText().equals(MAP_CADSR_VD))%0A//       cadsrVDPanel.setBackground(Color.LIGHT_GRAY);%0A//     else if(((JLabel)e.getSource()).getText().equals(MAP_LOCAL_VD))%0A//       lvdPanel.setBackground(Color.LIGHT_GRAY);%0A  %7D%0A  public void mouseExited(MouseEvent e) %7B%0A//     if(((JLabel)e.getSource()).getText().equals(MAP_CADSR_VD))%0A//       cadsrVDPanel.setBackground(Color.WHITE);%0A//     else if(((JLabel)e.getSource()).getText().equals(MAP_LOCAL_VD))%0A//       lvdPanel.setBackground(Color.WHITE);
 %0A  %7D%0A%0A
-%0A
 %7D%0A

add inheritance added