Hi
I've improved ROArc class so that we can now change the angle
between made by the center of the circle and the borders of the edge.
An angle of 0 will return a simple ROLine, and if the angle is bigger
than 2pi, it will use an angle like alpha % 2pi. The angle is given in
rad.
layout:= ROVerticalCompactTree new.
view shape circle size: 15
.
view nodes: ( ROLayout withAllSubclasses ).
view edgesFrom:
#superclass.
layout userDefinedEdges: view edges.
view layout:
layout.
layout verticalGap: 70; horizontalGap: 30.
view applyLayout.
view nodes do: [ :f | (layout childrenFor: f) do: [ :t | (t model
inheritsFrom: f model) ifTrue: [ t model methodDict keysDo: [ :k | (f
model methodDict includesKey: k) ifTrue: [ view edgeFromAssociation: f
model ->t model ] ] ] ] ].
view edges do: [ :e | e - ROLine + (ROArc
new color: (Color r: 0 g: 1 b: 0.5 ); width: 2; angle: 2) ].
layout
userDefinedEdges do: [ :e | e - ROArc + ((ROLine arrowed) color: (Color
r: 1 g: 0 b: 0 ); width: 2 )"; attachPoint: ROCenteredAttachPoint
instance)" ].
Maybe you will see something weird.
Well I don't
understand why, but the first time it draws the ROArc, if the mouse is
not on the canva, there are strange thing until you move the mouse on an
edge...
You can see the same phenomenon when dragging an edge and
making its abscissa bigger and smaller than its father's one.
If you
understand what appends please tell me.
Regards
Mathieu
Hello,
I am looking for two features in Roassal.
- I would like to customized the color of the labels added on the fly
with ROAddName/RORemoveName (See example
ROMondrianViewBuilder>>addingNameOn:).
- Possibility to create dynamicEdges in both directions
(incoming/outgoing), currently, we can only create outgoing edges.
If there's already a way of doing these, I would like to know how?
If not, do you want me to submit a slice?
tx,
Usman
Hi
I would like to have a Morphic widget like this. Does anyone know if there
is something already done that I could reuse?
[image: Inline image 1]
Maybe do it with Roassal in this way:
Use the list morph, where each row knows an image morph with its
corresponding slice of the graph.
Each time the graph changes (for example, if a node is appended), render
using Roassal the part of the graph has to be updated, and cut the rendered
surface in the new slices for each updated row.
Any opinion?
Maybe I should think more in vectors (i.e. Athens) instead of pixels/images?
Cheers,
Martin
Hi!
Just to share a small addon to manage alpha blending I made with Roassal.
Try in an easel the following:
-=-=-=-=-=-=-=-=-=-=-=-=
random := Random new.
view shape circle size: 80; fillColor: Color black.
view interaction on: ROMouseEnter do: [ :event |
ROColorAlphaFading new for: event element nbCycles: 60 ].
nodes := view nodes: (1 to: 50).
nodes do: [:el | el translateTo: (random next * 400) @ (random next * 400) ].
view noLayout.
ROPluggableAnimation new
nbCycles: 20000;
block: [ ROColorAlphaFading new for: nodes atRandom nbCycles: 60 ];
on: view raw.
-=-=-=-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-=-=-=
view shape circle size: 80; fillColor: Color black.
view interaction on: ROMouseEnter do: [ :event |
ROColorAlphaFading new for: event element nbCycles: 60 ].
view nodes: (1 to: 50).
view gridLayout.
-=-=-=-=-=-=-=-=-=-=-=-=
It also works with edges:
-=-=-=-=-=-=-=-=-=-=-=-=
view interaction
dynamicEdgeToAll: [ :model | (1 to: model) collect: [ :v | v // 2 ] ]
usingFading: (ROLine red width: 5; attachPoint: ROCenteredAttachPoint instance).
view shape rectangle size: 20.
view nodes: (1 to: 20).
view circleLayout.
-=-=-=-=-=-=-=-=-=-=-=-=
In the last version of Roassal
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Hi,
As a first step towards less floating windows, Glamour browsers open now in maximized mode by default. Let me know what you think.
Cheers,
Doru
--
www.tudorgirba.com
"What we can governs what we wish."
Hi,
Now that we have moved to SmalltalkHub, all links and loading code from moosetechnology.org needs to be updated. I would need help to get it up to date.
It is easy:
- pick a project, like http://www.moosetechnology.org/tools/petitparser
- update the links and load script
- test :)
Cheers,
Doru
--
www.tudorgirba.com
"Problem solving efficiency grows with the abstractness level of problem understanding."
Hi
There was a strike in Lille, and I admit it's not that easy to
work home, it's far more easy to sleep in the sofa.
I have made a new
shape anyway : ROArc, its an arc of a sixth of circle, maybe we can
script it to choose the another shape (1/4, 1/2 ...).
Gofer new
smalltalkhubUser: 'MathieuDehouck' project: 'RoassalAlgorithm';
package: 'Roassal-New';
load
You can try:
-=-=-=-=-=-=-=-=-=-=-=-
"Source code: ROExample>>expandableNodesOn:"
"Preambule. It includes
the initialization. "
| view rawView layout |
rawView := ROView
new.
view := ROMondrianViewBuilder view:
rawView.
"-------------"
"-------------"
layout:=
ROVerticalCompactTree new.
view shape circle size: 15 .
view nodes:
(Collection withAllSubclasses).
view edgesFrom: #superclass.
layout
userDefinedEdges: view edges.
view layout: layout.
layout
verticalGap: 70; horizontalGap: 30.
view applyLayout.
view nodes do:
[ :f | (layout childrenFor: f) do: [ :t | (t model inheritsFrom: f
model) ifTrue: [ t model methodDict keysDo: [ :k | (f model methodDict
includesKey: k) ifTrue: [ view edgeFromAssociation: f model ->t model ]
] ] ] ].
view edges do: [ :e | e - ROLine + (ROArc new color: (Color
r: 0 g: 1 b: 0.5 ); width: 2) ].
layout userDefinedEdges do: [ :e | e -
ROArc + ((ROLine new) color: (Color r: 1 g: 0 b: 0 ); width: 2 ) ].
view shape: (ROBezierCurve orthoVertical new color: (Color r: 0.9 g: 0.8
b: 0 ); width: 2 ) .
view edgeFromAssociation: (view nodes at: 1) model
->(view nodes at: 33) model.
view edgeFromAssociation: (view nodes at:
5) model ->(view nodes at: 45) model.
view edgeFromAssociation: (view
nodes at: 8) model ->(view nodes at: 36)
model.
"-------------"
"-------------"
"Below is the initiation of the
menu and opening the visualization"
ROEaselMorphic new populateMenuOn:
view.
view open.
-=-=-=-=-=-=-=-=-=-=-=-=-
And you'll see that when
we set a new shape in the easel, only the next edge is affected.
In
this example red edges represent inheritance, green arcs represent
overriding on parent's methods, and the 3 other are just for test
purpose.
And we noticed that only one of the three is drawn in yellow,
the two other are in straight grey.
And I think, we got the same
problem when defining multiple edges at the same time, only the first
take the newly set shape.
Regards
Mathieu
Hello
I've added new features for the force based layout.
You
can change the gravity center, tell where you want to see your fixed
nodes and so on.
I still have a bug with padding, and resizeStrategy,
for example when you click on Example in the view.
Gofer it
smalltalkhubUser: 'MathieuDehouck' project: 'RoassalAlgorithm';
package: 'RoassalForceBaseLayout';
load.
Try this :
---------------------------
"Preambule. It includes the
initialization. "
| rawView view layout |
rawView := ROView new.
view :=
ROMondrianViewBuilder view: rawView.
"enter your script
below"
"-------------"
"-------------"
view interaction on:
ROMouseEnter do: [ :n |
| nodes |
nodes := view raw
elementsFromModels: n element model allSubclasses.
ROHighlightElements
on: nodes ].
view interaction on: ROMouseLeave do: [ :n |
| nodes |
nodes := view raw elementsFromModels: n element model allSubclasses.
ROUnhighlightElements on: nodes ].
view shape rectangle size: 10.
view nodes: (Collection withAllSubclasses).
view edgesFrom:
#superclass.
layout := ROForceBasedLayout_N new.
layout fix: (view
nodes last) at: 450@450;
gravityAt: 437@38 .
view layout: layout.
view applyLayout.
"-------------"
"-------------"
"Below is the
initiation of the menu and opening the visualization"
ROEaselMorphic new
populateMenuOn: view.
view open
---------------------------------------
Mathieu