1 10 11 package org.enhydra.jawe.graph; 12 13 14 15 import org.jgraph.JGraph; 16 import org.jgraph.graph.*; 17 18 import java.awt.*; 19 import java.awt.geom.Rectangle2D ; 20 import java.util.*; 21 22 25 public class ParticipantView extends VertexView { 26 27 28 public static ParticipantRenderer renderer = new ParticipantRenderer(); 29 30 35 public ParticipantView(Object cell, JGraph graph, CellMapper cm) { 36 super(cell, graph, cm); 37 } 38 39 42 public CellViewRenderer getRenderer() { 43 return renderer; 44 } 45 46 49 public boolean intersects(Graphics g, Rectangle2D rect) { Rectangle2D bounds = getBounds(); if (bounds != null) { 52 Rectangle nameBounds=new Rectangle((int)bounds.getX(),(int)bounds.getY(), 53 renderer.participantNameWidth,(int)bounds.getHeight()); 54 return nameBounds.intersects(rect); 55 } 56 return false; 57 } 58 59 62 public void refreshChildViews () { 63 childViews.clear(); 64 refresh(false); 65 } 66 67 70 public Rectangle2D getBounds() { return bounds; 72 } 73 74 77 public void addChildView (CellView childView) { 78 if (childView != null) { 79 childViews.add(childView); 80 } 81 } 82 83 } 84 85 86 | Popular Tags |