Ejemplo n.º 1
1
      @Override
      public void visit(PostSynapticSite synapticSite) {

        if (pass != 0) return;

        RealPoint displayPosition = new RealPoint(3);
        viewerTransform.apply(synapticSite.getPosition(), displayPosition);

        setAlpha(displayPosition.getDoublePosition(2));

        final int radius = 10;
        if (synapticSite == controller.getSelectedAnnotation())
          g2d.setPaint(postSynapticSiteColor.brighter().brighter());
        else g2d.setPaint(postSynapticSiteColor);
        g2d.setStroke(new BasicStroke(2.0f));
        g2d.fillOval(
            Math.round(displayPosition.getFloatPosition(0) - radius),
            Math.round(displayPosition.getFloatPosition(1) - radius),
            2 * radius + 1,
            2 * radius + 1);
        g2d.setPaint(postSynapticSiteColor.darker());
        g2d.drawOval(
            Math.round(displayPosition.getFloatPosition(0) - radius),
            Math.round(displayPosition.getFloatPosition(1) - radius),
            2 * radius + 1,
            2 * radius + 1);
      }
Ejemplo n.º 2
0
      @Override
      public void visit(Synapse s) {

        RealPoint displayPosition = new RealPoint(3);
        viewerTransform.apply(s.getPosition(), displayPosition);

        double sx = displayPosition.getDoublePosition(0);
        double sy = displayPosition.getDoublePosition(1);
        double sz = displayPosition.getDoublePosition(2);

        setAlpha(sz);

        if (pass == 1) {

          final int radius = 10;
          if (s == controller.getSelectedAnnotation())
            g2d.setPaint(synapseColor.brighter().brighter());
          else g2d.setPaint(synapseColor);
          g2d.setStroke(new BasicStroke(2.0f));
          g2d.fillOval(
              (int) Math.round(sx - radius),
              (int) Math.round(sy - radius),
              2 * radius + 1,
              2 * radius + 1);
          g2d.setPaint(synapseColor.darker());
          g2d.drawOval(
              (int) Math.round(sx - radius),
              (int) Math.round(sy - radius),
              2 * radius + 1,
              2 * radius + 1);
        }
      }
Ejemplo n.º 3
0
      @Override
      public void visit(Annotation a) {

        if (pass != 2) return;

        RealPoint displayPosition = new RealPoint(3);
        viewerTransform.apply(a.getPosition(), displayPosition);

        double x = displayPosition.getDoublePosition(0);
        double y = displayPosition.getDoublePosition(1);
        double z = displayPosition.getDoublePosition(2);

        g2d.setPaint(Color.white);
        setAlpha(z);
        g2d.drawString(a.getComment(), (int) x, (int) y);
      }
Ejemplo n.º 4
0
      @Override
      public void visit(PreSynapticSite synapticSite) {

        RealPoint displayPosition = new RealPoint(3);
        viewerTransform.apply(synapticSite.getPosition(), displayPosition);

        setAlpha(displayPosition.getDoublePosition(2));

        final int radius = 10;
        if (synapticSite == controller.getSelectedAnnotation())
          g2d.setPaint(preSynapticSiteColor.brighter().brighter());
        else g2d.setPaint(preSynapticSiteColor);
        g2d.setStroke(new BasicStroke(2.0f));
        g2d.fillOval(
            (int) Math.round(displayPosition.getDoublePosition(0) - radius),
            (int) Math.round(displayPosition.getDoublePosition(1) - radius),
            2 * radius + 1,
            2 * radius + 1);
        g2d.setPaint(preSynapticSiteColor.darker());
        g2d.drawOval(
            (int) Math.round(displayPosition.getDoublePosition(0) - radius),
            (int) Math.round(displayPosition.getDoublePosition(1) - radius),
            2 * radius + 1,
            2 * radius + 1);

        if (synapticSite.getPartner() != null) {

          RealPoint siteDisplayPosition = new RealPoint(3);
          viewerTransform.apply(synapticSite.getPartner().getPosition(), siteDisplayPosition);

          double px = siteDisplayPosition.getDoublePosition(0);
          double py = siteDisplayPosition.getDoublePosition(1);

          drawArrow(
              g2d,
              displayPosition.getDoublePosition(0),
              displayPosition.getDoublePosition(1),
              px,
              py,
              pass);
        }
      }