edu.cmu.emulator.vis
Class WVNode

java.lang.Object
  extended by edu.cmu.emulator.vis.WVNode

public class WVNode
extends Object


Field Summary
private  AlphaComposite aComp
           
private  Color color
           
private  boolean hasMoved
           
private  int height
           
private  Image image
           
private  long lastRedraw
           
private  ArrayList lineSources
           
private  ArrayList lineTargets
           
private static int LOCATOR_SIZE
           
private static int MAX_HEIGHT
           
private static int MAX_WIDTH
           
private  String name
           
private  boolean needsRedraw
           
private  Graphics2D nodeG2
           
private  BufferedImage nodeImage
           
private  int oldMaxTargetX
           
private  int oldMaxTargetY
           
private  int oldMinTargetX
           
private  int oldMinTargetY
           
private  int oldX
           
private  int oldY
           
private  double[] pos
           
private  boolean selected
           
private  BufferedImage selectedNodeImage
           
private  int width
           
private  int xCorrection
           
private  AffineTransformOp xformOp
           
private  int yCorrection
           
 
Constructor Summary
WVNode(String name, String imageName, Color color)
           
 
Method Summary
 void addLineSource(WVNode node)
           
 void addLineTarget(WVNode node)
           
 void clearLineTargets()
           
 void drawLineTargets(WorldView wv, Graphics2D g2, int myXPixels, int myYPixels, double pixelsPerMeterX, double pixelsPerMeterY, double originPixelX, double originPixelY)
           
private  void drawNodeImage()
           
 void eraseLineTargets(WorldView wv, Graphics2D g2, int myXPixels, int myYPixels, double pixelsPerMeterX, double pixelsPerMeterY, double originPixelX, double originPixelY)
           
 boolean getAndResetNeedsRedraw()
           
 long getLastRedraw()
           
 String getName()
           
 boolean getNeedsRedraw()
           
 BufferedImage getNodeImage()
           
 int getOldX()
           
 int getOldY()
           
 double[] getPos()
           
 int getXCorrection()
           
 int getYCorrection()
           
 boolean hasMoved()
           
 boolean isSelected()
           
 void removeLineSource(WVNode node)
           
 void removeLineTarget(WVNode node)
           
 void render(Graphics2D g2)
           
 void setLastRedraw()
           
 void setNeedsRedraw(boolean b)
           
 void setOldXY(int oldX, int oldY)
           
 void setPos(double[] pos)
           
 void setSelected(boolean selected)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

private String name

image

private Image image

color

private Color color

pos

private double[] pos

selected

private boolean selected

width

private int width

height

private int height

xCorrection

private int xCorrection

yCorrection

private int yCorrection

oldX

private int oldX

oldY

private int oldY

lineTargets

private ArrayList lineTargets

lineSources

private ArrayList lineSources

oldMinTargetX

private int oldMinTargetX

oldMinTargetY

private int oldMinTargetY

oldMaxTargetX

private int oldMaxTargetX

oldMaxTargetY

private int oldMaxTargetY

hasMoved

private boolean hasMoved

lastRedraw

private long lastRedraw

needsRedraw

private boolean needsRedraw

aComp

private AlphaComposite aComp

nodeImage

private BufferedImage nodeImage

selectedNodeImage

private BufferedImage selectedNodeImage

nodeG2

private Graphics2D nodeG2

xformOp

private AffineTransformOp xformOp

LOCATOR_SIZE

private static final int LOCATOR_SIZE
See Also:
Constant Field Values

MAX_WIDTH

private static final int MAX_WIDTH
See Also:
Constant Field Values

MAX_HEIGHT

private static final int MAX_HEIGHT
See Also:
Constant Field Values
Constructor Detail

WVNode

public WVNode(String name,
              String imageName,
              Color color)
Method Detail

addLineTarget

public void addLineTarget(WVNode node)

removeLineTarget

public void removeLineTarget(WVNode node)

clearLineTargets

public void clearLineTargets()

addLineSource

public void addLineSource(WVNode node)

removeLineSource

public void removeLineSource(WVNode node)

drawNodeImage

private void drawNodeImage()

getName

public String getName()

setPos

public void setPos(double[] pos)

getPos

public double[] getPos()

getNodeImage

public BufferedImage getNodeImage()

render

public void render(Graphics2D g2)

eraseLineTargets

public void eraseLineTargets(WorldView wv,
                             Graphics2D g2,
                             int myXPixels,
                             int myYPixels,
                             double pixelsPerMeterX,
                             double pixelsPerMeterY,
                             double originPixelX,
                             double originPixelY)

drawLineTargets

public void drawLineTargets(WorldView wv,
                            Graphics2D g2,
                            int myXPixels,
                            int myYPixels,
                            double pixelsPerMeterX,
                            double pixelsPerMeterY,
                            double originPixelX,
                            double originPixelY)

isSelected

public boolean isSelected()

setSelected

public void setSelected(boolean selected)

getXCorrection

public int getXCorrection()

getYCorrection

public int getYCorrection()

getOldX

public int getOldX()

getOldY

public int getOldY()

setOldXY

public void setOldXY(int oldX,
                     int oldY)

setNeedsRedraw

public void setNeedsRedraw(boolean b)

hasMoved

public boolean hasMoved()

getNeedsRedraw

public boolean getNeedsRedraw()

getAndResetNeedsRedraw

public boolean getAndResetNeedsRedraw()

getLastRedraw

public long getLastRedraw()

setLastRedraw

public void setLastRedraw()


Copyright © 2013. All Rights Reserved.