~hilaire-fernandes/drgeo/trunk

« back to all changes in this revision

Viewing changes to src/DrGeoII-Core/DrGPropertyCommand.class.st

  • Committer: Hilaire Fernandes
  • Date: 2017-11-15 13:17:03 UTC
  • Revision ID: hilaire.fernandes@gmail.com-20171115131703-pz09obavthi53ebt
DrGeo code under Tonel file format

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"
 
2
A command to record property editing
 
3
"
 
4
Class {
 
5
        #name : #DrGPropertyCommand,
 
6
        #superclass : #DrGCommand,
 
7
        #instVars : [
 
8
                'property',
 
9
                'mathItem'
 
10
        ],
 
11
        #category : #'DrGeoII-Core-Command'
 
12
}
 
13
 
 
14
{ #category : #'as yet unclassified' }
 
15
DrGPropertyCommand class >> for: aMathItem with: aProperty in: aDomain [
 
16
        ^self new
 
17
                domain: aDomain;
 
18
                mathItem: aMathItem;
 
19
                property: aProperty
 
20
]
 
21
 
 
22
{ #category : #command }
 
23
DrGPropertyCommand >> execute [
 
24
        |temp|
 
25
        temp := mathItem property.
 
26
        mathItem property: property.
 
27
        property := temp. 
 
28
        mathItem changed
 
29
]
 
30
 
 
31
{ #category : #accessing }
 
32
DrGPropertyCommand >> mathItem: aMathItem [ 
 
33
        mathItem := aMathItem 
 
34
]
 
35
 
 
36
{ #category : #accessing }
 
37
DrGPropertyCommand >> property: aProperty [
 
38
        property := aProperty 
 
39
]
 
40
 
 
41
{ #category : #command }
 
42
DrGPropertyCommand >> unexecute [
 
43
        self execute
 
44
]