Exemplo n.º 1
0
  private void creaSeccionEntrada(String urlPublic) {
    Block entradaBlock = withNewBlock();

    EntradaReportStyle style = new EntradaReportStyle();
    BaseTable entradaTable = new BaseTable(style, 2, "11.8cm", "6.1cm");

    entradaTable.withNewRow();

    TableCell cellIzquierda = entradaTable.withNewCell(createEntradaIzquierda(urlPublic));
    cellIzquierda.setPadding("0.3cm");
    cellIzquierda.setPaddingTop("0.0cm");
    cellIzquierda.setBackgroundColor(FONDO_GRIS);

    TableCell cellDerecha = entradaTable.withNewCell(createEntradaDerecha());
    cellDerecha.setPadding("0.3cm");
    cellDerecha.setPaddingTop("0.3cm");
    cellDerecha.setBackgroundColor(FONDO_GRIS);
    cellDerecha.setBorderLeftWidth("0.03cm");
    cellDerecha.setBorderLeftColor("white");
    cellDerecha.setBorderLeftStyle(BorderStyleType.DOTTED);

    TableRow rowAbajo = entradaTable.withNewRow();
    rowAbajo.setBackgroundColor(FONDO_GRIS);
    entradaTable.withNewCell(ResourceProperties.getProperty(locale, "entrada.entradaValida"), "2");

    entradaBlock.getContent().add(entradaTable);
  }
Exemplo n.º 2
0
 private Block createTextParanimf(String fontSize) {
   Block textParanimf = new Block();
   textParanimf
       .getContent()
       .add(ResourceProperties.getProperty(locale, "entrada.nombreLocalizacion"));
   textParanimf.setFontSize(fontSize);
   textParanimf.setFontStyle(FontStyleType.ITALIC);
   return textParanimf;
 }
Exemplo n.º 3
0
  private Block createEntradaDerecha() {
    Block block = new Block();

    block.getContent().add(createEntradaDerechaArriba());
    block.getContent().add(createEntradaDerechaCentro());
    block.getContent().add(createEntradaDerechaAbajo());

    return block;
  }
Exemplo n.º 4
0
  private Block createBarcode(String urlPublic) {
    ExternalGraphic externalGraphic = new ExternalGraphic();
    externalGraphic.setSrc(urlPublic + "/rest/barcode/" + this.barcode);

    Block blockCodebar = new Block();
    blockCodebar.getContent().add(externalGraphic);

    return blockCodebar;
  }
Exemplo n.º 5
0
  private Block createEntradaIzquierda(String urlPublic) {
    Block block = new Block();

    block.getContent().add(createEntradaIzquierdaArriba());
    block.getContent().add(createEntradaIzquierdaCentro());
    block.getContent().add(createEntradaIzquierdaAbajo(urlPublic));

    return block;
  }
Exemplo n.º 6
0
  public Block creaHorizontalLine() {
    Leader line = new Leader();
    line.setColor(GRIS_OSCURO);
    line.setBorderAfterStyle(BorderStyleType.DASHED);
    line.setLeaderLengthOptimum("100%");

    Block b = new Block();
    b.getContent().add(line);

    return b;
  }
Exemplo n.º 7
0
  private void creaSeccionPublicidad() {
    if (existeImagen(this.urlPublicidad)) {
      Block publicidadBlock = withNewBlock();

      publicidadBlock.setMarginTop("0.3cm");

      ExternalGraphic externalGraphic = new ExternalGraphic();
      externalGraphic.setSrc(this.urlPublicidad);

      publicidadBlock.getContent().add(externalGraphic);
    }
  }
Exemplo n.º 8
0
  private Block createEntradaIzquierdaCentroFoto() {
    Block block = new Block();

    ExternalGraphic externalGraphic = new ExternalGraphic();

    if (existeImagen(this.urlPortada)) externalGraphic.setSrc(this.urlPortada);

    externalGraphic.setContentWidth("2.5cm");
    externalGraphic.setMaxWidth("2.5cm");
    block.getContent().add(externalGraphic);
    return block;
  }
Exemplo n.º 9
0
  public void generaPaginaButaca(EntradaModelReport entrada, String urlPublic) {
    this.setFila(entrada.getFila());
    this.setNumero(entrada.getNumero());
    this.setZona(entrada.getZona());
    this.setTotal(entrada.getTotal());
    this.setBarcode(entrada.getBarcode());

    creaSeccionEntrada(urlPublic);
    add(creaHorizontalLine());

    creaSeccionCondiciones(entrada.getTarifaDefecto());
    creaSeccionPublicidad();

    Block pageBreak = withNewBlock();
    pageBreak.setPageBreakAfter(PageBreakAfterType.ALWAYS);
  }
Exemplo n.º 10
0
  private Block createEntradaIzquierdaCentroDatos() {
    Block block = new Block();

    BaseTable table = new BaseTable(new EntradaReportStyle(), 3, "2.5cm", "1.8cm", "2.1cm");

    Block titulo = new Block();
    titulo.setFontSize("14pt");
    titulo.setFontStyle(FontStyleType.ITALIC);
    titulo.getContent().add(this.titulo);
    titulo.setMarginBottom("0.2cm");

    table.withNewRow();
    table.withNewCell(titulo, "3");

    table.withNewRow();
    table.withNewCell(ResourceProperties.getProperty(locale, "entrada.fecha"));
    table.withNewCell(ResourceProperties.getProperty(locale, "entrada.hora"));
    table.withNewCell(ResourceProperties.getProperty(locale, "entrada.apertura"));

    table.withNewRow();
    table.withNewCell(this.fecha);
    table.withNewCell(this.hora);
    table.withNewCell(this.horaApertura);

    table.withNewRow();
    TableCell cell = table.withNewCell(ResourceProperties.getProperty(locale, "entrada.zona"), "3");
    cell.setPaddingTop("0.2cm");

    Block zona = new Block();
    zona.getContent().add(this.zona);
    zona.setFontSize("12pt");

    table.withNewRow();
    table.withNewCell(zona, "3");

    if (this.fila != null && this.numero != null) {
      table.withNewRow();
      table.withNewCell(
          ResourceProperties.getProperty(locale, "entrada.butaca", this.fila, this.numero), "3");
    }

    block.getContent().add(table);

    return block;
  }
Exemplo n.º 11
0
  private BaseTable createEntradaDerechaCentro() {
    BaseTable table = new BaseTable(new EntradaReportStyle(), 2, "2.5cm", "2.5cm");

    String margin = "0.3cm";
    table.setMarginTop("0.5cm");
    table.setMarginBottom(margin);
    table.setMarginLeft(margin);
    table.setMarginRight(margin);

    table.setBackgroundColor(FONDO_BLANCO);

    Block titulo = new Block();
    titulo.setFontSize("14pt");
    titulo.setFontStyle(FontStyleType.ITALIC);
    titulo.getContent().add(this.titulo);
    titulo.setMarginBottom("0.2cm");

    table.withNewRow();
    TableCell tituloCell = table.withNewCell(titulo, "2");
    tituloCell.setPaddingTop("0.2cm");

    table.withNewRow();
    table.withNewCell(ResourceProperties.getProperty(locale, "entrada.fecha"));
    table.withNewCell(ResourceProperties.getProperty(locale, "entrada.hora"));

    table.withNewRow();
    table.withNewCell(this.fecha);
    table.withNewCell(this.hora);

    table.withNewRow();
    TableCell aperturaCell =
        table.withNewCell(ResourceProperties.getProperty(locale, "entrada.apertura"), "2");
    aperturaCell.setPaddingTop("0.2cm");

    table.withNewRow();
    table.withNewCell(this.horaApertura, "2");

    table.withNewRow();
    TableCell cell = table.withNewCell(ResourceProperties.getProperty(locale, "entrada.zona"), "2");
    cell.setPaddingTop("0.2cm");

    Block zona = new Block();
    zona.getContent().add(this.zona);
    zona.setFontSize("12pt");

    table.withNewRow();
    TableCell zonaCell = table.withNewCell(zona, "2");

    if (this.fila != null && this.numero != null) {
      table.withNewRow();
      TableCell butacaCell =
          table.withNewCell(
              ResourceProperties.getProperty(locale, "entrada.butaca", this.fila, this.numero),
              "2");
      butacaCell.setPaddingBottom("0.2cm");
    } else {
      zonaCell.setPaddingBottom("0.2cm");
    }

    return table;
  }
Exemplo n.º 12
0
  private void creaSeccionCondiciones(Boolean isTarifaDefecto) {
    if (isTarifaDefecto == null) isTarifaDefecto = false;
    String puntos = "";
    Block block = new Block();
    Block condicionesBlock = withNewBlock();
    condicionesBlock.setMarginTop("0.3cm");

    block.setFontSize("8pt");
    block.setColor(GRIS_OSCURO);
    block.setFontWeight("bold");
    block.setMarginBottom("0.2em");
    block.getContent().add(ResourceProperties.getProperty(locale, "entrada.condiciones"));
    condicionesBlock.getContent().add(block);

    block = new Block();
    block.setLinefeedTreatment(LinefeedTreatmentType.PRESERVE);
    block.setFontSize("8pt");
    block.setColor(GRIS_OSCURO);
    block.setMarginBottom("0.2em");

    if (!isTarifaDefecto) {
      block.setBackgroundImage("/etc/uji/par/imagenes/entrada_descuento.png");
      block.setBackgroundRepeat(BackgroundRepeatType.NO_REPEAT);
      block.setBackgroundPositionVertical("35%");
    }

    for (int i = 1; i <= 10; i++)
      puntos += ResourceProperties.getProperty(locale, String.format("entrada.condicion%d", i));

    block.getContent().add(puntos);
    condicionesBlock.getContent().add(block);
  }