Summary: | allow to configure default colors for individual shapes | ||
---|---|---|---|
Product: | [Applications] umbrello | Reporter: | Stefan Seefeld <stefan> |
Component: | general | Assignee: | Umbrello Development Group <umbrello-devel> |
Status: | CONFIRMED --- | ||
Severity: | wishlist | ||
Priority: | LO | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Stefan Seefeld
2004-09-21 22:54:19 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. 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. OK, although I can't really see much use in this. 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... Nothing so fancy. The drawing code is done it the method draw() in each *widget class. 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. 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.
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 ? |