當前位置: 首頁>>代碼示例>>Java>>正文


Java ChangeListener.ChangeEvent方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java ChangeListener.ChangeEvent方法的具體用法?Java ChangeListener.ChangeEvent怎麽用?Java ChangeListener.ChangeEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.scenes.scene2d.utils.ChangeListener的用法示例。


在下文中一共展示了ChangeListener.ChangeEvent方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addSlider

import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //導入方法依賴的package包/類
public Slider addSlider(final int min, final int max, final float x, final float y) {
  Slider _xblockexpression = null;
  {
    final Slider slider = this.addSliderWithoutLabel(min, max, x, y);
    final Label label = this.addLabel((x + 150), (y + 5), ("" + Integer.valueOf(min)));
    final Procedure2<ChangeListener.ChangeEvent, Actor> _function = new Procedure2<ChangeListener.ChangeEvent, Actor>() {
      @Override
      public void apply(final ChangeListener.ChangeEvent $0, final Actor $1) {
        float _value = slider.getValue();
        int _intValue = Float.valueOf(_value).intValue();
        String _plus = ("" + Integer.valueOf(_intValue));
        label.setText(_plus);
      }
    };
    MyChangeListener _myChangeListener = new MyChangeListener(_function);
    slider.addListener(_myChangeListener);
    _xblockexpression = slider;
  }
  return _xblockexpression;
}
 
開發者ID:CymricNPG,項目名稱:abattle,代碼行數:21,代碼來源:Widgets.java

示例2: fire

import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //導入方法依賴的package包/類
@Override
public boolean fire(Event event) {
    if (event instanceof ChangeListener.ChangeEvent) {
        if (changeConditions.isSatisfied()) {

            for (Invokable invokeEffect_: invokeEffects) {
                invokeEffect_.invoke();
            }
            
            return super.fire(event);
        } else return false;
    } 
    
    else {
        return super.fire(event);
    }
}
 
開發者ID:kibertoad,項目名稱:swampmachine,代碼行數:18,代碼來源:SwampTextButton.java

示例3: changed

import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //導入方法依賴的package包/類
@Override
public void changed(ChangeListener.ChangeEvent event, Actor actor) {
    main.getDialogFactory().showDialogColorPicker((Color) previewProperties.get("bgcolor"), new DialogColorPicker.ColorListener() {
        @Override
        public void selected(Color color) {
            if (color != null) {
                browseField.getTextButton().setText((int) (color.r * 255) + "," + (int) (color.g * 255) + "," + (int) (color.b * 255) + "," + (int) (color.a * 255));
                previewProperties.put("bgcolor", color);
                previewBgColor.set(color);
                refreshPreview();
            }
        }
    });
}
 
開發者ID:raeleus,項目名稱:skin-composer,代碼行數:15,代碼來源:RootTable.java

示例4: draw

import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //導入方法依賴的package包/類
@Override public void draw(Batch batch, float parentAlpha) {
    effect.setPosition(getX(), getY());
    Color c = getColor();
    batch.setColor(c.r, c.g, c.b, c.a * parentAlpha);
    effect.draw(batch, Gdx.graphics.getDeltaTime());
    if (effect.isComplete()) {
        ChangeListener.ChangeEvent event = Pools.obtain(ChangeListener.ChangeEvent.class);
        fire(event);
        Pools.free(event);
    }
}
 
開發者ID:ratrecommends,項目名稱:dice-heroes,代碼行數:12,代碼來源:ParticleActor.java

示例5: fire

import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //導入方法依賴的package包/類
@Override
public boolean fire(Event event) {
    if (event instanceof ChangeListener.ChangeEvent) {
        for (Invokable invokeEffect_ : invokeEffects) {
            invokeEffect_.invoke();
        }
        return super.fire(event);
    }
    else {
        return super.fire(event);
    }
}
 
開發者ID:kibertoad,項目名稱:swampmachine,代碼行數:13,代碼來源:SwampImageButton.java

示例6: changed

