Skip to content

Commit

Permalink
Merge pull request #76 from hpi-swa-teaching/master
Browse files Browse the repository at this point in the history
release v0.6
  • Loading branch information
LeonBein authored Jul 11, 2018
2 parents a286213 + 5bda1ab commit f57f6f3
Show file tree
Hide file tree
Showing 161 changed files with 611 additions and 409 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
instance creation
for: aMorph

^ self new addContent: aMorph
^ self new setContent: aMorph
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resizing
actionForCorner: aSymbol

^ ('drag', aSymbol capitalized, 'Event:fromHandle:') asSymbol
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
handles
addHandleAt: aPosition

| handle |
handle := self createHandleOnMove: (self actionForCorner: aPosition).
handle setProperty: #morphicLayerNumber toValue: self handleLayerNumber.
self addMorphInLayer: handle.
self resizeHandles at: aPosition put: handle

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ handles
addResizeHandles

self hasHandles ifFalse: [
self corners
withIndexDo: [:each :index |
self addHandleAtPosition: each withIndex: index].
self addHandleAt: #topLeft.
self addHandleAt: #topRight.
self addHandleAt: #bottomRight.
self addHandleAt: #bottomLeft.
self placeHandles.
self hasHandles: true]

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
handles
createHandleOnMove: aSymbol

| handle |
handle := RectangleMorph new
extent: self resizeHandleSize;
color: Color black.
handle
on: #mouseMove
send: aSymbol
to: self.
^ handle
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resizing
dragBottomLeftEvent: evt fromHandle: handle

self extentBottomLeft: (self resizeFractionsOf: evt)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resizing
dragBottomRightEvent: evt fromHandle: handle

self extentBottomRight: (self resizeFractionsOf: evt)
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
resizing
dragCorner: index event: evt fromHandle: handle

| layoutFractions |
layoutFractions := self layoutFractionsOf: evt cursorPoint.
index caseOf: { [1] -> [self extentTopLeft: layoutFractions].
[2] -> [self extentTopRight: layoutFractions].
[3] -> [self extentBottomRight: layoutFractions].
[4] -> [self extentBottomLeft: layoutFractions]}
dragCorner: aSymbol event: event fromHandle: aMorph

self
perform: (self actionForCorner: aSymbol)
with: event
with: aMorph
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resizing
dragTopLeftEvent: evt fromHandle: handle

self extentTopLeft: (self resizeFractionsOf: evt)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resizing
dragTopRightEvent: evt fromHandle: handle

self extentTopRight: (self resizeFractionsOf: evt)
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
resizing
extentBottomLeft: aPoint

self
layoutFrame
self layoutFrame
leftFraction: aPoint x;
bottomFraction: aPoint y.
self layoutChanged
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
resizing
extentBottomRight: aPoint

self
layoutFrame
self layoutFrame
rightFraction: aPoint x;
bottomFraction: aPoint y.
self layoutChanged
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
resizing
extentTopLeft: aPoint

self
layoutFrame
self layoutFrame
leftFraction: aPoint x;
topFraction: aPoint y.
self layoutChanged
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
resizing
extentTopRight: aPoint

self
layoutFrame
self layoutFrame
rightFraction: aPoint x;
topFraction: aPoint y.
self layoutChanged
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ initialize
super initialize.
self
color: Color transparent;
resizeHandles: OrderedCollection new;
resizeHandles: Dictionary new;
hasHandles: false;
addResizeHandles
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
magnetic raster
isMagnetic

^ self owner isMagnetic

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resizing
placeHandles

self resizeHandles withIndexDo: [:each :index |
each center: (self corners at: index)]
self resizeHandles keysAndValuesDo: [:key :each |
each center: (self perform: key)]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
magnetic raster
rasterResolution

^ (0.04@0.03)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resizing
resizeFractionsOf: anEvent

| layoutFractions |
layoutFractions := self owner layoutFractionsOf: anEvent cursorPoint.
self isMagnetic ifTrue: [layoutFractions := layoutFractions roundTo: self rasterResolution].
^ layoutFractions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
resizeHandles: anOrderedCollection
resizeHandles: aDictionary

resizeHandles := anOrderedCollection
resizeHandles := aDictionary
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
contentHandling
addContent: aMorph
setContent: aMorph

