Skip to content

Commit a82842f

Browse files
committed
group border color can be editable
1 parent 395d5f0 commit a82842f

2 files changed

Lines changed: 22 additions & 11 deletions

File tree

objectedit.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Maintainer:
77
# Created: Wed Jun 30 11:18:34 2010 (+0530)
88
# Version:
9-
# Last-Updated: Thu Jul 27 11:05:59 2017 (+0530)
9+
# Last-Updated: Tue Jun 19 11:05:59 2017 (+0530)
1010
# By: Harsha
1111
# Update #:
1212
# URL:
@@ -42,6 +42,7 @@
4242
# by setting/unsetting isbuffered field
4343
# Fri May 17 23:45:59 2017 (+0530) - Harsha added, notes header,
4444
# Kd is calculated for the second order reaction and value is displayed
45+
# Tue Jun 18 12:10:54 IST 2018 - Harsha now group boundary color can be editable from the object editor
4546
#
4647
# This program is free software; you can redistribute it and/or
4748
# modify it under the terms of the GNU General Public License as
@@ -174,7 +175,8 @@ def __init__(self, datain, headerdata=['Field','Value'], undolen=100, parent=Non
174175
#harsha: For signalling models will be pulling out notes field from Annotator
175176
# can updates if exist for other types also
176177
if ( isinstance(self.mooseObject, moose.PoolBase)
177-
or isinstance(self.mooseObject,moose.EnzBase) ) :
178+
or isinstance(self.mooseObject,moose.EnzBase)
179+
or isinstance(self.mooseObject,moose.Neutral)) :
178180
self.fields.append("Color")
179181
flag = QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEditable
180182
self.fieldFlags[fieldName] = flag

plugins/kkit.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66
__maintainer__ = "HarshaRani"
77
__email__ = "hrani@ncbs.res.in"
88
__status__ = "Development"
9-
__updated__ = "Oct 18 2017"
10-
'''
9+
__updated__ = "Jun 19 2018"
10+
11+
#Change log:
12+
# 2018 Jun 18: update the color of the group from objecteditor
13+
14+
#code
1115

12-
'''
1316
import math
1417
import sys
1518
from PyQt4 import QtGui, QtCore, Qt
@@ -483,14 +486,20 @@ def updateItemSlot(self, mooseObject):
483486
self.positionChange(mooseObject)
484487
self.view.removeConnector()
485488
self.view.showConnector(item)
486-
def updateColorSlot(self,mooseObject, color):
487-
#Color slot for changing background color for PoolItem from objecteditor
489+
def updateColorSlot(self,mooseObject, colour):
490+
#Color slot for changing background color for Pool,Enz and group from objecteditor
488491
anninfo = moose.Annotator(mooseObject.path+'/info')
489492
textcolor,bgcolor = getColor(anninfo)
490-
anninfo.color = str(color.name())
491-
item = self.mooseId_GObj[mooseObject]
492-
if (isinstance(item,PoolItem) or isinstance(item,EnzItem) or isinstance(item,MMEnzItem) ):
493-
item.updateColor(color)
493+
anninfo.color = str(colour.name())
494+
495+
if mooseObject.className == "Neutral":
496+
item = self.qGraGrp[mooseObject]
497+
item.setPen(QtGui.QPen(QtGui.QColor(colour),item.pen().width(),item.pen().style(),item.pen().capStyle(),item.pen().joinStyle()))# self.comptPen, Qt.Qt.SolidLine, Qt.Qt.RoundCap, Qt.Qt.RoundJoin))
498+
499+
elif (isinstance(mooseObject,PoolBase) or isinstance(mooseObject,EnzBase) ):
500+
item = self.mooseId_GObj[mooseObject]
501+
item.updateColor(colour)
502+
494503
'''
495504
def mooseObjOntoscene(self):
496505
# All the compartments are put first on to the scene \

0 commit comments

Comments
 (0)