Changeset 1954
- Timestamp:
- 02/25/08 15:16:27
(9 months ago)
- Author:
- jjarrett
- Message:
Additional Code clean up
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1953 |
r1954 |
|
| 657 | 657 | MLSLevel selected = null; |
|---|
| 658 | 658 | int i; |
|---|
| 659 | | // int displacedIndex = 0; |
|---|
| 660 | | // int selectedIndex = 0; |
|---|
| 661 | 659 | |
|---|
| 662 | 660 | _levels.values ().toArray (levels); |
|---|
| … | … | |
| 670 | 668 | displaced = current; |
|---|
| 671 | 669 | displaced.setOrder (currentIndex); |
|---|
| 672 | | // displacedIndex = i; |
|---|
| 673 | 670 | } |
|---|
| 674 | 671 | else if ((null == selected) && (currentIndex == current.getOrder ())) |
|---|
| … | … | |
| 676 | 673 | selected = current; |
|---|
| 677 | 674 | selected.setOrder (newIndex); |
|---|
| 678 | | // selectedIndex = i; |
|---|
| 679 | 675 | } |
|---|
| 680 | 676 | |
|---|
| … | … | |
| 685 | 681 | } |
|---|
| 686 | 682 | |
|---|
| 687 | | // levels[displacedIndex] = selected; |
|---|
| 688 | | // levels[selectedIndex] = displaced; |
|---|
| 689 | | // |
|---|
| 690 | | // _levels.clear (); |
|---|
| 691 | | // |
|---|
| 692 | | // for (i = 0; i < levels.length; i++) |
|---|
| 693 | | // { |
|---|
| 694 | | // _levels.put (levels[i].getName (), levels[i]); |
|---|
| 695 | | // } |
|---|
| 696 | | |
|---|
| 697 | 683 | return; |
|---|
| 698 | 684 | } |
|---|
| r1953 |
r1954 |
|
| 54 | 54 | import com.tresys.framework.plugin.SEFramework_Plugin; |
|---|
| 55 | 55 | import com.tresys.framework.plugin.builder.FrameworkBuilder; |
|---|
| 56 | | import com.tresys.framework.plugin.editor.policy.graphic.model.Shape; |
|---|
| 57 | 56 | import com.tresys.framework.plugin.preferences.PreferenceInitializer; |
|---|
| 58 | 57 | import com.tresys.framework.plugin.preferences.SEFPreferencePage; |
|---|
| r1953 |
r1954 |
|
| 45 | 45 | import com.tresys.framework.plugin.editor.policy.graphic.GraphicPolicyRefresh; |
|---|
| 46 | 46 | import com.tresys.framework.plugin.editor.policy.graphic.IShapeVisitor; |
|---|
| 47 | | import com.tresys.framework.plugin.editor.policy.graphic.model.AccessConnection; |
|---|
| 48 | | import com.tresys.framework.plugin.editor.policy.graphic.model.BaseDomainShape; |
|---|
| 49 | | import com.tresys.framework.plugin.editor.policy.graphic.model.BaseResourceShape; |
|---|
| 50 | | import com.tresys.framework.plugin.editor.policy.graphic.model.Connection; |
|---|
| 51 | | import com.tresys.framework.plugin.editor.policy.graphic.model.ControlResourceShape; |
|---|
| 52 | 47 | import com.tresys.framework.plugin.editor.policy.graphic.model.DefaultMLSLevelUpdateVisitor; |
|---|
| 53 | | import com.tresys.framework.plugin.editor.policy.graphic.model.DomainShape; |
|---|
| 54 | | import com.tresys.framework.plugin.editor.policy.graphic.model.EntryConnection; |
|---|
| 55 | | import com.tresys.framework.plugin.editor.policy.graphic.model.EntryPointShape; |
|---|
| 56 | 48 | import com.tresys.framework.plugin.editor.policy.graphic.model.PolicyDiagram; |
|---|
| 57 | | import com.tresys.framework.plugin.editor.policy.graphic.model.ResourceShape; |
|---|
| 58 | | import com.tresys.framework.plugin.editor.policy.graphic.model.UserDomainShape; |
|---|
| 59 | 49 | import com.tresys.framework.plugin.preferences.SEFPreferencePage; |
|---|
| 60 | 50 | |
|---|
| … | … | |
| 719 | 709 | |
|---|
| 720 | 710 | return; |
|---|
| 721 | | } |
|---|
| 722 | | |
|---|
| 723 | | |
|---|
| 724 | | // protected class MLSUpdateVisitor |
|---|
| 725 | | // implements IShapeVisitor |
|---|
| 726 | | // { |
|---|
| 727 | | // public void Visit (DomainShape i_domain) |
|---|
| 728 | | // { |
|---|
| 729 | | // i_domain.updateMLS (); |
|---|
| 730 | | // |
|---|
| 731 | | // return; |
|---|
| 732 | | // } |
|---|
| 733 | | // |
|---|
| 734 | | // public void Visit (BaseDomainShape i_baseDom) |
|---|
| 735 | | // { |
|---|
| 736 | | // return; |
|---|
| 737 | | // } |
|---|
| 738 | | // |
|---|
| 739 | | // public void Visit (UserDomainShape i_userDom) |
|---|
| 740 | | // { |
|---|
| 741 | | // return; |
|---|
| 742 | | // } |
|---|
| 743 | | // |
|---|
| 744 | | // public void Visit (ResourceShape i_resource) |
|---|
| 745 | | // { |
|---|
| 746 | | // i_resource.updateMLS (); |
|---|
| 747 | | // |
|---|
| 748 | | // return; |
|---|
| 749 | | // } |
|---|
| 750 | | // |
|---|
| 751 | | // public void Visit (BaseResourceShape i_baseRes) |
|---|
| 752 | | // { |
|---|
| 753 | | // return; |
|---|
| 754 | | // } |
|---|
| 755 | | // |
|---|
| 756 | | // public void Visit (AccessConnection i_access) |
|---|
| 757 | | // { |
|---|
| 758 | | // return; |
|---|
| 759 | | // } |
|---|
| 760 | | // |
|---|
| 761 | | // public void Visit (PolicyDiagram i_diagram) |
|---|
| 762 | | // { |
|---|
| 763 | | // return; |
|---|
| 764 | | // } |
|---|
| 765 | | // |
|---|
| 766 | | // public void Visit (EntryPointShape i_entryPt) |
|---|
| 767 | | // { |
|---|
| 768 | | // i_entryPt.updateMLS (); |
|---|
| 769 | | // |
|---|
| 770 | | // return; |
|---|
| 771 | | // } |
|---|
| 772 | | // |
|---|
| 773 | | // public void Visit (EntryConnection i_enter) |
|---|
| 774 | | // { |
|---|
| 775 | | // return; |
|---|
| 776 | | // } |
|---|
| 777 | | // |
|---|
| 778 | | // public void Visit (Connection conn) |
|---|
| 779 | | // { |
|---|
| 780 | | // return; |
|---|
| 781 | | // } |
|---|
| 782 | | // |
|---|
| 783 | | // public void Visit (ControlResourceShape i_controlResource) |
|---|
| 784 | | // { |
|---|
| 785 | | // i_controlResource.updateMLS (); |
|---|
| 786 | | // |
|---|
| 787 | | // return; |
|---|
| 788 | | // } |
|---|
| 789 | | // } |
|---|
| | 711 | } |
|---|
| 790 | 712 | } |
|---|
| r1953 |
r1954 |
|
| 40 | 40 | import com.tresys.framework.plugin.builder.SELinuxSystem; |
|---|
| 41 | 41 | import com.tresys.framework.plugin.editor.policy.graphic.IShapeVisitor; |
|---|
| 42 | | import com.tresys.framework.plugin.preferences.SEFPreferencePage; |
|---|
| 43 | 42 | import com.tresys.framework.plugin.wizards.ControlResourcePropertyWizard; |
|---|
| 44 | 43 | |
|---|
| … | … | |
| 434 | 433 | |
|---|
| 435 | 434 | return verbs; |
|---|
| 436 | | } |
|---|
| 437 | | |
|---|
| 438 | | // public void updateMLS() |
|---|
| 439 | | // { |
|---|
| 440 | | // ComponentWithDictObjects component = (ComponentWithDictObjects) getComponent(); |
|---|
| 441 | | // |
|---|
| 442 | | // firePropertyChange(Shape.MLS_PROP, null, component.getMLSLabel ()); |
|---|
| 443 | | // |
|---|
| 444 | | // return; |
|---|
| 445 | | // } |
|---|
| 446 | | // |
|---|
| 447 | | // public void updateDefaultMLS() |
|---|
| 448 | | // { |
|---|
| 449 | | // ComponentWithDictObjects component = (ComponentWithDictObjects) getComponent(); |
|---|
| 450 | | // |
|---|
| 451 | | // firePropertyChange(SEFPreferencePage.DEFAULT_MLS_LEVEL, null, component.getMLSLabel ()); |
|---|
| 452 | | // |
|---|
| 453 | | // return; |
|---|
| 454 | | // } |
|---|
| 455 | | |
|---|
| | 435 | } |
|---|
| 456 | 436 | } |
|---|
| r1953 |
r1954 |
|
| 5 | 5 | import com.tresys.framework.plugin.editor.policy.graphic.IShapeVisitor; |
|---|
| 6 | 6 | |
|---|
| | 7 | /** |
|---|
| | 8 | * DefaultMLSLevelUpdateVisitor |
|---|
| | 9 | * |
|---|
| | 10 | * Manages the process of updating changes to the any of the MLS related data on the |
|---|
| | 11 | * Project Property Page and the drawing editors |
|---|
| | 12 | * |
|---|
| | 13 | * @author jjarrett |
|---|
| | 14 | * |
|---|
| | 15 | */ |
|---|
| 7 | 16 | public class DefaultMLSLevelUpdateVisitor |
|---|
| 8 | 17 | implements IShapeVisitor |
|---|
| r1953 |
r1954 |
|
| 19 | 19 | import org.eclipse.core.resources.IResource; |
|---|
| 20 | 20 | import org.eclipse.core.runtime.IPath; |
|---|
| 21 | | import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; |
|---|
| 22 | 21 | import org.eclipse.draw2d.PositionConstants; |
|---|
| 23 | 22 | import org.eclipse.draw2d.geometry.Dimension; |
|---|
| … | … | |
| 52 | 51 | import com.tresys.framework.plugin.editor.properties.PathPropertyDescriptor; |
|---|
| 53 | 52 | import com.tresys.framework.plugin.editor.properties.PathRdefEditContainer; |
|---|
| 54 | | import com.tresys.framework.plugin.preferences.SEFPreferencePage; |
|---|
| 55 | 53 | import com.tresys.framework.plugin.wizards.ShapePropertyWizard; |
|---|
| 56 | 54 | |
|---|
| … | … | |
| 579 | 577 | return; |
|---|
| 580 | 578 | } |
|---|
| 581 | | |
|---|
| 582 | | // public void updateMLS() |
|---|
| 583 | | // { |
|---|
| 584 | | // Domain dom = (Domain)getComponent (); |
|---|
| 585 | | // |
|---|
| 586 | | // firePropertyChange(Shape.MLS_PROP, null, dom.getMLSLabel ()); |
|---|
| 587 | | // } |
|---|
| 588 | | // |
|---|
| 589 | | // public void updateDefaultMLS(PreferenceChangeEvent event) |
|---|
| 590 | | // { |
|---|
| 591 | | // Domain dom = (Domain)getComponent (); |
|---|
| 592 | | // |
|---|
| 593 | | // firePropertyChange(SEFPreferencePage.DEFAULT_MLS_LEVEL, event.getOldValue (), dom.getMLSLabel ()); |
|---|
| 594 | | // } |
|---|
| 595 | 579 | } |
|---|
| r1953 |
r1954 |
|
| 41 | 41 | import com.tresys.framework.plugin.editor.policy.graphic.IShapeVisitor; |
|---|
| 42 | 42 | import com.tresys.framework.plugin.editor.properties.PathPropertyDescriptor; |
|---|
| 43 | | import com.tresys.framework.plugin.preferences.SEFPreferencePage; |
|---|
| 44 | 43 | import com.tresys.framework.plugin.wizards.EntrypointShapePropertyWizard; |
|---|
| 45 | 44 | |
|---|
| … | … | |
| 382 | 381 | |
|---|
| 383 | 382 | return; |
|---|
| 384 | | } |
|---|
| 385 | | |
|---|
| 386 | | // public void updateMLS() |
|---|
| 387 | | // { |
|---|
| 388 | | // EntrypointResource epr = getEntrypointResource (); |
|---|
| 389 | | // |
|---|
| 390 | | // firePropertyChange(Shape.MLS_PROP, null, epr.getMLSLabel ()); |
|---|
| 391 | | // } |
|---|
| 392 | | // |
|---|
| 393 | | // public void updateDefaultMLS() |
|---|
| 394 | | // { |
|---|
| 395 | | // EntrypointResource epr = getEntrypointResource (); |
|---|
| 396 | | // |
|---|
| 397 | | // firePropertyChange(SEFPreferencePage.DEFAULT_MLS_LEVEL, null, epr.getMLSLabel ()); |
|---|
| 398 | | // } |
|---|
| 399 | | |
|---|
| 400 | | |
|---|
| | 383 | } |
|---|
| 401 | 384 | } |
|---|
| 402 | 385 | |
|---|
| r1953 |
r1954 |
|
| 45 | 45 | import com.tresys.framework.plugin.editor.properties.PathPropertyDescriptor; |
|---|
| 46 | 46 | import com.tresys.framework.plugin.editor.properties.PathRdefEditContainer; |
|---|
| 47 | | import com.tresys.framework.plugin.preferences.SEFPreferencePage; |
|---|
| 48 | 47 | import com.tresys.framework.plugin.wizards.ResourceShapePropertyWizard; |
|---|
| 49 | 48 | |
|---|
| … | … | |
| 321 | 320 | |
|---|
| 322 | 321 | return; |
|---|
| 323 | | } |
|---|
| 324 | | |
|---|
| 325 | | // public void updateMLS() |
|---|
| 326 | | // { |
|---|
| 327 | | // ComponentWithDictObjects component = (ComponentWithDictObjects) getComponent(); |
|---|
| 328 | | // |
|---|
| 329 | | // firePropertyChange(Shape.MLS_PROP, null, component.getMLSLabel ()); |
|---|
| 330 | | // } |
|---|
| 331 | | // |
|---|
| 332 | | // public void updateDefaultMLS() |
|---|
| 333 | | // { |
|---|
| 334 | | // ComponentWithDictObjects component = (ComponentWithDictObjects) getComponent(); |
|---|
| 335 | | // |
|---|
| 336 | | // firePropertyChange(SEFPreferencePage.DEFAULT_MLS_LEVEL, null, component.getMLSLabel ()); |
|---|
| 337 | | // } |
|---|
| 338 | | // |
|---|
| 339 | | |
|---|
| | 322 | } |
|---|
| 340 | 323 | } |
|---|
| r1953 |
r1954 |
|
| 130 | 130 | return; |
|---|
| 131 | 131 | } |
|---|
| 132 | | |
|---|
| | 132 | |
|---|
| | 133 | /** |
|---|
| | 134 | * formatHex |
|---|
| | 135 | * |
|---|
| | 136 | * Ensures that definition of the Colors can be correctly parsed from their |
|---|
| | 137 | * respective string representations |
|---|
| | 138 | * |
|---|
| | 139 | * @param sb - The StringBuilder used to generate the new text |
|---|
| | 140 | * representation of the color value |
|---|
| | 141 | * @param c - The integer value of the color to be output as a string |
|---|
| | 142 | * |
|---|
| | 143 | */ |
|---|
| 133 | 144 | protected static void formatHex(StringBuilder sb, int c) |
|---|
| 134 | 145 | { |
|---|
| r1953 |
r1954 |
|
| 23 | 23 | |
|---|
| 24 | 24 | import java.io.File; |
|---|
| 25 | | import java.util.Date; |
|---|
| 26 | 25 | import java.util.Iterator; |
|---|
| 27 | 26 | |
|---|
Download in other formats:
* Generating other formats may take time.