use of com.kotcrab.vis.ui.widget.VisLabel in project gdx-graph by MarcinSc.
the class GraphBoxImpl method addOutputGraphPart.
public void addOutputGraphPart(GraphNodeOutput graphNodeOutput) {
VisTable table = new VisTable();
VisLabel outputLabel = new VisLabel(graphNodeOutput.getFieldName());
outputLabel.setAlignment(Align.right);
table.add(outputLabel).grow().row();
GraphBoxPartImpl graphBoxPart = new GraphBoxPartImpl(table, null);
graphBoxPart.setOutputConnector(GraphBoxOutputConnector.Side.Right, graphNodeOutput);
addGraphBoxPart(graphBoxPart);
}
use of com.kotcrab.vis.ui.widget.VisLabel in project gdx-graph by MarcinSc.
the class ValueVector3BoxProducer method createValuePart.
private GraphBoxPartImpl createValuePart(float v1, float v2, float v3) {
final VisValidatableTextField v1Input = new VisValidatableTextField(Validators.FLOATS) {
@Override
public float getPrefWidth() {
return 50;
}
};
v1Input.setText(String.valueOf(v1));
v1Input.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
v1Input.fire(new GraphChangedEvent(false, true));
}
});
final VisValidatableTextField v2Input = new VisValidatableTextField(Validators.FLOATS) {
@Override
public float getPrefWidth() {
return 50;
}
};
v2Input.setText(String.valueOf(v2));
v2Input.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
v2Input.fire(new GraphChangedEvent(false, true));
}
});
final VisValidatableTextField v3Input = new VisValidatableTextField(Validators.FLOATS) {
@Override
public float getPrefWidth() {
return 50;
}
};
v3Input.setText(String.valueOf(v3));
v3Input.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
v3Input.fire(new GraphChangedEvent(false, true));
}
});
HorizontalGroup horizontalGroup = new HorizontalGroup();
horizontalGroup.addActor(new VisLabel("x"));
horizontalGroup.addActor(v1Input);
horizontalGroup.addActor(new VisLabel("y"));
horizontalGroup.addActor(v2Input);
horizontalGroup.addActor(new VisLabel("z"));
horizontalGroup.addActor(v3Input);
GraphBoxPartImpl colorPart = new GraphBoxPartImpl(horizontalGroup, new GraphBoxPartImpl.Callback() {
@Override
public void serialize(JsonValue object) {
object.addChild("v1", new JsonValue(Float.parseFloat(v1Input.getText())));
object.addChild("v2", new JsonValue(Float.parseFloat(v2Input.getText())));
object.addChild("v3", new JsonValue(Float.parseFloat(v3Input.getText())));
}
});
colorPart.setOutputConnector(GraphBoxOutputConnector.Side.Right, configuration.getNodeOutputs().get("value"));
return colorPart;
}
use of com.kotcrab.vis.ui.widget.VisLabel in project gdx-graph by MarcinSc.
the class ValueVector2BoxProducer method createValuePart.
private GraphBoxPartImpl createValuePart(float v1, float v2) {
final VisValidatableTextField v1Input = new VisValidatableTextField(Validators.FLOATS) {
@Override
public float getPrefWidth() {
return 50;
}
};
v1Input.setText(String.valueOf(v1));
v1Input.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
v1Input.fire(new GraphChangedEvent(false, true));
}
});
final VisValidatableTextField v2Input = new VisValidatableTextField(Validators.FLOATS) {
@Override
public float getPrefWidth() {
return 50;
}
};
v2Input.setText(String.valueOf(v2));
v2Input.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
v2Input.fire(new GraphChangedEvent(false, true));
}
});
HorizontalGroup horizontalGroup = new HorizontalGroup();
horizontalGroup.addActor(new VisLabel("x"));
horizontalGroup.addActor(v1Input);
horizontalGroup.addActor(new VisLabel("y"));
horizontalGroup.addActor(v2Input);
GraphBoxPartImpl colorPart = new GraphBoxPartImpl(horizontalGroup, new GraphBoxPartImpl.Callback() {
@Override
public void serialize(JsonValue object) {
object.addChild("v1", new JsonValue(Float.parseFloat(v1Input.getText())));
object.addChild("v2", new JsonValue(Float.parseFloat(v2Input.getText())));
}
});
colorPart.setOutputConnector(GraphBoxOutputConnector.Side.Right, configuration.getNodeOutputs().get("value"));
return colorPart;
}
Aggregations