136 } 137 138 @Override 139 public void mouseUp(MouseEvent e) { 140 if (selectionStartX >= 0 && (e.button == 1)) { 141 updateSelectionState(e); 142 selectionStartX = -1; 143 selectionStartY = -1; 144 if (selectionListener != null) { 145 selectionListener.run(); 146 } 147 } 148 } 149 150 @Override 151 public void mouseEnter(MouseEvent e) { 152 } 153 154 @Override 155 public void mouseExit(MouseEvent e) { 156 resetHoveredItemData(); 157 clearHighlightRects(); 158 } 159 160 @Override 161 public void mouseHover(MouseEvent e) { 162 } 163 } 164 165 class Painter implements PaintListener { 166 167 @Override 168 public void paintControl(PaintEvent e) { 169 Rectangle rect = getClientArea(); 170 if (awtNeedsRedraw || !awtCanvas.hasImage(rect.width, rect.height)) { 171 Graphics2D g2d = awtCanvas.getGraphics(rect.width, rect.height); 172 g2d.setColor(Color.WHITE); 173 g2d.fillRect(0, 0, rect.width, rect.height); 174 Point adjusted = translateDisplayToImageCoordinates(rect.width, rect.height); 175 render(g2d, adjusted.x, adjusted.y); 176 if (highlightRects != null) { | 136 } 137 138 @Override 139 public void mouseUp(MouseEvent e) { 140 if (selectionStartX >= 0 && (e.button == 1)) { 141 updateSelectionState(e); 142 selectionStartX = -1; 143 selectionStartY = -1; 144 if (selectionListener != null) { 145 selectionListener.run(); 146 } 147 } 148 } 149 150 @Override 151 public void mouseEnter(MouseEvent e) { 152 } 153 154 @Override 155 public void mouseExit(MouseEvent e) { 156 if (!getClientArea().contains(e.x, e.y)) { 157 resetHoveredItemData(); 158 } 159 clearHighlightRects(); 160 } 161 162 @Override 163 public void mouseHover(MouseEvent e) { 164 } 165 } 166 167 class Painter implements PaintListener { 168 169 @Override 170 public void paintControl(PaintEvent e) { 171 Rectangle rect = getClientArea(); 172 if (awtNeedsRedraw || !awtCanvas.hasImage(rect.width, rect.height)) { 173 Graphics2D g2d = awtCanvas.getGraphics(rect.width, rect.height); 174 g2d.setColor(Color.WHITE); 175 g2d.fillRect(0, 0, rect.width, rect.height); 176 Point adjusted = translateDisplayToImageCoordinates(rect.width, rect.height); 177 render(g2d, adjusted.x, adjusted.y); 178 if (highlightRects != null) { |