protected PickedObject getCurrentSelection() {
    if (this.sceneController == null) return null;

    PickedObjectList pol = this.getSceneController().getPickedObjectList();
    if (pol == null || pol.size() < 1) return null;

    PickedObject top = pol.getTopPickedObject();
    return top.isTerrain() ? null : top;
  }
Exemplo n.º 2
0
  public PickedObject resolvePick(DrawContext dc, java.awt.Point pickPoint, Layer layer) {
    PickedObject pickedObject = this.getTopObject(dc, pickPoint);
    if (pickedObject != null) {
      if (layer != null) pickedObject.setParentLayer(layer);

      dc.addPickedObject(pickedObject);
    }

    this.clearPickList();

    return pickedObject;
  }
  public Position getCurrentPosition() {
    if (this.sceneController == null) return null;

    PickedObjectList pol = this.getSceneController().getPickedObjectList();
    if (pol == null || pol.size() < 1) return null;

    Position p = null;
    PickedObject top = pol.getTopPickedObject();
    if (top != null && top.hasPosition()) p = top.getPosition();
    else if (pol.getTerrainObject() != null) p = pol.getTerrainObject().getPosition();

    return p;
  }
Exemplo n.º 4
0
 public void addPickableObject(PickedObject po) {
   this.getPickableObjects().put(po.getColorCode(), po);
 }