org.problets.domain.view.code.synthesis
Class SynthesisCodeLine

java.lang.Object
  extended by org.problets.domain.line.AbstractLine
      extended by org.problets.domain.line.CodeLine
          extended by org.problets.domain.view.code.synthesis.SynthesisCodeLine
All Implemented Interfaces:
java.lang.Cloneable

public class SynthesisCodeLine
extends CodeLine

Holds one line of code containing synthesis annotations

Since:
2 / 16 / 2008
Author:
Amruth Kumar

Field Summary
 
Fields inherited from class org.problets.domain.line.AbstractLine
UNASSIGNED_LINE
 
Constructor Summary
SynthesisCodeLine(java.lang.String inLineCode, java.lang.String inLineTemplate, int inLineNumber, DomainModel source)
           
 
Method Summary
 void draw(java.awt.Graphics g, int xStart, int xIndent, int yCoord)
          Draws a line of code that involves synthesis code annotations
 java.util.Vector getAllCodeSegmentAttempts()
          Returns CodeSegmentAttempt versions of all code segments in this line to be used to assemble the actual answer in SynthesisCodeModel
 SynthesisCodeSegment getCodeSegment(int xCoord)
          If the xCoord is within the x extent of a SynthesisCodeSegmentView object, returns its corresponding model.
 boolean hasAttempted()
          Returns true if the student has attempted all the code segments on this line
static void main(java.lang.String[] args)
           
 void print()
          Implemnts a base class method Prints all the fields of the class
 
Methods inherited from class org.problets.domain.line.CodeLine
addPrefix, addtoLineObjects, addtoLineObjects, clone, decrementIndentation, getIndentation, getLineCode, getLineObjects, getLineTemplate, getSource, incrementIndentation, initializeIndentation, isOutputStatement, setCode, setIndentation, toString
 
Methods inherited from class org.problets.domain.line.AbstractLine
getLineNumber, setLineNumber
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SynthesisCodeLine

public SynthesisCodeLine(java.lang.String inLineCode,
                         java.lang.String inLineTemplate,
                         int inLineNumber,
                         DomainModel source)
Method Detail

draw

public void draw(java.awt.Graphics g,
                 int xStart,
                 int xIndent,
                 int yCoord)
Draws a line of code that involves synthesis code annotations

Overrides:
draw in class CodeLine
xStart - Starting x coordinate for the line
xIndent - Amount by which code should be indented for each level of indentation Method draws the contents of this codeLine object Although this should ideally be in the view class, we are leaving it here since there is little need for a separate view class.

getCodeSegment

public SynthesisCodeSegment getCodeSegment(int xCoord)
If the xCoord is within the x extent of a SynthesisCodeSegmentView object, returns its corresponding model. Otherwise, returns null


hasAttempted

public boolean hasAttempted()
Returns true if the student has attempted all the code segments on this line


getAllCodeSegmentAttempts

public java.util.Vector getAllCodeSegmentAttempts()
Returns CodeSegmentAttempt versions of all code segments in this line to be used to assemble the actual answer in SynthesisCodeModel


print

public void print()
Implemnts a base class method Prints all the fields of the class

Overrides:
print in class CodeLine

main

public static void main(java.lang.String[] args)