home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 October / PCO1097.ISO / FilesBBS / FREI / DIGSIM.EXE / SchematicPanel.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-05-21  |  12.5 KB  |  547 lines

  1. import java.awt.BorderLayout;
  2. import java.awt.Color;
  3. import java.awt.Component;
  4. import java.awt.Container;
  5. import java.awt.Event;
  6. import java.awt.Font;
  7. import java.awt.FontMetrics;
  8. import java.awt.Graphics;
  9. import java.awt.Panel;
  10. import java.awt.Scrollbar;
  11.  
  12. class SchematicPanel extends Panel {
  13.    protected Scrollbar myHorizontal;
  14.    protected Scrollbar myVertical;
  15.    DigSim applet;
  16.    static final int GridStep = 8;
  17.    static final int hgs = 4;
  18.    Wire NewWire;
  19.    ElectronicComponent ComponentPressed;
  20.    ElectronicComponent PrevSelectedComponent;
  21.    int OldMouseX;
  22.    int OldMouseY;
  23.    boolean WireDrawing = false;
  24.    boolean JunctionDrawing = false;
  25.    protected Font SchematicFont;
  26.    protected FontMetrics SchematicFontMetrics;
  27.    static final Color BorderColor;
  28.    int GridXOffset;
  29.    int GridYOffset;
  30.    boolean SelectBox = false;
  31.    int SelectBoxX1;
  32.    int SelectBoxY1;
  33.    int SelectBoxX2;
  34.    int SelectBoxY2;
  35.    Schematic SelectSchematic;
  36.    Schematic CopySchematic;
  37.    static final Color JunctionColor;
  38.    boolean AutoJunction = true;
  39.  
  40.    public SchematicPanel(DigSim var1) {
  41.       this.applet = var1;
  42.       this.SelectSchematic = new Schematic();
  43.       ((Container)this).setLayout(new BorderLayout());
  44.       this.SchematicFont = new Font("TimesRoman", 0, 20);
  45.       this.SchematicFontMetrics = ((Component)this).getFontMetrics(this.SchematicFont);
  46.       ((Component)this).setFont(this.SchematicFont);
  47.       super.setLayout(new BorderLayout());
  48.       this.myVertical = new Scrollbar(1);
  49.       ((Container)this).add("East", this.myVertical);
  50.       this.myHorizontal = new Scrollbar(0);
  51.       ((Container)this).add("South", this.myHorizontal);
  52.       ((Component)this).repaint();
  53.    }
  54.  
  55.    public boolean handleEvent(Event var1) {
  56.       if (var1.target instanceof Scrollbar) {
  57.          ((Component)this).repaint();
  58.          return true;
  59.       } else {
  60.          super.handleEvent(var1);
  61.          return false;
  62.       }
  63.    }
  64.  
  65.    public void Cut() {
  66.       this.applet.MySchematic.RemoveSameElements(this.applet.PinGrid, this.SelectSchematic);
  67.       this.CopySchematic = new Schematic(this.SelectSchematic);
  68.       this.SelectSchematic.RemoveAllComponents();
  69.       this.applet.updateAnalyzer();
  70.       ((Component)this).repaint();
  71.    }
  72.  
  73.    public void Copy() {
  74.       this.CopySchematic = new Schematic(this.SelectSchematic);
  75.    }
  76.  
  77.    public void Paste() {
  78.       if (this.CopySchematic != null) {
  79.          this.SelectSchematic.RemoveAllComponents();
  80.          this.SelectSchematic = this.applet.MySchematic.PasteSchematic(this.applet.PinGrid, this.CopySchematic, this.GridXOffset, this.GridYOffset);
  81.          this.applet.frame.CutMenuItem.enable();
  82.          this.applet.frame.CopyMenuItem.enable();
  83.          if (this.applet.EnableFileOperations) {
  84.             this.applet.frame.CopyDiskMenuItem.enable();
  85.          }
  86.  
  87.          this.applet.MyControlPanel.EnableButton("Cut");
  88.          this.applet.MyControlPanel.EnableButton("Copy");
  89.          this.applet.updateAnalyzer();
  90.          ((Component)this).repaint();
  91.       }
  92.  
  93.    }
  94.  
  95.    public void CopyTo() {
  96.       this.applet.frame.DoFileSaveDialog(this.SelectSchematic, true, "Copy to");
  97.    }
  98.  
  99.    public void PasteFrom() {
  100.       Schematic var1 = this.applet.frame.DoFileOpenDialog((Pin[][])null, "Paste from");
  101.       if (var1 != null) {
  102.          this.SelectSchematic.RemoveAllComponents();
  103.          this.SelectSchematic = this.applet.MySchematic.PasteSchematic(this.applet.PinGrid, var1, this.GridXOffset, this.GridYOffset);
  104.          this.applet.frame.CutMenuItem.enable();
  105.          this.applet.frame.CopyMenuItem.enable();
  106.          if (this.applet.EnableFileOperations) {
  107.             this.applet.frame.CopyDiskMenuItem.enable();
  108.          }
  109.  
  110.          this.applet.MyControlPanel.EnableButton("Cut");
  111.          this.applet.MyControlPanel.EnableButton("Copy");
  112.          this.applet.updateAnalyzer();
  113.          ((Component)this).repaint();
  114.       }
  115.  
  116.    }
  117.  
  118.    public void SelectAll() {
  119.       this.SelectSchematic = new Schematic(this.applet.MySchematic);
  120.       if (this.SelectSchematic.size() > 0) {
  121.          this.SelectSchematic.SetAllComponentsSelected();
  122.          this.applet.frame.CutMenuItem.enable();
  123.          this.applet.frame.CopyMenuItem.enable();
  124.          this.applet.frame.PasteMenuItem.enable();
  125.          if (this.applet.EnableFileOperations) {
  126.             this.applet.frame.CopyDiskMenuItem.enable();
  127.          }
  128.  
  129.          this.applet.MyControlPanel.EnableButton("Cut");
  130.          this.applet.MyControlPanel.EnableButton("Copy");
  131.          this.applet.MyControlPanel.EnableButton("Paste");
  132.       } else {
  133.          this.applet.frame.CutMenuItem.disable();
  134.          this.applet.frame.CopyMenuItem.disable();
  135.          this.applet.frame.PasteMenuItem.disable();
  136.          if (this.applet.EnableFileOperations) {
  137.             this.applet.frame.CopyDiskMenuItem.disable();
  138.          }
  139.  
  140.          this.applet.MyControlPanel.DisableButton("Cut");
  141.          this.applet.MyControlPanel.DisableButton("Copy");
  142.          this.applet.MyControlPanel.DisableButton("Paste");
  143.       }
  144.  
  145.       ((Component)this).repaint();
  146.    }
  147.  
  148.    public void CheckDimensions() {
  149.       int var1 = ((Component)this).size().width;
  150.       int var2 = ((Component)this).size().height;
  151.       int var3 = var1 / 8 - 1;
  152.       int var4 = var2 / 8 - 1;
  153.       int var5 = var3 + this.GridXOffset - 100 - 1;
  154.       int var6 = var4 + this.GridYOffset - 100 - 1;
  155.       if (var5 > 0) {
  156.          this.GridXOffset -= var5;
  157.          if (this.GridXOffset < 0) {
  158.             this.GridXOffset = 0;
  159.          }
  160.  
  161.          this.myHorizontal.setValue(this.GridXOffset);
  162.       }
  163.  
  164.       if (var6 > 0) {
  165.          this.GridYOffset -= var6;
  166.          if (this.GridYOffset < 0) {
  167.             this.GridYOffset = 0;
  168.          }
  169.  
  170.          this.myVertical.setValue(this.GridYOffset);
  171.       }
  172.  
  173.    }
  174.  
  175.    public void AdjustScrollbars() {
  176.       this.GridXOffset = this.myHorizontal.getValue();
  177.       this.GridYOffset = this.myVertical.getValue();
  178.       int var2 = ((Component)this).size().width / 8 - 1;
  179.       int var3 = ((Component)this).size().height / 8 - 1;
  180.       String var1 = System.getProperty("os.name");
  181.       if (!var1.equals("Windows 95") && !var1.equals("Windows NT")) {
  182.          this.myVertical.setValues(this.GridYOffset, var3, 0, 101 - var3);
  183.          this.myHorizontal.setValues(this.GridXOffset, var2, 0, 101 - var2);
  184.       } else {
  185.          this.myVertical.setValues(this.GridYOffset, var3, 0, 101);
  186.          this.myHorizontal.setValues(this.GridXOffset, var2, 0, 101);
  187.       }
  188.    }
  189.  
  190.    public void DrawBorder(Graphics var1) {
  191.       var1.setColor(BorderColor);
  192.       var1.drawRect(-this.GridXOffset * 8 + 4, -this.GridYOffset * 8 + 4, 792, 792);
  193.       var1.setColor(DigSim.BackGroundColor);
  194.       var1.drawLine((100 - this.GridXOffset) * 8, 0, (100 - this.GridXOffset) * 8, (100 - this.GridYOffset) * 8);
  195.       var1.drawLine(0, (100 - this.GridYOffset) * 8, (100 - this.GridXOffset) * 8, (100 - this.GridYOffset) * 8);
  196.    }
  197.  
  198.    public void TellNotReady(Graphics var1) {
  199.       String var2 = "Please wait, I'm preparing the image";
  200.       var1.setColor(Color.green);
  201.       var1.fillRect(0, 0, ((Component)this).size().width, ((Component)this).size().height);
  202.       var1.setColor(Color.black);
  203.       var1.drawString(var2, ((Component)this).size().width / 2 - this.SchematicFontMetrics.stringWidth(var2) / 2, ((Component)this).size().height / 2);
  204.    }
  205.  
  206.    public synchronized void paint(Graphics var1) {
  207.       this.CheckDimensions();
  208.       if (this.applet.OffScreenWidth < ((Component)this).size().width || this.applet.OffScreenHeight < ((Component)this).size().height) {
  209.          this.update(var1);
  210.       }
  211.  
  212.       if (this.applet.ImagesReady()) {
  213.          var1.drawImage(this.applet.ImageBuffer, 0, 0, this);
  214.       } else {
  215.          this.TellNotReady(var1);
  216.       }
  217.    }
  218.  
  219.    public synchronized void update(Graphics var1) {
  220.       this.CheckDimensions();
  221.       if (this.applet.OffScreenWidth < ((Component)this).size().width || this.applet.OffScreenHeight < ((Component)this).size().height) {
  222.          this.applet.OffScreenHeight = ((Component)this).size().height;
  223.          this.applet.OffScreenWidth = ((Component)this).size().width;
  224.          this.applet.SetUpImages();
  225.       }
  226.  
  227.       this.AdjustScrollbars();
  228.       if (this.applet.ImagesReady()) {
  229.          this.applet.ibg.drawImage(this.applet.GridImage, 0, 0, this);
  230.          this.DrawBorder(this.applet.ibg);
  231.          this.applet.MySchematic.draw(this.applet.ibg, this.GridXOffset, this.GridYOffset, 8);
  232.          if (this.NewWire != null) {
  233.             this.NewWire.draw(this.applet.ibg, this.GridXOffset, this.GridYOffset, 8);
  234.          }
  235.  
  236.          if (this.SelectBox) {
  237.             this.DrawSelectBox();
  238.          }
  239.  
  240.          this.DrawJunctions(this.applet.PinGrid, this.applet.ibg, this.GridXOffset, this.GridYOffset, 8);
  241.          var1.drawImage(this.applet.ImageBuffer, 0, 0, this);
  242.       } else {
  243.          this.TellNotReady(var1);
  244.       }
  245.    }
  246.  
  247.    public void DrawJunctions(Pin[][] var1, Graphics var2, int var3, int var4, int var5) {
  248.       int var9 = ((Component)this).size().width / 8 + var3 - 1;
  249.       int var10 = ((Component)this).size().height / 8 + var4 - 1;
  250.       if (var9 >= 100) {
  251.          var9 = 99;
  252.       }
  253.  
  254.       if (var10 >= 100) {
  255.          var10 = 99;
  256.       }
  257.  
  258.       var2.setColor(JunctionColor);
  259.  
  260.       for(int var6 = var3; var6 < var9; ++var6) {
  261.          for(int var7 = var4; var7 < var10; ++var7) {
  262.             int var8 = var1[var6][var7].Components.size();
  263.             if (var8 == 2 && (ElectronicComponent)var1[var6][var7].Components.elementAt(0) instanceof Wire && (ElectronicComponent)var1[var6][var7].Components.elementAt(1) instanceof Wire || var8 > 2) {
  264.                var2.drawLine((var6 - var3) * var5 - 1, (var7 - var4) * var5, (var6 - var3) * var5 + 1, (var7 - var4) * var5);
  265.                var2.drawLine((var6 - var3) * var5, (var7 - var4) * var5 - 1, (var6 - var3) * var5, (var7 - var4) * var5 + 1);
  266.             }
  267.          }
  268.       }
  269.  
  270.    }
  271.  
  272.    public void DrawSelectBox() {
  273.       int var1 = Math.abs(this.SelectBoxX2 - this.SelectBoxX1);
  274.       int var2 = Math.abs(this.SelectBoxY2 - this.SelectBoxY1);
  275.       int var3 = this.SelectBoxX1 < this.SelectBoxX2 ? this.SelectBoxX1 : this.SelectBoxX2;
  276.       int var4 = this.SelectBoxY1 < this.SelectBoxY2 ? this.SelectBoxY1 : this.SelectBoxY2;
  277.       this.applet.ibg.setColor(Color.white);
  278.       this.applet.ibg.drawRect(var3, var4, var1, var2);
  279.    }
  280.  
  281.    public int GetXCoord(int var1) {
  282.       int var2 = (var1 + 4) / 8 + this.GridXOffset;
  283.       if (var2 < 1) {
  284.          var2 = 1;
  285.       }
  286.  
  287.       if (var2 >= 100) {
  288.          var2 = 99;
  289.       }
  290.  
  291.       return var2;
  292.    }
  293.  
  294.    public int GetYCoord(int var1) {
  295.       int var2 = (var1 + 4) / 8 + this.GridYOffset;
  296.       if (var2 < 1) {
  297.          var2 = 1;
  298.       }
  299.  
  300.       if (var2 >= 100) {
  301.          var2 = 99;
  302.       }
  303.  
  304.       return var2;
  305.    }
  306.  
  307.    public void WireMouseDown(int var1, int var2) {
  308.       this.StatusMessage("Move to the desired end position and release the mouse button.");
  309.       this.NewWire = new Wire(this.applet.PinGrid, this.GetXCoord(var1), this.GetYCoord(var2));
  310.       this.NewWire.Set2ndCoord(this.applet.PinGrid, this.GetXCoord(var1), this.GetYCoord(var2));
  311.    }
  312.  
  313.    public void JunctionMouseDown(int var1, int var2) {
  314.       if (!this.applet.MySchematic.PlaceJunction(this.applet.PinGrid, this.GetXCoord(var1), this.GetYCoord(var2), 8)) {
  315.          this.StatusMessage("Sorry, can't place a junction here. Try again.");
  316.       } else {
  317.          this.StatusMessage("Click again to add another junction.");
  318.          ((Component)this).repaint();
  319.       }
  320.    }
  321.  
  322.    public void WireMouseDrag(int var1, int var2) {
  323.       this.StatusMessage("Release mouse button to add the wire here.");
  324.       if (this.NewWire != null) {
  325.          this.NewWire.Set2ndCoord(this.applet.PinGrid, this.GetXCoord(var1), this.GetYCoord(var2));
  326.          ((Component)this).repaint();
  327.       }
  328.  
  329.    }
  330.  
  331.    public void WireMouseUp(int var1, int var2) {
  332.       if (this.NewWire != null) {
  333.          if (this.NewWire.x1 == this.GetXCoord(var1) && this.NewWire.y1 == this.GetYCoord(var2)) {
  334.             this.StatusMessage("Sorry - can't place wire. Length must be minimal one gridpoint.");
  335.             this.NewWire = null;
  336.             return;
  337.          }
  338.  
  339.          this.StatusMessage("Choose a position for the next wire and press the mouse button.");
  340.          this.NewWire.Set2ndCoord(this.applet.PinGrid, this.GetXCoord(var1), this.GetYCoord(var2));
  341.          this.applet.addComponent(this.NewWire);
  342.          this.NewWire.CheckPosition();
  343.          this.NewWire.PlacePinsHere(this.applet.PinGrid);
  344.          if (this.AutoJunction) {
  345.             this.applet.MySchematic.PlaceJunction(this.applet.PinGrid, this.NewWire.x1, this.NewWire.y1, 8);
  346.             this.applet.MySchematic.PlaceJunction(this.applet.PinGrid, this.NewWire.x2, this.NewWire.y2, 8);
  347.          }
  348.  
  349.          this.NewWire = null;
  350.          ((Component)this).repaint();
  351.       }
  352.  
  353.    }
  354.  
  355.    public void MouseDownSimulateRunning(int var1, int var2) {
  356.       this.ComponentPressed = this.applet.MySchematic.CheckIfComponentClicked(this.GetXCoord(var1), this.GetYCoord(var2));
  357.       if (this.ComponentPressed != null) {
  358.          if (!this.ComponentPressed.SimMouseDown()) {
  359.             this.StatusMessage("Sorry, cannot move component while simulating. Press 'simulate' again to stop.");
  360.             return;
  361.          }
  362.       } else {
  363.          this.StatusMessage("Can't find a component here. Try again please.");
  364.       }
  365.  
  366.    }
  367.  
  368.    public void MouseUpSimulateRunning(int var1, int var2) {
  369.       if (this.ComponentPressed != null) {
  370.          this.ComponentPressed.SimMouseUp();
  371.       }
  372.  
  373.    }
  374.  
  375.    public void MouseDragSimulateRunning(int var1, int var2) {
  376.    }
  377.  
  378.    public synchronized boolean mouseDown(Event var1, int var2, int var3) {
  379.       this.SelectBox = false;
  380.       if (this.applet.SimulateRunning()) {
  381.          this.MouseDownSimulateRunning(var2, var3);
  382.          return true;
  383.       } else if (this.WireDrawing) {
  384.          this.WireMouseDown(var2, var3);
  385.          return true;
  386.       } else if (this.JunctionDrawing) {
  387.          this.JunctionMouseDown(var2, var3);
  388.          return true;
  389.       } else {
  390.          ElectronicComponent var4 = this.applet.MySchematic.CheckIfComponentClicked(this.GetXCoord(var2), this.GetYCoord(var3));
  391.          if (var4 != null) {
  392.             if (var1.clickCount == 2 && var4 instanceof Caption && var4 == this.PrevSelectedComponent) {
  393.                Caption var6 = (Caption)var4;
  394.                if (this.applet.frame.MyTextChangeDialog == null) {
  395.                   this.applet.frame.MyTextChangeDialog = new TextDialog(this.applet.frame, var6, 6);
  396.                }
  397.             }
  398.  
  399.             if (var1.clickCount == 2 && var4 instanceof Probe && var4 == this.PrevSelectedComponent) {
  400.                Probe var7 = (Probe)var4;
  401.                if (this.applet.frame.MyTextProbeChangeDialog == null) {
  402.                   this.applet.frame.MyTextProbeChangeDialog = new TextDialog(this.applet.frame, var7, 8);
  403.                }
  404.             }
  405.  
  406.             this.PrevSelectedComponent = var4;
  407.             if (this.SelectSchematic.size() > 0 && !this.SelectSchematic.InSchematic(var4)) {
  408.                if (var1.shiftDown()) {
  409.                   var4.Selected = true;
  410.                   this.SelectSchematic.addComponent(var4);
  411.                } else {
  412.                   this.SelectSchematic.RemoveAllComponents();
  413.                }
  414.  
  415.                ((Component)this).repaint();
  416.             }
  417.  
  418.             if (this.SelectSchematic.size() > 0) {
  419.                this.SelectSchematic.RemovePinsGrid(this.applet.PinGrid);
  420.                if (this.SelectSchematic.size() > 1) {
  421.                   this.StatusMessage("Move all components to the desired position and release the mouse button.");
  422.                } else {
  423.                   ElectronicComponent var5 = (ElectronicComponent)this.SelectSchematic.Components.elementAt(0);
  424.                   this.StatusMessage("Move this " + var5.getName() + " to the desired position and release the mouse button.");
  425.                }
  426.             } else {
  427.                var4.Selected = true;
  428.                this.SelectSchematic.addComponent(var4);
  429.                this.StatusMessage("Move this " + var4.getName() + " to the desired position and release the mouse button.");
  430.                var4.RemovePinsGrid(this.applet.PinGrid);
  431.                ((Component)this).repaint();
  432.             }
  433.  
  434.             this.OldMouseX = var2;
  435.             this.OldMouseY = var3;
  436.          } else {
  437.             this.SelectSchematic.RemoveAllComponents();
  438.             this.SelectBox = true;
  439.             this.SelectBoxX1 = this.SelectBoxX2 = var2;
  440.             this.SelectBoxY1 = this.SelectBoxY2 = var3;
  441.             ((Component)this).repaint();
  442.          }
  443.  
  444.          return true;
  445.       }
  446.    }
  447.  
  448.    public synchronized boolean mouseUp(Event var1, int var2, int var3) {
  449.       if (this.applet.HelpWanted) {
  450.          ElectronicComponent var4;
  451.          if ((var4 = this.applet.MySchematic.CheckIfComponentClicked(this.GetXCoord(var2), this.GetYCoord(var3))) != null) {
  452.             new HelpDialog(this.applet.frame, var4.ComponentName);
  453.          } else {
  454.             new HelpDialog(this.applet.frame, "Schematic");
  455.          }
  456.  
  457.          return true;
  458.       } else if (this.applet.SimulateRunning()) {
  459.          this.MouseUpSimulateRunning(var2, var3);
  460.          return true;
  461.       } else if (this.WireDrawing) {
  462.          this.WireMouseUp(var2, var3);
  463.          return true;
  464.       } else if (this.JunctionDrawing) {
  465.          return true;
  466.       } else {
  467.          if (this.SelectSchematic.size() > 0) {
  468.             this.SelectSchematic.CheckPosition();
  469.             this.SelectSchematic.PlacePinsHere(this.applet.PinGrid);
  470.             this.StatusMessage("Ready. Select another component or make a choice.");
  471.             ((Component)this).repaint();
  472.          } else if (this.SelectBox) {
  473.             this.SelectBox = false;
  474.             this.applet.MySchematic.CheckIfComponentsInSelectBox(this.SelectSchematic, this.GetXCoord(this.SelectBoxX1), this.GetYCoord(this.SelectBoxY1), this.GetXCoord(this.SelectBoxX2), this.GetYCoord(this.SelectBoxY2));
  475.             if (this.SelectSchematic.size() > 0) {
  476.                ((Component)this).repaint();
  477.             }
  478.          }
  479.  
  480.          if (this.SelectSchematic.size() > 0) {
  481.             this.applet.frame.CutMenuItem.enable();
  482.             this.applet.frame.CopyMenuItem.enable();
  483.             if (this.applet.EnableFileOperations) {
  484.                this.applet.frame.CopyDiskMenuItem.enable();
  485.             }
  486.  
  487.             this.applet.MyControlPanel.EnableButton("Cut");
  488.             this.applet.MyControlPanel.EnableButton("Copy");
  489.          } else {
  490.             this.applet.frame.CutMenuItem.disable();
  491.             this.applet.frame.CopyMenuItem.disable();
  492.             if (this.applet.EnableFileOperations) {
  493.                this.applet.frame.CopyDiskMenuItem.disable();
  494.             }
  495.  
  496.             this.applet.MyControlPanel.DisableButton("Cut");
  497.             this.applet.MyControlPanel.DisableButton("Copy");
  498.          }
  499.  
  500.          return true;
  501.       }
  502.    }
  503.  
  504.    public synchronized boolean mouseDrag(Event var1, int var2, int var3) {
  505.       if (var2 != -1 && var3 != -1) {
  506.          if (this.applet.SimulateRunning()) {
  507.             this.MouseDragSimulateRunning(var2, var3);
  508.             return true;
  509.          } else if (this.WireDrawing) {
  510.             this.WireMouseDrag(var2, var3);
  511.             return true;
  512.          } else if (this.JunctionDrawing) {
  513.             return true;
  514.          } else {
  515.             if (this.SelectSchematic.size() > 0) {
  516.                int var4 = (var2 - this.OldMouseX) / 8;
  517.                int var5 = (var3 - this.OldMouseY) / 8;
  518.                if (var4 != 0 || var5 != 0) {
  519.                   this.OldMouseX = var2 - (var2 - this.OldMouseX) % 8;
  520.                   this.OldMouseY = var3 - (var3 - this.OldMouseY) % 8;
  521.                   this.SelectSchematic.AdjustPosition(this.applet.PinGrid, var4, var5);
  522.                   this.applet.MySchematic.Modified = true;
  523.                   ((Component)this).repaint();
  524.                }
  525.             } else if (this.SelectBox) {
  526.                this.SelectBoxX2 = var2;
  527.                this.SelectBoxY2 = var3;
  528.                ((Component)this).repaint();
  529.             }
  530.  
  531.             return true;
  532.          }
  533.       } else {
  534.          return true;
  535.       }
  536.    }
  537.  
  538.    public void StatusMessage(String var1) {
  539.       this.applet.StatusMessage(var1);
  540.    }
  541.  
  542.    static {
  543.       BorderColor = Color.red;
  544.       JunctionColor = Color.white;
  545.    }
  546. }
  547.