<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.santafe.edu/index.php?action=history&amp;feed=atom&amp;title=CustomEdge.java</id>
	<title>CustomEdge.java - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.santafe.edu/index.php?action=history&amp;feed=atom&amp;title=CustomEdge.java"/>
	<link rel="alternate" type="text/html" href="https://wiki.santafe.edu/index.php?title=CustomEdge.java&amp;action=history"/>
	<updated>2026-04-27T22:11:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://wiki.santafe.edu/index.php?title=CustomEdge.java&amp;diff=3459&amp;oldid=prev</id>
		<title>Seoc at 04:01, 16 June 2006</title>
		<link rel="alternate" type="text/html" href="https://wiki.santafe.edu/index.php?title=CustomEdge.java&amp;diff=3459&amp;oldid=prev"/>
		<updated>2006-06-16T04:01:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:01, 16 June 2006&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Base model]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pre&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/*&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/*&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * CustomEdge.java&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * CustomEdge.java&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l109&quot;&gt;Line 109:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 111:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     }&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/pre&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Seoc</name></author>
	</entry>
	<entry>
		<id>https://wiki.santafe.edu/index.php?title=CustomEdge.java&amp;diff=3394&amp;oldid=prev</id>
		<title>Seoc at 14:08, 15 June 2006</title>
		<link rel="alternate" type="text/html" href="https://wiki.santafe.edu/index.php?title=CustomEdge.java&amp;diff=3394&amp;oldid=prev"/>
		<updated>2006-06-15T14:08:56Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;/*&lt;br /&gt;
 * CustomEdge.java&lt;br /&gt;
 *&lt;br /&gt;
 * Created on January 22, 2005, 5:55 PM&lt;br /&gt;
 * Modified on June 13 2006&lt;br /&gt;
 * &lt;br /&gt;
 * This class is for the edges in a netwok&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
package CoopNetBlue;&lt;br /&gt;
import java.awt.Color;&lt;br /&gt;
import uchicago.src.sim.gui.ColorMap;&lt;br /&gt;
&lt;br /&gt;
import uchicago.src.sim.gui.DrawableEdge;&lt;br /&gt;
import uchicago.src.sim.gui.SimGraphics;&lt;br /&gt;
import uchicago.src.sim.network.DefaultEdge;&lt;br /&gt;
import uchicago.src.sim.network.Node;&lt;br /&gt;
/**&lt;br /&gt;
 *&lt;br /&gt;
 * @author Jack Waddell&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// DefaultEdge gives us the standard edge methods&lt;br /&gt;
// DrawableEdge lets us draw it in the GUI&lt;br /&gt;
public class CustomEdge extends DefaultEdge implements DrawableEdge {&lt;br /&gt;
    //*************************************************************&lt;br /&gt;
    // Static Parameters&lt;br /&gt;
&lt;br /&gt;
    // These are for drawing the edge in GUI&lt;br /&gt;
    public static GUIModel          guiModel = null;&lt;br /&gt;
    public static ColorMap          redColorMap, blueColorMap;&lt;br /&gt;
    public static final int         colorMapSize = 64;&lt;br /&gt;
    public static final int         colorMapMax = colorMapSize - 1;&lt;br /&gt;
&lt;br /&gt;
    //***********************************************************&lt;br /&gt;
    //Instance parameters&lt;br /&gt;
    &lt;br /&gt;
    private Color color = Color.red;  // Edge color&lt;br /&gt;
&lt;br /&gt;
    //***********************************************************&lt;br /&gt;
    // Methods&lt;br /&gt;
&lt;br /&gt;
    //////////////////////////////////////////////////&lt;br /&gt;
    // Constructor&lt;br /&gt;
    public CustomEdge() {&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    //////////////////////////////////////////////////&lt;br /&gt;
    // Constructor (overloaded)&lt;br /&gt;
    // Inputs: Node from, the (generic class) Node from which the edge emerges&lt;br /&gt;
    //         Node to, the (generic) Node to which the edge points&lt;br /&gt;
    public CustomEdge(Node from, Node to) {&lt;br /&gt;
        super(from, to, &amp;quot;&amp;quot;);   // Calls DefaultEdge constructor&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    //////////////////////////////////////////////////&lt;br /&gt;
    // setColor&lt;br /&gt;
    // Inputs: Color c&lt;br /&gt;
    // Outputs: none&lt;br /&gt;
    // Sets edge&amp;#039;s color to c, a Java color&lt;br /&gt;
    public void setColor(Color c) {&lt;br /&gt;
        color = c;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
    ////////////////////////////////////////////////////////&lt;br /&gt;
    // draw&lt;br /&gt;
    // Inputs: SimGraphics g&lt;br /&gt;
    //         int fromX, toX, fromY, toY&lt;br /&gt;
    // Outputs: none&lt;br /&gt;
    // Required to implement DrawableEdge.&lt;br /&gt;
    public void draw(SimGraphics g, int fromX, int toX, int fromY, int toY) {&lt;br /&gt;
        g.drawDirectedLink(color, fromX, toX, fromY, toY);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    //******************************************************&lt;br /&gt;
    // Static Methods&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
    ////////////////////////////////////////////////////&lt;br /&gt;
    // setUpEdgeDrawing&lt;br /&gt;
    // Inputs: GUIModel m, a pointer to the GUIModel instance&lt;br /&gt;
    // Outputs: none&lt;br /&gt;
    // Prepares the edge to be drawn in the GUI&lt;br /&gt;
    public static void setUpEdgeDrawing (GUIModel m) {&lt;br /&gt;
	//System.out.printf(&amp;quot;Setting up Edge Color Map\n&amp;quot;);&lt;br /&gt;
	guiModel = m;&lt;br /&gt;
	redColorMap = new ColorMap();&lt;br /&gt;
	double minRed = 0.5;&lt;br /&gt;
	&lt;br /&gt;
	for (int i = 0; i &amp;lt; colorMapSize; i++){&lt;br /&gt;
	    double fracR = minRed + ( (1.0-minRed)*i/colorMapMax );&lt;br /&gt;
	    fracR = 1.0 + minRed - fracR;&lt;br /&gt;
	    //System.out.printf(&amp;quot;Edge Color Map: i = %d, fR = %f\n&amp;quot;, i, fracR);&lt;br /&gt;
	    redColorMap.mapColor(i, fracR, 0, 0);		   &lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	blueColorMap = new ColorMap();&lt;br /&gt;
	double minBlue = 0.5;&lt;br /&gt;
	for (int i = 0; i &amp;lt; colorMapSize; i++){&lt;br /&gt;
	    double fracB = minBlue + ( (1.0-minBlue)*i/colorMapMax );&lt;br /&gt;
	    fracB = 1.0 + minBlue - fracB;&lt;br /&gt;
	    //System.out.printf(&amp;quot;Edge Color Map: i = %d, fR = %f\n&amp;quot;, i, fracR);&lt;br /&gt;
	    blueColorMap.mapColor(i, 0, 0, fracB);		   &lt;br /&gt;
	}&lt;br /&gt;
    }&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Seoc</name></author>
	</entry>
</feed>