Hi Michiel
It would be wise to state clearly in the contract for the
NotationName.setNotationOffset(int offset) method that the value
should be frozen, once set. Maybe you can even implement this by
refusing any change once the value was already set to a non-zero value.
This will reduce the problem of changing offsets to notation language
changes.
I need to do this because each notation has it's own way of displaying
visibility. Java has words, UML has signs... so the size of the offset
needs to change each time the notation is changed.
With the Dialog font 16 points, the toggling in Java notation for a
"protected void newOperation()" still works in the space after the
void, so the area is a bit wide. This may obscure the normal editing
mode for double-clicking - which is bad.
In fact, wherever you double-click on "final int newAttr", the
visibility is toggled, and you do not enter editing mode.
Maybe you can detect double-clicking and not toggle visibility, but go
to edit mode?
You are right! This comes from the fact that protected is very long,
package is not displayed and it's impossible to make a correlation
between font size and font width that works everytime (mine works better
for small fonts). The size can be reduced, there's no problem. But maybe
I could limit the size for all notations. Make a size that's big enough
to be comfortable to use and small enough to not interfere with
double-clicking!
I still think that this feature needs some visual indication to be
usefull - there are too many hidden features already in ArgoUML.
Why not create a toolbelt-button (selection action button) instead?
I mean a button that appears at the left hand side of the text when
the text is selected, and the mouse is hovering over the fig.
You mean something like the buttons around a Class fig ? This could be
nice, and it will in fact make it more obvious for the users. This would
also be "offset" free :D
I do not understand your question: "Where should I put the code to set
this offset in order to execute it every time the notation changes, ..."
I want to put a line of code like this
"ProjectManager.getManager().getCurrentProject().getProjectSettings().getNotationName().setOffset(size)"
in every existing notation. But I need this part of code to be executed
only when the notation changes. I've tried InitNotationJava,
InitNotationUML, but they are called at the beginning when initializing
subsystems, not everytime the notation is changed.
Since you do this in FigOperation, it seems to be working:
int offset =
ProjectManager.getManager().getCurrentProject().getProjectSettings().getNotationName().getNotationOffset();
The value is taken from the NotationName every time...
Getting the value is not a problem, but setting it is.
BTW: You should shorten
ProjectManager.getManager().getCurrentProject() to "getProject()", to
prevent dependency on the kernel.
;)
I will further discuss this with Luis before I make any decision, but
the idea with the toolbelt-button is a good approach I think. The only
problem is, I have no idea on how to do this now...
Regards,
Bogdan
--
Bogdan SZANTO
-----------------------------------------------
Impossible is nothing ~ Nothing is impossible !
-----------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]