本文整理汇总了Java中de.lessvoid.nifty.NiftyEventSubscriber类的典型用法代码示例。如果您正苦于以下问题:Java NiftyEventSubscriber类的具体用法?Java NiftyEventSubscriber怎么用?Java NiftyEventSubscriber使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NiftyEventSubscriber类属于de.lessvoid.nifty包,在下文中一共展示了NiftyEventSubscriber类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onWindowButton
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern="bt.*")
public void onWindowButton(String id, ButtonClickedEvent e) {
String windowId = "wd" + id.substring(2);
for (WindowController wc : windowControllers) {
Window window = wc.getWindow();
if (window.getId().equals(windowId)) {
Element windowElement = window.getElement();
if (windowElement.isVisible()) {
break;
}
// move the selected window to the top layer
windowElement.markForMove(windowElement.getParent());
windowElement.reactivate();
windowElement.startEffect(EffectEventId.onCustom);
windowElement.show();
for (Element elm : windowElement.getElements()) {
// have to do this after markForMove(), otherwise radio button selections
// are not displayed properly
elm.show();
}
break;
}
}
}
开发者ID:dwhuang,项目名称:SMILE,代码行数:26,代码来源:GuiController.java
示例2: onButtonClick
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern = ".*Button")
public void onButtonClick(String id, ButtonClickedEvent e) {
System.out.println("button "+id+" clicked: "+e);
if (runButton == e.getButton()) {
simulation.guiRun();
} else if (stopButton == e.getButton()) {
simulation.guiStop();
} else if (resetButton == e.getButton()) {
simulation.guiReset();
} else if (deleteWaterButton == e.getButton()) {
simulation.guiDeleteWater();
} else if (deleteSourceButton == e.getButton()) {
simulation.guiDeleteRiverSource();
} else if (nextStepButton == e.getButton()) {
simulation.guiNextStep();
}
}
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:18,代码来源:WaterErosionScreenController.java
示例3: onCheckBoxClick
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern = ".*CheckBox")
public void onCheckBoxClick(String id, CheckBoxStateChangedEvent e) {
System.out.println("checkbox "+id+" changed: "+e);
if (e.getCheckBox()==elevationConstraintCheckBox && controlPoint!=null && !disableInput) {
controlPoint.hasElevation = e.isChecked();
sketchTerrain.guiControlPointChanged();
} else if (e.getCheckBox()==addCurveCheckBox && e.isChecked()) {
editCurveCheckBox.setChecked(false);
curveSelected = false;
controlPoint = null;
updatePhase();
sketchTerrain.guiAddCurves();
} else if (e.getCheckBox()==editCurveCheckBox && e.isChecked()) {
addCurveCheckBox.setChecked(false);
updatePhase();
sketchTerrain.guiEditCurves();
} else if (e.getCheckBox()==showCurvesCheckBox) {
sketchTerrain.guiShowCurves(e.isChecked());
}
}
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:21,代码来源:SketchTerrainScreenController.java
示例4: onSliderChange
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern = ".*Slider")
public void onSliderChange(String id, SliderChangedEvent e) {
System.out.println("slider "+id+" changed: "+e);
if (controlPoint==null || disableInput) {
return;
}
if (e.getSlider()==plateauSizeSlider) {
controlPoint.plateau = e.getValue();
} else if (e.getSlider()==slopeSizeLeftSlider) {
controlPoint.extend1 = e.getValue() / SLOPE_SIZE_SCALE;
} else if (e.getSlider()==slopeAngleLeftSlider) {
controlPoint.angle1 = e.getValue() / SLOPE_ANGLE_SCALE;
} else if (e.getSlider()==slopeSizeRightSlider) {
controlPoint.extend2 = e.getValue() / SLOPE_SIZE_SCALE;
} else if (e.getSlider()==slopeAngleRightSlider) {
controlPoint.angle2 = e.getValue() / SLOPE_ANGLE_SCALE;
} else if (e.getSlider()==smoothLeftSlider) {
controlPoint.smooth1 = e.getValue();
} else if (e.getSlider()==smoothRightSlider) {
controlPoint.smooth2 = e.getValue();
}
sketchTerrain.guiControlPointChanged();
}
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:24,代码来源:SketchTerrainScreenController.java
示例5: onButtonClick
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern = ".*Button")
public void onButtonClick(String id, ButtonClickedEvent e) {
System.out.println("button "+id+" clicked");
if (smoothBiomesButton == e.getButton()) {
generator.guiSmoothBiomeBorder();
} else if (distortBiomesButton == e.getButton()) {
generator.guiDistortBiomeBorder();
} else if (recordAddButton == e.getButton()) {
generator.guiRecordingAdd();
} else if (recordDeleteButton == e.getButton()) {
generator.guiRecordingDelete();
} else if (recordDeleteAllButton == e.getButton()) {
generator.guiRecordingDeleteAll();
} else if (recordPlayButton == e.getButton()) {
generator.guiRecordingPlay();
} else if (recordRecordButton == e.getButton()) {
generator.guiRecordingRecord();
}
}
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:20,代码来源:VegetationScreenController.java
示例6: onSliderChanged
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern = ".*slider")
public void onSliderChanged(final String id, final SliderChangedEvent event) {
Tool actualTooL = ToolManager.getActualTool();
switch (id) {
case "sizeslider":
if (event.getValue() < ToolManager.getActualTool().pencil.size) {
ToolManager.getActualTool().pencil.decRadius();
} else if (event.getValue() > ToolManager.getActualTool().pencil.size) {
ToolManager.getActualTool().pencil.incRadius();
}
break;
case "strslider":
ToolManager.getActualTool().pencil.strength = event.getValue();
break;
}
}
开发者ID:methusalah,项目名称:OpenRTS,代码行数:17,代码来源:EditorGUIController.java
示例7: sliderUpdate
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern = ".*Volume")
public void sliderUpdate(String id, SliderChangedEvent e) {
if ("masterVolume".equals(id)) {
masterLabel.getRenderer(TextRenderer.class)
.setText(Integer.toString((int) masterControl.getValue()));
Options.setMasterVolume((int) masterControl.getValue());
} else if ("musicVolume".equals(id)) {
musicLabel.getRenderer(TextRenderer.class)
.setText(Integer.toString((int) musicControl.getValue()));
Options.setMusicVolume((int) musicControl.getValue());
} else {
soundLabel.getRenderer(TextRenderer.class)
.setText(Integer.toString((int) soundControl.getValue()));
Options.setMasterVolume((int) soundControl.getValue());
}
}
开发者ID:oberien,项目名称:Oberien,代码行数:17,代码来源:SettingsScreenController.java
示例8: onMouseDown
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern=".*AnalogPad")
public void onMouseDown(String id, NiftyMousePrimaryClickedEvent e) {
if (e.getElement() != pad) {
return;
}
anchored = true;
anchorX = e.getMouseX();
anchorY = e.getMouseY();
x = anchorX;
y = anchorY;
}
开发者ID:dwhuang,项目名称:SMILE,代码行数:12,代码来源:AnalogPadController.java
示例9: onMouseMove
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern=".*AnalogPad")
public void onMouseMove(String id, NiftyMousePrimaryClickedMovedEvent e) {
if (e.getElement() != pad || !anchored) {
return;
}
x = e.getMouseX();
y = e.getMouseY();
}
开发者ID:dwhuang,项目名称:SMILE,代码行数:9,代码来源:AnalogPadController.java
示例10: onNavAltClicked
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern="(btAscend|btDescend)")
public void onNavAltClicked(String id, NiftyMousePrimaryClickedEvent e) {
if (id.equals("btAscend")) {
altitudeChange = 1;
} else {
altitudeChange = -1;
}
}
开发者ID:dwhuang,项目名称:SMILE,代码行数:9,代码来源:CamNavWindowController.java
示例11: onMenuItem
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern="mnContextMenu")
public void onMenuItem(String id, MyMenuItemActivatedEvent<ContextMenuParam> e) {
if (contextMenuListener != null) {
contextMenuListener.onContextMenu(e.getItemName(), e.getItemUserObject());
}
closeContextMenu();
}
开发者ID:dwhuang,项目名称:SMILE,代码行数:8,代码来源:GuiController.java
示例12: onBtPlaneRotClicked
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern="btPlaneRot(L|R)")
public void onBtPlaneRotClicked(String id, NiftyMousePrimaryClickedEvent e) {
if (e.getElement() == btPlaneRotL.getElement()) {
planeRotDir = 1;
} else if (e.getElement() == btPlaneRotR.getElement()) {
planeRotDir = -1;
}
}
开发者ID:dwhuang,项目名称:SMILE,代码行数:9,代码来源:DemoWindowController.java
示例13: onBtRobotJointClicked
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern="btRobotJoint.?")
public void onBtRobotJointClicked(String id, NiftyMousePrimaryClickedEvent e) {
if (id.equals("btRobotJointL")) {
jointVelocity = 1;
ddRobotJointInd = ddRobotJoint.getSelectedIndex();
} else if (id.equals("btRobotJointR")) {
jointVelocity = -1;
ddRobotJointInd = ddRobotJoint.getSelectedIndex();
}
}
开发者ID:dwhuang,项目名称:SMILE,代码行数:11,代码来源:RobotWindowController.java
示例14: onSliderChange
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern = ".*Slider")
public void onSliderChange(String id, SliderChangedEvent e) {
System.out.println("slider "+id+" changed: "+e);
if (brushSizeSlider==e.getSlider()) {
simulation.guiBrushSizeChanged(e.getValue());
} else if (sourceRadiusSlider == e.getSlider()) {
simulation.guiRiverSourceRadiusChanged(e.getValue());
} else if (sourceIntensitySlider == e.getSlider()) {
simulation.guiRiverSourceIntensityChanged(e.getValue());
}
}
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:12,代码来源:WaterErosionScreenController.java
示例15: onSelectionChange
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern = ".*DropDown")
public void onSelectionChange(String id, DropDownSelectionChangedEvent e) {
System.out.println("dropdown "+id+" changed: "+e.getSelection());
if (upscaleDropDown==e.getDropDown()) {
simulation.guiUpscaleMap(e.getSelectionItemIndex());
}
}
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:8,代码来源:WaterErosionScreenController.java
示例16: onCheckBoxClick
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern = ".*CheckBox")
public void onCheckBoxClick(String id, CheckBoxStateChangedEvent e) {
System.out.println("checkbox "+id+" changed: "+e);
if (elevationCheckBox == e.getCheckBox()) {
generator.guiShowDrawElevation(e.isChecked());
if (e.isChecked()) {
biomesCheckBox.setChecked(false);
temperatureCheckBox.setChecked(false);
moistureCheckBox.setChecked(false);
}
} else if (biomesCheckBox == e.getCheckBox()) {
generator.guiShowBiomes(e.isChecked());
if (e.isChecked()) {
elevationCheckBox.setChecked(false);
temperatureCheckBox.setChecked(false);
moistureCheckBox.setChecked(false);
}
} else if (temperatureCheckBox == e.getCheckBox()) {
generator.guiShowDrawTemperature(e.isChecked());
if (e.isChecked()) {
elevationCheckBox.setChecked(false);
biomesCheckBox.setChecked(false);
moistureCheckBox.setChecked(false);
}
} else if (moistureCheckBox == e.getCheckBox()) {
generator.guiShowDrawMoisture(e.isChecked());
if (e.isChecked()) {
elevationCheckBox.setChecked(false);
biomesCheckBox.setChecked(false);
temperatureCheckBox.setChecked(false);
}
}
}
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:34,代码来源:PolygonalScreenController.java
示例17: onSelectionChange
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern = ".*DropDown")
public void onSelectionChange(String id, DropDownSelectionChangedEvent e) {
System.out.println("dropdown "+id+" changed: "+e.getSelection());
if (pointCountDropDown == e.getDropDown()) {
generator.guiPointCountChanged(pointCountDropDown.getSelection());
} else if (relaxationDropDown == e.getDropDown()) {
generator.guiRelaxationChanged(relaxationDropDown.getSelectedIndex());
} else if (coastlineDropDown == e.getDropDown()) {
generator.guiCoastlineChanged(PolygonalMapGenerator.Coastline.values()[coastlineDropDown.getSelectedIndex()]);
} else if (mapSizeDropDown == e.getDropDown()) {
generator.guiMapSizeChanged(mapSizeDropDown.getSelection());
}
}
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:14,代码来源:PolygonalScreenController.java
示例18: onSeedChange
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern = ".*TextField")
public void onSeedChange(String id, TextFieldChangedEvent e) {
System.out.println("textfield "+id+" changed: "+e.getText());
if (seedTextField==e.getTextFieldControl()) {
generator.guiSeedChanged(e.getText().hashCode());
} else if (mapSeedTextField == e.getTextFieldControl()) {
generator.guiMapSeedChanged(e.getText().hashCode());
}
}
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:10,代码来源:PolygonalScreenController.java
示例19: onButtonClick
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern = ".*Button")
public void onButtonClick(String id, ButtonClickedEvent e) {
System.out.println("button "+id+" clicked: "+e);
if (e.getButton()==solveButton) {
sketchTerrain.guiSolve();
} else if (e.getButton()==stopButton) {
sketchTerrain.guiStopSolve();
} else if (e.getButton()==deleteCurveButton) {
sketchTerrain.guiDeleteCurve();
} else if (e.getButton()==deleteControlPointButton) {
sketchTerrain.guiDeleteControlPoint();
} else if (e.getButton()==nextStepButton) {
sketchTerrain.guiNextStep();
}
}
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:16,代码来源:SketchTerrainScreenController.java
示例20: onSelectionChange
import de.lessvoid.nifty.NiftyEventSubscriber; //导入依赖的package包/类
@NiftyEventSubscriber(pattern = ".*ListBox")
public void onSelectionChange(String id, ListBoxSelectionChangedEvent e) {
System.out.println("list box "+id+" selection changed: "+e);
if (e.getListBox()==presetListBox) {
List<Integer> indices = e.getSelectionIndices();
if (!indices.isEmpty()) {
sketchTerrain.guiPresetChanged(indices.get(0));
}
}
}
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:11,代码来源:SketchTerrainScreenController.java
注:本文中的de.lessvoid.nifty.NiftyEventSubscriber类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论