self
position: aMorph position;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,46 @@
{
"class" : {
"for:" : "MK 5/18/2018 16:30" },
"for:" : "LB 7/6/2018 18:09" },
"instance" : {
"addContent:" : "LM 6/15/2018 19:11",
"addHandleAtPosition:withIndex:" : "MK 5/25/2018 17:37",
"addResizeHandles" : "MK 5/25/2018 17:39",
"actionForCorner:" : "LB 7/6/2018 16:30",
"addHandleAt:" : "LB 7/6/2018 18:07",
"addResizeHandles" : "LB 7/6/2018 16:15",
"child" : "MK 5/18/2018 20:03",
"child:" : "LM 5/21/2018 12:48",
"copyChildToHand" : "LM 6/17/2018 11:52",
"corners" : "MK 5/25/2018 17:11",
"createContextMenu" : "LB 6/15/2018 21:42",
"createHandleAtPosition:withIndex:" : "MK 5/25/2018 17:37",
"createHandleOnMove:" : "LB 7/6/2018 16:26",
"defaultContextMenuContent" : "LM 6/17/2018 11:52",
"disablePresentationMode" : "WoC 6/17/2018 18:44",
"dragCorner:event:fromHandle:" : "MK 5/25/2018 17:10",
"dragBottomLeftEvent:fromHandle:" : "LB 7/6/2018 16:32",
"dragBottomRightEvent:fromHandle:" : "LB 7/6/2018 16:28",
"dragCorner:event:fromHandle:" : "LB 7/6/2018 16:35",
"dragTopLeftEvent:fromHandle:" : "LB 7/6/2018 16:32",
"dragTopRightEvent:fromHandle:" : "LB 7/6/2018 16:32",
"enablePresentationMode" : "LM 6/8/2018 20:10",
"extent:" : "MK 5/25/2018 17:11",
"extentBottomLeft:" : "MK 5/25/2018 17:12",
"extentBottomRight:" : "MK 5/25/2018 17:12",
"extentTopLeft:" : "MK 5/25/2018 17:12",
"extentTopRight:" : "MK 5/25/2018 17:12",
"extentBottomLeft:" : "LB 7/6/2018 15:57",
"extentBottomRight:" : "LB 7/6/2018 15:57",
"extentTopLeft:" : "LB 7/6/2018 15:57",
"extentTopRight:" : "LB 7/6/2018 15:57",
"filterEvent:for:" : "MK 6/1/2018 18:02",
"grabChild" : "LM 6/15/2018 16:32",
"handleLayerNumber" : "MK 5/25/2018 16:26",
"handlesMouseDown:" : "WoC 5/22/2018 19:48",
"hasHandles" : "MK 5/18/2018 19:42",
"hasHandles:" : "MK 5/25/2018 17:01",
"ifAnyHandleContains:do:" : "MK 5/25/2018 17:06",
"initialize" : "MK 5/25/2018 17:10",
"layoutFractionsOf:" : "LB 5/22/2018 16:09",
"initialize" : "LB 7/6/2018 15:35",
"isMagnetic" : "LB 7/5/2018 21:38",
"mouseDown:" : "MK 6/1/2018 16:25",
"notifySlideRescale:" : "LM 6/17/2018 19:02",
"placeHandles" : "WoC 6/17/2018 13:22",
"placeHandles" : "LB 7/6/2018 18:10",
"rasterResolution" : "LB 7/5/2018 19:42",
"removeResizeHandles" : "MK 5/25/2018 16:18",
"removedMorph:" : "WoC 5/23/2018 18:40",
"resizeChild" : "MK 5/18/2018 20:03",
"resizeFractionsOf:" : "LB 7/6/2018 17:48",
"resizeHandleSize" : "MK 5/18/2018 19:13",
"resizeHandles" : "MK 5/18/2018 17:43",
"resizeHandles:" : "MK 5/18/2018 17:44" } }
"resizeHandles:" : "LB 7/6/2018 15:35",
"setContent:" : "LB 7/6/2018 18:08" } }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
nil
for: aString

^ self new setContent: aString
^ self new withMessage: aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
alphaThreshold

^ 1000
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
content: anObject
content: aMorph

content := anObject
content := aMorph
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
remaining: anObject
remaining: aNumber

remaining := anObject
remaining := aNumber
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ updateColor

| alpha |
self remaining: self remaining - 10.
self remaining < 1000
self remaining < self alphaThreshold
ifTrue: [
alpha := remaining / 1000.0.
alpha := remaining / self alphaThreshold.
self color: (self color alpha: alpha)]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
accessing
setContent: aString
withMessage: aString

self content contents: aString. "here no cascade because it fixes a presentation bug"
self bounds: (self content position corner: self content bottomRight + self defaultPadding).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{
"class" : {
"for:" : "WoC 6/15/2018 17:24" },
"for:" : "LB 7/6/2018 18:05" },
"instance" : {
"active" : "WoC 6/15/2018 19:23",
"active:" : "WoC 6/15/2018 19:23",
"alphaThreshold" : "LB 7/6/2018 18:03",
"content" : "WoC 6/15/2018 17:21",
"content:" : "WoC 6/15/2018 17:21",
"content:" : "LB 7/6/2018 18:02",
"defaultPadding" : "WoC 6/15/2018 17:31",
"fadingTime" : "WoC 6/15/2018 17:46",
"initialize" : "WoC 6/15/2018 19:23",
"isActive" : "WoC 6/15/2018 19:23",
"remaining" : "WoC 6/15/2018 17:41",
"remaining:" : "WoC 6/15/2018 17:41",
"setContent:" : "WoC 6/15/2018 18:13",
"remaining:" : "LB 7/6/2018 18:03",
"step" : "WoC 6/15/2018 17:43",
"stepTime" : "WoC 6/15/2018 17:55",
"updateColor" : "WoC 6/15/2018 17:54" } }
"updateColor" : "LB 7/6/2018 18:03",
"withMessage:" : "LB 7/6/2018 18:05" } }
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
as yet unclassified
forSlide: aPSSlide

^ self new setSlide: aPSSlide
^ self new
slide: aPSSlide;
yourself

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
defaultWidth

^ 80
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
formSize

^ self defaultWidth @ (self defaultWidth * self slide sideRatio)
Loading

0 comments on commit f57f6f3

Please sign in to comment.