X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fstructure%2FStructureCommandsBase.java;h=8716691d76f861effe1260796bbf4522a980fd90;hb=3975a73e927fe1adb8f3411f22c10a3e5e74ec73;hp=119a27ab212bc8cc99eb60a7c0f631b6af608b26;hpb=6cb920bb7a7f285a165cd34b3429dabba71f7518;p=jalview.git
diff --git a/src/jalview/structure/StructureCommandsBase.java b/src/jalview/structure/StructureCommandsBase.java
index 119a27a..8716691 100644
--- a/src/jalview/structure/StructureCommandsBase.java
+++ b/src/jalview/structure/StructureCommandsBase.java
@@ -1,7 +1,10 @@
package jalview.structure;
-import jalview.api.AlignmentViewPanel;
-import jalview.datamodel.SequenceI;
+import java.awt.Color;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
/**
* A base class holding methods useful to all classes that implement commands
@@ -12,12 +15,243 @@ import jalview.datamodel.SequenceI;
*/
public abstract class StructureCommandsBase implements StructureCommandsI
{
+ public static final String NAMESPACE_PREFIX = "jv_";
+
+ private static final String CMD_SEPARATOR = ";";
+
+ /**
+ * Returns something that separates concatenated commands
+ *
+ * @return
+ */
+ protected String getCommandSeparator()
+ {
+ return CMD_SEPARATOR;
+ }
+
+ /**
+ * Returns the lowest model number used by the structure viewer
+ *
+ * @return
+ */
+ @Override
+ public int getModelStartNo()
+ {
+ return 0;
+ }
+
+ /**
+ * Helper method to add one contiguous range to the AtomSpec model for the given
+ * value (creating the model if necessary). As used by Jalview, {@code value} is
+ *
+ *
a colour, when building a 'colour structure by sequence' command
+ *
a feature value, when building a 'set Chimera attributes from features'
+ * command
+ *
+ *
+ * @param map
+ * @param value
+ * @param model
+ * @param startPos
+ * @param endPos
+ * @param chain
+ */
+ public static final void addAtomSpecRange(Map