当前位置: 首页>>代码示例>>Java>>正文


Java OnEvent类代码示例

本文整理汇总了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;
        }
    }
}
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:27,代码来源:MainController.java

示例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;
    }
}
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:23,代码来源:VersionCheckDialogController.java

示例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.
}
 
开发者ID:gdx-libs,项目名称:gdx-autumn,代码行数:20,代码来源:ContextInitializer.java

示例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;
    }
}
 
开发者ID:gdx-libs,项目名称:gdx-autumn,代码行数:21,代码来源:ReflectionEventListener.java

示例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;
    }
}
 
开发者ID:gdx-libs,项目名称:gdx-autumn,代码行数:21,代码来源:ReflectionMessageListener.java

示例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.
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:21,代码来源:ContextInitializer.java

示例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;
    }
}
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:11,代码来源:CanvasController.java

示例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;
    }
}
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:11,代码来源:PngFileTypeController.java

示例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;
    }
}
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:11,代码来源:JpegFileTypeController.java

示例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;
    }
}
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:14,代码来源:KtxFileTypeController.java

示例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;
    }
}
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:14,代码来源:PackInputFilesController.java

示例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()))
        );
    }
}
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:8,代码来源:NotificationProducer.java

示例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();
    }
}
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:8,代码来源:ExtensionModulesDialogController.java

示例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));
}
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:10,代码来源:RecentProjectsRepository.java

示例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;
}
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:13,代码来源:InitialUpdateCheckService.java


注:本文中的com.github.czyzby.autumn.annotation.OnEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。