当前位置: 首页>>代码示例>>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;未经允许,请勿转载。