1 10 11 package org.enhydra.jawe; 12 13 import org.jgraph.graph.*; 14 import org.jgraph.JGraph; 15 16 import java.awt.*; 17 import java.awt.geom.Rectangle2D ; 18 import java.net.URL ; 19 import javax.swing.UIManager ; 20 21 26 27 public class JaWEPortView extends PortView { 28 29 protected static MyPortRenderer renderer; 30 31 34 public JaWEPortView(Object cell, JGraph graph, CellMapper mapper) { 35 super(cell,graph,mapper); 36 } 37 38 41 public static void setPortSize (int s) { 42 if (size<2) size=2; 43 size=s; 44 } 45 46 49 public static int getPortSize () { 50 return size; 51 } 52 53 public CellViewRenderer getRenderer() { 54 if (renderer==null) { 55 renderer = new MyPortRenderer(); 56 } 57 return renderer; 58 } 59 60 public static class MyPortRenderer extends PortRenderer { 61 62 public MyPortRenderer() { 63 Color fg=UIManager.getColor("MenuItem.selectionBackground"); 64 Color bg=Utils.getColor(JaWEConfig.getInstance().getHandleColor()); 65 setForeground(fg); 66 setBackground(bg); 67 } 68 } 69 70 } 71 72 73 | Popular Tags |