Changeset 155 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/gui/panels
- Timestamp:
- 11/20/2019 03:22:38 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/scriptbuilder/gui/panels/IncidentTimelinePanel.java
r150 r155 63 63 * If true, right-clicking on this panel will produce the popup menu. 64 64 */ 65 private boolean hasPopupAccess; 65 private boolean hasPopupAccessRightClick; 66 /** 67 * If true, left-clicking on this panel will produce the popup menu. 68 */ 69 private boolean hasPopupAccessLeftClick; 66 70 67 71 int cursorTime, lastSlice, x, y; … … 250 254 251 255 addTime = -(addTime-(addTime%20)); 252 256 //this if statement might be useless? 253 257 if(offset<=incident.offset+incident.length) 254 258 { … … 274 278 275 279 // Does user want a popup menu? 276 if (e.isPopupTrigger() && hasPopupAccess) 280 if (e.isPopupTrigger() && hasPopupAccessRightClick) 281 { 282 if(getTopLevelAncestor() instanceof IncidentEditorFrame) 283 { 284 if (((IncidentEditorFrame)getTopLevelAncestor()).currentEventType == null){ 285 JPopupMenu popup = createPopup(currentMouseX,currentMouseY); 286 popup.show(e.getComponent(), currentMouseX, currentMouseY); 287 288 } 289 290 }else 291 { 292 JPopupMenu popup = createPopup(); 293 popup.show(e.getComponent(), currentMouseX, currentMouseY); 294 } 295 296 297 298 } 299 } 300 @Override 301 public void mouseReleased(MouseEvent e) 302 { 303 int currentMouseX = e.getX(); 304 int currentMouseY = e.getY(); 305 306 // Does user want a popup menu? 307 if (e.isPopupTrigger() && hasPopupAccessRightClick) 277 308 { 278 309 if(getTopLevelAncestor() instanceof IncidentEditorFrame) … … 285 316 popup.show(e.getComponent(), currentMouseX, currentMouseY); 286 317 } 287 288 289 290 }291 }292 @Override293 public void mouseReleased(MouseEvent e)294 {295 int currentMouseX = e.getX();296 int currentMouseY = e.getY();297 298 // Does user want a popup menu?299 if (e.isPopupTrigger() && hasPopupAccess)300 {301 JPopupMenu popup = createPopup();302 popup.show(e.getComponent(), currentMouseX, currentMouseY);303 318 } 304 319 } … … 323 338 else if (getTopLevelAncestor() instanceof IncidentEditorFrame) 324 339 { 340 325 341 incidentEditFrameCurrent = (IncidentEditorFrame) getTopLevelAncestor(); 326 342 editor = new Editor(incidentEditFrameCurrent); … … 485 501 super(); 486 502 487 hasPopupAccess = true;503 hasPopupAccessRightClick = true; 488 504 489 505 requestedEditorFillerTime = 0; … … 525 541 super(); 526 542 527 hasPopupAccess = usesPopup;543 hasPopupAccessRightClick = usesPopup; 528 544 529 545 requestedEditorFillerTime = 0;
Note: See TracChangeset
for help on using the changeset viewer.
