diff --git a/resources/images/genomespace.png b/resources/images/genomespace.png new file mode 100644 index 0000000..c10c835 --- /dev/null +++ b/resources/images/genomespace.png Binary files differ diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index 53a05dd..abd86dd 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -1,389 +1,396 @@ action.cancel = Cancel action.create = Create action.update = Update action.delete = Delete action.snapshot = Snapshot action.clear = Clear action.accept = Accept action.select_ddbb = --- Select Database --- action.undo = Undo action.redo = Redo action.reset = Reset action.remove_left = Remove left action.remove_right = Remove right action.remove_empty_columns = Remove Empty Columns action.remove_all_gaps = Remove All Gaps action.boxes = Boxes action.text = Text action.by_pairwise_id = by Pairwise Identity action.by_id = by Id action.by_length = by Length action.by_group = by Group action.remove_redundancy = Remove Redundancy... action.pairwise_alignment = Pairwise Alignments... action.by_rna_helixes = by RNA Helices action.user_defined = User Defined... action.by_conservation = By Conservation action.wrap = Wrap action.show_gaps = Show Gaps action.find = Find... action.undefine_groups = Undefine Groups action.make_groups_selection = Make Groups For Selection action.copy = Copy action.cut = Cut action.paste = Paste action.font = Font... action.scale_above = Scale Above action.scale_left = Scale Left action.scale_right = Scale Right action.by_tree_order = By Tree Order action.sort = Sort action.calculate_tree = Calculate Tree action.help = Help action.by_annotation = by Annotation... action.invert_sequence_selection = Invert Sequence Selection action.invert_column_selection = Invert Column Selection action.show = Show action.hide = Hide action.ok = OK action.set_defaults = Defaults action.create_group = Create Group action.remove_group = Remove Group action.edit_group = Edit Group action.edit_new_group = Edit New Group action.hide_sequences = Hide Sequences action.reveal_all = Reveal All action.reveal_sequences = Reveal Sequences action.find_all = Find all action.find_next = Find next action.file = File action.view = View action.change_params = Change Parameters action.apply = Apply action.apply_threshold_all_groups = Apply threshold to all groups action.apply_all_groups = Apply to all Groups action.by_chain = By chain action.by_sequence = By Sequence action.paste_annotations = Paste Annotations action.format = Format action.select = Select action.new_view = New View action.close = Close action.add = Add action.save_as_default = Save as default action.cancel_fetch = Cancel Fetch action.save_omit_hidden_columns = Save / Omit Hidden Columns action.change_font = Change Font action.colour = Colour action.calculate = Calculate action.select_all = Select all action.deselect_all = Deselect all action.invert_selection = Invert selection action.using_jmol = Using Jmol action.link = Link action.show_chain = Show Chain label.str = Str: label.seq = Seq: label.structures_manager = Structures Manager label.nickname = Nickname: label.url = URL: label.input_file_url = Enter URL or Input File label.select_feature = Select feature: label.name = Name: label.name_param = Name: {0} label.group = Group: label.colour = Colour: label.description = Description: label.start = Start: label.end = End: label.current_parameter_set_name = Current parameter set name: label.service_action = Service Action: label.post_url = POST URL: label.url_suffix = URL Suffix label.sequence_source = Sequence Source label.per_seq = per Sequence label.result_vertically_separable = Results are vertically separable label.amend = Amend label.undo_command = Undo {0} label.redo_command = Redo {0} label.principal_component_analysis = Principal Component Analysis label.average_distance_identity = Average Distance Using % Identity label.neighbour_joining_identity = Neighbour Joining Using % Identity label.status_bar = Status bar label.out_to_textbox = Output to Textbox label.clustalx = Clustalx label.zappo = Zappo label.taylor = Taylor label.hydrophobicity = Hydrophobicity label.helix_propensity = Helix Propensity label.strand_propensity = Strand Propensity label.turn_propensity = Turn Propensity label.buried_index = Buried Index label.purine_pyrimidine = Purine/Pyrimidine label.percentage_identity = Percentage Identity label.blosum62_score = BLOSUM62 Score label.tcoffee_scores = T-Coffee Scores label.average_distance_bloslum62 = Average Distance Using BLOSUM62 label.neighbour_blosum62 = Neighbour Joining Using BLOSUM62 label.show_annotations = Show annotations label.colour_text = Colour Text label.show_non_conversed = Show nonconserved label.overview_window = Overview Window label.none = None label.above_identity_threshold = Above Identity Threshold label.nucleotide = Nucleotide label.to_new_alignment = To New Alignment label.to_this_alignment = Add To This Alignment label.apply_colour_to_all_groups = Apply Colour To All Groups label.modify_identity_thereshold = Modify Identity Threshold... label.modify_conservation_thereshold = Modify Conservation Threshold... label.input_from_textbox = Input from textbox label.centre_column_labels = Centre column labels label.automatic_scrolling = Automatic Scrolling label.documentation = Documentation label.about = About... label.show_sequence_limits = Show Sequence Limits label.feature_settings = Feature Settings... label.sequence_features = Sequence Features label.all_columns = All Columns label.all_sequences = All Sequences label.selected_columns = Selected Columns label.selected_sequences = Selected Sequences label.all_but_selected_region = All but Selected Region (Shift+Ctrl+H) label.selected_region = Selected Region label.all_sequences_columns = All Sequences and Columns label.group_consensus = Group Consensus label.group_conservation = Group Conservation label.show_consensus_histogram = Show Consensus Histogram label.show_consensus_logo = Show Consensus Logo label.norm_consensus_logo = Normalise Consensus Logo label.apply_all_groups = Apply to all groups label.autocalculated_annotation = Autocalculated Annotation label.min_colour = Min Colour label.max_colour = Max Colour label.use_original_colours = Use Original Colours label.threshold_minmax = Threshold is min/max label.represent_group_with = Represent Group with label.selection = Selection label.group_colour = Group Colour label.sequence = Sequence label.view_pdb_structure = View PDB Structure label.min = Min: label.max = Max: label.colour_by_label = Colour by label label.new_feature = New Feature label.match_case = Match Case label.view_alignment_editor = View in alignment editor label.labels = Labels label.output_values = Output Values... label.input_data = Input Data... label.nucleotide_matrix = Nucleotide matrix label.protein_matrix = Protein matrix label.show_bootstrap_values = Show Bootstrap Values label.show_distances = Show distances label.mark_unassociated_leaves = Mark Unassociated Leaves label.fit_to_window = Fit To Window label.newick_format = Newick Format label.colours = Colours label.view_mapping = View Mapping label.wireframe = Wireframe label.depthcue = Depthcue label.z_buffering = Z Buffering label.charge_cysteine = Charge & Cysteine label.all_chains_visible = All Chains Visible label.successfully_added_features_alignment = Successfully added features to alignment label.keyboard_editing_mode = Keyboard editing mode is {0} label.paste_features_annotations_Tcoffee_here = Paste your features / annotations / T-coffee score file here. label.removed_columns = Removed {0} columns. label.removed_empty_columns = Removed {0} empty columns. label.paste_newick_tree_file = Paste your Newick tree file here. label.order_by_params = Order by {0} label.html_content = {0} label.paste_pdb_file= Paste your PDB file here. label.paste_pdb_file_for_sequence = Paste PDB file for sequence {0} label.could_not_parse_newick_file = Could not parse Newick file\!\n {0} label.successfully_pasted_tcoffee_scores_to_alignment= Successfully pasted T-Coffee scores to alignment. label.failed_add_tcoffee_scores = Failed to add T-Coffee scores: label.successfully_pasted_annotation_to_alignment= Successfully pasted annotation to alignment. label.successfully_pasted_alignment_file = Successfully pasted alignment file label.paste_your_alignment_file = Paste your alignment file here label.paste_your = Paste your label.finished_searching = Finished searching label.search_results= Search results {0} : {1} label.found_match_for = Found match for {0} label.font = Font: label.size = Size: label.style = Style: label.enter_redundancy_threshold = Enter the redundancy threshold label.calculating = Calculating.... label.modify_conservation_visibility = Modify conservation visibility label.colour_residues_above_occurence = Colour residues above % occurence label.set_this_label_text = set this label text label.sequences_from = Sequences from {0} label.successfully_loaded_file = Successfully loaded file {0} label.successfully_saved_to_file_in_format = Successfully saved to file: {0} in {1} format. label.copied_sequences_to_clipboard = Copied {0} sequences to clipboard. label.check_file_matches_sequence_ids_alignment = Check that the file matches sequence IDs in the alignment. label.problem_reading_tcoffee_score_file = Problem reading T-COFFEE score file label.source_to_target = {0} to '{1}' label.per_sequence_only= Per-sequence only label.to_file = to File label.to_textbox = to Textbox label.jalview = Jalview label.csv_spreadsheet = CSV (Spreadsheet) label.status = [Status] label.channels = Channels label.channel_title_item_count = {0} ({1}) label.blog_item_published_on_date = {0} {1} label.select_das_service_from_table = Select a DAS service from the table to read a full description here. label.session_update = Session Update label.new_vamsas_session = New Vamsas Session label.groovy_console = Groovy Console... label.lineart = Lineart label.dont_ask_me_again = Don't ask me again label.select_eps_character_rendering_style = Select EPS character rendering style label.invert_selection = Invert Selection label.optimise_order = Optimise Order label.seq_sort_by_score = Seq sort by Score label.load_colours = Load Colours label.save_colours = Save Colours label.fetch_das_features = Fetch DAS Features label.selected_database_to_fetch_from = Selected {0} database {1} to fetch from {2} label.database_param = Database: {0} label.example_param = Example: {0} label.select_file_format_before_saving = You must select a file format before saving! label.file_format_not_specified = File format not specified label.alignment_contains_hidden_columns = The Alignment contains hidden columns.\nDo you want to save only the visible alignment? label.couldnt_save_file = Couldn't save file: {0} label.error_saving_file = Error Saving File label.remove_from_default_list = Remove from default list? label.remove_user_defined_colour = Remove user defined colour label.you_must_select_least_two_sequences = You must select at least 2 sequences. label.invalid_selection = Invalid Selection label.principal_component_analysis_must_take_least_four_input_sequences = Principal component analysis must take\nat least 4 input sequences. label.sequence_selection_insufficient = Sequence selection insufficient label.you_need_more_two_sequences_selected_build_tree = You need to have more than two sequences selected to build a tree! label.not_enough_sequences = Not enough sequences label.selected_region_to_tree_may_only_contain_residues_or_gaps = The selected region to create a tree may\nonly contain residues or gaps.\nTry using the Pad function in the edit menu,\nor one of the multiple sequence alignment web services. label.sequences_selection_not_aligned = Sequences in selection are not aligned label.sequences_must_be_aligned_before_creating_tree = The sequences must be aligned before creating a tree.\nTry using the Pad function in the edit menu,\n or one of the multiple sequence alignment web services. label.sequences_not_aligned = Sequences not aligned label.problem_reading_tree_file = Problem reading tree file label.possible_problem_with_tree_file = Possible problem with tree file label.select_at_least_three_bases_in_at_least_one_sequence_to_cDNA_translation = Please select at least three bases in at least one sequence in order to perform a cDNA translation. label.translation_failed = Translation Failed label.error_when_translating_sequences_submit_bug_report = Unfortunately, something went wrong when translating your sequences.\nPlease take a look in the Jalview java console\nand submit a bug report including the stacktrace. label.implementation_error = Implementation error: label.automatically_associate_pdb_files_with_sequences_same_name = Do you want to automatically associate the {0} PDB files with sequences in the alignment that have the same name? label.automatically_associate_pdb_files_by_name = Automatically Associate PDB files by name label.ignore_unmatched_dropped_files_info = Do you want to ignore the {0} files whose names did not match any sequence IDs ? label.ignore_unmatched_dropped_files = Ignore unmatched dropped files? label.enter_view_name = Enter View Name label.enter_label = Enter label label.enter_label_for_the_structure = Enter a label for the structure? label.pdb_entry_is_already_displayed = {0} is already displayed.\nDo you want to re-use this viewer ? label.map_sequences_to_visible_window = Map Sequences to Visible Window: {0} label.add_pdbentry_to_view = Do you want to add {0} to the view called\n'{1}'\n label.align_to_existing_structure_view = Align to existing structure view label.pdb_entries_couldnt_be_retrieved = The following pdb entries could not be retrieved from the PDB\:\n{0}\nPlease try downloading them manually. label.couldnt_load_file = Couldn't load file label.couldnt_find_pdb_id_in_file = Couldn't find a PDB id in the file supplied. Please enter an Id to identify this structure. label.no_pdb_id_in_file = No PDB Id in File label.couldnt_read_pasted_text = Couldn't read the pasted text {0} label.error_parsing_text = Error parsing text label.enter_local_das_source = Enter Nickname & URL of Local DAS Source label.you_can_only_edit_or_remove_local_das_sources = You can only edit or remove local DAS Sources! label.public_das_source = Public DAS source - not editable label.input_alignment_from_url = Input Alignment From URL label.couldnt_import_as_vamsas_session = Couldn't import '{0}' as a new vamsas session. label.vamsas_document_import_failed = Vamsas Document Import Failed label.couldnt_locate = Couldn't locate {0} label.url_not_found = URL not found label.no_link_selected = No link selected label.new_sequence_url_link = New sequence URL link label.cannot_edit_annotations_in_wrapped_view = Cannot edit annotations in wrapped view label.wrapped_view_no_edit = Wrapped view - no edit label.error_retrieving_data = Error Retrieving Data label.user_colour_scheme_must_have_name = User colour scheme must have a name label.no_name_colour_scheme = No name for colour scheme label.invalid_url = Invalid URL ! label.error_loading_file = Error loading file label.problems_opening_file = Encountered problems opening {0}!! label.file_open_error = File open error label.no_das_sources_selected_warn = No das sources were selected.\nPlease select some sources and\ntry again. label.no_das_sources_selected_title = No DAS Sources Selected label.colour_scheme_exists_overwrite = Colour scheme {0} exists.\nContinue saving colour scheme as {1}?" label.duplicate_scheme_name = Duplicate scheme name label.jalview_new_questionnaire = There is a new Questionnaire available. Would you like to complete it now ?\n label.jalview_user_survey = Jalview User Survey label.alignment_properties = Alignment Properties: {0} label.alignment_props = Alignment Properties label.input_cut_paste = Cut & Paste Input label.alignment_output_command = Alignment output - {0} label.annotations = Annotations label.features = Features label.overview_params = Overview {0} label.paste_newick_file = Paste Newick file label.load_tree_from_file = From File - label.colour_by_annotation = Colour by Annotation label.selection_output_command = Selection output - {0} label.annotation_for_displayid =

