Bug 89980 - allow to configure default colors for individual shapes
Summary: allow to configure default colors for individual shapes
Status: CONFIRMED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: LO wishlist
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-21 22:54 UTC by Stefan Seefeld
Modified: 2004-10-20 21:15 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Seefeld 2004-09-21 22:54:19 UTC
Version:            (using KDE KDE 3.3.0)

This is a feature I very much appreciate in magicdraw:

Having a 'color code' for all the shape / diagram types makes it much simpler
to catch the important information when glancing at a diagram. Have a look at
the screenshots at http://www.magicdraw.com...

Later, these color properties can (together with other settings) be set per item, 
per diagram, per project, or globally (i.e. per user).
Comment 1 Jonathan Riddell 2004-09-21 23:09:32 UTC
You can specify colours per file, per diagram or per item.

Please give a more clear explanation if you mean something more than this.
Comment 2 Stefan Seefeld 2004-09-21 23:22:08 UTC
I'm talking about *default* colors, i.e. I want to configure umbrello
such that each new use case becomes green, each new state yellow,
each new class red, each new package blue. You get the idea...

I don't think this is currently possible, at least I only found a single
place to configure a default color...a single one, that applied to all
shapes.
Comment 3 Jonathan Riddell 2004-09-25 00:31:08 UTC
OK, although I can't really see much use in this.
Comment 4 Stefan Seefeld 2004-10-20 06:19:02 UTC
how are shapes created ? Do you use some kind of prototype pattern ?
Would it be possible to configure the default properties (such as fill color)
per shape, and then let the shape instance inherit the default value until
the user overrides it explicitely ?
With some hints may be I'm able to provide a patch...
Comment 5 Jonathan Riddell 2004-10-20 18:34:22 UTC
Nothing so fancy.  The drawing code is done it the method draw() in each *widget class.
Comment 6 Stefan Seefeld 2004-10-20 18:43:06 UTC
understood. I'm just wondering how best to implement the inheritance of default
parameters when shapes are instantiated. It strikes me that 'prototype' would
be an appropriate pattern.
That way on startup one prototype of each shape is instantiated and initialized with the configured default (drawing) properties. Whenever the user requests a new shape, the appropriate prototype is cloned with these defaults as its initial state.
Comment 7 Oliver Kellogg 2004-10-20 20:56:54 UTC
Stefan Seefeld wrote:
> I'm just wondering how best to implement the inheritance of
> default parameters when shapes are instantiated.

For more info, see UMLWidget::init (which is called by nearly
all widget constructors)
  ...
  const Settings::OptionState& optionState = m_pView->getOptionState();
  m_FillColour = optionState.uiState.fillColor;
  m_LineColour = optionState.uiState.lineColor;
  m_LineWidth  = optionState.uiState.lineWidth;
  m_Font       = optionState.uiState.font;
  ...

So it's much like you said, each widget's presentation attributes
are initialized from the global settings and can then be overridden
individually.
Comment 8 Stefan Seefeld 2004-10-20 21:15:09 UTC
fine. I can see a problem with this approach however:
All properties are retrieved from an 'UMLView' instance,
and so it is hard to add shape-specific properties.
In other words, the current approach is not extensible
since all initialization passes through a central hub.

Of course the prototype pattern alone won't help here
as it doesn't define how and where the prototypes themselfs
would be created. An (abstract) factory may help here.

What do you think ?