コード例 #1
0
 @Nullable
 private GraphElement overCell(MouseEvent e) {
   int y = PositionUtil.getYInsideRow(e);
   int x = e.getX();
   GraphPrintCell row = getGraphPrintCell(e);
   return row != null ? myGraphPainter.mouseOver(row, x, y) : null;
 }
コード例 #2
0
 @Override
 public void mouseClicked(MouseEvent e) {
   if (e.getClickCount() == 1) {
     Node jumpToNode = arrowToNode(e);
     if (jumpToNode != null) {
       jumpToRow(jumpToNode.getRowIndex());
       return;
     }
     GraphElement graphElement = overCell(e);
     myUI.click(graphElement);
     if (graphElement == null) {
       myUI.click(PositionUtil.getRowIndex(e));
     }
   }
   myTableListener.onClick(e, e.getClickCount());
 }
コード例 #3
0
 @Nullable
 private Node arrowToNode(MouseEvent e) {
   int y = PositionUtil.getYInsideRow(e);
   int x = e.getX();
   GraphPrintCell row = getGraphPrintCell(e);
   if (row == null) {
     return null;
   }
   SpecialPrintElement printElement = myGraphPainter.mouseOverArrow(row, x, y);
   if (printElement == null) {
     return null;
   }
   Edge edge = printElement.getGraphElement().getEdge();
   if (edge == null) {
     return null;
   }
   return printElement.getType() == SpecialPrintElement.Type.DOWN_ARROW
       ? edge.getDownNode()
       : edge.getUpNode();
 }
コード例 #4
0
 @Nullable
 private GraphPrintCell getGraphPrintCell(MouseEvent e) {
   int rowIndex = PositionUtil.getRowIndex(e);
   return getGraphPrintCellForRow(getModel(), rowIndex);
 }