Commit 5cccc1d6 authored by Maxime Perrotin's avatar Maxime Perrotin

Adjust better size of MSC instances in streaming mode

parent 4b2b73d8
......@@ -19,9 +19,10 @@
# along with TASTE Msc Diagram Editor. If not, see
# <http://www.gnu.org/licenses/>.
#
# Author: Angel Esquinas <aesquina@datsi.fi.upm.es>
# Original Author: Angel Esquinas <aesquina@datsi.fi.upm.es>
# Maintainer: Maxime Perrotin <maxime.perrotin@esa.int>
#
# Copyright (c) 2012 European Space Agency
# Copyright (c) 2012-2015 European Space Agency
#
#******************************************************************************
import logging
......@@ -198,17 +199,14 @@ class MscGraphBasicMSCScene(QGraphicsScene):
def removeMessage(self, message):
u"""Remove a Message from Scene"""
self.bmsc().removeMessage(message)
logger.debug("BEFORE REMOVE ITEM")
if message.scene():
self.removeItem(message)
logger.debug("BEFORE DELETE")
message.delete()
#--------------- Comments
def addComment(self, item=None, pos=None):
u"""
Add new "comment" to the scene and position it in "pos"
if any
Add new "comment" to the scene and position it in (optional) "pos"
"""
if item != None and item.comment() != None:
return
......
......@@ -197,6 +197,9 @@ class MscGraphInstance(MscGraphItem):
if y > lowLimit:
lowLimit = y
# Adjust size to fit Condition boxes
newSize += 40
if newSize < lowLimit:
self.bodySize = lowLimit + (2 * self.Offset)
else:
......@@ -279,8 +282,6 @@ class MscGraphInstance(MscGraphItem):
if change == MscGraphItem.ItemPositionChange:
if self.flagFixAxisY:
value.setY(self.pos().y())
# for mess in self.messages:
# mess.updatePosition()
return MscGraphItem.itemChange(self, change, value)
......@@ -288,9 +289,7 @@ class MscGraphInstance(MscGraphItem):
# Label Functions
#**************************************************************************
def addLabel(self):
# labelValidator = QRegExpValidator(mscregexp.MscNameRegExp, self)
self.label = MscGraphTextItem(self.mscData().name(), self)
# self.label.setValidator(labelValidator)
self.label.setEditable(True)
self.label.setCenterPos(QPointF(0, -15))
self.label.lostFocus.connect(self._labelLostFocus)
......@@ -352,7 +351,6 @@ class MscGraphInstance(MscGraphItem):
if self.headWidth < labelWidth:
self.headWidth = labelWidth + (2 * self.Offset)
#self.updateEnd()
self.updateDraw()
MscGraphItem.resizeItem(self, watched, pos)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment