X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFeatureRenderer.java;h=cbdf2eff623e69f150ae02d7c018e6fc86bb167c;hb=cca50cb3aee94f3ed1a5e504d45b8d8b665f8c5b;hp=c07fdcfa866d7b8f6b785b5a81dadfeb0307aad0;hpb=cb5d856b1304448cae13a333cbd9017f81520d90;p=jalview.git diff --git a/src/jalview/gui/FeatureRenderer.java b/src/jalview/gui/FeatureRenderer.java index c07fdcf..cbdf2ef 100644 --- a/src/jalview/gui/FeatureRenderer.java +++ b/src/jalview/gui/FeatureRenderer.java @@ -1,19 +1,21 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1) + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) * Copyright (C) 2014 The Jalview Authors * * This file is part of Jalview. * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. * * Jalview is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along with Jalview. If not, see . + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.gui; @@ -82,10 +84,10 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer { this.ap = ap; this.av = ap.av; - if (ap != null && ap.seqPanel != null && ap.seqPanel.seqCanvas != null - && ap.seqPanel.seqCanvas.fr != null) + if (ap != null && ap.getSeqPanel() != null && ap.getSeqPanel().seqCanvas != null + && ap.getSeqPanel().seqCanvas.fr != null) { - transferSettings(ap.seqPanel.seqCanvas.fr); + transferSettings(ap.getSeqPanel().seqCanvas.fr); } } @@ -170,9 +172,12 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer this.transparency = fr.transparency; this.featureOrder = fr.featureOrder; } + /** * update from another feature renderer - * @param fr settings to copy + * + * @param fr + * settings to copy */ public void transferSettings(FeatureRenderer fr) { @@ -935,8 +940,7 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer return ((GraduatedColor) fc).getMaxColor(); } } - throw new Error("Implementation Error: Unrecognised render object " - + fc.getClass() + " for features of type " + featureType); + throw new Error(MessageManager.formatMessage("error.implementation_error_unrecognised_render_object_for_features_type", new String[]{fc.getClass().toString(),featureType})); } /** @@ -960,8 +964,7 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer return ((GraduatedColor) fc).findColor(feature); } } - throw new Error("Implementation Error: Unrecognised render object " - + fc.getClass() + " for features of type " + feature.getType()); + throw new Error(MessageManager.formatMessage("error.implementation_error_unrecognised_render_object_for_features_type", new String[]{fc.getClass().toString(),feature.getType()})); } private boolean showFeature(SequenceFeature sequenceFeature) @@ -1021,7 +1024,7 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer if (fcol instanceof Color) { Color col = JColorChooser.showDialog(Desktop.desktop, - "Select Feature Colour", ((Color) fcol)); + MessageManager.getString("label.select_feature_colour"), ((Color) fcol)); if (col != null) { fcol = col; @@ -1092,7 +1095,7 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer highlight.addResult(sequences[0], features[index].getBegin(), features[index].getEnd()); - ap.seqPanel.seqCanvas.highlightSearchResults(highlight); + ap.getSeqPanel().seqCanvas.highlightSearchResults(highlight); } Object col = getFeatureStyle(name.getText()); @@ -1118,12 +1121,14 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer tmp = new JPanel(); panel.add(tmp); - tmp.add(new JLabel(MessageManager.getString("label.group")+":", JLabel.RIGHT)); + tmp.add(new JLabel(MessageManager.getString("label.group") + ":", + JLabel.RIGHT)); tmp.add(source); tmp = new JPanel(); panel.add(tmp); - tmp.add(new JLabel(MessageManager.getString("label.colour"), JLabel.RIGHT)); + tmp.add(new JLabel(MessageManager.getString("label.colour"), + JLabel.RIGHT)); tmp.add(colour); colour.setPreferredSize(new Dimension(150, 15)); colour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 9)); @@ -1135,7 +1140,8 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer bigPanel.add(panel, BorderLayout.NORTH); panel = new JPanel(); - panel.add(new JLabel(MessageManager.getString("label.description"), JLabel.RIGHT)); + panel.add(new JLabel(MessageManager.getString("label.description"), + JLabel.RIGHT)); description.setFont(JvSwingUtils.getTextAreaFont()); description.setLineWrap(true); panel.add(new JScrollPane(description)); @@ -1145,9 +1151,11 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer bigPanel.add(panel, BorderLayout.SOUTH); panel = new JPanel(); - panel.add(new JLabel(MessageManager.getString("label.start"), JLabel.RIGHT)); + panel.add(new JLabel(MessageManager.getString("label.start"), + JLabel.RIGHT)); panel.add(start); - panel.add(new JLabel(MessageManager.getString("label.end"), JLabel.RIGHT)); + panel.add(new JLabel(MessageManager.getString("label.end"), + JLabel.RIGHT)); panel.add(end); bigPanel.add(panel, BorderLayout.CENTER); } @@ -1208,12 +1216,12 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer { "OK", "Cancel" }; } - String title = newFeatures ? "Create New Sequence Feature(s)" - : "Amend/Delete Features for " + sequences[0].getName(); + String title = newFeatures ? MessageManager.getString("label.create_new_sequence_features") + : MessageManager.formatMessage("label.amend_delete_features", new String[]{sequences[0].getName()}); int reply = JOptionPane.showInternalOptionDialog(Desktop.desktop, bigPanel, title, JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.QUESTION_MESSAGE, null, options, "OK"); + JOptionPane.QUESTION_MESSAGE, null, options, MessageManager.getString("action.ok")); jalview.io.FeaturesFile ffile = new jalview.io.FeaturesFile();