Changeset 2005
- Timestamp:
- 03/19/08 14:41:13 (8 months ago)
- Files:
-
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/SharedColors.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/builder/AccessCheckBuilder.java (modified) (8 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/builder/FrameworkNature.java (modified) (5 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/builder/SELinuxSystem.java (modified) (4 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/linkage/NamedInterfaceSelection.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/DomainBorder.java (modified) (2 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/DomainFigure.java (modified) (2 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/EntryPointFigure.java (modified) (4 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/PolicyComponentFigure.java (modified) (3 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/ResourceFigure.java (modified) (3 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/Shape.java (modified) (3 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyEditPart.java (modified) (3 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/preferences/MLSESupport.java (copied) (copied from trunk/framework-plugin/src/com/tresys/framework/plugin/preferences/MLSESupport.java)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/preferences/MLSEclipseLevel.java (deleted)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/preferences/MLSSettingsProjProperties.java (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/SharedColors.java
r1921 r2005 30 30 31 31 /** Creates an returns a shared color manager. */ 32 publicSharedColors ()32 SharedColors () 33 33 { 34 34 super (); branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/builder/AccessCheckBuilder.java
r1989 r2005 17 17 import java.io.InputStream; 18 18 import java.util.Collection; 19 import java.util.HashSet; 19 20 import java.util.Iterator; 20 21 import java.util.Map; … … 40 41 import com.tresys.framework.compiler.linkage.libselinuxjava.sepol_access_decision; 41 42 import com.tresys.framework.compiler.linkage.libselinuxjava.sepol_access_vector; 43 import com.tresys.framework.compiler.linkage.libselinuxjava.sepol_handle_t; 44 import com.tresys.framework.compiler.linkage.libselinuxjava.sepol_module_package_t; 45 import com.tresys.framework.compiler.linkage.libselinuxjava.sepol_policydb_t; 42 46 import com.tresys.framework.compiler.linkage.libselinuxjava.sepol_security_class_t; 43 47 import com.tresys.framework.compiler.linkage.libselinuxjava.sepol_security_id_t; … … 101 105 try 102 106 { 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 104 136 } 105 137 catch (CoreException ce) 106 138 {} 139 catch (IOException ioe) 140 { 141 ioe.printStackTrace (); 142 } 107 143 } 108 144 … … 118 154 implements IResourceVisitor 119 155 { 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 120 204 /* (non-Javadoc) 121 205 * @see org.eclipse.core.resources.IResourceVisitor#visit(org.eclipse.core.resources.IResource) … … 123 207 public boolean visit (IResource resource) 124 208 { 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 } 129 247 130 // match policy file131 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 policy147 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 }166 248 return false; 167 249 } … … 180 262 181 263 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; 184 267 private final BuildConfFile m_buildConf; 185 268 private final ErrorHandler m_errorHandler; 186 269 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 188 278 AccessCheckVisitor (BuildConfFile i_buildConf, IFile i_policyFile, ErrorHandler i_errorHandler) 189 279 throws FileNotFoundException, IOException 190 280 { 191 192 m_errorHandler = i_errorHandler; 281 this (i_buildConf, i_errorHandler); 193 282 policy_file_t pFile = null; 194 m_buildConf = i_buildConf;195 283 196 284 if (false) … … 216 304 } 217 305 306 long nStartTime = System.currentTimeMillis (); 218 307 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 (); 219 315 m_sidTab = new sidtab_t(); 220 316 } 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 221 362 222 363 public void PostVisit (Policy i_policy) … … 279 420 Rdef rdef = (Rdef) itr.next (); 280 421 281 String sResType = res. getName () + '_' + rdef.GetName () + "_t"; //$NON-NLS-1$422 String sResType = res.GetTypeWithDictionaryObject(rdef.GetName()); 282 423 String sResContext = res.getUser () + ':' + res.getRole () + ':' + sResType; 283 424 branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/builder/FrameworkNature.java
r1989 r2005 60 60 import com.tresys.framework.plugin.editor.policy.graphic.IShapeVisitor; 61 61 import com.tresys.framework.plugin.editor.policy.graphic.model.DefaultMLSLevelUpdateVisitor; 62 import com.tresys.framework.plugin.preferences.MLSESupport; 62 63 import com.tresys.framework.plugin.preferences.MLSSettingsProjProperties; 63 64 import com.tresys.framework.plugin.preferences.PreferenceInitializer; … … 91 92 92 93 // Reference to retain the MLS Level Configuration file 93 protected MLS Support _mlsConfiguration = null;94 protected MLSESupport _mlsConfiguration = null; 94 95 95 96 /** … … 626 627 * configuration file 627 628 */ 628 public MLS Support getMLSSupport (boolean bInitIfNotFound)629 public MLSESupport getMLSSupport (boolean bInitIfNotFound) 629 630 { 630 631 if (null == _mlsConfiguration) … … 637 638 try 638 639 { 639 _mlsConfiguration = new MLS Support(mlsConfigurationFile.getLocation ().toFile ());640 _mlsConfiguration = new MLSESupport(mlsConfigurationFile.getLocation ().toFile ()); 640 641 } 641 642 catch (MLSInitializationException mie) … … 647 648 IPath ipFull = mlsConfigurationFile.getLocation (); 648 649 File file = ipFull.toFile (); 649 _mlsConfiguration = new MLS Support(file.getAbsolutePath ());650 _mlsConfiguration = new MLSESupport(file.getAbsolutePath ()); 650 651 } 651 652 } branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/builder/SELinuxSystem.java
r2004 r2005 55 55 import com.tresys.framework.compiler.linkage.Linkage; 56 56 import com.tresys.framework.compiler.linkage.libselinuxjava_plugin; 57 import com.tresys.framework.compiler.mls.MLSSupport;58 57 import com.tresys.framework.compiler.policy.IPolicyVisitor; 59 58 import com.tresys.framework.compiler.policy.Policy; … … 66 65 import com.tresys.framework.plugin.editor.policy.graphic.GraphicPolicyRefresh; 67 66 import com.tresys.framework.plugin.editor.policy.graphic.model.PolicyDiagram; 67 import com.tresys.framework.plugin.preferences.MLSESupport; 68 68 import com.tresys.framework.plugin.preferences.SEFPreferencePage; 69 69 … … 123 123 protected final File buildPath; 124 124 125 private final MLS Support m_mlsSupport;125 private final MLSESupport m_mlsSupport; 126 126 protected ErrorHandler m_fsysErrorHandler; 127 127 protected ErrorHandler m_fpolErrorHandler; … … 129 129 protected static final boolean DEBUG = SEFramework_Plugin.getDefault ().isDebugging ("/debug/building"); 130 130 131 public SELinuxSystem(IFolder folder, MLS Support i_mlsSupport)131 public SELinuxSystem(IFolder folder, MLSESupport i_mlsSupport) 132 132 throws IllegalArgumentException 133 133 { branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/linkage/NamedInterfaceSelection.java
r1886 r2005 209 209 Integer nBackflow = new Integer (0); 210 210 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 {} 213 218 214 219 getInterfaceList ().setBackflow (nBackflow); branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/DomainBorder.java
r1825 r2005 4 4 |*| Author: David Sugar <dsugar@tresys.com> 5 5 |*| 6 |*| Version: @version@ 6 |*| $Rev$ 7 |*| $Date$ 7 8 \*/ 8 9 … … 66 67 67 68 Insets tmpPadding = getPadding(); 68 tempRect.setBounds(getPaintRectangle(figure, insets));69 Rectangle rec = tempRect;69 Rectangle rec = Rectangle.SINGLETON; 70 rec.setBounds(getPaintRectangle(figure, insets)); 70 71 71 72 Dimension textSize = FigureUtilities.getTextExtents(getLabel (), getFont()); 72 73 73 74 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; 75 76 int y = rec.y + tmpPadding.top; 76 77 branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/DomainFigure.java
r1825 r2005 4 4 |*| Author: David Sugar <dsugar@tresys.com> 5 5 |*| 6 |*| Version: @version@ 6 |*| $Rev$ 7 |*| $Version$ 7 8 \*/ 8 9 … … 38 39 protected void outlineShape(Graphics graphics) 39 40 { 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 } 48 51 } 49 52 } branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/EntryPointFigure.java
r1825 r2005 3 3 |*| License: refer to COPYING file for license information. 4 4 |*| Author: Mary Snyder <msnyder@tresys.com> 5 |*| Dave Sugar <dsugar@tresys.com> 5 6 |*| 6 |*| Version: @version@ 7 |*| $Rev$ 8 |*| $Date$ 7 9 \*/ 8 10 … … 17 19 import org.eclipse.swt.graphics.Image; 18 20 19 public class EntryPointFigure extends PolicyComponentFigure 21 public class EntryPointFigure 22 extends PolicyComponentFigure 20 23 { 21 24 … … 30 33 protected void fillShape(Graphics graphics) 31 34 { 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); 39 38 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)); 47 40 48 41 { … … 75 68 protected void outlineShape(Graphics graphics) 76 69 { 77 Rectangle outlineBounds = getBounds(); 70 Rectangle outlineBounds = Rectangle.SINGLETON; 71 outlineBounds.setBounds (getBounds()); 78 72 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)); 89 74 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 92 83 93 84 } 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 } 94 102 } 95 branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/PolicyComponentFigure.java
r1989 r2005 4 4 |*| Author: David Sugar <dsugar@tresys.com> 5 5 |*| 6 |*| Version: @version@ 6 |*| $Rev$ 7 |*| $Date$ 7 8 \*/ 8 9 … … 28 29 private String m_sName; 29 30 private int m_nSeverity = -1; 31 private Color m_mlsHighlight = null; 30 32 31 33 private static final Image m_imgError = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK); … … 92 94 } 93 95 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 94 106 public void setSeverity (int i_nSeverity) 95 107 { branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/ResourceFigure.java
r1825 r2005 4 4 |*| Author: David Sugar <dsugar@tresys.com> 5 5 |*| 6 |*| Version: @version@ 6 |*| $Rev$ 7 |*| $Date$ 7 8 \*/ 8 9 … … 27 28 Rectangle fillBounds = new Rectangle (getBounds()); 28 29 graphics.fillOval(fillBounds); 29 30 fillBounds.expand( -lineWidth, -lineWidth);30 31 fillBounds.expand(lineWidth * -2, lineWidth * -2); 31 32 32 33 FontMetrics metrics = graphics.getFontMetrics(); … … 81 82 r.width--; 82 83 r.height--; 83 r.shrink((lineWidth - 1) / 2, (lineWidth - 1) / 2); 84 r.shrink((getLineWidth () - 1) / 2, (getLineWidth () - 1) / 2); 85 84 86 graphics.drawOval(r); 87 88 r.shrink(getLineWidth (), getLineWidth ()); 89 90 if (getMLSHighlight () != null) 91 { 92 graphics.setForegroundColor (getMLSHighlight ()); 93 graphics.drawOval (r); 94 } 85 95 } 86 96 branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/Shape.java
r1989 r2005 27 27 import com.tresys.framework.compiler.dictionary.Verb; 28 28 import com.tresys.framework.compiler.mls.MLSLevel; 29 import com.tresys.framework.compiler.mls.MLSSupport;30 29 import com.tresys.framework.compiler.policy.Component; 31 30 import com.tresys.framework.compiler.policy.Domain; … … 36 35 import com.tresys.framework.plugin.builder.FrameworkNature; 37 36 import com.tresys.framework.plugin.builder.SELinuxSystem; 37 import com.tresys.framework.plugin.preferences.MLSESupport; 38 38 39 39 public abstract class Shape … … 602 602 } 603 603 604 public MLS Support getMLSSupport ()604 public MLSESupport getMLSSupport () 605 605 { 606 606 FrameworkNature nat = FrameworkNature.getNature (getSystem ().getProject ()); branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyEditPart.java
r1989 r2005 39 39 import com.tresys.framework.plugin.editor.policy.graphic.model.ResourceShape; 40 40 import com.tresys.framework.plugin.editor.policy.graphic.model.Shape; 41 import com.tresys.framework.plugin.preferences.MLSE clipseLevel;41 import com.tresys.framework.plugin.preferences.MLSESupport; 42 42 import com.tresys.framework.plugin.preferences.SEFPreferencePage; 43 43 … … 234 234 Rectangle bounds = new Rectangle(shape.getLocation(), shape.getSize()); 235 235 236 IFigure tmpFigure = getFigure();236 IFigure drawn_figure = getFigure(); 237 237 238 238 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)) 241 241 return; 242 242 243 PolicyComponentFigure policyComponentfigure = (PolicyComponentFigure) drawn_figure; 244 243 245 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()); 246 248 247 249 if (shape.getComponent () instanceof IMLSSetting) … … 249 251 MLSLevel mls = ((IMLSSetting) shape.getComponent ()).getMLSLevel (); 250 252 if (mls != null) 251 tmpFigure.setBackgroundColor (MLSEclipseLevel.getColorInstance (mls)); 253 { 254 MLSESupport mlsSupport = getCastedModel ().getMLSSupport (); 255 policyComponentfigure.setMLSHighlight (mlsSupport.getColorInstance (mls)); 256 } 252 257 } 253 258 } branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/preferences/MLSSettingsProjProperties.java
r1989 r2005 70 70 import com.tresys.framework.compiler.mls.MLSInitializationException; 71 71 import com.tresys.framework.compiler.
