Raptor
Class ProgramLine

java.lang.Object
  extended by Raptor.ProofItem
      extended by Raptor.ProgramLine
All Implemented Interfaces:
java.awt.event.MouseListener, java.io.Serializable, java.util.EventListener

public class ProgramLine
extends ProofItem

Is a line containing the program code in a ProofBox.
Extends ProofItem

See Also:
Serialized Form

Constructor Summary
ProgramLine(Statements pStatements, int pLine, ProofWindow pParentWindow, ProofBox pParentBox)
          Constructs a ProgramLine with a statement and program line number
ProgramLine(Statements pStatements, ProofWindow pParentWindow, ProofBox pParentBox)
          Constructs a ProgramLine with statement.
 
Method Summary
 void deselectLine()
          Carries out the methods required to show and record that a ProgramLine has been deselected
 void deselectLineNoClear()
          Carries out the methods required to show and record that a ProgramLine has been deselected without clearing the last selected item for the ProofWindow.
 javax.swing.JPanel display()
          Returns a JPanel containing this ProgramLine
 void displayColour()
          Sets the display colour of the ProgramLine depending on if the line is selected.
 int getProgLineNum()
          Returns the program line number of ProgramLine
 Statements getStatements()
          Returns the statement of this ProgramLine
 boolean isUsed()
          Returns true if ProgramLine has been used
 void mouseClicked(java.awt.event.MouseEvent e)
          Responds to a ProofItem with a mouse listener being clicked.
 int[] recalculateLineNum(int pNextProofLine, int pThisProgLine)
          Returns the line number for the next ProofItem
 void selectLine()
          Carries out the methods required to show and record that a ProgramLine has been selected
 void setProgLineNum(int pLine)
          Sets the program line number of this ProgramLine
 void setStatements(Statements pStatements)
          Sets the statement of this ProgramLine
 void setUsed(boolean pOpt)
          Set if the ProgramLine has been used
 
Methods inherited from class Raptor.ProofItem
getParentBox, getParentWindow, mouseEntered, mouseExited, mousePressed, mouseReleased, setParentBox
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgramLine

public ProgramLine(Statements pStatements,
                   ProofWindow pParentWindow,
                   ProofBox pParentBox)
Constructs a ProgramLine with statement.

Parameters:
pStatements - the ProgramLine statement
pParentWindow - the window that the ProgramLine is in
pParentBox - the ProofBox that contains this ProgramLine

ProgramLine

public ProgramLine(Statements pStatements,
                   int pLine,
                   ProofWindow pParentWindow,
                   ProofBox pParentBox)
Constructs a ProgramLine with a statement and program line number

Parameters:
pStatements - the ProgramLine statement
pLine - the line number of program line
pParentWindow - the window that the ProgramLine is in
pParentBox - the ProofBox that contains this ProgramLine
Method Detail

getProgLineNum

public int getProgLineNum()
Returns the program line number of ProgramLine


setProgLineNum

public void setProgLineNum(int pLine)
Sets the program line number of this ProgramLine

Parameters:
pLine - the line number of this ProgramLine

recalculateLineNum

public int[] recalculateLineNum(int pNextProofLine,
                                int pThisProgLine)
Returns the line number for the next ProofItem

Specified by:
recalculateLineNum in class ProofItem
Parameters:
pNextProofLine - the line number of next ProofItem
pThisProgLine - the line number of this ProgramLine

getStatements

public Statements getStatements()
Returns the statement of this ProgramLine


setStatements

public void setStatements(Statements pStatements)
Sets the statement of this ProgramLine


isUsed

public boolean isUsed()
Returns true if ProgramLine has been used


setUsed

public void setUsed(boolean pOpt)
Set if the ProgramLine has been used

Parameters:
pOpt - set if the ProgramLine is used

selectLine

public void selectLine()
Carries out the methods required to show and record that a ProgramLine has been selected


deselectLine

public void deselectLine()
Carries out the methods required to show and record that a ProgramLine has been deselected

Overrides:
deselectLine in class ProofItem

deselectLineNoClear

public void deselectLineNoClear()
Carries out the methods required to show and record that a ProgramLine has been deselected without clearing the last selected item for the ProofWindow. This prevents looping.

Overrides:
deselectLineNoClear in class ProofItem

display

public javax.swing.JPanel display()
Returns a JPanel containing this ProgramLine

Specified by:
display in class ProofItem

displayColour

public void displayColour()
Sets the display colour of the ProgramLine depending on if the line is selected.

Overrides:
displayColour in class ProofItem

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Responds to a ProofItem with a mouse listener being clicked.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Overrides:
mouseClicked in class ProofItem
Parameters:
e - the object with a mouse listener that was clicked