import jalview.api.AlignmentViewPanel;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
-import jalview.schemes.ColourSchemeI;
import jalview.structures.models.AAStructureBindingModel;
public interface JalviewStructureDisplayI
void closeViewer(boolean closeExternalViewer);
/**
- * apply a colourscheme to the structures in the viewer
- *
- * @param colourScheme
- */
- void setJalviewColourScheme(ColourSchemeI colourScheme);
-
- /**
*
* @return true if all background sequence/structure binding threads have
* completed for this viewer instance
return;
}
- // Chimera expects RBG values in the range 0-1
+ // Chimera expects RGB values in the range 0-1
final double normalise = 255D;
viewerCommandHistory(false);
StringBuilder command = new StringBuilder(128);
? ResidueProperties.getSingleCharacterCode(resName)
: resName.charAt(0);
Color col = cs.findColour(res, 0, null, null, 0f);
- command.append("color " + col.getRed() / normalise + ","
- + col.getGreen() / normalise + "," + col.getBlue() / normalise
- + " ::" + resName + ";");
+ command.append("color ")
+ .append(String.valueOf(col.getRed() / normalise)).append(",")
+ .append(String.valueOf(col.getGreen() / normalise))
+ .append(",").append(String.valueOf(col.getBlue() / normalise))
+ .append(" ::").append(resName).append(";");
}
sendAsynchronousCommand(command.toString(), COLOURING_CHIMERA);
buildColourMenu();
}
- @Override
- public void setJalviewColourScheme(ColourSchemeI cs)
- {
- getBinding().setJalviewColourScheme(cs);
- }
-
/**
* Sends commands to the structure viewer to superimpose structures based on
* currently associated alignments. May optionally return an error message for
{
return;
}
- // todo: property change event for visibleAlignment
- // to avoid unnecessary redraws here
- if (!colourBySequence && !isShowAlignmentOnly())
+
+ /*
+ * if structure is not coloured by sequence, but restricted to the alignment,
+ * then redraw it (but don't recolour it) in case hidden regions have changed
+ * (todo: specific messaging for change of hidden region only)
+ */
+ if (!colourBySequence)
{
+ if (isShowAlignmentOnly())
+ {
+ showStructures(alignmentv.getAlignViewport(), false);
+ }
return;
}
if (getSsm() == null)