gg.dispose();
-
fastPaint = true;
// Call repaint on alignment panel so that repaints from other alignment
public PCAPanel getPcaPanel()
{
- // only called for FreeUpMemoryTest
return pcaPanel;
}
}
initConsole(false);
JalviewAppender jappender = new JalviewAppender();
jappender.setLayout(new SimpleLayout());
- // BH 2019 JalviewAppender.setTextArea(textArea);
jappender.setTextArea(textArea);
org.apache.log4j.Logger.getRootLogger().addAppender(jappender);
}
*/
package jalview.gui;
-import java.awt.Color;
-
/**
* DOCUMENT ME!
*
extends jalview.renderer.seqfeatures.FeatureRenderer
implements jalview.api.FeatureRenderer
{
- Color resBoxColour;
-
AlignmentPanel ap;
/**
*/
public class JalviewAppender extends WriterAppender
{
-
- // BH 2019 was static
-
- private JTextArea jTextArea = null;
+ JTextArea jTextArea = null;
/** Set the target JTextArea for the logging information to appear. */
public void setTextArea(JTextArea jTextArea)
*/
public final class JvSwingUtils
{
- public static final String HTML_PREFIX = "<html><div style=\"width:350px;white-space:pre-wrap;padding:2px;overflow-wrap:break-word;\">";
-
+ static final String HTML_PREFIX = "<html><div style=\"width:350px;white-space:pre-wrap;padding:2px;overflow-wrap:break-word;\">";
/**
* wrap a bare html safe string to around 60 characters per line using a CSS
return enclose ? "<html>" + ttext + "</html>" : ttext;
}
// BH 2018,2019
- return (enclose
- ? HTML_PREFIX
- + ttext
- + "</div></html>"
- : ttext);
+ return (enclose ? HTML_PREFIX + ttext + "</div></html>" : ttext);
}
combo.setToolTipText(tooltips.get(j));
}
}
+
@Override
public void mouseExited(MouseEvent e)
{
private Dimension dim;
- private boolean showProgress = !Platform.isJS(); // Jalview.getInstance().getShowStatus()
+ private boolean showProgress = !Platform.isJS();
/**
* Creates a new OverviewPanel object.
});
}
+ /***
+ * Resize is called on the initial display of the Overview. This code adjusts
+ * sizes to account for the progress bar if it has not already been accounted
+ * for, which triggers another resize call for the correct sizing, at which
+ * point the overview image is updated. (This avoids a double recalculation of
+ * the image.)
+ */
protected void resizePanel()
{
int ph = (progressPanel.getParent() == null ? 0
: progressPanel.getHeight());
- // Resize is called on the initial display of the overview.
- // This code adjusts sizes to account for the progress bar if it has not
- // already been accounted for, which triggers another resize call for
- // the correct sizing, at which point the overview image is updated.
- // (This avoids a double recalculation of the image.)
if (getWidth() == od.getWidth() && getHeight() == od.getHeight() + ph)
{
if (canvas.lastMiniMe == null)
}
/**
- * Create the appropriate type of OverViewDimensions, with the desired size.
+ * Creates the appropriate type of OverviewDimensions, with the desired size
*/
private void createOverviewDimensions()
{
od = new OverviewDimensionsHideHidden(av.getRanges(), showAnnotation,
dim);
}
-
}
/**
}
/**
- * Updates the overview image when the related alignment panel is updated.
- *
- * Cases:
- *
- * AlignFrame.setFeatureGroupState
- *
- * AlignmentPanel.paintAlignment(true,...) (117 references)
- *
- * OverviewPanel..componentResized() OverviewPanel.toggleHiddenColumns()
- *
- * PopupMenu for action.reveal_sequences, action.reveal_all
- *
- * SliderPanel.mouseReleased()
- *
+ * Updates the overview image when the related alignment panel is updated
*/
public void updateOverviewImage()
{
/**
* Update the overview panel box when the associated alignment panel is
* changed
- *
*/
private void setBoxPositionOnly()
{
private static final int MIN_HEIGHT = 250;
- private RotatableCanvas rc;
+ RotatableCanvas rc;
AlignmentPanel ap;
}
}
+ @Override
public void makePCAImage(ImageMaker.TYPE type)
{
int width = getRotatableCanvas().getWidth();
}
- /*
- * (non-Javadoc)
- *
- * @see
- * jalview.jbgui.GPCAPanel#outputPoints_actionPerformed(java.awt.event.ActionEvent
- * )
- */
@Override
protected void outputPoints_actionPerformed()
{
}
}
- /*
- * (non-Javadoc)
- *
- * @see
- * jalview.jbgui.GPCAPanel#outputProjPoints_actionPerformed(java.awt.event
- * .ActionEvent)
- */
@Override
protected void outputProjPoints_actionPerformed()
{
}
}
- /*
- * (non-Javadoc)
- *
- * @see jalview.gui.IProgressIndicator#setProgressBar(java.lang.String, long)
- */
@Override
public void setProgressBar(String message, long id)
{
progressBar.setProgressBar(message, id);
- // if (progressBars == null)
- // {
- // progressBars = new Hashtable();
- // progressBarHandlers = new Hashtable();
- // }
- //
- // JPanel progressPanel;
- // Long lId = new Long(id);
- // GridLayout layout = (GridLayout) statusPanel.getLayout();
- // if (progressBars.get(lId) != null)
- // {
- // progressPanel = (JPanel) progressBars.get(new Long(id));
- // statusPanel.remove(progressPanel);
- // progressBars.remove(lId);
- // progressPanel = null;
- // if (message != null)
- // {
- // statusBar.setText(message);
- // }
- // if (progressBarHandlers.contains(lId))
- // {
- // progressBarHandlers.remove(lId);
- // }
- // layout.setRows(layout.getRows() - 1);
- // }
- // else
- // {
- // progressPanel = new JPanel(new BorderLayout(10, 5));
- //
- // JProgressBar progressBar = new JProgressBar();
- // progressBar.setIndeterminate(true);
- //
- // progressPanel.add(new JLabel(message), BorderLayout.WEST);
- // progressPanel.add(progressBar, BorderLayout.CENTER);
- //
- // layout.setRows(layout.getRows() + 1);
- // statusPanel.add(progressPanel);
- //
- // progressBars.put(lId, progressPanel);
- // }
- // // update GUI
- // // setMenusForViewport();
- // validate();
}
@Override
final IProgressIndicatorHandler handler)
{
progressBar.registerHandler(id, handler);
- // if (progressBarHandlers == null || !progressBars.contains(new Long(id)))
- // {
- // throw new
- // Error(MessageManager.getString("error.call_setprogressbar_before_registering_handler"));
- // }
- // progressBarHandlers.put(new Long(id), handler);
- // final JPanel progressPanel = (JPanel) progressBars.get(new Long(id));
- // if (handler.canCancel())
- // {
- // JButton cancel = new JButton(
- // MessageManager.getString("action.cancel"));
- // final IProgressIndicator us = this;
- // cancel.addActionListener(new ActionListener()
- // {
- //
- // @Override
- // public void actionPerformed(ActionEvent e)
- // {
- // handler.cancelActivity(id);
- // us.setProgressBar(MessageManager.formatMessage("label.cancelled_params",
- // new String[]{((JLabel) progressPanel.getComponent(0)).getText()}), id);
- // }
- // });
- // progressPanel.add(cancel, BorderLayout.EAST);
- // }
}
/**
@Override
public void paintComponent(Graphics g)
{
-
if (av.getAlignPanel().getHoldRepaint())
{
return;
* Using the current font, determine fields labelWidthEast and labelWidthWest,
* and return the number of residues that can fill the remaining width
*
- * @param width
+ * @param w
* the width in pixels (possibly including scales)
*
* @return the visible width in residues, after allowing for East or West
* scales (if shown)
*
*/
- public int getWrappedCanvasWidth(int width)
+ public int getWrappedCanvasWidth(int w)
{
int charWidth = av.getCharWidth();
labelWidthWest = av.getScaleLeftWrapped() ? labelWidth : 0;
- return (width - labelWidthEast - labelWidthWest) / charWidth;
+ return (w - labelWidthEast - labelWidthWest) / charWidth;
}
/**
protected SequenceI selectedSequence;
- public SequenceI[] selectedSequences;
+ SequenceI[] selectedSequences;
private IProgressIndicator progressIndicator;
protected void txt_search_ActionPerformed()
{
String text = txt_search.getText().trim();
- if (text.length() >= PDB_ID_MIN)
- {
- new Thread()
+ if (text.length() >= PDB_ID_MIN)
{
-
- @Override
- public void run()
+ new Thread()
{
- errorWarning.setLength(0);
- isValidPBDEntry = false;
- if (text.length() > 0)
+
+ @Override
+ public void run()
{
- String searchTerm = text.toLowerCase();
- searchTerm = searchTerm.split(":")[0];
- // System.out.println(">>>>> search term : " + searchTerm);
- List<FTSDataColumnI> wantedFields = new ArrayList<>();
- FTSRestRequest pdbRequest = new FTSRestRequest();
- pdbRequest.setAllowEmptySeq(false);
- pdbRequest.setResponseSize(1);
- pdbRequest.setFieldToSearchBy("(pdb_id:");
- pdbRequest.setWantedFields(wantedFields);
- pdbRequest.setSearchTerm(searchTerm + ")");
- pdbRequest.setAssociatedSequence(selectedSequence);
- pdbRestClient = PDBFTSRestClient.getInstance();
- wantedFields.add(pdbRestClient.getPrimaryKeyColumn());
- FTSRestResponse resultList;
- try
- {
- resultList = pdbRestClient.executeRequest(pdbRequest);
- } catch (Exception e)
+ errorWarning.setLength(0);
+ isValidPBDEntry = false;
+ if (text.length() > 0)
{
- errorWarning.append(e.getMessage());
- return;
- } finally
- {
- validateSelections();
- }
- if (resultList.getSearchSummary() != null
- && resultList.getSearchSummary().size() > 0)
- {
- isValidPBDEntry = true;
+ String searchTerm = text.toLowerCase();
+ searchTerm = searchTerm.split(":")[0];
+ // System.out.println(">>>>> search term : " + searchTerm);
+ List<FTSDataColumnI> wantedFields = new ArrayList<>();
+ FTSRestRequest pdbRequest = new FTSRestRequest();
+ pdbRequest.setAllowEmptySeq(false);
+ pdbRequest.setResponseSize(1);
+ pdbRequest.setFieldToSearchBy("(pdb_id:");
+ pdbRequest.setWantedFields(wantedFields);
+ pdbRequest.setSearchTerm(searchTerm + ")");
+ pdbRequest.setAssociatedSequence(selectedSequence);
+ pdbRestClient = PDBFTSRestClient.getInstance();
+ wantedFields.add(pdbRestClient.getPrimaryKeyColumn());
+ FTSRestResponse resultList;
+ try
+ {
+ resultList = pdbRestClient.executeRequest(pdbRequest);
+ } catch (Exception e)
+ {
+ errorWarning.append(e.getMessage());
+ return;
+ } finally
+ {
+ validateSelections();
+ }
+ if (resultList.getSearchSummary() != null
+ && resultList.getSearchSummary().size() > 0)
+ {
+ isValidPBDEntry = true;
+ }
}
+ validateSelections();
}
- validateSelections();
- }
- }.start();
- }
+ }.start();
+ }
}
@Override
* referenced in input data has already been associated with jalview objects.
*
* @param tp
- * @param loaderFrame
* @return Object[] { AlignmentView, AlignmentI - reference alignment for
* input }
*/
/*
* instances of this class scoped by some context class
*/
- private IdentityHashMap<StructureSelectionManagerProvider, StructureSelectionManager> structureSelections;
+ private IdentityHashMap<StructureSelectionManagerProvider, StructureSelectionManager> selectionManagers;
/**
* Answers an instance of this class for the current application (Java or JS
StructureSelectionManager getInstanceForContext(
StructureSelectionManagerProvider context)
{
- StructureSelectionManager instance = structureSelections.get(context);
+ StructureSelectionManager instance = selectionManagers.get(context);
if (instance == null)
{
instance = new StructureSelectionManager();
- structureSelections.put(context, instance);
+ selectionManagers.put(context, instance);
}
return instance;
}
public static void release(StructureSelectionManagerProvider provider)
{
- getInstance().structureSelections.remove(provider);
+ getInstance().selectionManagers.remove(provider);
}
/**
*/
private StructureSelectionManager()
{
- structureSelections = new IdentityHashMap<>();
+ selectionManagers = new IdentityHashMap<>();
}
/**
}
/**
+ * Returns a readable description of all mappings for the wrapped pdbfile to
+ * any mapped sequences
*
- * @return a readable description of all mappings for the wrapped pdbfile to
- * any mapped sequences
- *
+ * @return
*/
public String printMappings()
{
{
// NOTE: THIS WILL FAIL IN SWINGJS BECAUSE IT INVOLVES A FILE READER
- System.out.println("IDentifiersURLProvider.idFileName=" + idFileName);
+ // System.out.println("IDentifiersURLProvider.idFileName=" + idFileName);
FileReader reader = new FileReader(idFileName);
String key = "";
Map<String, Object> obj = (Map<String, Object>) JSONUtils.parse(reader);
}
} catch (IOException | ParseException e)
{
- // unnecessary
- e.printStackTrace();
+ //e.printStackTrace();
// Note how in JavaScript we can grab the first bytes from any file reader.
// Typical report here is "NetworkError" because the file does not exist.
// "https://." is coming from System.getProperty("user.home"), but this could
import com.stevesoft.pat.Regex;
-/**
- * This class is not implemented because Preferences never puts anything in
- * groupURLLinks.
- *
- * @author hansonr
- *
+/*
+ * This class is not currently instantiated because Preferences never puts anything in
+ * groupURLLinks
*/
public class GroupUrlLink
{
*/
private boolean isResidueObserved(Residue residue)
{
- Set<String> annotations = getResidueAnnotaitons(residue,
+ Set<String> annotations = getResidueAnnotations(residue,
ResidueDetailType.ANNOTATION);
if (annotations == null || annotations.isEmpty())
{
* @param type
* @return
*/
- private Set<String> getResidueAnnotaitons(Residue residue,
+ private Set<String> getResidueAnnotations(Residue residue,
ResidueDetailType type)
{
HashSet<String> foundAnnotations = new HashSet<>();
public class SiftsSettings implements ApplicationSingletonI
{
-
/**
- * public only for testng
+ * Constructor
*
* @return
*/
- public static SiftsSettings getInstance()
+ private static SiftsSettings getInstance()
{
return (SiftsSettings) ApplicationSingletonProvider
.getInstance(SiftsSettings.class);