本文整理汇总了C#中UMD.HCIL.Piccolo.PNode.AddChild方法的典型用法代码示例。如果您正苦于以下问题:C# PNode.AddChild方法的具体用法?C# PNode.AddChild怎么用?C# PNode.AddChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UMD.HCIL.Piccolo.PNode
的用法示例。
在下文中一共展示了PNode.AddChild方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddBoundsHandlesTo
/// <summary>
/// Adds bounds handles to the given node.
/// </summary>
/// <param name="aNode">The node to isLocal bounds handles to.</param>
public static void AddBoundsHandlesTo(PNode aNode) {
aNode.AddChild(new PBoundsHandle(PBoundsLocator.CreateEastLocator(aNode)));
aNode.AddChild(new PBoundsHandle(PBoundsLocator.CreateWestLocator(aNode)));
aNode.AddChild(new PBoundsHandle(PBoundsLocator.CreateNorthLocator(aNode)));
aNode.AddChild(new PBoundsHandle(PBoundsLocator.CreateSouthLocator(aNode)));
aNode.AddChild(new PBoundsHandle(PBoundsLocator.CreateNorthEastLocator(aNode)));
aNode.AddChild(new PBoundsHandle(PBoundsLocator.CreateNorthWestLocator(aNode)));
aNode.AddChild(new PBoundsHandle(PBoundsLocator.CreateSouthEastLocator(aNode)));
aNode.AddChild(new PBoundsHandle(PBoundsLocator.CreateSouthWestLocator(aNode)));
}
示例2: Reparent
/// <summary>
/// Set the parent of this node, and transform the node in such a way that it
/// doesn't move in global coordinates.
/// </summary>
/// <param name="newParent">The new parent of this node.</param>
public virtual void Reparent(PNode newParent) {
PMatrix originalTransform = LocalToGlobalMatrix;
PMatrix newTransform = newParent.GlobalToLocalMatrix;
newTransform.Multiply(originalTransform);
RemoveFromParent();
Matrix = newTransform;
newParent.AddChild(this);
fullBoundsCache = ComputeFullBounds();
}
示例3: Layout
public override void Layout(float x, float y)
{
if (originalX != -1)
x = originalX;
if (originalY != -1)
y = originalY;
outlinePen = new Pen(Color.Black);
string s = pcc.Exports[index].ObjectName;
s = s.Replace("BioSeqAct_", "");
s = s.Replace("SFXSeqAct_", "");
s = s.Replace("SeqAct_", "");
s = s.Replace("SeqCond_", "");
float starty = 8;
float w = 20;
varLinkBox = new PPath();
for (int i = 0; i < Varlinks.Count(); i++)
{
string d = "";
foreach (int l in Varlinks[i].Links)
d = d + "#" + l + ",";
d = d.Remove(d.Length - 1);
SText t2 = new SText(d + "\n" + Varlinks[i].Desc);
t2.X = w;
t2.Y = 0;
w += t2.Width + 20;
t2.Pickable = false;
Varlinks[i].node.TranslateBy(t2.X + t2.Width / 2, t2.Y + t2.Height);
t2.AddChild(Varlinks[i].node);
varLinkBox.AddChild(t2);
}
if (Varlinks.Count != 0)
varLinkBox.Height = varLinkBox[0].Height;
varLinkBox.Width = w;
varLinkBox.Pickable = false;
outLinkBox = new PPath();
float outW = 0;
for (int i = 0; i < Outlinks.Count(); i++)
{
SText t2 = new SText(Outlinks[i].Desc);
if (t2.Width + 10 > outW) outW = t2.Width + 10;
t2.X = 0 - t2.Width;
t2.Y = starty;
starty += t2.Height;
t2.Pickable = false;
Outlinks[i].node.TranslateBy(0, t2.Y + t2.Height / 2);
t2.AddChild(Outlinks[i].node);
outLinkBox.AddChild(t2);
}
outLinkBox.Pickable = false;
inputLinkBox = new PNode();
GetInputLinks();
float inW = 0;
float inY = 8;
for (int i = 0; i < InLinks.Count(); i++)
{
SText t2 = new SText(InLinks[i].Desc);
if (t2.Width > inW) inW = t2.Width;
t2.X = 3;
t2.Y = inY;
inY += t2.Height;
t2.Pickable = false;
InLinks[i].node.X = -10;
InLinks[i].node.Y = t2.Y + t2.Height / 2 - 5;
t2.AddChild(InLinks[i].node);
inputLinkBox.AddChild(t2);
}
inputLinkBox.Pickable = false;
if (inY > starty) starty = inY;
if (inW + outW + 10 > w) w = inW + outW + 10;
List<SaltPropertyReader.Property> props = SaltPropertyReader.getPropList(pcc, pcc.Exports[index].Data);
foreach (SaltPropertyReader.Property prop in props)
{
if (prop.Name == "oSequenceReference")
s += "\n\"" + pcc.Exports[prop.Value.IntValue - 1].ObjectName + "\"";
else if (prop.Name == "EventName" || prop.Name == "StateName")
s += "\n\"" + prop.Value.IntValue + "\"";
else if (prop.Name == "OutputLabel" || prop.Name == "m_sMovieName")
s += "\n\"" + prop.Value.StringValue + "\"";
else if (prop.Name == "m_pEffect")
if(prop.Value.IntValue > 0)
s += "\n\"" + pcc.Exports[prop.Value.IntValue - 1].ObjectName + "\"";
else
s += "\n\"" + pcc.Imports[-prop.Value.IntValue - 1].Name + "\"";
}
float tW = GetTitleBox(s, w);
if (tW > w)
{
w = tW;
titleBox.Width = w;
}
titleBox.X = 0;
titleBox.Y = 0;
float h = titleBox.Height + 2;
inputLinkBox.TranslateBy(0, h);
outLinkBox.TranslateBy(w, h);
h += starty + 8;
varLinkBox.TranslateBy(varLinkBox.Width < w ? (w - varLinkBox.Width) / 2 : 0, h);
h += varLinkBox.Height;
box = PPath.CreateRectangle(0, titleBox.Height + 2, w, h - (titleBox.Height + 2));
box.Brush = nodeBrush;
//.........这里部分代码省略.........
示例4: Layout
public override void Layout(float x, float y)
{
if (pcc.Game == MEGame.ME1)
{
// ==
if (Math.Abs(x - -0.1f) < float.Epsilon)
x = originalX;
// ==
if (Math.Abs(y - -0.1f) < float.Epsilon)
y = originalY;
}
else
{
// ==
if (Math.Abs(originalX - -1) > float.Epsilon)
x = originalX;
// ==
if (Math.Abs(originalY - -1) > float.Epsilon)
y = originalY;
}
outlinePen = new Pen(Color.Black);
string s = export.ObjectName;
s = s.Replace("BioSeqAct_", "");
s = s.Replace("SFXSeqAct_", "");
s = s.Replace("SeqAct_", "");
s = s.Replace("SeqCond_", "");
float starty = 8;
float w = 20;
varLinkBox = new PPath();
for (int i = 0; i < Varlinks.Count(); i++)
{
string d = "";
foreach (int l in Varlinks[i].Links)
d = d + "#" + l + ",";
d = d.Remove(d.Length - 1);
SText t2 = new SText(d + "\n" + Varlinks[i].Desc);
t2.X = w;
t2.Y = 0;
w += t2.Width + 20;
t2.Pickable = false;
Varlinks[i].node.TranslateBy(t2.X + t2.Width / 2, t2.Y + t2.Height);
t2.AddChild(Varlinks[i].node);
varLinkBox.AddChild(t2);
}
if (Varlinks.Count != 0)
varLinkBox.Height = varLinkBox[0].Height;
varLinkBox.Width = w;
varLinkBox.Pickable = false;
outLinkBox = new PPath();
float outW = 0;
for (int i = 0; i < Outlinks.Count(); i++)
{
SText t2 = new SText(Outlinks[i].Desc);
if (t2.Width + 10 > outW) outW = t2.Width + 10;
t2.X = 0 - t2.Width;
t2.Y = starty;
starty += t2.Height;
t2.Pickable = false;
Outlinks[i].node.TranslateBy(0, t2.Y + t2.Height / 2);
t2.AddChild(Outlinks[i].node);
outLinkBox.AddChild(t2);
}
outLinkBox.Pickable = false;
inputLinkBox = new PNode();
GetInputLinks();
float inW = 0;
float inY = 8;
for (int i = 0; i < InLinks.Count(); i++)
{
SText t2 = new SText(InLinks[i].Desc);
if (t2.Width > inW) inW = t2.Width;
t2.X = 3;
t2.Y = inY;
inY += t2.Height;
t2.Pickable = false;
InLinks[i].node.X = -10;
InLinks[i].node.Y = t2.Y + t2.Height / 2 - 5;
t2.AddChild(InLinks[i].node);
inputLinkBox.AddChild(t2);
}
inputLinkBox.Pickable = false;
if (inY > starty) starty = inY;
if (inW + outW + 10 > w) w = inW + outW + 10;
var props = export.GetProperties();
foreach (var prop in props)
{
if (prop.Name == "oSequenceReference")
{
ObjectProperty objectProperty = (prop as ObjectProperty);
if (pcc.Game == MEGame.ME1)
{
if (objectProperty.Value > 0)
{
string seqName = pcc.getEntry(objectProperty.Value).ObjectName;
if (seqName == "Sequence")
{
var objNameProp = pcc.getExport(objectProperty.Value - 1).GetProperty<StrProperty>("ObjName");
if (objNameProp != null)
{
seqName = objNameProp;
//.........这里部分代码省略.........