protected String prepareUrlForExport() {
   StringBuilder sb =
       new StringBuilder(256)
           .append("exported/")
           .append(prepareNameForURL(diagram.getName()))
           .append(".zip?")
           .append(getURLPartToAvoidCaching());
   DiagramServiceServlet.addParameter(sb, InputParameter.DiagramKey.getName(), diagram.getKey());
   return sb.toString();
 }
  public void printCanvasFrame(ServletInput input) throws JAXBException, IOException {
    final ApplicationState state = input.getState();
    final HtmlWriter writer = new HtmlWriter(input.getResponse().getWriter());

    final String diagramKey = "'" + diagram.getKey() + "'";

    Img img = new FrameServlet.Image(diagram, null, "frameImage", ID_IMAGE_MAP);
    img.setOnMouseOver("hideCaret()");

    Tr tr = new Tr();

    Td td = new Td();
    td.add(img);

    final DiagramImageMap map = DiagramImageMap.create(state);

    td.add(map);
    tr.add(td);

    SectionHeader header = createToolbar(state, diagram, diagramKey);
    Td headerTd = new Td();
    headerTd.setStyle("vertical-align:top");
    headerTd.add(header);
    tr.add(headerTd);

    Table table = new Table();
    table.add(tr);

    writer.write(table);
  }
示例#3
0
  protected DiagramImageMap(Diagram diagram) {
    super();
    this.diagram = diagram;
    setName(ID_IMAGE_MAP);
    setId(ID_IMAGE_MAP);

    final Collection<Block> blocks = diagram.getBlocks();
    if (null != blocks) {
      for (final Block block : blocks) {
        if (null != block) {
          addForBlock(block);
        }
      }
    }
    final Collection<Link> links = diagram.getLinks();
    if (null != links) {
      for (final Link link : links) {
        if (null != link) {
          addForLink(link);
        }
      }
    }
  }