|
|
Mozy Online Backup: 2GB Free. Automatic. Secure.
Subject: [argouml-dev] Re: Feature3_5140_bszanto: make visibility clickable - msg#00184
List: db.axion.devel
Hi Michiel,
It would have been better to discuss this on the dev list, to sollicit
more design ideas.
Yes it would have!
Can you please point what interface/abstract class I should modify in
order to have a public int getVisibilityOffset() method in every
notation ?
That would be the NotationName interface, and then you can implement
it in NotationNameImpl. You will also need a setter - so that all
notations (e.g. C++) can set this value, and a reasonable default value.
Maybe each notation should be able to switch this feature off?
I'll put this in the interface and implement it in the required
notations. This could be easily switched off with an offset of 0.
But I do have another problem with this value! What is it exactly used
for? (I did not read all the code.) Did you take into account the font
size? If your values work for the default size 10, then it won't on my
PC, where I use size 16.
The value is the approximate width in pixels (default font size) of the
+/-/~/# signs and the public/private/protected words to identify where
the user clicked. The visibility is cycled only if the click is on the
sign or on the word.
Why not make it a separate UI widget, then you will be able to detect
hits easily, and size independently.
This will then work a bit like entering stereotypes on class names:
You can enter them in fronnt of the name, but they will appear above
them. Double clicking on the name allows you to add another...
I would consider showing the visibility in a separate widget.
On a usability point of view I find it very comfortable only clicking
the sign/word to cycle visibility. No need to add and charge the class
Fig. If you have 2 mins to try the feature it would be great. You could
see how easy it is. Computing the size of the offset could be done in
the method and there we could take into account the size of the font.
Maybe Bob has an opinion on this.
Bob ?
Regards,
Michiel
Regards,
Bogdan
--
Bogdan SZANTO
-----------------------------------------------
Impossible is nothing ~ Nothing is impossible !
-----------------------------------------------
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
[argouml-dev] [GSOC] Weekly Report
What I did this week:1. separated the codes for issues 5029 & 5042 in two different branches2. closed 50293. solved issues 5253 & 52544. wrote tests for the OCL evaluator
Next steps:1. wrote more tests and improve the ocl evaluator2. continue work in issue 5260 (organize WFRs) and add more WFRs defined in OCL3. fix 5263maas-http://www.marcosaurelio.com
*1984 +2057"Do not read beauty magazines, they will only make you feel ugly"
Next Message by Date:
click to view message preview
[argouml-dev] The upcoming alpha or beta release
Hello all!
There are still P1 issues so there is no possibility to do a release today. Please everyone, work with the issues and prioritize the high priority (P1 and P2) issues.
I will suggest a new plan tomorrow.
/Linus
Previous Message by Thread:
click to view message preview
[argouml-dev] Feature3_5140_bszanto: make visibility clickable.
Hi Bogdan,
It would have been better to discuss this on the dev list, to sollicit more
design ideas.
Can you please point what interface/abstract class I should modify in
order to have a public int getVisibilityOffset() method in every notation
?
That would be the NotationName interface, and then you can implement it in
NotationNameImpl. You will also need a setter - so that all notations (e.g.
C++) can set this value, and a reasonable default value.
Maybe each notation should be able to switch this feature off?
But I do have another problem with this value! What is it exactly used for?
(I did not read all the code.) Did you take into account the font size? If
your values work for the default size 10, then it won't on my PC, where I
use size 16.
Why not make it a separate UI widget, then you will be able to detect hits
easily, and size independently.
This will then work a bit like entering stereotypes on class names: You can
enter them in fronnt of the name, but they will appear above them. Double
clicking on the name allows you to add another...
I would consider showing the visibility in a separate widget.
Maybe Bob has an opinion on this.
Regards,
Michiel
----- Original Message -----
From: "Bogdan Szanto" <bogdan.szanto@xxxxxxxxx>
To: "Michiel van der Wulp" <mvw@xxxxxxxxxx>
Sent: Saturday, July 26, 2008 11:03 AM
Subject: Re: svn commit: r15373 -
branches/gsoc2008/feature3_5140_bszanto/src/org/argouml/uml/diagram:
static_structure/ui ui
Hi Michiel,
I agree it's a little messy, but this is why I need feedback from you
guys :D
Can you please point what interface/abstract class I should modify in
order to have a public int getVisibilityOffset() method in every notation ?
Regards,
Bogdan
Michiel van der Wulp wrote:
Hi Bogdan,
Hmm... this part I do not like at all:
+ // The hit zone is different for the different notations.
+ // Java uses words (public, protected, private) while UML 1.4
uses
+ // signs (+, -, ~, #).
+ int offset = 0;
+ if (notation.equals("Java")) {
+ offset = 50;
+ } else if (notation.equals("UML 1.4")) {
+ offset = 10;
+ }
If needed, you could ask the notation itself how big the offset is you
need to use, or if possible, measure the length of the returned string.
Regards,
Michiel
----- Original Message ----- From: <bszanto@xxxxxxxxxx>
To: <commits@xxxxxxxxxxxxxxxxxx>
Sent: Saturday, July 26, 2008 10:24 AM
Subject: svn commit: r15373 -
branches/gsoc2008/feature3_5140_bszanto/src/org/argouml/uml/diagram:
static_structure/ui ui
Author: bszanto
Date: 2008-07-26 01:24:10-0700
New Revision: 15373
Modified:
branches/gsoc2008/feature3_5140_bszanto/src/org/argouml/uml/diagram/static_structure/ui/FigOperation.java
branches/gsoc2008/feature3_5140_bszanto/src/org/argouml/uml/diagram/ui/FigCompartmentBox.java
Log:
Clicking (roughly) the +/-/~/# signs or the public/package/private words
now cycles through the visibilities of the operation.
Modified:
branches/gsoc2008/feature3_5140_bszanto/src/org/argouml/uml/diagram/static_structure/ui/FigOperation.java
Url:
http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/feature3_5140_bszanto/src/org/argouml/uml/diagram/static_structure/ui/FigOperation.java?view=diff&rev=15373&p1=branches/gsoc2008/feature3_5140_bszanto/src/org/argouml/uml/diagram/static_structure/ui/FigOperation.java&p2=branches/gsoc2008/feature3_5140_bszanto/src/org/argouml/uml/diagram/static_structure/ui/FigOperation.java&r1=15372&r2=15373
==============================================================================
---
branches/gsoc2008/feature3_5140_bszanto/src/org/argouml/uml/diagram/static_structure/ui/FigOperation.java
(original)
+++
branches/gsoc2008/feature3_5140_bszanto/src/org/argouml/uml/diagram/static_structure/ui/FigOperation.java
2008-07-26 01:24:10-0700
@@ -25,8 +25,10 @@
package org.argouml.uml.diagram.static_structure.ui;
import java.awt.Font;
+import java.awt.Rectangle;
import java.beans.PropertyChangeEvent;
+import org.argouml.kernel.ProjectManager;
import org.argouml.model.Model;
import org.argouml.notation.NotationProvider;
import org.tigris.gef.presentation.Fig;
@@ -94,5 +96,51 @@
return Model.getFacade().isAbstract(getOwner())
? Font.ITALIC : Font.PLAIN;
}
+
+ /**
+ * Cyclies the visibility of an operation when clicking in the
beggining
+ * part of the FigOperation.
+ * @param r Hit rectangle.
+ * @author bszanto
+ */
+ public void changeVisibility(Rectangle r) {
+ if (super.hit(r)) {
+ String notation =
ProjectManager.getManager().getCurrentProject()
+ .getProjectSettings().getNotationLanguage();
+
+ // The hit zone is different for the different notations.
+ // Java uses words (public, protected, private) while UML
1.4 uses
+ // signs (+, -, ~, #).
+ int offset = 0;
+ if (notation.equals("Java")) {
+ offset = 50;
+ } else if (notation.equals("UML 1.4")) {
+ offset = 10;
+ }
+
+ if (r.x < (_x + offset)) {
+ Object operation = getOwner();
+ Object visibity =
Model.getFacade().getVisibility(operation);
+
+ // visibility is chandes according to prop panel order
which is:
+ // public, package, protected, private
+ if
(Model.getVisibilityKind().getPrivate().equals(visibity)) {
+ Model.getCoreHelper().setVisibility(operation,
+ Model.getVisibilityKind().getPublic());
+ } else if (Model.getVisibilityKind().getPublic().equals(
+ visibity)) {
+ Model.getCoreHelper().setVisibility(operation,
+ Model.getVisibilityKind().getPackage());
+ } else if
(Model.getVisibilityKind().getPackage().equals(
+ visibity)) {
+ Model.getCoreHelper().setVisibility(operation,
+ Model.getVisibilityKind().getProtected());
+ } else {
+ Model.getCoreHelper().setVisibility(operation,
+ Model.getVisibilityKind().getPrivate());
+ }
+ }
+ }
+ }
}
Modified:
branches/gsoc2008/feature3_5140_bszanto/src/org/argouml/uml/diagram/ui/FigCompartmentBox.java
Url:
http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/feature3_5140_bszanto/src/org/argouml/uml/diagram/ui/FigCompartmentBox.java?view=diff&rev=15373&p1=branches/gsoc2008/feature3_5140_bszanto/src/org/argouml/uml/diagram/ui/FigCompartmentBox.java&p2=branches/gsoc2008/feature3_5140_bszanto/src/org/argouml/uml/diagram/ui/FigCompartmentBox.java&r1=15372&r2=15373
==============================================================================
---
branches/gsoc2008/feature3_5140_bszanto/src/org/argouml/uml/diagram/ui/FigCompartmentBox.java
(original)
+++
branches/gsoc2008/feature3_5140_bszanto/src/org/argouml/uml/diagram/ui/FigCompartmentBox.java
2008-07-26 01:24:10-0700
@@ -32,6 +32,7 @@
import org.argouml.ui.targetmanager.TargetManager;
import org.argouml.uml.diagram.static_structure.ui.FigAttribute;
+import org.argouml.uml.diagram.static_structure.ui.FigOperation;
import org.argouml.uml.diagram.static_structure.ui.SelectionClass;
import org.tigris.gef.base.Editor;
import org.tigris.gef.base.Globals;
@@ -116,9 +117,11 @@
2,
2);
- if (highlightedFigText instanceof FigAttribute) {
- // try to change visibility
+ // try to change visibility
+ if (highlightedFigText instanceof FigAttribute) {
((FigAttribute) highlightedFigText).changeVisibility(r);
+ } else if (highlightedFigText instanceof FigOperation) {
+ ((FigOperation) highlightedFigText).changeVisibility(r);
}
unhighlight();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: commits-help@xxxxxxxxxxxxxxxxxx
No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.138 / Virus Database: 270.5.6/1574 - Release Date: 7/25/2008
4:27 PM
--
Bogdan SZANTO
address:
15e Ãtage
1, AllÃe AthÃna
69100 Villeurbanne
FRANCE
tel: +33 (0)6 37 45 98 55
+33 (0)4 69 16 08 73
mail: bogdan.szanto@xxxxxxxxxxxx
szantobogdan@xxxxxxxxx
bogdan.szanto@xxxxxxxxx
-----------------------------------------------
Impossible is nothing ~ Nothing is impossible !
-----------------------------------------------
No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.138 / Virus Database: 270.5.6/1574 - Release Date: 7/25/2008
4:27 PM
Next Message by Thread:
click to view message preview
Re: [argouml-dev] Re: Feature3_5140_bszanto: make visibility clickable
Hi Bogdan
I've just switched to your branch to see how this works. I haven't
looked at the code, just the usability.
I have no great views on this feature. I think its rather a hidden and
inconsistent feature so likely not to get noticed.
Personally I'm looking forward to the class wizard from which I'm
hoping we will get more flexibility for editing the class and its
contained elements with commonly recognised widgets.
Bob.
2008/7/28 Bogdan Szanto <bogdan.szanto@xxxxxxxxx>:
> Hi Michiel,
>>
>> It would have been better to discuss this on the dev list, to sollicit
>> more design ideas.
>
> Yes it would have!
>>>
>>> Can you please point what interface/abstract class I should modify in
>>> order to have a public int getVisibilityOffset() method in every notation ?
>>
>> That would be the NotationName interface, and then you can implement it in
>> NotationNameImpl. You will also need a setter - so that all notations (e.g.
>> C++) can set this value, and a reasonable default value.
>> Maybe each notation should be able to switch this feature off?
>
> I'll put this in the interface and implement it in the required notations.
> This could be easily switched off with an offset of 0.
>>
>> But I do have another problem with this value! What is it exactly used
>> for? (I did not read all the code.) Did you take into account the font size?
>> If your values work for the default size 10, then it won't on my PC, where I
>> use size 16.
>
> The value is the approximate width in pixels (default font size) of the
> +/-/~/# signs and the public/private/protected words to identify where the
> user clicked. The visibility is cycled only if the click is on the sign or
> on the word.
>>
>> Why not make it a separate UI widget, then you will be able to detect hits
>> easily, and size independently.
>> This will then work a bit like entering stereotypes on class names: You
>> can enter them in fronnt of the name, but they will appear above them.
>> Double clicking on the name allows you to add another...
>> I would consider showing the visibility in a separate widget.
>
> On a usability point of view I find it very comfortable only clicking the
> sign/word to cycle visibility. No need to add and charge the class Fig. If
> you have 2 mins to try the feature it would be great. You could see how easy
> it is. Computing the size of the offset could be done in the method and
> there we could take into account the size of the font.
>>
>> Maybe Bob has an opinion on this.
>
> Bob ?
>>
>> Regards,
>> Michiel
>
> Regards,
> Bogdan
>
> --
> Bogdan SZANTO
> -----------------------------------------------
> Impossible is nothing ~ Nothing is impossible !
> -----------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@xxxxxxxxxxxxxxxxxx
> For additional commands, e-mail: dev-help@xxxxxxxxxxxxxxxxxx
>
>
|
|