Examples of JsrcFile


Examples of com.confluenity.jaylen.io.JsrcFile

    if (selected == null) {
      return;
    }
    UUID uuid = null;
    try {
      uuid = context.addJsrcFile(new JsrcFile(selected.getFilePath(), "r"));
    } catch (IOException e) {
      logger.error(e.getLocalizedMessage(), e);
    }
    JsrcFile jsrc = context.getJsrcFile(uuid);
    if(jsrc != null) {
      Tree tree = springContext.getBean("objectTree", Tree.class);
      TreeItem treeItem = new TreeItem(tree, SWT.NONE);
      treeItem.setImage(springContext.getBean("treeItemGlyph", Image.class));
      treeItem.setText(new String[] {jsrc.getFileType(), String.valueOf(jsrc.getFrameCount()), String.valueOf(jsrc.getPointCount())});
      treeItem.setData(uuid);
    }

  }
View Full Code Here

Examples of com.confluenity.jaylen.io.JsrcFile

    Canvas.class.cast(owner).addPaintListener(this);
  }

  @Override
  public void paintControl(PaintEvent event) {
    final JsrcFile jsrc = context.getJsrcFile(context.getSelectedFile());
    if(jsrc == null) {
      return;
    }
    Integer f = context.getSelectedFrame(jsrc.getUuid());
    if (f < 0) {
      return;
    }
    Rectangle rectangle = ((Canvas) event.widget).getBounds();
    event.gc.setForeground(event.display.getSystemColor(SWT.COLOR_DARK_GRAY));
    event.gc.drawFocus(5, 5, rectangle.width - 15, rectangle.height - 15);
    try {
      JsrcFile.Frame frame = jsrc.readFrame(f);
      double size = Double.parseDouble(jsrc.getHeader().getItem("size"));
      double halfSize = size*0.5;
      for (JsrcFile.Frame.Particle particle : frame.getParticles()) {
        int x = (int)(((particle.getRx() + halfSize) / size) * (double)(rectangle.width - 20));
        int y = (int)(((halfSize - particle.getRy()) / size) * (double)(rectangle.height - 20));
        event.gc.drawOval(x + 10 - 2, y + 10 - 2, 4, 4);
View Full Code Here

Examples of com.confluenity.jaylen.io.JsrcFile

      case ODS: exportToOds(selected); break;
    }
  }

  private JsrcFile.Frame getFrame() throws IOException {
    final JsrcFile jsrc = context.getJsrcFile(context.getSelectedFile());
    if (jsrc == null) {
      return null;
    }
    return jsrc.readFrame(context.getSelectedFrame(jsrc.getUuid()));
  }
View Full Code Here

Examples of com.confluenity.jaylen.io.JsrcFile

    TreeItem[] selection = Tree.class.cast(owner).getSelection();
    if (selection.length > 0) {
      TreeItem item = selection[0];
      UUID uuid = UUID.class.cast(item.getData());
      context.setSelectedFile(uuid);
      JsrcFile jsrc = context.getJsrcFile(uuid);
      frameScale.setMaximum(jsrc.getFrameCount() - 1);
      dataTable.removeAll();
      {
        TableItem tableItem = new TableItem(dataTable, SWT.NONE);
        tableItem.setText(new String[] {"File name", jsrc.getName()});
      }
      for (String name : jsrc.getHeader().getNames()) {
        TableItem tableItem = new TableItem(dataTable, SWT.NONE);
        tableItem.setText(new String[] {name, jsrc.getHeader().getItem(name)});
      }
      context.setSelectedFrame(jsrc.getUuid(), 0);
      canvas.redraw();
    }
  }
View Full Code Here

Examples of com.confluenity.jaylen.io.JsrcFile

    super(type, owner);
  }

  @Override
  public void handleEvent(Event event) {
    final JsrcFile jsrc = context.getJsrcFile(context.getSelectedFile());
    if(jsrc == null) {
      return;
    }
    context.setSelectedFrame(jsrc.getUuid(), Scale.class.cast(owner).getSelection());
    canvas.redraw();
  }
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.