Pandora
Class ProofLine

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

public class ProofLine
extends ProofItem
implements java.lang.Comparable<ProofLine>

Is a line contained inside a ProofBox.
Extends ProofItem

See Also:
Serialized Form

Constructor Summary
ProofLine(Formula f, Justification just, int line, ProofWindow parentWindow, ProofBox parentBox)
          Constructs a ProofLine with a Formula, Justification and Line number.
ProofLine(Formula f, Justification just, ProofWindow parentWindow, ProofBox parentBox)
          Constructs a ProofLine with a Formula and a Justification.
ProofLine(Formula f, ProofWindow parentWindow, ProofBox parentBox)
          Constructs a ProofLine with a formula.
ProofLine(Formula f, java.lang.String type, ProofWindow parentWindow, ProofBox parentBox)
          Constructs a ProofLine with a Formula and a String which will become the Justification.
 
Method Summary
 int compareTo(ProofLine o)
           
 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 line)
          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 f)
          Sets the formula
 void setJustification(Justification just)
          Sets a new justification of the ProofLine.
 void setLineComment(java.lang.String comment)
          Sets the comment of this ProofLine
 void setLineNum(int line)
          Sets the line number of this ProofLine.
 
Methods inherited from class Pandora.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 f,
                 ProofWindow parentWindow,
                 ProofBox parentBox)
Constructs a ProofLine with a formula.

Parameters:
f - the formula of the ProofLine
parentWindow - The window that the ProofLine is in
parentBox - The ProofBox that contains this ProofLine

ProofLine

public ProofLine(Formula f,
                 java.lang.String type,
                 ProofWindow parentWindow,
                 ProofBox parentBox)
Constructs a ProofLine with a Formula and a String which will become the Justification.

Parameters:
f - The formula of the ProofLine
type - The String which will become the justification of the ProofLine
parentWindow - The window that the ProofLine is in
parentBox - The ProofBox that contains this ProofLine

ProofLine

public ProofLine(Formula f,
                 Justification just,
                 ProofWindow parentWindow,
                 ProofBox parentBox)
Constructs a ProofLine with a Formula and a Justification.

Parameters:
f - The formula of the ProofLine
just - The justification of the ProofLine
parentWindow - The window that the ProofLine is in
parentBox - The ProofBox that contains this ProofLine

ProofLine

public ProofLine(Formula f,
                 Justification just,
                 int line,
                 ProofWindow parentWindow,
                 ProofBox parentBox)
Constructs a ProofLine with a Formula, Justification and Line number.

Parameters:
f - The formula of the ProofLine
just - The justification of the ProofLine
line - The line number of the ProofLine
Method Detail

getLineNum

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


setLineNum

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

Parameters:
line - The line number of this ProofLine

recalculateLineNum

public int recalculateLineNum(int line)
Returns the line number for next ProofItem.

Specified by:
recalculateLineNum in class ProofItem
Parameters:
line - The line number of this ProofLine

getFormula

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


setFormula

public void setFormula(Formula f)
Sets the formula

Parameters:
f - formula to set

getJustification

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


setJustification

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

Parameters:
just - 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 comment)
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.


deselectLine

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


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.


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

compareTo

public int compareTo(ProofLine o)
Specified by:
compareTo in interface java.lang.Comparable<ProofLine>