double clickX = e.getX();
double clickY = e.getY();
double xc,yc;
//GraphicalBufferSolution child;
AbstractIconEntity child;
for (int i=0;i<children.size();i++)
{
child = (AbstractIconEntity)children.get(i);
if (!e.isControlDown())
{
if (child.isSelected())
{
child.setSelected(false);
child.setBorder(null);
}
}
}
child=(AbstractIconEntity)e.getComponent();
child.setSelected(true);
child.setBorder(BorderFactory.createEtchedBorder());
xc = child.getX();
yc = child.getY();
child.setOffsetX(clickX);
child.setOffsetY(clickY);
//System.out.println(clickX+":"+xc);
//System.out.println(clickY+":"+yc);
// GraphicalBufferSolution child=null;
//
// //Deselect all children.
// for (int i=0;i<children.size();i++)
// {
// child = (GraphicalBufferSolution)children.get(i);
// child.setSelected(false);
// }
// //Now see if any one should be selected.
// for (int i=0;i<children.size();i++)
// {
// child = (GraphicalBufferSolution)children.get(i);
// if (child.isInside(clickX,clickY))
// {
// System.out.println("Is inside");
// child.setSelected(true);
// xc = child.getX();
// yc = child.getY();
//
// child.setOffsetX(clickX-xc);
// child.setOffsetY(clickY-yc);
// break;
// }
// else
// {
// System.out.println("Not inside");
// }
//
// }
}
if (e.getButton() == MouseEvent.BUTTON3)
{
//System.out.println("Button 3 pressed");
double xc,yc;
double clickX = e.getX();
double clickY = e.getY();
AbstractIconEntity child=null;
child = (AbstractIconEntity)e.getComponent();
if (child == null)
{
System.out.println("Child is null");
}
//System.out.println("Got to here 1"+child.getX()+":"+e.getX()+child.getY()+":"+e.getY());
child.viewTaskList(child.getX()+e.getX(),child.getY()+e.getY());
//System.out.println("Got to here");
}
}