/**
   * Activates the selected control.
   *
   * @param listBox
   */
  private void activateControl() {

    String selectedValue = this.listBox.getValue(this.listBox.getSelectedIndex());

    if (this.oldValue != null) {
      this.clickControls.get(this.oldValue).deactivate();
    }

    Control control = this.clickControls.get(selectedValue);
    control.activate();

    this.oldValue = selectedValue;
  }
예제 #2
0
 public void removeControl(Control control) {
   MapImpl.removeControl(getJSObject(), control.getJSObject());
 }
예제 #3
0
 public Control getControlsByClass(String className) {
   JSObject jsObject = MapImpl.getControlsByClass(getJSObject(), className);
   return Control.narrowToControl(jsObject);
 }
예제 #4
0
  /**
   * APIMethod: getControl
   *
   * <p>Parameters: id - {String} ID of the control to return.
   *
   * <p>Returns: {<OpenLayers.Control>} The control from the map's list of controls which has a
   * matching 'id'. If none found, returns null.
   */
  public Control getControl(String controlID) {
    JSObject jsObject = MapImpl.getControl(getJSObject(), controlID);

    return (jsObject != null) ? Control.narrowToControl(jsObject) : null;
  }
예제 #5
0
 public void addControl(Control control) {
   MapImpl.addControl(getJSObject(), control.getJSObject());
 }