本文整理汇总了Java中com.github.czyzby.autumn.annotation.OnEvent类的典型用法代码示例。如果您正苦于以下问题:Java OnEvent类的具体用法?Java OnEvent怎么用?Java OnEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OnEvent类属于com.github.czyzby.autumn.annotation包,在下文中一共展示了OnEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onEvent
import com.github.czyzby.autumn.annotation.OnEvent; //导入依赖的package包/类
@OnEvent(PackPropertyChangedEvent.class) void onEvent(PackPropertyChangedEvent event) {
if (initialized) {
switch (event.getProperty()) {
case NAME:
case SCALE_FACTORS:
if (event.getPack() == getSelectedPack()) {
updateViewsFromPack(event.getPack());
}
break;
case OUTPUT:
if (event.getPack() == getSelectedPack()) {
actorsPacks.edtOutputDir.setProgrammaticChangeEvents(false);
actorsPacks.edtOutputDir.setText(event.getPack().getOutputDir());
actorsPacks.edtOutputDir.setProgrammaticChangeEvents(true);
}
break;
case FILENAME:
if (event.getPack() == getSelectedPack()) {
actorsPacks.edtFileName.setProgrammaticChangeEvents(false);
actorsPacks.edtFileName.setText(event.getPack().getFilename());
actorsPacks.edtFileName.setProgrammaticChangeEvents(true);
}
break;
}
}
}
示例2: onEvent
import com.github.czyzby.autumn.annotation.OnEvent; //导入依赖的package包/类
@OnEvent(VersionUpdateCheckEvent.class) void onEvent(VersionUpdateCheckEvent event) {
if (dialog == null) return;
switch (event.getAction()) {
case CHECK_STARTED:
showGroup(groupChecking);
break;
case CHECK_FINISHED:
break;
case FINISHED_ERROR:
showGroup(groupError);
break;
case FINISHED_UP_TO_DATE:
showGroup(groupUpToDate);
break;
case FINISHED_UPDATE_AVAILABLE:
showGroup(groupUpdateDetails);
latestVersion = event.getLatestVersion();
fillUpdateDetailsGroup(latestVersion);
break;
}
}
示例3: ContextInitializer
import com.github.czyzby.autumn.annotation.OnEvent; //导入依赖的package包/类
/** Creates a new context initializer with default annotation processors. */
public ContextInitializer() {
// Default annotations:
scannedMetaAnnotations.add(Processor.class);
scannedMetaAnnotations.add(Provider.class);
scannedAnnotations.add(Component.class);
scannedAnnotations.add(Dispose.class);
scannedAnnotations.add(OnEvent.class);
scannedAnnotations.add(OnMessage.class);
// Default processors:
addProcessor(new MetaAnnotationProcessor()); // Registers annotation processors.
addProcessor(new ProviderAnnotationProcessor()); // Registers dependency providers.
addProcessor(new InjectAnnotationProcessor()); // Injects field dependencies.
addProcessor(new InitiateAnnotationProcessor()); // Invokes initiation methods.
addProcessor(new DestroyAnnotationProcessor()); // Schedules destruction methods upon disposing.
addProcessor(new DisposeAnnotationProcessor()); // Schedules disposing of fields and components.
addProcessor(new EventDispatcher()); // Registers event listeners. Allows to post events.
addProcessor(new MessageDispatcher()); // Registers message listeners. Allows to post messages.
}
示例4: processEvent
import com.github.czyzby.autumn.annotation.OnEvent; //导入依赖的package包/类
@Override
public boolean processEvent(final Object event) {
replaceParameters(event);
try {
final Object result = invoke();
if (removeAfterInvocation) {
return OnEvent.REMOVE;
} else if (result instanceof Boolean) {
return ((Boolean) result).booleanValue();
}
return OnEvent.KEEP;
} catch (final Exception exception) {
if (strict) {
// Gdx applications seem to ignore exceptions in posted runnables. This is bad.
Gdx.app.error("ERROR", "Exception occured on event listener.", exception);
throw new GdxRuntimeException("Unable to invoke event listener.", exception);
}
return OnEvent.KEEP;
}
}
示例5: processMessage
import com.github.czyzby.autumn.annotation.OnEvent; //导入依赖的package包/类
@Override
public boolean processMessage() {
replaceParameters();
try {
final Object result = invoke();
if (removeAfterInvocation) {
return OnEvent.REMOVE;
} else if (result instanceof Boolean) {
return ((Boolean) result).booleanValue();
}
return OnEvent.KEEP;
} catch (final Exception exception) {
if (strict) {
// Gdx applications seem to ignore exceptions in posted runnables. This is bad.
Gdx.app.error("ERROR", "Exception occured on message listener.", exception);
throw new GdxRuntimeException("Unable to invoke message listener.", exception);
}
return OnEvent.KEEP;
}
}
示例6: ContextInitializer
import com.github.czyzby.autumn.annotation.OnEvent; //导入依赖的package包/类
/** Creates a new context initializer with default annotation processors. */
public ContextInitializer() {
// Default annotations:
scannedMetaAnnotations.add(Processor.class);
scannedMetaAnnotations.add(Provider.class);
scannedAnnotations.add(Component.class);
scannedAnnotations.add(Dispose.class);
scannedAnnotations.add(OnEvent.class);
scannedAnnotations.add(OnMessage.class);
// Default processors:
addProcessor(new ComponentAnnotationProcessor()); // Maps components by interfaces.
addProcessor(new MetaAnnotationProcessor()); // Registers annotation processors.
addProcessor(new ProviderAnnotationProcessor()); // Registers dependency providers.
addProcessor(new InjectAnnotationProcessor()); // Injects field dependencies.
addProcessor(new InitiateAnnotationProcessor()); // Invokes initiation methods.
addProcessor(new DestroyAnnotationProcessor()); // Schedules destruction methods upon disposing.
addProcessor(new DisposeAnnotationProcessor()); // Schedules disposing of fields and components.
addProcessor(new EventDispatcher()); // Registers event listeners. Allows to post events.
addProcessor(new MessageDispatcher()); // Registers message listeners. Allows to post messages.
}
示例7: onEvent
import com.github.czyzby.autumn.annotation.OnEvent; //导入依赖的package包/类
@OnEvent(ProjectPropertyChangedEvent.class) void onEvent(ProjectPropertyChangedEvent event) {
if (canvas == null) return;
switch (event.getProperty()) {
case SELECTED_PACK:
currentPack = event.getProject().getSelectedPack();
canvas.reloadPack(currentPack);
break;
}
}
示例8: onEvent
import com.github.czyzby.autumn.annotation.OnEvent; //导入依赖的package包/类
@OnEvent(FileTypePropertyChangedEvent.class) void onEvent(FileTypePropertyChangedEvent event) {
switch (event.getProperty()) {
case PNG_ENCODING:
updateEncoding();
break;
case PNG_COMPRESSION:
updateCompression();
break;
}
}
示例9: onEvent
import com.github.czyzby.autumn.annotation.OnEvent; //导入依赖的package包/类
@OnEvent(FileTypePropertyChangedEvent.class) void onEvent(FileTypePropertyChangedEvent event) {
switch (event.getProperty()) {
case JPEG_ENCODING:
updateEncoding();
break;
case JPEG_QUALITY:
updateQuality();
break;
}
}
示例10: onEvent
import com.github.czyzby.autumn.annotation.OnEvent; //导入依赖的package包/类
@OnEvent(FileTypePropertyChangedEvent.class) void onEvent(FileTypePropertyChangedEvent event) {
switch (event.getProperty()) {
case KTX_FORMAT:
updateFormat();
break;
case KTX_ENCODING:
updateEncoding();
break;
case KTX_ZIPPING:
updateZipping();
break;
}
}
示例11: onEvent
import com.github.czyzby.autumn.annotation.OnEvent; //导入依赖的package包/类
@OnEvent(PackPropertyChangedEvent.class) void onEvent(PackPropertyChangedEvent event) {
if (getSelectedPack() != event.getPack()) return;
switch (event.getProperty()) {
case INPUT_FILE_ADDED:
listAdapter.add(event.getInputFile());
updateButtonsState();
break;
case INPUT_FILE_REMOVED:
listAdapter.removeValue(event.getInputFile(), true);
updateButtonsState();
break;
}
}
示例12: onEvent
import com.github.czyzby.autumn.annotation.OnEvent; //导入依赖的package包/类
@OnEvent(ProjectSerializerEvent.class) void onEvent(ProjectSerializerEvent event) {
if (event.getAction() == ProjectSerializerEvent.Action.SAVED) {
eventDispatcher.postEvent(new ShowToastEvent()
.message(getString("toastProjectSaved", event.getFile().path()))
);
}
}
示例13: onEvent
import com.github.czyzby.autumn.annotation.OnEvent; //导入依赖的package包/类
@OnEvent(ExtensionModuleStatusChangedEvent.class) void onEvent(ExtensionModuleStatusChangedEvent event) {
ExtensionModuleController moduleController = event.getModuleController();
ModuleViewHolder moduleViewHolder = moduleViewHolders.get(moduleController.getModuleId());
if (moduleViewHolder != null) {
moduleViewHolder.updateFromController();
}
}
示例14: onProjectSerializerEvent
import com.github.czyzby.autumn.annotation.OnEvent; //导入依赖的package包/类
@OnEvent(value = ProjectSerializerEvent.class) void onProjectSerializerEvent(ProjectSerializerEvent event) {
FileHandle file = event.getFile();
recentProjects.removeValue(file, false);
recentProjects.insert(0, file);
saveData();
eventDispatcher.postEvent(new RecentProjectsUpdatedEvent(recentProjects));
}
示例15: onEvent
import com.github.czyzby.autumn.annotation.OnEvent; //导入依赖的package包/类
@OnEvent(VersionUpdateCheckEvent.class) boolean onEvent(VersionUpdateCheckEvent event) {
switch (event.getAction()) {
case FINISHED_ERROR:
case FINISHED_UP_TO_DATE:
// Everything appears to be fine, stop listening for updates
return OnEvent.REMOVE;
case FINISHED_UPDATE_AVAILABLE:
showUpdateNotification(event.getLatestVersion());
return OnEvent.REMOVE;
}
return OnEvent.KEEP;
}