medusa.display
Class PaintTools
- java.lang.Object
-
- medusa.display.PaintTools
-
public class PaintTools extends java.lang.ObjectConvenience class containing methods of painting nodes and edges. Medusa will most often use these methods. If you want to implement your own methods, simply modify the methodspaintNodeandpaintEdgein the graph panels.
-
-
Constructor Summary
Constructors Constructor and Description PaintTools()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static double[]controlPoints(int x1, int y1, int x2, int y2, double orientation, double offset)Calculates the control points between (x1,y1) and (x2,y2) for the cubic curvestatic voiddrawCompositeNode(java.awt.Graphics2D g2d, Node n, int nodeSize)A composite node has two or more colors.static java.awt.ShapegetShape(int i, int x, int y, int nodeSize)static doublegetTheta(int x1, int x2, int y1, int y2)The theta parameter is used when drawing bezier curves.static int[]intControlPoints(int x1, int y1, int x2, int y2, double orientation, double offset)static voidpaintPath(java.awt.Graphics2D g2d, int x1, int y1, int x2, int y2, double orientation, double offset, boolean arrow)Paints the cubic curve between (x1,y1) and (x2,y2).static voidpaintPath(java.awt.Graphics2D g2d, int x1, int y1, int x2, int y2, double orientation, double offset, boolean arrow, boolean label)static voidPaintPathWithConfLabel(java.awt.Graphics2D g2d, int x1, int y1, int x2, int y2, double orientation, double offset, boolean arrow, boolean label)static voidpaintRegulatoryPath(java.awt.Graphics2D g2d, int x1, int y1, int x2, int y2, double orientation, double offset, int shape)Not implemented.static java.lang.StringpsCircle(int x, int y, int nodeSize)static java.lang.StringpsRectangle(int x, int y, int nodeSize)PostScript method for rectangular nodesstatic java.lang.StringpsRhomb(int x, int y, int nodeSize)PostScript method for drawing rhomboidsstatic java.lang.StringpsTriangle(int x, int y, int nodeSize)PostScript method for drawing trianglesstatic java.awt.Polygonrhomb(int x, int y, int nodeSize)Draws a rhomboid node shape.static java.awt.Polygontriangle(int x, int y, int nodeSize)
-
-
-
Method Detail
-
getTheta
public static double getTheta(int x1, int x2, int y1, int y2)The theta parameter is used when drawing bezier curves.- Parameters:
x1-x2-y1-y2-- Returns:
- theta: the "attack" parameter of bezier curves
-
rhomb
public static java.awt.Polygon rhomb(int x, int y, int nodeSize)Draws a rhomboid node shape.- Parameters:
x-y-nodeSize-- Returns:
-
triangle
public static java.awt.Polygon triangle(int x, int y, int nodeSize)
-
getShape
public static java.awt.Shape getShape(int i, int x, int y, int nodeSize)
-
drawCompositeNode
public static void drawCompositeNode(java.awt.Graphics2D g2d, Node n, int nodeSize)A composite node has two or more colors. Nodes have additional data storage for additional colors. A composite node will be split into two halves with each half in a different color.- Parameters:
g2d-n-nodeSize-
-
paintPath
public static void paintPath(java.awt.Graphics2D g2d, int x1, int y1, int x2, int y2, double orientation, double offset, boolean arrow)Paints the cubic curve between (x1,y1) and (x2,y2). The offset parameter allows multiple edges to be shown concurrently. The orientation decides how steep the curve should be, and the offset parameter is just a tweak to make the curve less "blunt"- Parameters:
g2d-x1-y1-x2-y2-orientation-offset-arrow-
-
paintPath
public static void paintPath(java.awt.Graphics2D g2d, int x1, int y1, int x2, int y2, double orientation, double offset, boolean arrow, boolean label)
-
PaintPathWithConfLabel
public static void PaintPathWithConfLabel(java.awt.Graphics2D g2d, int x1, int y1, int x2, int y2, double orientation, double offset, boolean arrow, boolean label)- Parameters:
g2d-x1-y1-x2-y2-orientation-offset-arrow-label-
-
controlPoints
public static double[] controlPoints(int x1, int y1, int x2, int y2, double orientation, double offset)Calculates the control points between (x1,y1) and (x2,y2) for the cubic curve- Parameters:
x1-y1-x2-y2-orientation-offset-- Returns:
-
intControlPoints
public static int[] intControlPoints(int x1, int y1, int x2, int y2, double orientation, double offset)
-
paintRegulatoryPath
public static void paintRegulatoryPath(java.awt.Graphics2D g2d, int x1, int y1, int x2, int y2, double orientation, double offset, int shape)Not implemented. An example of the kind of edges that can be drawn. This method draws the standard "inhibition"/"activation" interactions. set shape = 1 for an arrow shape = 2 for bar shape = 3 for circle
-
psRhomb
public static java.lang.String psRhomb(int x, int y, int nodeSize)PostScript method for drawing rhomboids- Parameters:
x-y-nodeSize-- Returns:
-
psTriangle
public static java.lang.String psTriangle(int x, int y, int nodeSize)PostScript method for drawing triangles
-
psRectangle
public static java.lang.String psRectangle(int x, int y, int nodeSize)PostScript method for rectangular nodes
-
psCircle
public static java.lang.String psCircle(int x, int y, int nodeSize)
-
-
DMelt 3.0 © DataMelt by jWork.ORG