Raptor
Class ProofLine

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

public class ProofLine
extends ProofItem

Represents a line contained inside a ProofBox.
Extends ProofItem

See Also:
Serialized Form

Constructor Summary
ProofLine(Formula pFormula, Justification pJustification, int pLine, ProofWindow pParentWindow, ProofBox pParentBox)
          Constructs a ProofLine with a Formula, Justification and Line number.
ProofLine(Formula pFormula, Justification pJustification, ProofWindow pParentWindow, ProofBox pParentBox)
          Constructs a ProofLine with a Formula and a Justification.
ProofLine(Formula pFormula, ProofWindow pParentWindow, ProofBox pParentBox)
          Constructs a ProofLine with a formula.
ProofLine(Formula pFormula, java.lang.String pType, ProofWindow pParentWindow, ProofBox pParentBox)
          Constructs a ProofLine with a Formula and a String which will become the Justification.
 
Method Summary
 void deselectLine()
          Carries out the methods required to show and record that a ProofLine has been deselected.
 void deselectLineNoClear()
          Carries out the methods required to show and record that a ProofLine has been deselected without clearing the last selected item for the ProofWindow.
 javax.swing.JPanel display()
          Returns JPanel containing this ProofLine.
 void displayColour()
          Sets the display colour of the ProofLine depending on if the line is selected.
 Formula getFormula()
          Returns the formula of this ProofLine.
 Justification getJustification()
          Returns the justification of this ProofLine.
 java.lang.String getLineComment()
          Returns the comment of this ProofLine
 int getLineNum()
          Returns to line number of the ProofLine.
 void mouseClicked(java.awt.event.MouseEvent e)
          Responds to a ProofItem with a mouse listener being clicked.
 int[] recalculateLineNum(int pThisLine, int pNextLine)
          Returns the line number for next ProofItem.
 void selectLine()
          Carries out the methods required to show and record that a ProofLine has been selected.
 void setFormula(Formula pFormula)
          Sets the formula
 void setJustification(Justification pJustification)
          Sets a new justification of the ProofLine.
 void setLineComment(java.lang.String pComment)
          Sets the comment of this ProofLine
 void setLineNum(int pLine)
          Sets the line number of this ProofLine.
 
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

ProofLine

public ProofLine(Formula pFormula,
                 ProofWindow pParentWindow,
                 ProofBox pParentBox)
Constructs a ProofLine with a formula.

Parameters:
pFormula - the formula of the ProofLine
pParentWindow - The window that the ProofLine is in
pParentBox - The ProofBox that contains this ProofLine

ProofLine

public ProofLine(Formula pFormula,
                 java.lang.String pType,
                 ProofWindow pParentWindow,
                 ProofBox pParentBox)
Constructs a ProofLine with a Formula and a String which will become the Justification.

Parameters:
pFormula - The formula of the ProofLine
pType - The String which will become the justification of the ProofLine
pParentWindow - The window that the ProofLine is in
pParentBox - The ProofBox that contains this ProofLine

ProofLine

public ProofLine(Formula pFormula,
                 Justification pJustification,
                 ProofWindow pParentWindow,
                 ProofBox pParentBox)
Constructs a ProofLine with a Formula and a Justification.

Parameters:
pFormula - The formula of the ProofLine
pJustification - The justification of the ProofLine
pParentWindow - The window that the ProofLine is in
pParentBox - The ProofBox that contains this ProofLine

ProofLine

public ProofLine(Formula pFormula,
                 Justification pJustification,
                 int pLine,
                 ProofWindow pParentWindow,
                 ProofBox pParentBox)
Constructs a ProofLine with a Formula, Justification and Line number.

Parameters:
pFormula - The formula of the ProofLine
pJustification - The justification of the ProofLine
pLine - The line number of the ProofLine
pParentWindow - The window that the ProofLine is in
pParentBox - The ProofBox that contains this ProofLine
Method Detail

getLineNum

public int getLineNum()
Returns to line number of the ProofLine.


setLineNum

public void setLineNum(int pLine)
Sets the line number of this ProofLine.

Parameters:
pLine - The line number of this ProofLine

recalculateLineNum

public int[] recalculateLineNum(int pThisLine,
                                int pNextLine)
Returns the line number for next ProofItem.

Specified by:
recalculateLineNum in class ProofItem
Parameters:
pThisLine - The line number of this ProofLine
pNextLine - the line number of next ProgramLine

getFormula

public Formula getFormula()
Returns the formula of this ProofLine.


setFormula

public void setFormula(Formula pFormula)
Sets the formula

Parameters:
pFormula - formula to set

getJustification

public Justification getJustification()
Returns the justification of this ProofLine.


setJustification

public void setJustification(Justification pJustification)
Sets a new justification of the ProofLine.

Parameters:
pJustification - The new justification of this ProofLine

getLineComment

public java.lang.String getLineComment()
Returns the comment of this ProofLine


setLineComment

public void setLineComment(java.lang.String pComment)
Sets the comment of this ProofLine


selectLine

public void selectLine()
Carries out the methods required to show and record that a ProofLine has been selected. Also handles selecting lines during the Trust Me rules for referencing, and conducts checks to make sure the selection is valid


deselectLine

public void deselectLine()
Carries out the methods required to show and record that a ProofLine has been deselected. Also handles deselecting lines during the Trust Me rules to dereference a line

Overrides:
deselectLine in class ProofItem

deselectLineNoClear

public void deselectLineNoClear()
Carries out the methods required to show and record that a ProofLine 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 JPanel containing this ProofLine.

Specified by:
display in class ProofItem

displayColour

public void displayColour()
Sets the display colour of the ProofLine 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