public ParticleContainer(Editor editor) {
   parent = editor.getContentComponent();
   parent.add(this);
   this.setBounds(parent.getBounds());
   setVisible(true);
   parent.addComponentListener(this);
 }
Пример #2
0
 public void addNotify() {
   super.addNotify();
   scene.addSceneListener(this);
   JComponent viewComponent = scene.getView();
   if (viewComponent == null) {
     viewComponent = scene.createView();
   }
   viewComponent.addComponentListener(this);
   repaint();
 }
Пример #3
0
  public void addEngines() {
    ArrayList<Player> disPlayers = new ArrayList<Player>();
    ArrayList<Player> ordPlayers = new ArrayList<Player>();
    PMS r = PMS.get();

    for (String id : configuration.getEnginesAsList(r.getRegistry())) {
      // boolean matched = false;
      for (Player p : PlayerFactory.getAllPlayers()) {
        if (p.id().equals(id)) {
          ordPlayers.add(p);
          // matched = true;
        }
      }
    }

    for (Player p : PlayerFactory.getAllPlayers()) {
      if (!ordPlayers.contains(p)) {
        ordPlayers.add(p);
        disPlayers.add(p);
      }
    }

    for (Player p : ordPlayers) {
      TreeNodeSettings en = new TreeNodeSettings(p.name(), p, null);
      if (disPlayers.contains(p)) {
        en.setEnable(false);
      }
      JComponent jc = en.getConfigPanel();
      if (jc == null) {
        jc = buildEmpty();
      }
      jc.addComponentListener(
          new ComponentAdapter() {
            @Override
            public void componentShown(ComponentEvent e) {
              handleCardComponentChange(e.getComponent());
            }
          });
      tabbedPane.add(en.id(), jc);
      parent[p.purpose()].add(en);
    }

    for (int i = 0; i < tree.getRowCount(); i++) {
      tree.expandRow(i);
    }

    tree.setSelectionRow(0);
  }