Annotation for {0}

label.pdb_sequence_mapping = PDB - Sequence Mapping label.pca_details = PCA details label.redundancy_threshold_selection = Redundancy threshold selection label.user_defined_colours = User defined colours label.jalviewLite_release = JalviewLite - Release {0} label.jaview_build_date = Build date: {0} label.jalview_authors_1 = Authors: Jim Procter, Andrew Waterhouse, Jan Engelhardt, Lauren Lui, label.jalview_authors_2 = Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton. label.jalview_dev_managers = Development managed by The Barton Group, University of Dundee, Scotland, UK. label.jalview_distribution_lists = For help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list label.jalview_please_cite = If you use Jalview, please cite: label.jalview_cite_1_authors = Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009) label.jalview_cite_1_title = Jalview Version 2 - a multiple sequence alignment editor and analysis workbench label.jalview_cite_1_ref = Bioinformatics doi: 10.1093/bioinformatics/btp033 label.right_click = Right click label.to_add_annotation = to add annotation label.alignment_has_no_annotations = Alignment has no annotations label.retrieving_pdb_data = Retrieving PDB data... label.label = Label label.no_features_added_to_this_alignment = No Features added to this alignment!! label.features_can_be_added_from_searches_1 = (Features can be added from searches or label.features_can_be_added_from_searches_2 = from Jalview / GFF features files) label.calculating_pca= Calculating PCA label.reveal_columns = Reveal Columns label.jalview_cannot_open_file = Jalview can't open file label.jalview_applet = Jalview applet label.loading_data = Loading data label.memory_stats = Total Free Memory: {0} MB; Max Memory: {1} MB; {2} % label.calculating_tree = Calculating tree label.state_queueing = queuing label.state_running = running label.state_complete = complete label.state_job_cancelled = job cancelled!! label.state_job_error = job error! label.server_error_try_later = Server Error! (try later) label.error_loading_pdb_data = Error loading PDB data!! label.fetching_pdb_data = Fetching PDB data... label.structure_type = Structure_type label.settings_for_type = Settings for {0} label.view_full_application = View in Full Application label.load_associated_tree = Load Associated Tree ... label.load_features_annotations = Load Features/Annotations ... label.export_features = Export Features ... label.export_annotations = Export Annotations ... label.jalview_copy = Copy (Jalview Only) label.jalview_cut = Cut (Jalview Only) label.to_upper_case = To Upper Case label.to_lower_case = To Lower Case label.toggle_case = Toggle Case label.edit_name_description = Edit Name/Description label.create_sequence_feature = Create Sequence Feature label.edit_sequence = Edit Sequence label.sequence_details = Sequence Details label.jmol_help = Jmol Help label.all = All label.sort_by_score = Sort by Score label.sort_by_density = Sort by Density label.reveal = Reveal label.hide_columns = Hide Columns +label.genomespace = Genomespace files +label.genomespace_invalid_username_pwd = Invalid user name or password! +label.genomespace_login_error = Login Error +label.genomespace_empty_username = User name cannot be empty. Please, provide a valid one +label.genomespace_empty_password = Password cannot be empty. Please, provide a valid one +label.genomespace_connection_error_retry = Connection error. Please, check URL is fine and retry. +label.genomespace_connection_unavailable = Connection unavailable. Please, check URL is fine and retry. diff --git a/test/jalview/gui/GenomeSpaceDemo.java b/test/jalview/gui/GenomeSpaceDemo.java new file mode 100644 index 0000000..f555baa --- /dev/null +++ b/test/jalview/gui/GenomeSpaceDemo.java @@ -0,0 +1,108 @@ +package jalview.gui; + +import jalview.util.MessageManager; + +import java.awt.Dimension; +import java.awt.Dialog.ModalityType; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JDesktopPane; +import javax.swing.JFrame; +import javax.swing.JOptionPane; + +import org.genomespace.client.GsSession; +import org.genomespace.client.exceptions.AuthorizationException; +import org.genomespace.client.exceptions.ConfigurationError; +import org.genomespace.client.exceptions.InternalServerException; +import org.genomespace.client.exceptions.ServerNotFoundException; +import org.genomespace.client.ui.GSFileBrowserDialog; +import org.genomespace.client.ui.GSLoginDialog; +import org.genomespace.datamanager.core.GSFileMetadata; +import org.junit.Test; + +public class GenomeSpaceDemo { + volatile boolean finish=false; + + @Test + public void test_GenomeSpace(){ + final JFrame cfoo = new JFrame("Testing GenomeSpace"); + cfoo.setSize(200, 100); + JButton genomespace = new JButton(MessageManager.getString("label.genomespace"), new ImageIcon("/images/genomespace.png")); + cfoo.add(genomespace); + cfoo.setVisible(true); + + genomespace.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + boolean error = false; + StringBuffer sb = new StringBuffer(); + try { + // open a GSLogin Dialog + GsSession session = null; + final GSLoginDialog loginDialog = new GSLoginDialog(null, ModalityType.APPLICATION_MODAL); + loginDialog.setVisible(true); + final String userName = loginDialog.getUsername(); + final String password = loginDialog.getPassword(); + boolean loginError = false; + StringBuffer loginMsg = new StringBuffer(); + if ((userName==null) || (userName.trim().length()==0)){ + loginError = true; + loginMsg.append(MessageManager.getString("label.genomespace_empty_username")).append("\n"); + } + if ((password==null) || (password.trim().length()==0)){ + loginError = true; + loginMsg.append(MessageManager.getString("label.genomespace_empty_password")); + } + if (loginError) + JOptionPane.showMessageDialog(null, + loginMsg.toString(), + MessageManager.getString("label.genomespace_login_error"), + JOptionPane.ERROR_MESSAGE); + + session = loginDialog.getGsSession(); + if (session==null) + session = new GsSession(); + session.login(userName, password); + //Once user is logged, list its working files + GSFileBrowserDialog fileBrowser = new GSFileBrowserDialog(null, session.getDataManagerClient(), + GSFileBrowserDialog.DialogType.FILE_SELECTION_DIALOG); + fileBrowser.setVisible(true); + GSFileMetadata selection = fileBrowser.getSelectedFileMetadata(); + // Do something with the selected file + JOptionPane.showMessageDialog(null, selection.getPath(),MessageManager.getString("label.genomespace_login_error"), + JOptionPane.INFORMATION_MESSAGE); + } catch (final AuthorizationException e1) { + error = true; + sb.append(MessageManager.getString("label.genomespace_invalid_username_pwd")).append("\n"); + }catch (ConfigurationError ce){ + error = true; + sb.append(MessageManager.getString("label.genomespace_connection_unavailable")).append("\n"); + }catch (ServerNotFoundException e2) { + error = true; + sb.append(MessageManager.getString("label.genomespace_connection_error_retry")).append("\n"); + } catch (InternalServerException e3) { + error = true; + sb.append(MessageManager.getString("label.genomespace_connection_error_retry")).append("\n"); + }catch(Exception e5){ + error = true; + sb.append(MessageManager.getString("label.genomespace_invalid_username_pwd")); + } + if (error) + JOptionPane.showMessageDialog(null, sb.toString(),MessageManager.getString("label.genomespace_login_error"),JOptionPane.ERROR_MESSAGE); + finish=true; + } + }); + + while (!finish) + { + try { + Thread.sleep(100); + } catch (InterruptedException x) {} + } + + } +}