Examples of PrintContext


Examples of apex.jorje.services.printers.PrintContext

            printerFactory, ListPrinter.create(formalParameterPrinter, ", ", "", ""));
    private static OutlineViewPropertyClassMemberPrinter propertyMemberPrinter =
            new OutlineViewPropertyClassMemberPrinter(printerFactory);

    private PrintContext defaultPrintContext() {
        return new PrintContext();
    }
View Full Code Here

Examples of apex.jorje.services.printers.PrintContext

                            @Override
                            public Map<String, Object> _case(RealLoc loc) {
                                try {
                                    Map<String, Object> config = new HashMap<String, Object>();
                                    MarkerUtilities.setMessage(config, PrinterUtil.INSTANCE.getFactory()
                                            .userErrorPrinter().print(apexException.getError(), new PrintContext()));

                                    MarkerUtilities.setCharStart(config,
                                        ParserLocationTranslator.getStartOffset(loc, fDocument));
                                    MarkerUtilities.setCharEnd(config,
                                        ParserLocationTranslator.getEndOffset(loc, fDocument));

                                    config.put(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
                                    config.put(IMarker.LOCATION, fFile.getFullPath().toString());

                                    return config;
                                } catch (BadLocationException e) {
                                    return _default(error);
                                }
                            }

                            @Override
                            public Map<String, Object> _case(SyntheticLoc loc) {
                                return _default(error);
                            }
                        });
                    }

                    /*
                     * Everything else, just put on the first line since we don't have any other information
                     */
                    @Override
                    protected Map<String, Object> _default(SemanticError x) {
                        Map<String, Object> config = new HashMap<String, Object>();

                        MarkerUtilities.setLineNumber(config, 1);
                        // Need to implement the first, currently get a NotImplementedYet exception
                        MarkerUtilities.setMessage(
                            config,
                            PrinterUtil.INSTANCE.getFactory().userErrorPrinter()
                                    .print(apexException.getError(), new PrintContext()));

                        // Not sure why there aren't any utilities methods for these fields in MarkerUtilities
                        // Set them directly instead.
                        config.put(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
                        config.put(IMarker.LOCATION, fFile.getFullPath().toString());
View Full Code Here

Examples of factOrFiction.print.PrintContext

      printerTransform.scale((float) paperDisplayBounds.width
          / (float) paperSize.x, (float) paperDisplayBounds.height
          / (float) paperSize.y);
      printerGC.setTransform(printerTransform);
     
      PrintContext context = new PrintContext( printerGC, getDisplay().getDPI() );

      // get full paper size
      Rectangle pageArea = SWTUtils.getPrintableBounds(printer);
      context.translate( new Point(pageArea.x, pageArea.y));
     
      page.doPrint( context, new Point(pageArea.width, pageArea.height) );

      displayImage = new Image(event.display, printerImage.getImageData());
      event.gc.drawImage(displayImage, dirtyPaperBounds.x, dirtyPaperBounds.y);
View Full Code Here

Examples of uk.ac.bbsrc.tgac.miso.core.service.printing.context.PrintContext

      ServiceLoader<PrintContext> consumerLoader = ServiceLoader.load(PrintContext.class);
      Iterator<PrintContext> consumerIterator = consumerLoader.iterator();

      contextMap = new HashMap<String, PrintContext>();
      while (consumerIterator.hasNext()) {
        PrintContext p = consumerIterator.next();

        if (!contextMap.containsKey(p.getName())) {
          contextMap.put(p.getName(), p);
        }
        else {
          if (contextMap.get(p.getName()) != p) {
            String msg = "Multiple different PrintContexts with the same context name " +
                         "('" + p.getName() + "') are present on the classpath. Context names must be unique.";
            log.error(msg);
            throw new ServiceConfigurationError(msg);
          }
        }
      }
View Full Code Here

Examples of uk.ac.bbsrc.tgac.miso.core.service.printing.context.PrintContext

  }

  public JSONObject getContextFields(HttpSession session, JSONObject json) {
    try {
      if (json.has("contextName") && !json.get("contextName").equals("")) {
        PrintContext p = printManager.getPrintContext(json.getString("contextName"));
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("contextFields", PrintServiceUtils.mapContextFieldsToJSON(p));
        return JSONUtils.JSONObjectResponse(map);
      }
      else {
View Full Code Here

Examples of uk.ac.bbsrc.tgac.miso.core.service.printing.context.PrintContext

      MisoPrintService printService = new DefaultPrintService();
      if ("Custom".equals(json.getString("serviceFor"))) {
        printService = new CustomPrintService();
      }
      printService.setName(json.getString("serviceName"));
      PrintContext pc = printManager.getPrintContext(json.getString("contextName"));
      JSONObject contextFields = JSONObject.fromObject(json.getString("contextFields"));
      PrintServiceUtils.mapJSONToContextFields(contextFields, pc);
      printService.setPrintContext(pc);
      printService.setBarcodableSchema(barcodableSchema);
      printService.setEnabled(true);
View Full Code Here

Examples of uk.ac.bbsrc.tgac.miso.core.service.printing.context.PrintContext

  public JSONObject editPrinterService(HttpSession session, JSONObject json) {
    try {
      if (json.has("serviceName") && !json.get("serviceName").equals("")) {
        MisoPrintService bps = printManager.getPrintService(json.getString("serviceName"));
        if (bps != null) {
          PrintContext pc = bps.getPrintContext();
          JSONObject contextFields = new JSONObject();
          contextFields.put("host", json.getString("host"));
          PrintServiceUtils.mapJSONToContextFields(contextFields, pc);
          bps.setPrintContext(pc);
          printManager.storePrintService(bps);
View Full Code Here

Examples of uk.ac.bbsrc.tgac.miso.core.service.printing.context.PrintContext

  public class MisoPrintServiceMapper implements RowMapper<MisoPrintService> {
    public MisoPrintService mapRow(ResultSet rs, int rowNum) throws SQLException {
      try {
        MisoPrintService printService;

        PrintContext pc = printManager.getPrintContext(rs.getString("contextName"));
        BarcodableSchema barcodableSchema = printManager.getBarcodableSchema(rs.getString("printSchema"));
        if (barcodableSchema !=null){
        barcodableSchema.getBarcodeLabelFactory().setFilesManager(misoFilesManager);
        barcodableSchema.getBarcodeLabelFactory().setSecurityManager(securityManager);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.