Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 28 additions & 12 deletions src/Molecule-IDE/MolComponentImpl.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,41 @@ Extension { #name : #MolComponentImpl }
{ #category : #'*Molecule-IDE' }
MolComponentImpl >> asRSMoleculeShape [

| classNameLabel componentNameLabel contracts composite |
classNameLabel := RSLabel new
text: self className;
color: Color black lighter lighter;
italic;
fontSize: 14;
| implementationLabel componentNameLabel contracts composite componentTypeLabel componentNameText |

componentTypeLabel := RSLabel new
text: (self class componentType asString);
color: Color black;
bold;
fontSize: 18;
yourself.

"don't display the default name to have better visual identification of named components"
componentNameText := self componentName = (MolUtils defaultComponentName)
ifTrue:[ '' ]
Comment thread
LabordePierre marked this conversation as resolved.
Outdated
ifFalse:[ '#', self componentName ].

componentNameLabel := RSLabel new
text: self componentName;
color: Color black;
fontSize: 18;
text: componentNameText;
color: Color black lighter;
fontSize: 16;
yourself.

implementationLabel := RSLabel new
text: (self className);
color: Color black lighter lighter;
italic;
fontSize: 12;
yourself.

contracts := MolComponentToRoassal makeContractShapesFor: self.

RSVerticalLineLayout new
alignCenter;
on: {
componentTypeLabel.
implementationLabel.
componentNameLabel.
classNameLabel.
contracts }.

composite := RSComposite new
Expand All @@ -32,8 +47,9 @@ MolComponentImpl >> asRSMoleculeShape [
withBorder;
color: Color gray muchLighter;
shapes: {
componentNameLabel.
classNameLabel.
componentTypeLabel.
implementationLabel.
componentNameLabel.
contracts };
yourself.
composite adjustToChildren.
Expand Down
Loading