private void repaintTrack() { // Update tracks Track[] tracks = MainFrame.getInstance().getTrackListPanel().getModel().getTracks(); for (Track track : tracks) { track.repaint(); } }
private void setTrackLock(boolean lock) { // Update tracks LayerType[] filter = {LayerType.VARIANT_LAYER}; List<Layer<?>> allLayers = MainFrame.getInstance().getTrackListPanel().getModel().getAllLayers(); List<Layer<?>> layers = Utils.getLayers(allLayers, filter); for (Layer<?> layer : layers) { if (lock) { ((VariantLayer) layer).getGenomeDrawer().lockPainting(); } else { ((VariantLayer) layer).getGenomeDrawer().unlockPainting(); } } }
@Override public void trackListActionPerformed(ActionEvent arg0) { if (MainFrame.getInstance().isLocked()) { return; } final Track selectedTrack = getTrackListPanel().getSelectedTrack(); if (selectedTrack != null) { VariantLayerDisplaySettings data = AddOrEditVariantLayerDialog.showAddDialog(getRootPane()); if (data != null) { MGDisplaySettings settings = MGDisplaySettings.getInstance(); VariantLayer newLayer = new VariantLayer(selectedTrack); newLayer.setData(data); selectedTrack.getLayers().add(newLayer); selectedTrack.setActiveLayer(newLayer); // Updates track (filters, display) MGARefresh action = new MGARefresh(); action.setPreviousFilterList(settings.getFilterSettings().getAllMGFilters()); action.actionPerformed(null); } } }