SysMO-DB/seek

View on GitHub
lib/seek/image_file_dictionary.rb

Summary

Maintainability
B
6 hrs
Test Coverage
module Seek
  # a means to lookup the configured icon image filename for a given key
  class ImageFileDictionary
    include Singleton

    def initialize
      @dictionary = dictionary_definition
    end

    def image_filename_for_key(key)
      @dictionary[key.to_sym]
    end

    private

    def dictionary_definition
      # in the future this could be moved out to a file
      { refresh: 'famfamfam_silk/arrow_refresh_small.png',
        arrow_up: 'famfamfam_silk/arrow_up.png',
        arrow_down: 'famfamfam_silk/arrow_down.png',
        arrow_right: 'famfamfam_silk/arrow_right.png',
        next: 'famfamfam_silk/arrow_right.png',
        arrow_left: 'famfamfam_silk/arrow_left.png',
        back: 'famfamfam_silk/arrow_left.png',
        arrow_down_small: 'misc_icons/arrow_down_small.png',
        bioportal_logo: 'logos/bioportal_logo.png',
        new: 'famfamfam_silk/add.png',
        add: 'famfamfam_silk/add.png',
        multi_add: 'famfamfam_silk/table_add.png',
        download: 'crystal_project/16x16/actions/build.png',
        big_download: 'crystal_project/32x32/actions/build.png',
        show: 'famfamfam_silk/zoom.png',
        zoom_in: 'famfamfam_silk/zoom_in.png',
        zoom_out: 'famfamfam_silk/zoom_out.png',
        copy: 'famfamfam_silk/page_copy.png',
        edit: 'famfamfam_silk/page_white_edit.png',
        edit_off: 'stop_edit.png',
        manage: 'famfamfam_silk/wrench.png',
        destroy: 'famfamfam_silk/cross.png',
        tag: 'famfamfam_silk/tag_blue.png',
        favourite: 'famfamfam_silk/star.png',
        comment: 'famfamfam_silk/comment.png',
        comments: 'famfamfam_silk/comments.png',
        info: 'famfamfam_silk/information.png',
        help: 'famfamfam_silk/help.png',
        confirm: 'famfamfam_silk/accept.png',
        reject: 'famfamfam_silk/cancel.png',
        user: 'famfamfam_silk/user.png',
        person: 'famfamfam_silk/user.png',
        avatar: 'famfamfam_silk/picture.png',
        avatars: 'famfamfam_silk/photos.png',
        save: 'famfamfam_silk/disk.png',
        message: 'famfamfam_silk/email.png',
        message_read: 'famfamfam_silk/email_open.png',
        reply: 'famfamfam_silk/email_go.png',
        message_delete: 'famfamfam_silk/email_delete.png',
        messages_outbox: 'famfamfam_silk/email_go.png',
        file: 'redmond_studio/documents_16.png',
        logout: 'famfamfam_silk/door_out.png',
        login: 'famfamfam_silk/door_in.png',
        picture: 'famfamfam_silk/picture.png',
        pictures: 'famfamfam_silk/photos.png',
        profile: 'famfamfam_silk/user_suit.png',
        history: 'famfamfam_silk/time.png',
        news: 'famfamfam_silk/newspaper.png',
        announcement: 'famfamfam_silk/transmit.png',
        denied: 'famfamfam_silk/exclamation.png',
        institution: 'famfamfam_silk/house.png',
        project: 'famfamfam_silk/report.png',
        tick: 'crystal_project/22x22/apps/clean.png',
        lock: 'famfamfam_silk/lock.png',
        open: 'famfamfam_silk/lock_open.png',
        no_user: 'famfamfam_silk/link_break.png',
        sop: 'famfamfam_silk/page.png',
        sops: 'famfamfam_silk/page_copy.png',
        model: 'crystal_project/32x32/apps/kformula.png',
        models: 'crystal_project/64x64/apps/kformula.png',
        data_file: 'famfamfam_silk/database.png',
        data_files: 'famfamfam_silk/database.png',
        study: 'famfamfam_silk/page.png',
        test: 'crystal_project/16x16/actions/run.png',
        execute: 'famfamfam_silk/lightning.png',
        warning: 'crystal_project/22x22/apps/alert.png',
        warn: 'crystal_project/22x22/apps/alert.png',
        skipped: 'crystal_project/22x22/actions/undo.png',
        error: 'famfamfam_silk/exclamation.png',
        feedback: 'famfamfam_silk/email.png',
        spinner: 'ajax-loader.gif',
        large_spinner: 'ajax-loader-large.gif',
        current: 'famfamfam_silk/bullet_green.png',
        collapse: 'folds/fold.png',
        expand: 'folds/unfold.png',
        pal: 'famfamfam_silk/rosette.png',
        admin: 'famfamfam_silk/shield.png',
        pdf_file: 'file_icons/small/pdf.png',
        xls_file: 'file_icons/small/xls.png',
        doc_file: 'file_icons/small/doc.png',
        misc_file: 'file_icons/small/genericBlue.png',
        ppt_file: 'file_icons/small/ppt.png',
        xml_file: 'file_icons/small/xml.png',
        zip_file: 'file_icons/small/zip.png',
        jpg_file: 'file_icons/small/jpg.png',
        gif_file: 'file_icons/small/gif.png',
        png_file: 'file_icons/small/png.png',
        jpg_file: 'file_icons/small/jpg.png',
        bmp_file: 'file_icons/small/bmp.png',
        svg_file: 'file_icons/small/svg.png',
        txt_file: 'file_icons/small/txt.png',
        rtf_file: 'file_icons/small/rtf.png',
        html_file: 'file_icons/small/html.png',
        investigation_avatar: 'crystal_project/64x64/apps/mydocuments.png',
        investigation: 'crystal_project/64x64/apps/mydocuments.png',
        investigations: 'crystal_project/64x64/apps/mydocuments.png',
        study_avatar: 'crystal_project/64x64/apps/package_editors.png',
        assay_avatar: 'misc_icons/flask3-64x64.png',
        assay_experimental_avatar: 'misc_icons/flask3-64x64.png',
        assay: 'misc_icons/flask3-64x64.png',
        assay_modelling_avatar: 'crystal_project/64x64/filesystems/desktop.png',
        model_avatar: 'crystal_project/64x64/apps/kformula.png',
        person_avatar: 'avatar.png',
        jerm_logo: 'jerm_logo.png',
        project_avatar: 'project_64x64.png',
        institution_avatar: 'institution_64x64.png',
        programme_avatar: 'crystal_project/64x64/filesystems/folder_favorites.png',
        organism_avatar: 'misc_icons/cell3.png',
        strain_avatar: 'misc_icons/enterococcus_faecalis64-64.jpg',
        publication_avatar: 'crystal_project/64x64/mimetypes/wordprocessing.png',
        publication: 'crystal_project/64x64/mimetypes/wordprocessing.png',
        publications: 'crystal_project/64x64/mimetypes/wordprocessing.png',
        saved_search_avatar: 'crystal_project/32x32/actions/find.png',
        saved_search: 'crystal_project/32x32/actions/find.png',
        visit_pubmed: 'famfamfam_silk/page_white_go.png',
        markup: 'famfamfam_silk/page_white_text.png',
        atom_feed: 'misc_icons/feed_icon.png',
        impersonate: 'famfamfam_silk/group_go.png',
        partial_world: 'misc_icons/partial_world.png',
        world: 'famfamfam_silk/world.png',
        file_large: 'crystal_project/32x32/apps/klaptop.png',
        internet_large: 'crystal_project/32x32/devices/Globe2.png',
        jws_builder: 'misc_icons/jws_builder24x24.png',
        event_avatar: 'crystal_project/32x32/apps/vcalendar.png',
        specimen_avatar: 'misc_icons/green_virus-64x64.png',
        sample_avatar: 'misc_icons/sampleBGXblue.png',
        specimen: 'misc_icons/green_virus-64x64.png',
        specimens: 'misc_icons/green_virus-64x64.png',
        publish: 'famfamfam_silk/world_add.png',
        spreadsheet: 'famfamfam_silk/table.png',
        spreadsheet_annotation: 'famfamfam_silk/tag_blue.png',
        spreadsheet_annotation_edit: 'famfamfam_silk/tag_blue_edit.png',
        spreadsheet_annotation_add: 'famfamfam_silk/tag_blue_add.png',
        spreadsheet_annotation_destroy: 'famfamfam_silk/tag_blue_delete.png',
        spreadsheet_export: 'famfamfam_silk/table_go.png',
        unsubscribe: 'famfamfam_silk/email_delete.png',
        subscribe: 'famfamfam_silk/email_add.png',
        presentation_avatar: 'misc_icons/1315482798_presentation-slides.png',
        presentation: 'misc_icons/1315482798_presentation-slides.png',
        presentations: 'misc_icons/1315482798_presentation-slides.png',
        endnote: 'famfamfam_silk/script_go.png',
        expand_plus: 'toggle_expand_64x64.png',
        collapse_minus: 'toggle_collapse_64x64.png',
        cytoscape_web: 'famfamfam_silk/chart_line.png',
        graph: 'famfamfam_silk/chart_line.png',
        import: 'famfamfam_silk/page_add.png',
        project_manager: 'famfamfam_silk/medal_gold_1.png',
        asset_manager: 'famfamfam_silk/medal_bronze_3.png',
        gatekeeper: 'famfamfam_silk/medal_silver_2.png',
        organise: 'famfamfam_silk/folder.png',
        search: 'famfamfam_silk/eye.png',
        report: 'famfamfam_silk/report.png',
        jws_shadow: 'jws/shadow2.gif',
        home: 'famfamfam_silk/house.png',
        waiting: 'misc_icons/waiting.png',
        run_workflow: 'famfamfam_silk/cog_go.png',
        workflow_avatar: 'logos/taverna_logo.png',
        sweep: 'famfamfam_silk/chart_organisation.png',
        share: 'famfamfam_silk/link.png',
        sweep_run: 'famfamfam_silk/table_multiple.png',
        simple_run: 'famfamfam_silk/table.png',
        myexperiment: 'myexp_icon.png',
        filter: 'crystal_project/16x16/actions/filter.png'
      }
    end
  end
end