-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the need to dowload the ressources a second time
- Loading branch information
Showing
11 changed files
with
142 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 0 additions & 96 deletions
96
src/Molecule-Geographical-Position-Example/MolGeoDownloadedRessource.class.st
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/Molecule-Geographical-Position-Example/MolGeoGPSDownloaded.class.st
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/Molecule-Geographical-Position-Example/MolGeoGPSInaccurateDownloaded.class.st
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/Molecule-Geographical-Position-Example/MolGeoGSMDownloaded.class.st
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/Molecule-Geographical-Position-Example/MolGeoGalileoDownloaded.class.st
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/Molecule-Geographical-Position-Example/MolGeoMapDownloaded.class.st
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
125 changes: 125 additions & 0 deletions
125
src/Molecule-Geographical-Position-Example/MolGeoRessource.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
Class { | ||
#name : #MolGeoRessource, | ||
#superclass : #Object, | ||
#instVars : [ | ||
'fileName' | ||
], | ||
#category : #'Molecule-Geographical-Position-Example-ressources' | ||
} | ||
|
||
{ #category : #'as yet unclassified' } | ||
MolGeoRessource class >> galileo [ | ||
|
||
^ self new | ||
fileName: 'favorite.png'; | ||
yourself | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
MolGeoRessource class >> gps [ | ||
|
||
^ self new | ||
fileName: 'link.png'; | ||
yourself | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
MolGeoRessource class >> gpsInacurrate [ | ||
|
||
^ self new | ||
fileName: 'chains.png'; | ||
yourself | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
MolGeoRessource class >> gsm [ | ||
|
||
^ self new | ||
fileName: 'antenna.png'; | ||
yourself | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
MolGeoRessource class >> map [ | ||
|
||
^ self new | ||
fileName: 'map.png'; | ||
yourself | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
MolGeoRessource class >> wiFi [ | ||
|
||
^ self new | ||
fileName: 'wifi.png'; | ||
yourself | ||
] | ||
|
||
{ #category : #converting } | ||
MolGeoRessource >> asForm [ | ||
|
||
^ (Form fromFileNamed: self fileReference) | ||
mapColor: Color white | ||
to: Color transparent | ||
] | ||
|
||
{ #category : #converting } | ||
MolGeoRessource >> asForm: anExtent [ | ||
|
||
^ self asForm scaledToSize: anExtent | ||
] | ||
|
||
{ #category : #default } | ||
MolGeoRessource >> baseIcebergDirectory [ | ||
|
||
| expectedName myRepository | | ||
expectedName := 'molecule-geographical-position-example'. | ||
|
||
myRepository := IceRepository registry | ||
detect: [ :each | | ||
each name asLowercase = expectedName ] | ||
ifNone: [ | ||
self error: | ||
('Did not find any repository named ''{1}'' in Iceberg (case insensitive). Alexandrie tests require it to access resources.' | ||
format: { expectedName }) ]. | ||
|
||
^ myRepository location | ||
] | ||
|
||
{ #category : #default } | ||
MolGeoRessource >> baseRessourceDirectory [ | ||
|
||
^ self baseIcebergDirectory / 'ressources' | ||
] | ||
|
||
{ #category : #accessing } | ||
MolGeoRessource >> fileName [ | ||
|
||
^ fileName | ||
] | ||
|
||
{ #category : #accessing } | ||
MolGeoRessource >> fileName: aString [ | ||
|
||
fileName := aString | ||
] | ||
|
||
{ #category : #accessing } | ||
MolGeoRessource >> fileReference [ | ||
|
||
^ self baseRessourceDirectory / self fileName | ||
] | ||
|
||
{ #category : #initialization } | ||
MolGeoRessource >> initialize [ | ||
|
||
super initialize. | ||
|
||
fileName := 'doesnotexist.png' | ||
] | ||
|
||
{ #category : #testing } | ||
MolGeoRessource >> isDownloaded [ | ||
|
||
^ self fileReference exists | ||
] |
11 changes: 0 additions & 11 deletions
11
src/Molecule-Geographical-Position-Example/MolGeoWiFiDownloaded.class.st
This file was deleted.
Oops, something went wrong.