X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fstructure%2FStructureCommandsBase.java;h=8716691d76f861effe1260796bbf4522a980fd90;hb=d85279450741df748b662ca0e7757a489b8c6d01;hp=321fc257fa5f3613e425ea02eb6b912417a22c94;hpb=2ab7b9b152018bb808693218ad88dc3778166492;p=jalview.git
diff --git a/src/jalview/structure/StructureCommandsBase.java b/src/jalview/structure/StructureCommandsBase.java
index 321fc25..8716691 100644
--- a/src/jalview/structure/StructureCommandsBase.java
+++ b/src/jalview/structure/StructureCommandsBase.java
@@ -1,5 +1,11 @@
package jalview.structure;
+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
* for structure viewers
@@ -9,4 +15,243 @@ package jalview.structure;
*/
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