|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsim.portrayal.SimplePortrayal2D
sim.portrayal.network.SimpleEdgePortrayal2D
public class SimpleEdgePortrayal2D
Field Summary | |
---|---|
static int |
ALWAYS_SCALE
|
double |
baseWidth
|
java.awt.Paint |
fromPaint
|
java.awt.Font |
labelFont
|
java.awt.Paint |
labelPaint
|
static int |
NEVER_SCALE
|
static int |
SCALE_WHEN_SMALLER
|
int |
shape
|
static int |
SHAPE_LINE
|
static int |
SHAPE_TRIANGLE
|
java.awt.Paint |
toPaint
|
Constructor Summary | |
---|---|
SimpleEdgePortrayal2D()
Draws a single-color, undirected black line (or triangle) with no label. |
|
SimpleEdgePortrayal2D(java.awt.Paint edgePaint,
java.awt.Paint labelPaint)
One single color line will be drawn, and if labelPaint is null, no label is drawn. |
|
SimpleEdgePortrayal2D(java.awt.Paint fromPaint,
java.awt.Paint toPaint,
java.awt.Paint labelPaint)
If fromPaint == toPaint, one single color line will be drawn, and if labelPaint is null, no label is drawn. |
|
SimpleEdgePortrayal2D(java.awt.Paint fromPaint,
java.awt.Paint toPaint,
java.awt.Paint labelPaint,
java.awt.Font labelFont)
If fromPaint == toPaint, one single color line will be drawn, and if labelPaint is null, no label is drawn. |
Method Summary | |
---|---|
void |
draw(java.lang.Object object,
java.awt.Graphics2D graphics,
DrawInfo2D info)
Draw a portrayed object centered at the origin in info, and with the given scaling factors. |
double |
getBaseWidth()
|
java.lang.String |
getLabel(Edge edge,
EdgeDrawInfo2D info)
Returns a name appropriate for the edge. |
int |
getLabelScaling()
|
java.lang.String |
getName(LocationWrapper wrapper)
Returns a static, one-line name for the given object that is useful for a human to distinguish it from other objects. |
int |
getScaling()
|
int |
getShape()
Returns the shape of the edge. |
boolean |
hitObject(java.lang.Object object,
DrawInfo2D range)
If drawing area intersects selected area, return true. |
void |
setBaseWidth(double val)
Sets the width of the base of the triangle used in drawing the directed edge -- by default, this is 0 (a simple line is drawn). |
void |
setLabelScaling(int val)
|
void |
setScaling(int val)
|
void |
setShape(int shape)
Sets the shape of the edge. |
Methods inherited from class sim.portrayal.SimplePortrayal2D |
---|
getInspector, getStatus, move, setSelected |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.awt.Paint fromPaint
public java.awt.Paint toPaint
public java.awt.Paint labelPaint
public java.awt.Font labelFont
public static final int NEVER_SCALE
public static final int SCALE_WHEN_SMALLER
public static final int ALWAYS_SCALE
public double baseWidth
public static final int SHAPE_LINE
public static final int SHAPE_TRIANGLE
public int shape
Constructor Detail |
---|
public SimpleEdgePortrayal2D()
public SimpleEdgePortrayal2D(java.awt.Paint edgePaint, java.awt.Paint labelPaint)
public SimpleEdgePortrayal2D(java.awt.Paint fromPaint, java.awt.Paint toPaint, java.awt.Paint labelPaint)
public SimpleEdgePortrayal2D(java.awt.Paint fromPaint, java.awt.Paint toPaint, java.awt.Paint labelPaint, java.awt.Font labelFont)
Method Detail |
---|
public int getShape()
public void setShape(int shape)
public double getBaseWidth()
public void setBaseWidth(double val)
public int getScaling()
public void setScaling(int val)
public int getLabelScaling()
public void setLabelScaling(int val)
public java.lang.String getLabel(Edge edge, EdgeDrawInfo2D info)
public void draw(java.lang.Object object, java.awt.Graphics2D graphics, DrawInfo2D info)
Portrayal2D
draw
in interface Portrayal2D
draw
in class SimplePortrayal2D
public boolean hitObject(java.lang.Object object, DrawInfo2D range)
SimplePortrayal2D
hitObject
in class SimplePortrayal2D
public java.lang.String getName(LocationWrapper wrapper)
Portrayal
getName
in interface Portrayal
getName
in class SimplePortrayal2D
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |