Ejemplo n.º 1
0
  @Override
  public BlockView getBlockToUnsnap(int x, int y) {
    BlockView rec = _emitBox.getBlockToUnsnap(x - _emitBox.getX(), y - _emitBox.getY());

    if (rec != null) {
      for (Component cinner : rec.getInnerComponents()) {
        removeFromPanel(cinner);

        rec.addToPanel(rec, cinner);
      }
    }

    return rec;
  }
Ejemplo n.º 2
0
  @Override
  public void paintComponent(Graphics g) {
    super.paintComponent(g);
    Graphics2D g2d = (Graphics2D) g.create();

    Point p = getLocation();
    if (getParentBlock() != null) g2d.translate(p.getX(), p.getY());

    _emitBox.paintComponent(g2d);

    g2d.dispose();
  }
Ejemplo n.º 3
0
  @Override
  public void update(Observable o, Object arg) {
    if (isInit()) {
      if (arg != null && (arg instanceof String) && ((String) arg).equals("error")) {
        super.update(o, arg);
      } else if (o instanceof EmitModel
          && arg != null
          && arg instanceof String
          && ((String) arg).equals("updateEmit")) {
        String ev = (String) _dropdown.getSelectedItem();

        if (ev != null) {
          _emitBox.removeMembers();
          ((EmitController) getController())
              .setEvent(getPanel().getClassModel(), getPanel().getAllEvents(), ev);
          _emitBox.makeMembers();
          getPanel().resetPositions();
        }
      }
    }
  }