handlerIconPanel = new ProxyPanel();
add("West", handlerIconPanel);
handlerActivityPanel = new ProxyPanel();
handlerActivityPanel.addMouseListener(new MouseListener(){
public void mouseClicked(MouseEvent e) {
ProcessDesigner.getInstance().getPropertyPanel().removeAll();
ObjectType eventHandlerType;
try {
//find out which handler is selected. Either I know this is not that good code ;)
int handlerIndex = getScopeActivity().getEventHandlers().length - e.getX() / 32;
EventHandler theEventHandler = getScopeActivity().getEventHandlers()[handlerIndex];
//
eventHandlerType = new ObjectType(EventHandler.class);
ObjectInstance eventHandlerInstance = (ObjectInstance)eventHandlerType.createInstance();
eventHandlerInstance.setObject(theEventHandler);
InputForm eventHandlerInputForm = new InputForm(eventHandlerType){
public void onSaveOK(Instance rec, JDialog dialog){
}
public void onUpdateOK(Instance rec, JDialog dialog){
onSaveOK(rec, dialog);
}
};
eventHandlerInputForm.setInstance(eventHandlerInstance);
JDialog dialog=new InputDialog(eventHandlerInputForm, ProcessDesigner.getInstance()){
//do not clear the form
public void onSaveOK(Instance rec){
getInputForm().onSaveOK(rec, this);
}
};
JPanel propertyPanel = InputDialog.createPanel(
eventHandlerInputForm,
null,
"Apply",
"Apply",
"Cancel"
);
//dialog.show();
//
ProcessDesigner.getInstance().getPropertyPanel().add("Center", propertyPanel);
ProcessDesigner.getInstance().getPropertyPanel().revalidate();
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
}
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
}
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}});
handlerActivityPanel.setLayout(new BoxLayout(handlerActivityPanel, BoxLayout.Y_AXIS));
handlerActivityPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
//setBorder(BorderFactory.createLineBorder(Color.GRAY, 1));
//setBorder(BorderFactory.createTitledBorder("event handlers"));
//setBackground(Color.LIGHT_GRAY);
add("Center", handlerActivityPanel);
handlerActivityPanel.addMouseListener(new MouseListener(){
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
}