當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。