1 19 package org.openharmonise.workfloweditor.flowchart; 20 21 import java.awt.event.*; 22 import java.util.*; 23 24 import javax.swing.event.*; 25 26 import org.openharmonise.workfloweditor.flowchart.shapes.*; 27 28 29 36 public class LineSelectionMouseHandler extends MouseInputAdapter { 37 38 41 private FlowChart m_chart = null; 42 43 46 private AbstractWorkflowShape m_startShape = null; 47 48 51 private AbstractWorkflowShape m_endShape = null; 52 53 56 private ConnectionLine m_connectionLine = null; 57 58 63 public LineSelectionMouseHandler(FlowChart chart) { 64 super(); 65 this.m_chart = chart; 66 } 67 68 71 public void mouseDragged(MouseEvent me) { 72 73 } 74 75 78 public void mousePressed(MouseEvent me) { 79 80 } 81 82 85 public void mouseReleased(MouseEvent me) { 86 87 } 88 89 92 public void mouseClicked(MouseEvent me) { 93 boolean bLineSelected = false; 94 Iterator itor = this.m_chart.getShapes().iterator(); 95 while (itor.hasNext()) { 96 AbstractWorkflowShape shape = (AbstractWorkflowShape) itor.next(); 97 if(shape instanceof ConnectionLine) { 98 ConnectionLine connectionLine = (ConnectionLine) shape; 99 if(connectionLine.selectionPointContains(me.getX(), me.getY())) { 100 this.m_chart.removeShape(connectionLine); 101 } 102 } 103 } 104 } 105 106 } 107 | Popular Tags |