Skip to content

Commit

Permalink
reworked RS interactions
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Oct 15, 2023
1 parent 362aa1c commit c606138
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ OPUmlClassifierItemLabel >> modelChanged [
]

{ #category : #rendering }
OPUmlClassifierItemLabel >> renderShapeDetails [
OPUmlClassifierItemLabel >> selectableInteraction [

| selectable |
super renderShapeDetails.
selectable := OPRSSelectable new.
selectable highlightColor: Color blue.
roassalShape @ selectable
^ OPRSSelectable highlightColorBlue
]

{ #category : #'as yet unclassified' }
Expand Down
12 changes: 7 additions & 5 deletions repository/OpenPonk-ClassEditor/OPUmlClassifierShape.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,21 @@ OPUmlClassifierShape >> minExtent [
]

{ #category : #hooks }
OPUmlClassifierShape >> setupHighlight: aHighlightable [
OPUmlClassifierShape >> selectableInteraction [

super setupHighlight: aHighlightable.
adornmentCreationBlock ifNil: [ ^ self ].
aHighlightable highlightAdornments: [ :builder |
| selectableInteraction |
selectableInteraction := super selectableInteraction.
adornmentCreationBlock ifNil: [ ^ selectableInteraction ].
selectableInteraction highlightAdornments: [ :builder |
builder horizontalLocation
outer;
right.
builder verticalLocation
inner;
top.
builder directionDown.
adornmentCreationBlock value: builder ]
adornmentCreationBlock value: builder ].
^ selectableInteraction
]

{ #category : #accessing }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,28 +117,29 @@ OPUmlCompartmentableShape >> renderBasicShape [
{ #category : #rendering }
OPUmlCompartmentableShape >> renderShapeDetails [

| selectable |
super renderShapeDetails.
selectable := OPRSSelectable new.
self setupHighlight: selectable.
roassalShape @ selectable.
self roassalShape @ OPRSSelectionDraggable.
self roassalShape
when: RSPositionChangedEvent
do: [ :event | self layoutContents ]
for: self
]

{ #category : #rendering }
OPUmlCompartmentableShape >> selectableInteraction [

^ OPRSSelectable highlightBorderColorBlue
]

{ #category : #accessing }
OPUmlCompartmentableShape >> separators [

^ separators
]

{ #category : #rendering }
OPUmlCompartmentableShape >> setupHighlight: selectable [
OPUmlCompartmentableShape >> shouldBePositionableByUser [

selectable highlightBorderColor: Color blue
^ true
]

{ #category : #rendering }
Expand Down
32 changes: 26 additions & 6 deletions repository/OpenPonk-ClassEditor/OPUmlPackageShape.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ Class {
#category : #'OpenPonk-ClassEditor-DiagramElements'
}

{ #category : #rendering }
OPUmlPackageShape >> addSelectionDraggableInteraction [

roassalShape
@ (OPRSSelectionDraggable thatAlsoDragsShapesProvidedByBlock:
innerRoassalShapesBlock)
]

{ #category : #initialization }
OPUmlPackageShape >> initialize [

Expand Down Expand Up @@ -113,13 +121,25 @@ OPUmlPackageShape >> renderShapeDetails [
self width.
self minWidth.
(mainLabel width + self padding) } max ]
for: self.
for: self
]

self roassalShape
@ OPRSSelectable;
@ (OPRSSelectionDraggable thatAlsoDragsShapesProvidedByBlock:
innerRoassalShapesBlock);
@ OPRSResizable
{ #category : #rendering }
OPUmlPackageShape >> selectableInteraction [

^ OPRSSelectable
]

{ #category : #rendering }
OPUmlPackageShape >> shouldBePositionableByUser [

^ true
]

{ #category : #interactions }
OPUmlPackageShape >> shouldBeResizableByUser [

^ true
]

{ #category : #accessing }
Expand Down

0 comments on commit c606138

Please sign in to comment.