Пример #1
0
 public virtual void  actionPerformed(System.Object event_sender, System.EventArgs arg0)
 {
     //UPGRADE_NOTE: The method 'java.util.EventObject.getSource' needs to be in a event handling method in order to be properly converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1171"'
     if (event_sender == zoomInButton)
     {
         container.zoomIn();
         calculateMainContainerFont();
         container.repaint();
     }
     else
     {
         //UPGRADE_NOTE: The method 'java.util.EventObject.getSource' needs to be in a event handling method in order to be properly converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1171"'
         if (event_sender == zoomOutButton)
         {
             container.zoomOut();
             calculateMainContainerFont();
             container.repaint();
         }
         else
         {
             //UPGRADE_NOTE: The method 'java.util.EventObject.getSource' needs to be in a event handling method in order to be properly converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1171"'
             if (event_sender == reloadButton)
             {
                 reloadView();
             }
             else
             {
                 //UPGRADE_NOTE: The method 'java.util.EventObject.getSource' needs to be in a event handling method in order to be properly converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1171"'
                 if (event_sender == autoReloadButton)
                 {
                     if (autoReloadButton.isSelected())
                     {
                         reloadButton.setEnabled(false);
                         engine.addEngineEventListener(this);
                     }
                     else
                     {
                         reloadButton.setEnabled(true);
                         engine.removeEngineEventListener(this);
                     }
                 }
             }
         }
     }
 }
        protected internal virtual void  radarNewPosition(int x, int y)
        {
            double masterZoomFactor = masterShapeContainer.ZoomFactor;
            double myScalingFactor  = Factor;
            //UPGRADE_WARNING: Narrowing conversions may produce unexpected results in C#. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1042"'
            int x1 = (int)(x / myScalingFactor);
            //UPGRADE_WARNING: Narrowing conversions may produce unexpected results in C#. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1042"'
            int y1 = (int)(y / myScalingFactor);

            x1 -= masterShapeContainer.Width / 2 / masterZoomFactor;
            y1 -= masterShapeContainer.Height / 2 / masterZoomFactor;
            int offsetXmax = graphwidth + 10 - (int)(masterShapeContainer.Width / masterZoomFactor);
            int offsetYmax = graphheight + 10 - (int)(masterShapeContainer.Height / masterZoomFactor);

            if (x1 > offsetXmax)
            {
                x1 = offsetXmax;
            }
            if (y1 > offsetYmax)
            {
                y1 = offsetYmax;
            }
            if (x1 < 0)
            {
                x1 = 0;
            }
            if (y1 < 0)
            {
                y1 = 0;
            }
            masterShapeContainer.OffsetX = x1;
            masterShapeContainer.OffsetY = y1;
            offsetX = x1;
            offsetY = y1;
            masterShapeContainer.repaint();
            this.repaint();
        }