at.tuwien.ifs.somtoolbox.util
Class LabelPNodeGenerator

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.util.LabelPNodeGenerator

public class LabelPNodeGenerator
extends Object

Convenience class for creating new labels. (cluster and manual)

Version:
$Id: LabelPNodeGenerator.java 3589 2010-05-21 10:42:01Z mayer $
Author:
Angela Roiger

Field Summary
private static EditLabelEventListener labelListener
           
 
Constructor Summary
LabelPNodeGenerator()
           
 
Method Summary
static void addTextToLabel(edu.umd.cs.piccolo.PNode labelNode, String text, int fontSize, double xOffset, double yOffset)
          Adds an additional line of text to the label.
static void changeColor(edu.umd.cs.piccolo.nodes.PText label, Color c)
           
static void changeRotation(edu.umd.cs.piccolo.PNode labelNode, double rotation)
          Set the rotation of the PNode in radians
static edu.umd.cs.piccolo.PNode newLabel(edu.umd.cs.piccolo.nodes.PText textNode)
           
static edu.umd.cs.piccolo.PNode newLabel(String text, int fontSize)
           
static edu.umd.cs.piccolo.PNode newLabel(String text, int fontSize, double xPos, double yPos, double xOffset, double yOffset)
           
static edu.umd.cs.piccolo.PNode newLabelNode(double xOffset, double yOffset, double rotation)
           
static edu.umd.cs.piccolo.nodes.PText newLabelText(String text, float fontSize)
           
static edu.umd.cs.piccolo.nodes.PText newLabelText(String text, float fontSize, double xOffset, double yOffset)
           
static edu.umd.cs.piccolo.nodes.PText newLabelTextLocation(String text, float fontSize, double x, double y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

labelListener

private static EditLabelEventListener labelListener
Constructor Detail

LabelPNodeGenerator

public LabelPNodeGenerator()
Method Detail

addTextToLabel

public static void addTextToLabel(edu.umd.cs.piccolo.PNode labelNode,
                                  String text,
                                  int fontSize,
                                  double xOffset,
                                  double yOffset)
Adds an additional line of text to the label.

Parameters:
labelNode - The node to add the text to
text - the text string
fontSize - the desired font size
xOffset - unused
yOffset - unused

changeColor

public static void changeColor(edu.umd.cs.piccolo.nodes.PText label,
                               Color c)

changeRotation

public static void changeRotation(edu.umd.cs.piccolo.PNode labelNode,
                                  double rotation)
Set the rotation of the PNode in radians

Parameters:
labelNode - the node to be rotated
rotation - the rotation in radians

newLabel

public static edu.umd.cs.piccolo.PNode newLabel(edu.umd.cs.piccolo.nodes.PText textNode)

newLabel

public static edu.umd.cs.piccolo.PNode newLabel(String text,
                                                int fontSize)

newLabel

public static edu.umd.cs.piccolo.PNode newLabel(String text,
                                                int fontSize,
                                                double xPos,
                                                double yPos,
                                                double xOffset,
                                                double yOffset)

newLabelNode

public static edu.umd.cs.piccolo.PNode newLabelNode(double xOffset,
                                                    double yOffset,
                                                    double rotation)

newLabelText

public static edu.umd.cs.piccolo.nodes.PText newLabelText(String text,
                                                          float fontSize)

newLabelText

public static edu.umd.cs.piccolo.nodes.PText newLabelText(String text,
                                                          float fontSize,
                                                          double xOffset,
                                                          double yOffset)

newLabelTextLocation

public static edu.umd.cs.piccolo.nodes.PText newLabelTextLocation(String text,
                                                                  float fontSize,
                                                                  double x,
                                                                  double y)