1276 self selectionOfColor value: 0. |
1276 self selectionOfColor value: 0. |
1277 self selectionOfColor value: (self listOfColors indexOf: imageEditView selectedColor). |
1277 self selectionOfColor value: (self listOfColors indexOf: imageEditView selectedColor). |
1278 ! |
1278 ! |
1279 |
1279 |
1280 update:something with:aParameter from:changedObject |
1280 update:something with:aParameter from:changedObject |
|
1281 |clrIndex| |
|
1282 |
1281 changedObject == self listOfColors ifTrue:[ |
1283 changedObject == self listOfColors ifTrue:[ |
1282 something == #at: ifTrue:[ |
1284 something == #at: ifTrue:[ |
1283 "/ colormap entry changed at aParameter |
1285 "/ colormap entry changed at aParameter |
1284 self image colorMap at:aParameter put:(changedObject at:aParameter). |
1286 |
|
1287 clrIndex := aParameter. |
|
1288 (self hasMask) ifTrue:[ |
|
1289 clrIndex := clrIndex - 1. |
|
1290 ]. |
|
1291 |
|
1292 self image colorMap at:clrIndex put:(changedObject at:aParameter). |
1285 self colorMapChanged. |
1293 self colorMapChanged. |
1286 ^ self |
1294 ^ self |
1287 ]. |
1295 ]. |
1288 ]. |
1296 ]. |
1289 super update:something with:aParameter from:changedObject |
1297 super update:something with:aParameter from:changedObject |
1290 |
1298 |
1291 "Modified: / 7.8.1998 / 22:32:09 / cg" |
1299 "Modified: / 18.8.1998 / 17:18:42 / cg" |
1292 ! |
1300 ! |
1293 |
1301 |
1294 updateForNoneImage |
1302 updateForNoneImage |
1295 "updates channels and view, if image is loaded" |
1303 "updates channels and view, if image is loaded" |
1296 |
1304 |
1427 !ImageEditor methodsFor:'loading'! |
1444 !ImageEditor methodsFor:'loading'! |
1428 |
1445 |
1429 loadFromFile: aFileName |
1446 loadFromFile: aFileName |
1430 "loads an image from aFileName and sets up color map list and other info labels" |
1447 "loads an image from aFileName and sets up color map list and other info labels" |
1431 |
1448 |
1432 (imageEditView loadFromFile: aFileName) notNil |
1449 |img| |
1433 ifTrue: |
1450 |
1434 [ |
1451 (imageEditView loadFromFile: aFileName) notNil ifTrue:[ |
1435 self image notNil |
1452 (img := self image) notNil ifTrue:[ |
1436 ifTrue: |
1453 img colorMap notNil ifTrue:[ |
1437 [ |
1454 self listOfColors contents:(img usedColors asSet asOrderedCollection). |
1438 self image colorMap notNil |
1455 ] ifFalse:[ |
1439 ifTrue: |
|
1440 [ |
|
1441 self listOfColors contents: self image usedColors asSet. |
|
1442 ] |
|
1443 ifFalse: |
|
1444 [ |
|
1445 self listOfColors removeAll. |
1456 self listOfColors removeAll. |
1446 ]. |
1457 ]. |
1447 self findColorMapMode. |
1458 self findColorMapMode. |
1448 self updateLabelsAndHistory. |
1459 self updateLabelsAndHistory. |
1449 ] |
1460 ] ifFalse:[ |
1450 ifFalse: |
|
1451 [ |
|
1452 self updateForNoneImage |
1461 self updateForNoneImage |
1453 ] |
1462 ] |
1454 ] |
1463 ] |
1455 ! |
1464 |
1456 |
1465 "Modified: / 18.8.1998 / 17:03:54 / cg" |
1457 loadFromImage: anImage |
1466 ! |
|
1467 |
|
1468 loadFromImage:anImage |
1458 "loads an image from anImage and sets up color map list and other info labels" |
1469 "loads an image from anImage and sets up color map list and other info labels" |
1459 |
1470 |
1460 imageEditView image: anImage. |
1471 |img| |
1461 self image notNil |
1472 |
1462 ifTrue: |
1473 imageEditView image:anImage. |
1463 [ |
1474 (img := self image) notNil ifTrue:[ |
1464 self image colorMap notNil |
1475 img colorMap notNil ifTrue:[ |
1465 ifTrue: |
1476 self listOfColors contents:(img usedColors asSet asOrderedCollection). |
1466 [ |
1477 ] ifFalse:[ |
1467 self listOfColors contents: self image usedColors asSet asOrderedCollection. |
|
1468 ] |
|
1469 ifFalse: |
|
1470 [ |
|
1471 self listOfColors removeAll. |
1478 self listOfColors removeAll. |
1472 ]. |
1479 ]. |
1473 self findColorMapMode. |
1480 self findColorMapMode. |
1474 self updateLabelsAndHistory. |
1481 self updateLabelsAndHistory. |
1475 ] |
1482 ] ifFalse:[ |
1476 ifFalse: |
|
1477 [ |
|
1478 self updateForNoneImage |
1483 self updateForNoneImage |
1479 ] |
1484 ] |
|
1485 |
|
1486 "Modified: / 18.8.1998 / 17:04:46 / cg" |
1480 ! |
1487 ! |
1481 |
1488 |
1482 loadFromMessage: aMessage |
1489 loadFromMessage: aMessage |
1483 "loads an image by evaluating aMessage and sets up color map list and other info labels" |
1490 "loads an image by evaluating aMessage and sets up color map list and other info labels" |
1484 |
1491 |
1485 (imageEditView loadFromMessage: aMessage) notNil |
1492 |img| |
1486 ifTrue: |
1493 |
1487 [ |
1494 (imageEditView loadFromMessage: aMessage) notNil ifTrue:[ |
1488 self image notNil |
1495 (img := self image) notNil ifTrue:[ |
1489 ifTrue: |
1496 self listOfColors contents:(img usedColors asSet asOrderedCollection). |
1490 [ |
|
1491 self listOfColors contents: self image usedColors asSet asOrderedCollection. |
|
1492 self findColorMapMode. |
1497 self findColorMapMode. |
1493 self updateLabelsAndHistory. |
1498 self updateLabelsAndHistory. |
1494 ] |
1499 ] ifFalse:[ |
1495 ifFalse: |
|
1496 [ |
|
1497 self updateForNoneImage |
1500 self updateForNoneImage |
1498 ] |
1501 ] |
1499 ] |
1502 ] |
|
1503 |
|
1504 "Modified: / 18.8.1998 / 17:03:01 / cg" |
1500 ! |
1505 ! |
1501 |
1506 |
1502 loadFromOrPrepareForMessage: aMessage |
1507 loadFromOrPrepareForMessage: aMessage |
1503 "loads an image by evaluating aMessage; |
1508 "loads an image by evaluating aMessage; |
1504 if no image could extract from aMessage; do set the class and the selector from |
1509 if no image could extract from aMessage; do set the class and the selector from |
1634 colorMapChanged |
1645 colorMapChanged |
1635 |img| |
1646 |img| |
1636 |
1647 |
1637 img := self image. |
1648 img := self image. |
1638 img release. |
1649 img release. |
1639 (imageEditView image:img) notNil ifTrue: |
1650 imageEditView invalidate. |
1640 [ |
1651 self imagePreView invalidate. |
1641 self updateLabelsAndHistory. |
1652 |
1642 self imagePreView image:img |
1653 "/ (imageEditView image:img) notNil ifTrue:[ |
1643 ] |
1654 "/ self updateLabelsAndHistory. |
|
1655 "/ self imagePreView image:img |
|
1656 "/ ] |
1644 |
1657 |
1645 "Created: / 7.8.1998 / 22:26:10 / cg" |
1658 "Created: / 7.8.1998 / 22:26:10 / cg" |
1646 "Modified: / 7.8.1998 / 22:37:29 / cg" |
1659 "Modified: / 18.8.1998 / 17:08:55 / cg" |
1647 ! |
1660 ! |
1648 |
1661 |
1649 colorMapMode:aMode value: aValue |
1662 colorMapMode:aMode value: aValue |
1650 "calculates a new color map for the image from aMode" |
1663 "calculates a new color map for the image from aMode" |
1651 |
1664 |