Changeset 155 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/gui/panels


Ignore:
Timestamp:
11/20/2019 03:22:38 PM (6 years ago)
Author:
sdanthin
Message:

units.xml moved to Incidents folder

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/gui/panels/IncidentTimelinePanel.java

    r150 r155  
    6363     * If true, right-clicking on this panel will produce the popup menu. 
    6464     */ 
    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; 
    6670     
    6771    int cursorTime, lastSlice, x, y; 
     
    250254                         
    251255                        addTime = -(addTime-(addTime%20)); 
    252                          
     256                        //this if statement might be useless? 
    253257                        if(offset<=incident.offset+incident.length) 
    254258                        { 
     
    274278 
    275279            // 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) 
    277308            { 
    278309                if(getTopLevelAncestor() instanceof IncidentEditorFrame) 
     
    285316                    popup.show(e.getComponent(), currentMouseX, currentMouseY); 
    286317                } 
    287                  
    288                  
    289                  
    290             } 
    291         } 
    292         @Override 
    293         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); 
    303318            } 
    304319        } 
     
    323338            else if (getTopLevelAncestor() instanceof IncidentEditorFrame) 
    324339            { 
     340                 
    325341                incidentEditFrameCurrent = (IncidentEditorFrame) getTopLevelAncestor(); 
    326342                editor = new Editor(incidentEditFrameCurrent); 
     
    485501        super(); 
    486502 
    487         hasPopupAccess = true; 
     503        hasPopupAccessRightClick = true; 
    488504 
    489505        requestedEditorFillerTime = 0; 
     
    525541        super(); 
    526542 
    527         hasPopupAccess = usesPopup; 
     543        hasPopupAccessRightClick = usesPopup; 
    528544 
    529545        requestedEditorFillerTime = 0; 
Note: See TracChangeset for help on using the changeset viewer.