Changeset 1480
- Timestamp:
- 02/16/07 09:45:39 (2 years ago)
- Files:
-
- trunk/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/DomainFigure.java (modified) (3 diffs)
- trunk/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/DomainEditPart.java (modified) (4 diffs)
- trunk/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyContainerEditPart.java (modified) (2 diffs)
- trunk/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyContainerHighlightEditPolicy.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/DomainFigure.java
r1474 r1480 10 10 11 11 import org.eclipse.draw2d.Graphics; 12 import org.eclipse.draw2d.IFigure;13 12 import org.eclipse.draw2d.Shape; 14 13 import org.eclipse.draw2d.geometry.Rectangle; 15 import org.eclipse.swt.graphics.Image;16 14 17 15 public class DomainFigure … … 23 21 setBorder (new DomainBorder (this)); 24 22 } 25 26 27 public void removeConnection (IFigure i_connection)28 {29 30 }31 23 32 24 /** … … 36 28 { 37 29 Rectangle bounds = new Rectangle (getBounds()); 38 39 /*40 41 30 graphics.fillRectangle(bounds); 42 bounds.expand(-lineWidth, -lineWidth);43 44 FontMetrics metrics = graphics.getFontMetrics();45 46 Rectangle clip = new Rectangle ();47 graphics.getClip(clip);48 graphics.setClip(bounds);49 graphics.drawText(getName (), bounds.x, bounds.y + bounds.height/2 - metrics.getHeight()/2);50 graphics.setClip(clip);51 */52 53 Image imgWarning = getSeverityImg();54 if (imgWarning != null)55 graphics.drawImage(imgWarning, bounds.x + 10, bounds.y + 10);56 31 57 32 super.fillShape (graphics); trunk/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/DomainEditPart.java
r1479 r1480 47 47 private Map targetAnchors = new HashMap (); 48 48 49 private LayeredPane m_layers = null;49 private ScalableFreeformLayeredPane m_layers = null; 50 50 private FreeformLayeredPane m_printableLayers = null; 51 51 … … 64 64 ConnectionLayer connectionLayer = new ConnectionLayer (); 65 65 connectionLayer.setConnectionRouter(new ShortestPathConnectionRouter (mainLayer)); 66 66 67 67 m_printableLayers = new FreeformLayeredPane (); 68 68 m_printableLayers.setLayoutManager(new StackLayout ()); 69 69 m_printableLayers.add (connectionLayer, LayerConstants.CONNECTION_LAYER); 70 70 m_printableLayers.add (mainLayer, LayerConstants.PRIMARY_LAYER); 71 72 71 } 73 72 … … 75 74 } 76 75 77 protected LayeredPane createLayers () 78 { 79 IFigure fig = getFigure (); 80 fig.setLayoutManager(new StackLayout ()); 81 82 83 ScalableFreeformLayeredPane layers = new ScalableFreeformLayeredPane (); 84 layers.setLayoutManager(new StackLayout ()); 85 layers.setScale(.75); 86 87 IFigure figureConetnts = layers; 88 89 // layers.add (new GridLayer (), LayerConstants.GRID_LAYER); 90 layers.add (getPrintableLayers (), LayerConstants.PRINTABLE_LAYERS); 91 // layers.add (new FreeformLayer (), LayerConstants.HANDLE_LAYER); 92 //layers.add (new FeedbackLayer (), LayerConstants.FEEDBACK_LAYER); 93 // layers.add (new GuideLayer (), LayerConstants.GUIDE_LAYER); 76 protected LayeredPane getLayers () 77 { 78 if (m_layers == null) 79 { 80 IFigure fig = getFigure (); 81 fig.setLayoutManager(new StackLayout ()); 82 83 m_layers = new ScalableFreeformLayeredPane (); 84 m_layers.setLayoutManager(new StackLayout ()); 85 m_layers.setScale(.75); 86 87 IFigure figureConetnts = m_layers; 88 89 // layers.add (new GridLayer (), LayerConstants.GRID_LAYER); 90 m_layers.add (getPrintableLayers (), LayerConstants.PRINTABLE_LAYERS); 91 // layers.add (new FreeformLayer (), LayerConstants.HANDLE_LAYER); 92 // layers.add (new FeedbackLayer (), LayerConstants.FEEDBACK_LAYER); 93 // layers.add (new GuideLayer (), LayerConstants.GUIDE_LAYER); 94 94 95 95 /* 96 // for scrolling in domains97 // may cause problems with connection routing98 ScrollPane scrollPane = new ScrollPane ();99 // scrollPane.setHorizontalScrollBarVisibility(ScrollPane.NEVER);100 // scrollPane.setVerticalScrollBarVisibility(ScrollPane.NEVER);101 scrollPane.setViewport (new FreeformViewport ());102 scrollPane.setContents(layers);103 figureConetnts = scrollPane;96 // for scrolling in domains 97 // may cause problems with connection routing 98 ScrollPane scrollPane = new ScrollPane (); 99 // scrollPane.setHorizontalScrollBarVisibility(ScrollPane.NEVER); 100 // scrollPane.setVerticalScrollBarVisibility(ScrollPane.NEVER); 101 scrollPane.setViewport (new FreeformViewport ()); 102 scrollPane.setContents(layers); 103 figureConetnts = scrollPane; 104 104 // */ 105 105 106 fig.add (figureConetnts); 107 108 return layers; 106 fig.add (figureConetnts); 107 } 108 109 return m_layers; 109 110 } 110 111 111 112 protected IFigure getLayer (Object layer) 112 113 { 113 if (m_layers == null) 114 m_layers = createLayers (); 115 116 IFigure fig = m_layers.getLayer(layer); 114 IFigure fig = getLayers ().getLayer(layer); 115 117 116 if (fig == null) 118 fig = m_printableLayers.getLayer(layer);117 fig = getPrintableLayers().getLayer(layer); 119 118 120 119 if (fig == null) … … 155 154 // and the reconnection of connections between Shape instances 156 155 installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new ShapeNodeEditPolicy()); 156 157 // feed back when item being moved into a domain 158 installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new PolicyContainerHighlightEditPolicy()); 157 159 } 158 160 trunk/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyContainerEditPart.java
r1479 r1480 16 16 17 17 import org.eclipse.gef.EditPart; 18 import org.eclipse.gef.EditPolicy;19 18 import org.eclipse.jface.text.Assert; 20 19 import org.eclipse.swt.widgets.Display; … … 53 52 protected void createEditPolicies () 54 53 { 55 installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new PolicyContainerHighlightEditPolicy());56 54 } 57 55 trunk/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyContainerHighlightEditPolicy.java
r1479 r1480 46 46 private IFigure getContainerFigure () 47 47 { 48 // ((DomainEditPart) getHost ()).getL 49 return ((GraphicalEditPart) getHost ()).getContentPane(); // getFigure (); 48 return ((GraphicalEditPart) getHost ()).getFigure (); 50 49 } 51 50
