Changeset 2005

Show
Ignore:
Timestamp:
03/19/08 14:41:13 (8 months ago)
Author:
apatel
Message:

merged trunk:2003

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/SharedColors.java

    r1921 r2005  
    3030 
    3131        /** Creates an returns a shared color manager. */ 
    32         public SharedColors () 
     32        SharedColors () 
    3333        { 
    3434                super (); 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/builder/AccessCheckBuilder.java

    r1989 r2005  
    1717import java.io.InputStream; 
    1818import java.util.Collection; 
     19import java.util.HashSet; 
    1920import java.util.Iterator; 
    2021import java.util.Map; 
     
    4041import com.tresys.framework.compiler.linkage.libselinuxjava.sepol_access_decision; 
    4142import com.tresys.framework.compiler.linkage.libselinuxjava.sepol_access_vector; 
     43import com.tresys.framework.compiler.linkage.libselinuxjava.sepol_handle_t; 
     44import com.tresys.framework.compiler.linkage.libselinuxjava.sepol_module_package_t; 
     45import com.tresys.framework.compiler.linkage.libselinuxjava.sepol_policydb_t; 
    4246import com.tresys.framework.compiler.linkage.libselinuxjava.sepol_security_class_t; 
    4347import com.tresys.framework.compiler.linkage.libselinuxjava.sepol_security_id_t; 
     
    101105                        try 
    102106                        { 
    103                                 sys.getFolder ().accept (new PolicyFolderVisitor (), 1, false); 
     107                                PolicyFolderVisitor folderVisitor = new PolicyFolderVisitor (); 
     108                         
     109                                sys.getFolder ().accept (folderVisitor, 1, false); 
     110 
     111                                // visit the actual policy 
     112                                SLIDEProjectNature snat = SLIDEProjectNature.getNature (getProject ()); 
     113                                File buildConfPath = snat.GetBuildConfPath (sys.getFolder ()); 
     114                                BuildConfFile buildConf = new BuildConfFile (buildConfPath); 
     115 
     116                                AccessCheckVisitor accessVisitor = null; 
     117                                if (buildConf.isMonolithic ()) 
     118                                { 
     119                                        if (folderVisitor.isMonolithic ()) 
     120                                                accessVisitor = new AccessCheckVisitor (buildConf, folderVisitor.getMonolithicPolicy (), sys.getFPOLErrorHandler ()); 
     121                                } 
     122                                 
     123                                else 
     124                                { 
     125                                        if (folderVisitor.isModular ()) 
     126                                                accessVisitor = new AccessCheckVisitor (buildConf, folderVisitor.getBaseModule (), folderVisitor.getModules (), sys.getFPOLErrorHandler ()); 
     127                                } 
     128                                 
     129                                if (accessVisitor != null) 
     130                                { 
     131                                        Policy policy = sys.getPolicy (); 
     132                                         
     133                                        policy.Accept (accessVisitor); 
     134                                } 
     135 
    104136                        } 
    105137                        catch (CoreException ce) 
    106138                        {} 
     139                        catch (IOException ioe) 
     140                        { 
     141                                ioe.printStackTrace (); 
     142                        } 
    107143                } 
    108144                 
     
    118154                implements IResourceVisitor 
    119155        { 
     156                 
     157                private boolean m_bFoundMonolithic; 
     158                private boolean m_bFoundModules; 
     159 
     160                private IFile m_monolithicPolicy = null; 
     161                private IFile m_baseModule = null; 
     162                private Collection /* <IFile> */ m_modules = new HashSet (); 
     163                 
     164                /** 
     165                 * @return the m_bFoundModules 
     166                 */ 
     167                public boolean isModular () 
     168                { 
     169                        return m_bFoundModules; 
     170                } 
     171                 
     172                /** 
     173                 * @return the m_bFoundMonolithic 
     174                 */ 
     175                public boolean isMonolithic () 
     176                { 
     177                        return m_bFoundMonolithic; 
     178                } 
     179                 
     180                /** 
     181                 * @return the m_monolithicPolicy 
     182                 */ 
     183                public IFile getMonolithicPolicy () 
     184                { 
     185                        return m_monolithicPolicy; 
     186                } 
     187                 
     188                /** 
     189                 * @return the m_baseModule 
     190                 */ 
     191                public IFile getBaseModule () 
     192                { 
     193                        return m_baseModule; 
     194                } 
     195                 
     196                /** 
     197                 * @return the m_modules 
     198                 */ 
     199                public Collection getModules () 
     200                { 
     201                        return m_modules; 
     202                } 
     203                 
    120204        /* (non-Javadoc) 
    121205                 * @see org.eclipse.core.resources.IResourceVisitor#visit(org.eclipse.core.resources.IResource) 
     
    123207                public boolean visit (IResource resource) 
    124208                { 
    125                         try 
    126                         { 
    127                                 if (!(resource instanceof IFile)) 
    128                                         return true; 
     209                        if (!(resource instanceof IFile)) 
     210                                return true; 
     211                         
     212                        // match policy file 
     213                        String sExtn = resource.getFileExtension (); 
     214                        if (sExtn == null) 
     215                                return false; 
     216                         
     217                        String sFilename = resource.getName (); 
     218                        String sSubName = sFilename.substring (0, sFilename.length () - sExtn.length () -1); 
     219                         
     220                        // found a monolithic policy binary 
     221                        if (BaseProjectNature.FILE_POLICY_BASE.equals (sSubName)) 
     222                        { 
     223                         
     224                                try 
     225                                { 
     226                                        if (Integer.valueOf (sExtn) == null) 
     227                                                return false; 
     228                                } 
     229                                catch (NumberFormatException nfe) 
     230                                { 
     231                                        return false; 
     232                                } 
     233 
     234                                m_bFoundMonolithic = true; 
     235                                m_monolithicPolicy = (IFile) resource; 
     236                        } 
     237                         
     238                        // if it is a module file 
     239                        if (BaseProjectNature.MODULE_EXTENSION.equals (sExtn)) 
     240                        { 
     241                                m_bFoundModules = true; 
     242                                if (BaseProjectNature.FILE_BASE_MODULE.equals (sFilename)) 
     243                                        m_baseModule = (IFile) resource; 
     244                                else 
     245                                        m_modules.add (resource); 
     246                        } 
    129247                                 
    130                                 // match policy file 
    131                                 String sExtn = resource.getFileExtension (); 
    132                                 if (sExtn == null) 
    133                                         return false; 
    134                                  
    135                                 //TODO: need to deal with modular builds!!                               
    136                                 String sSubName = resource.getName (); 
    137                                 sSubName = sSubName.substring (0, sSubName.length () - sExtn.length () -1); 
    138                                 if (!BaseProjectNature.FILE_POLICY_BASE.equals (sSubName)) 
    139                                         return false; 
    140                                  
    141                                 if (Integer.valueOf (sExtn) == null) 
    142                                         return false; 
    143  
    144                                 FrameworkNature nat = FrameworkNature.getNature (resource.getProject ()); 
    145  
    146                                 // visit the actual policy 
    147                                 SELinuxSystem sys = nat.getSystem (resource); 
    148  
    149                                 SLIDEProjectNature snat = SLIDEProjectNature.getNature (resource.getProject ()); 
    150                                 File buildConfPath = snat.GetBuildConfPath (resource); 
    151                                 BuildConfFile buildConf = new BuildConfFile (buildConfPath); 
    152  
    153                                 AccessCheckVisitor visitor = new AccessCheckVisitor (buildConf, (IFile) resource, sys.getFPOLErrorHandler ()); 
    154  
    155                                 if (visitor != null) 
    156                                 { 
    157                                         Policy policy = sys.getPolicy (); 
    158                                          
    159                                         policy.Accept (visitor); 
    160                                 } 
    161                         } 
    162                         catch (IOException e) 
    163                         { 
    164                                 e.printStackTrace(); 
    165                         } 
    166248                        return false; 
    167249                }        
     
    180262 
    181263                 
    182                 protected policydb_t m_policyDB; 
    183                 protected sidtab_t m_sidTab; 
     264                protected policydb_t m_policyDB = null; 
     265                protected sepol_policydb_t m_sepol_policyDB = null; 
     266                protected sidtab_t m_sidTab = null; 
    184267                private final BuildConfFile m_buildConf; 
    185268                private final ErrorHandler m_errorHandler; 
    186269                 
    187                 // load policy  
     270                private AccessCheckVisitor (BuildConfFile i_buildConf, ErrorHandler i_errorHandler) 
     271                { 
     272                        m_errorHandler = i_errorHandler; 
     273                        m_buildConf = i_buildConf; 
     274                         
     275                } 
     276                 
     277                // load monolithic policy  
    188278                AccessCheckVisitor (BuildConfFile i_buildConf, IFile i_policyFile, ErrorHandler i_errorHandler) 
    189279                        throws FileNotFoundException, IOException 
    190280                { 
    191                          
    192                         m_errorHandler = i_errorHandler; 
     281                        this (i_buildConf, i_errorHandler); 
    193282                        policy_file_t pFile = null; 
    194                         m_buildConf = i_buildConf; 
    195283                 
    196284                        if (false) 
     
    216304                        } 
    217305                         
     306                        long nStartTime = System.currentTimeMillis (); 
    218307                        m_policyDB = new policydb_t (pFile); 
     308                        if (DEBUG) 
     309                        { 
     310                                long nEndTime = System.currentTimeMillis (); 
     311                                System.out.println ("Time to load monolithic policy: " + (nEndTime - nStartTime)); 
     312                        } 
     313 
     314                        m_policyDB.set_activepolicy (); 
    219315                        m_sidTab = new sidtab_t(); 
    220316                } 
     317                 
     318                // load modular policy  
     319                AccessCheckVisitor (BuildConfFile i_buildConf, IFile i_base, Collection /* <IFile> */ i_modules, ErrorHandler i_errorHandler) 
     320                        throws FileNotFoundException, IOException 
     321                { 
     322                        this (i_buildConf, i_errorHandler); 
     323                         
     324                        String sBasePath = i_base.getRawLocation ().toOSString (); 
     325                        sepol_module_package_t [] modules = new sepol_module_package_t [i_modules.size ()]; 
     326 
     327                        long nStartTime = System.currentTimeMillis (); 
     328                         
     329                        sepol_module_package_t base = new sepol_module_package_t (sBasePath); 
     330 
     331                        int i = 0; 
     332                        for (Iterator itr = i_modules.iterator (); itr.hasNext (); ) 
     333                        { 
     334                                IFile moduleFile = (IFile) itr.next (); 
     335                                String sModulePath = moduleFile.getRawLocation ().toOSString (); 
     336                                modules[i++] = new sepol_module_package_t (sModulePath); 
     337                        } 
     338 
     339                        if (DEBUG) 
     340                        { 
     341                                long nEndTime = System.currentTimeMillis (); 
     342                                System.out.println ("Time to load modules: " + (nEndTime - nStartTime)); 
     343                        } 
     344                         
     345                        sepol_handle_t handle = new sepol_handle_t(); 
     346 
     347                        nStartTime = System.currentTimeMillis (); 
     348                        handle.link_packages (base, modules); 
     349                         
     350                        if (DEBUG) 
     351                        { 
     352                                long nEndTime = System.currentTimeMillis (); 
     353                                System.out.println ("Time to link modules: " + (nEndTime - nStartTime)); 
     354                        } 
     355                         
     356                        m_sepol_policyDB = new sepol_policydb_t (handle, base.get_policy ());                    
     357                        m_sepol_policyDB.set_activepolicy (); 
     358                         
     359                        m_sidTab = new sidtab_t(); 
     360                } 
     361                 
    221362                 
    222363                public void PostVisit (Policy i_policy) 
     
    279420                                Rdef rdef = (Rdef) itr.next (); 
    280421 
    281                                 String sResType = res.getName () + '_' + rdef.GetName () + "_t"; //$NON-NLS-1$  
     422                                String sResType = res.GetTypeWithDictionaryObject(rdef.GetName()); 
    282423                                String sResContext = res.getUser () + ':' + res.getRole () + ':' + sResType; 
    283424 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/builder/FrameworkNature.java

    r1989 r2005  
    6060import com.tresys.framework.plugin.editor.policy.graphic.IShapeVisitor; 
    6161import com.tresys.framework.plugin.editor.policy.graphic.model.DefaultMLSLevelUpdateVisitor; 
     62import com.tresys.framework.plugin.preferences.MLSESupport; 
    6263import com.tresys.framework.plugin.preferences.MLSSettingsProjProperties; 
    6364import com.tresys.framework.plugin.preferences.PreferenceInitializer; 
     
    9192         
    9293        // Reference to retain the MLS Level Configuration file 
    93         protected MLSSupport _mlsConfiguration = null; 
     94        protected MLSESupport _mlsConfiguration = null; 
    9495 
    9596        /** 
     
    626627         *                                                                                configuration file  
    627628         */ 
    628         public MLSSupport getMLSSupport (boolean bInitIfNotFound) 
     629        public MLSESupport getMLSSupport (boolean bInitIfNotFound) 
    629630        { 
    630631                if (null == _mlsConfiguration) 
     
    637638                        try 
    638639                        { 
    639                                 _mlsConfiguration = new MLSSupport(mlsConfigurationFile.getLocation ().toFile ()); 
     640                                _mlsConfiguration = new MLSESupport(mlsConfigurationFile.getLocation ().toFile ()); 
    640641                        } 
    641642                        catch (MLSInitializationException mie) 
     
    647648                                        IPath ipFull = mlsConfigurationFile.getLocation (); 
    648649                                        File file = ipFull.toFile ();   
    649                                         _mlsConfiguration = new MLSSupport(file.getAbsolutePath ()); 
     650                                        _mlsConfiguration = new MLSESupport(file.getAbsolutePath ()); 
    650651                                } 
    651652                        } 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/builder/SELinuxSystem.java

    r2004 r2005  
    5555import com.tresys.framework.compiler.linkage.Linkage; 
    5656import com.tresys.framework.compiler.linkage.libselinuxjava_plugin; 
    57 import com.tresys.framework.compiler.mls.MLSSupport; 
    5857import com.tresys.framework.compiler.policy.IPolicyVisitor; 
    5958import com.tresys.framework.compiler.policy.Policy; 
     
    6665import com.tresys.framework.plugin.editor.policy.graphic.GraphicPolicyRefresh; 
    6766import com.tresys.framework.plugin.editor.policy.graphic.model.PolicyDiagram; 
     67import com.tresys.framework.plugin.preferences.MLSESupport; 
    6868import com.tresys.framework.plugin.preferences.SEFPreferencePage; 
    6969 
     
    123123        protected final File buildPath; 
    124124 
    125         private final MLSSupport m_mlsSupport; 
     125        private final MLSESupport m_mlsSupport; 
    126126        protected ErrorHandler m_fsysErrorHandler; 
    127127        protected ErrorHandler m_fpolErrorHandler; 
     
    129129        protected static final boolean DEBUG = SEFramework_Plugin.getDefault ().isDebugging ("/debug/building"); 
    130130         
    131         public SELinuxSystem(IFolder folder, MLSSupport i_mlsSupport)  
     131        public SELinuxSystem(IFolder folder, MLSESupport i_mlsSupport)  
    132132                throws IllegalArgumentException  
    133133        { 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/linkage/NamedInterfaceSelection.java

    r1886 r2005  
    209209                Integer nBackflow = new Integer (0); 
    210210                String sBackflow = m_txtBackflow.getText (); 
    211                 if (sBackflow.length () > 0) 
    212                         nBackflow = Integer.valueOf (sBackflow); 
     211                try 
     212                { 
     213                        if (sBackflow.length () > 0) 
     214                                nBackflow = Integer.valueOf (sBackflow); 
     215                } 
     216                catch (NumberFormatException nfe) 
     217                {} 
    213218                 
    214219                getInterfaceList ().setBackflow (nBackflow); 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/DomainBorder.java

    r1825 r2005  
    44|*| Author:     David Sugar <dsugar@tresys.com> 
    55|*|   
    6 |*| Version: @version@ 
     6|*| $Rev$ 
     7|*| $Date$ 
    78\*/ 
    89 
     
    6667                 
    6768                Insets tmpPadding = getPadding(); 
    68                 tempRect.setBounds(getPaintRectangle(figure, insets))
    69                 Rectangle rec = tempRect
     69                Rectangle rec = Rectangle.SINGLETON
     70                rec.setBounds(getPaintRectangle(figure, insets))
    7071                 
    7172                Dimension textSize = FigureUtilities.getTextExtents(getLabel (), getFont()); 
    7273                 
    7374                rec.height = Math.min (rec.height, textSize.height + tmpPadding.getHeight()); 
    74                 int x = rec.x + tmpPadding.left + 2
     75                int x = rec.x + tmpPadding.left + 5
    7576                int y = rec.y + tmpPadding.top; 
    7677 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/DomainFigure.java

    r1825 r2005  
    44|*| Author:     David Sugar <dsugar@tresys.com> 
    55|*|   
    6 |*| Version: @version@ 
     6|*| $Rev$ 
     7|*| $Version$ 
    78\*/ 
    89 
     
    3839        protected void outlineShape(Graphics graphics)  
    3940        { 
    40 /* 
    41                 Rectangle r = getBounds(); 
    42                 int x = r.x + lineWidth / 2; 
    43                 int y = r.y + lineWidth / 2; 
    44                 int w = r.width - Math.max(1, lineWidth); 
    45                 int h = r.height - Math.max(1, lineWidth); 
    46                 graphics.drawRectangle(x, y, w, h); 
    47 */ 
     41                Rectangle r = Rectangle.SINGLETON; 
     42                r.setBounds (getBounds()); 
     43                 
     44                 
     45                r.shrink((getLineWidth () -1) * 2, (getLineWidth () -1 ) * 2); 
     46                if (getMLSHighlight () != null) 
     47                { 
     48                        graphics.setForegroundColor (getMLSHighlight ()); 
     49                        graphics.drawRectangle (r); 
     50                } 
    4851        } 
    4952} 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/EntryPointFigure.java

    r1825 r2005  
    33|*| License: refer to COPYING file for license information. 
    44|*| Author:     Mary Snyder <msnyder@tresys.com> 
     5|*|                             Dave Sugar <dsugar@tresys.com> 
    56|*|   
    6 |*| Version: @version@ 
     7|*| $Rev$ 
     8|*| $Date$ 
    79\*/ 
    810 
     
    1719import org.eclipse.swt.graphics.Image; 
    1820 
    19 public class EntryPointFigure extends PolicyComponentFigure 
     21public class EntryPointFigure 
     22        extends PolicyComponentFigure 
    2023{ 
    2124         
     
    3033        protected void fillShape(Graphics graphics)  
    3134        { 
    32                 Rectangle fillBounds = new Rectangle (getBounds()); 
    33                 fillBounds.expand(-lineWidth, -lineWidth); 
    34  
    35                 int x = fillBounds.x; 
    36                 int y = fillBounds.y; 
    37                 int width = fillBounds.width; 
    38                 int height = fillBounds.height; 
     35                Rectangle fillBounds = Rectangle.SINGLETON; 
     36                fillBounds.setBounds (getBounds()); 
     37                fillBounds.expand(getLineWidth () * -2, getLineWidth () * -2); 
    3938                 
    40                 int[] points = { x + width/2, y,                                        // top 
    41                                          x + width, y + height/3,                       // right-top 
    42                                          x + ( 5 * width )/6,  y + height,      // right-bottom 
    43                                          x + width/6, y +  height,                      // left-bottom 
    44                                          x, y + height/3 };                                     // left-top 
    45                  
    46                 graphics.fillPolygon(points); 
     39                graphics.fillPolygon(getPoints (fillBounds)); 
    4740                 
    4841                { 
     
    7568        protected void outlineShape(Graphics graphics)  
    7669        { 
    77                 Rectangle outlineBounds = getBounds(); 
     70                Rectangle outlineBounds = Rectangle.SINGLETON; 
     71                outlineBounds.setBounds (getBounds()); 
    7872                 
    79                 int x = outlineBounds.x + lineWidth / 2; 
    80                 int y = outlineBounds.y + lineWidth / 2; 
    81                 int width = outlineBounds.width - Math.max(1, lineWidth); 
    82                 int height = outlineBounds.height - Math.max(1, lineWidth); 
    83                  
    84                 int[] points = { x + width/2, y,                                // top 
    85                          x + outlineBounds.width - 2, y + height/3,     // right-top 
    86                          x + ( 5 * width )/6,  y + height,              // right-bottom 
    87                          x + width/6, y +  height,                              // left-bottom 
    88                          x, y + height/3 };                                             // left-top 
     73                graphics.drawPolygon(getPoints (outlineBounds)); 
    8974 
    90                 graphics.drawPolygon(points); 
    91                  
     75                if (getMLSHighlight () != null) 
     76                { 
     77                        outlineBounds.shrink(getLineWidth (), getLineWidth ()); 
     78                        graphics.setForegroundColor (getMLSHighlight ()); 
     79                         
     80                        graphics.drawPolygon (getPoints (outlineBounds)); 
     81                } 
     82 
    9283 
    9384        } 
     85         
     86        private int [] getPoints (Rectangle i_bounds) 
     87        { 
     88                int x = i_bounds.x + getLineWidth () / 2; 
     89                int y = i_bounds.y + getLineWidth () / 2; 
     90                int width = i_bounds.width - Math.max(1, getLineWidth ()); 
     91                int height = i_bounds.height - Math.max(1, getLineWidth ()); 
     92 
     93                int[] points = { x + width/2, y,                        // top 
     94                 x + i_bounds.width - 2, y + height/3,  // right-top 
     95                 x + ( 5 * width )/6,  y + height,              // right-bottom 
     96                 x + width/6, y +  height,                              // left-bottom 
     97                 x, y + height/3 };                                             // left-top 
     98 
     99                return points; 
     100//              return new PointList (points); 
     101        } 
    94102} 
    95  
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/PolicyComponentFigure.java

    r1989 r2005  
    44|*| Author:     David Sugar <dsugar@tresys.com> 
    55|*|   
    6 |*| Version: @version@ 
     6|*| $Rev$ 
     7|*| $Date$ 
    78\*/ 
    89 
     
    2829        private String m_sName; 
    2930        private int m_nSeverity = -1; 
     31        private Color m_mlsHighlight = null; 
    3032 
    3133        private static final Image m_imgError = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK); 
     
    9294        } 
    9395         
     96        public void setMLSHighlight (Color i_color) 
     97        { 
     98                m_mlsHighlight = i_color; 
     99        } 
     100         
     101        protected Color getMLSHighlight () 
     102        { 
     103                return m_mlsHighlight; 
     104        } 
     105         
    94106        public void setSeverity (int i_nSeverity) 
    95107        { 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/ResourceFigure.java

    r1825 r2005  
    44|*| Author:     David Sugar <dsugar@tresys.com> 
    55|*|   
    6 |*| Version: @version@ 
     6|*| $Rev$ 
     7|*| $Date$ 
    78\*/ 
    89 
     
    2728                Rectangle fillBounds = new Rectangle (getBounds()); 
    2829                graphics.fillOval(fillBounds); 
    29  
    30                 fillBounds.expand(-lineWidth, -lineWidth); 
     30                 
     31                fillBounds.expand(lineWidth * -2, lineWidth * -2); 
    3132                 
    3233                FontMetrics metrics = graphics.getFontMetrics(); 
     
    8182                r.width--; 
    8283                r.height--; 
    83                 r.shrink((lineWidth - 1) / 2, (lineWidth - 1) / 2); 
     84                r.shrink((getLineWidth () - 1) / 2, (getLineWidth () - 1) / 2); 
     85                 
    8486                graphics.drawOval(r); 
     87                 
     88                r.shrink(getLineWidth (), getLineWidth ()); 
     89                 
     90                if (getMLSHighlight () != null) 
     91                { 
     92                        graphics.setForegroundColor (getMLSHighlight ()); 
     93                        graphics.drawOval (r); 
     94                } 
    8595        } 
    8696 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/Shape.java

    r1989 r2005  
    2727import com.tresys.framework.compiler.dictionary.Verb; 
    2828import com.tresys.framework.compiler.mls.MLSLevel; 
    29 import com.tresys.framework.compiler.mls.MLSSupport; 
    3029import com.tresys.framework.compiler.policy.Component; 
    3130import com.tresys.framework.compiler.policy.Domain; 
     
    3635import com.tresys.framework.plugin.builder.FrameworkNature; 
    3736import com.tresys.framework.plugin.builder.SELinuxSystem; 
     37import com.tresys.framework.plugin.preferences.MLSESupport; 
    3838 
    3939public abstract class Shape  
     
    602602        } 
    603603         
    604         public MLSSupport getMLSSupport () 
     604        public MLSESupport getMLSSupport () 
    605605        { 
    606606                FrameworkNature nat = FrameworkNature.getNature (getSystem ().getProject ()); 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyEditPart.java

    r1989 r2005  
    3939import com.tresys.framework.plugin.editor.policy.graphic.model.ResourceShape; 
    4040import com.tresys.framework.plugin.editor.policy.graphic.model.Shape; 
    41 import com.tresys.framework.plugin.preferences.MLSEclipseLevel
     41import com.tresys.framework.plugin.preferences.MLSESupport
    4242import com.tresys.framework.plugin.preferences.SEFPreferencePage; 
    4343 
     
    234234                Rectangle bounds = new Rectangle(shape.getLocation(), shape.getSize()); 
    235235                 
    236                 IFigure tmpFigure = getFigure(); 
     236                IFigure drawn_figure = getFigure(); 
    237237                 
    238238                GraphicalEditPart part = (GraphicalEditPart) getParent (); 
    239                 part.setLayoutConstraint(this, tmpFigure, bounds); 
    240                 if (!(tmpFigure instanceof PolicyComponentFigure)) 
     239                part.setLayoutConstraint (this, drawn_figure, bounds); 
     240                if (!(drawn_figure instanceof PolicyComponentFigure)) 
    241241                        return; 
    242242                 
     243                PolicyComponentFigure policyComponentfigure = (PolicyComponentFigure) drawn_figure; 
     244                 
    243245                String sName = shape.getSubName(); 
    244                 ((PolicyComponentFigure) tmpFigure).setName (sName);           
    245                 ((PolicyComponentFigure) tmpFigure).setSeverity (shape.getProblemSeverity().intValue()); 
     246                policyComponentfigure.setName (sName);                 
     247                policyComponentfigure.setSeverity (shape.getProblemSeverity().intValue()); 
    246248                 
    247249                if (shape.getComponent () instanceof IMLSSetting) 
     
    249251                        MLSLevel mls = ((IMLSSetting) shape.getComponent ()).getMLSLevel (); 
    250252                        if (mls != null) 
    251                                 tmpFigure.setBackgroundColor (MLSEclipseLevel.getColorInstance (mls)); 
     253                        { 
     254                                MLSESupport mlsSupport = getCastedModel ().getMLSSupport (); 
     255                                policyComponentfigure.setMLSHighlight (mlsSupport.getColorInstance (mls)); 
     256                        } 
    252257                } 
    253258        } 
  • branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/preferences/MLSSettingsProjProperties.java

    r1989 r2005  
    7070import com.tresys.framework.compiler.mls.MLSInitializationException; 
    7171import com.tresys.framework.compiler.