summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Sims <mark@nanorex.com>2008-12-16 03:24:51 +0000
committerMark Sims <mark@nanorex.com>2008-12-16 03:24:51 +0000
commitfd059d37cc19e93b10e402f52a75e3175b5dcef8 (patch)
tree947400de3cd54f91bdd6478b625fed3289d5d1bf
parentd6a04a5af488673a141cf27bd969f83afd835363 (diff)
downloadnanoengineer-theirix-fd059d37cc19e93b10e402f52a75e3175b5dcef8.tar.gz
nanoengineer-theirix-fd059d37cc19e93b10e402f52a75e3175b5dcef8.zip
Implemented protein model tree icons (normal and hide). Also added more details to getDisplayStyle() docstring.
-rw-r--r--cad/src/graphics/display_styles/ProteinChunks.py4
-rwxr-xr-xcad/src/model/chunk.py20
-rw-r--r--cad/src/ui/modeltree/Protein-hide.pngbin0 -> 285 bytes
-rw-r--r--cad/src/ui/modeltree/Protein.pngbin0 -> 302 bytes
4 files changed, 20 insertions, 4 deletions
diff --git a/cad/src/graphics/display_styles/ProteinChunks.py b/cad/src/graphics/display_styles/ProteinChunks.py
index 22dae7478..02c95533b 100644
--- a/cad/src/graphics/display_styles/ProteinChunks.py
+++ b/cad/src/graphics/display_styles/ProteinChunks.py
@@ -386,8 +386,8 @@ class ProteinChunks(ChunkDisplayMode):
# Pretty sure Bruce's intention is to define icons for subclasses
# of ChunkDisplayMode here, not in mticon_names[] and hideicon_names[]
# in chunks.py. Ask him to be sure. Mark 2008-02-12
- icon_name = "modeltree/DnaCylinder.png"
- hide_icon_name = "modeltree/DnaCylinder-hide.png"
+ icon_name = "modeltree/Protein.png"
+ hide_icon_name = "modeltree/Protein-hide.png"
def _get_aa_color(self, chunk, pos, n_pos, sec, aa, c_sec, n_sec):
"""
diff --git a/cad/src/model/chunk.py b/cad/src/model/chunk.py
index cdb08c05c..bd6d3da6f 100755
--- a/cad/src/model/chunk.py
+++ b/cad/src/model/chunk.py
@@ -1417,10 +1417,15 @@ class Chunk(NodeWithAtomContents, InvalMixin,
return
def node_icon(self, display_prefs): # bruce 050109 revised this [was seticon]; revised again 060608
try:
+ if self.isProteinChunk():
+ hd = get_display_mode_handler(diPROTEIN)
+ if hd:
+ return hd.get_icon(self.hidden)
if self.hidden:
return self.hideicon[self.display]
else:
return self.mticon[self.display]
+
except IndexError:
# probably one of those new-fangled ChunkDisplayModes [bruce 060608]
hd = get_display_mode_handler(self.display)
@@ -3479,7 +3484,7 @@ class Chunk(NodeWithAtomContents, InvalMixin,
# all calls and this looks safe. (Ditto with Atom version of this
# method.) [bruce comment 080305 @@@@]
"""
- set self's display style
+ Set self's display style.
"""
if self.display == disp:
#bruce 080305 optimization; looks safe after review of all calls;
@@ -3497,7 +3502,18 @@ class Chunk(NodeWithAtomContents, InvalMixin,
def getDisplayStyle(self):
"""
- return self's display style.
+ Return the display style set on self (and not the one supplied from
+ self's environment (i.e. the glpane) when self's display style is set to
+ to diDEFAULT).
+
+ Use get_dispdef to obtain the display style set by self or self's
+ environment when self's display style is set to diDEFAULT.
+
+ @note: self's display style used to draw self can differ from
+ self.display not only if it's diDEFAULT, but due to some special cases
+ in get_dispdef based on the type of chunk.
+
+ @see: L{get_dispdef()}
"""
return self.display
diff --git a/cad/src/ui/modeltree/Protein-hide.png b/cad/src/ui/modeltree/Protein-hide.png
new file mode 100644
index 000000000..0e4f330a8
--- /dev/null
+++ b/cad/src/ui/modeltree/Protein-hide.png
Binary files differ
diff --git a/cad/src/ui/modeltree/Protein.png b/cad/src/ui/modeltree/Protein.png
new file mode 100644
index 000000000..626e443ac
--- /dev/null
+++ b/cad/src/ui/modeltree/Protein.png
Binary files differ