forked from Coded/SIPRP
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.1 KiB
60 lines
1.1 KiB
package siprp.planoactuacao.print;
|
|
|
|
import java.util.Vector;
|
|
|
|
import org.jdom.Element;
|
|
|
|
public class AreaToPrint
|
|
implements PrintableInterface
|
|
{
|
|
protected String designacao;
|
|
protected Vector<RiscoToPrint> riscos;
|
|
|
|
public AreaToPrint( String designacao, Vector<RiscoToPrint> riscos )
|
|
{
|
|
super();
|
|
this.designacao = designacao;
|
|
this.riscos = riscos;
|
|
}
|
|
|
|
public String getDesignacao()
|
|
{
|
|
return designacao;
|
|
}
|
|
|
|
public void setDesignacao( String designacao )
|
|
{
|
|
this.designacao = designacao;
|
|
}
|
|
|
|
public Vector<RiscoToPrint> getRiscos()
|
|
{
|
|
return riscos;
|
|
}
|
|
|
|
public void setRiscos( Vector<RiscoToPrint> riscos )
|
|
{
|
|
this.riscos = riscos;
|
|
}
|
|
|
|
public void addRisco( RiscoToPrint risco )
|
|
{
|
|
riscos.add( risco );
|
|
}
|
|
|
|
@Override
|
|
public Element toJdomElement() throws Exception
|
|
{
|
|
Element areaElement = new Element( "area" );
|
|
Element designacaoElement = new Element( "designacao" );
|
|
designacaoElement.setText( designacao );
|
|
areaElement.addContent( designacaoElement );
|
|
for( RiscoToPrint risco : riscos )
|
|
{
|
|
areaElement.addContent( risco.toJdomElement() );
|
|
}
|
|
return areaElement;
|
|
}
|
|
|
|
}
|