import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //導入方法依賴的package包/類
@Override
public void changed(ChangeListener.ChangeEvent ev, Actor a) {
    if (a == btnPAP) {
        selectMap(false);
    } else if (a == btnOnline) {
    } else if (a == btnSettings) {
        manager.setScreen(new SettingsScreen(manager));
    } else if (a == btnAbout) {
        dialogInfo.show(stage);
    }
}
 
開發者ID:NaikSoftware,項目名稱:SaveUA,代碼行數:12,代碼來源:GdxMenu.java

示例7: calculatePositionAndValue

import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //導入方法依賴的package包/類
void calculatePositionAndValue (float x, float y, boolean isTouchUp) {
    float oldPositionX = knobPosition.x;
    float oldPositionY = knobPosition.y;
    float oldPercentX = knobPercent.x;
    float oldPercentY = knobPercent.y;
    float centerX = knobBounds.x;
    float centerY = knobBounds.y;
    knobPosition.set(centerX, centerY);
    knobPercent.set(0f, 0f);
    if (!isTouchUp) {
        if (!deadzoneBounds.contains(x, y)) {
            knobPercent.set((x - centerX) / knobBounds.radius, (y - centerY) / knobBounds.radius);
            float length = knobPercent.len();
            if (length > 1) knobPercent.scl(1 / length);
            if (knobBounds.contains(x, y)) {
                knobPosition.set(x, y);
            } else {
                knobPosition.set(knobPercent).nor().scl(knobBounds.radius).add(knobBounds.x, knobBounds.y);
            }
        }
    }
    if (oldPercentX != knobPercent.x || oldPercentY != knobPercent.y) {
        ChangeListener.ChangeEvent changeEvent = Pools.obtain(ChangeListener.ChangeEvent.class);
        if (fire(changeEvent)) {
            knobPercent.set(oldPercentX, oldPercentY);
            knobPosition.set(oldPositionX, oldPositionY);
        }
        Pools.free(changeEvent);
    }
}
 
開發者ID:neuroradiology,項目名稱:TinyVoxel,代碼行數:31,代碼來源:CustomTouchPad.java

示例8: notifyValueChanged

import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //導入方法依賴的package包/類
/**
 * Called by {@link SpinnerModel}. Notifies when underlying model value has changed and spinner text field must updated.
 * Typically there is no need to call this method manually.
 * @param fireEvent if true then {@link ChangeListener.ChangeEvent} will be fired
 */
public void notifyValueChanged (boolean fireEvent) {
	VisValidatableTextField textField = getTextField();
	int cursor = textField.getCursorPosition();
	textField.setCursorPosition(0);
	textField.setText(model.getText());
	textField.setCursorPosition(cursor);

	if (fireEvent) {
		ChangeListener.ChangeEvent changeEvent = Pools.obtain(ChangeListener.ChangeEvent.class);
		fire(changeEvent);
		Pools.free(changeEvent);
	}
}
 
開發者ID:kotcrab,項目名稱:vis-editor,代碼行數:19,代碼來源:Spinner.java

示例9: changed

import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //導入方法依賴的package包/類
@Override
public void changed(ChangeListener.ChangeEvent ev, Actor a) {
}
 
開發者ID:NaikSoftware,項目名稱:SaveUA,代碼行數:4,代碼來源:GameScreen.java

示例10: fireChangeEvent

import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //導入方法依賴的package包/類
void fireChangeEvent() {
    ChangeListener.ChangeEvent changeEvent = Pools.obtain(ChangeListener.ChangeEvent.class);
    fire(changeEvent);
    Pools.free(changeEvent);
}
 
開發者ID:langurmonkey,項目名稱:gaiasky,代碼行數:6,代碼來源:MenuItem.java

示例11: fireChangeEvent

import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; //導入方法依賴的package包/類
void fireChangeEvent () {
	ChangeListener.ChangeEvent changeEvent = Pools.obtain(ChangeListener.ChangeEvent.class);
	fire(changeEvent);
	Pools.free(changeEvent);
}
 
開發者ID:kotcrab,項目名稱:vis-editor,代碼行數:6,代碼來源:MenuItem.java


注:本文中的com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。