use of automenta.vivisect.swing.NSlider in project opennars by opennars.
the class NARGraphDisplay method getControls.
//
// @Override
// public int getTextColor(V v) {
// return defaultTextColor;
//
// }
//
public JPanel getControls() {
JPanel menu = new JPanel(new FlowLayout(FlowLayout.LEFT));
NSlider nodeSize = new NSlider(this.nodeSize, 1, maxNodeSize) {
@Override
public void onChange(float v) {
NARGraphDisplay.this.nodeSize = v;
// app.drawn = false;
}
};
nodeSize.setPrefix("Node Size: ");
nodeSize.setPreferredSize(new Dimension(80, 25));
menu.add(nodeSize);
NSlider edgeWidth = new NSlider(this.lineWidth, 0f, maxNodeSize / 4f) {
@Override
public void onChange(float v) {
lineWidth = v;
// app.drawn = false;
}
};
edgeWidth.setPrefix("Line Thick: ");
edgeWidth.setPreferredSize(new Dimension(80, 25));
menu.add(edgeWidth);
NSlider nodeSpeed = new NSlider(this.nodeSpeed, 0.001f, 0.99f) {
@Override
public void onChange(float v) {
NARGraphDisplay.this.nodeSpeed = (float) v;
// app.drawn = false;
}
};
nodeSpeed.setPrefix("Speed: ");
nodeSpeed.setPreferredSize(new Dimension(70, 25));
menu.add(nodeSpeed);
NSlider fontSize = new NSlider(this.textSize, 0f, 2f) {
@Override
public void onChange(float v) {
NARGraphDisplay.this.textSize = (float) v;
// app.drawn = false;
}
};
fontSize.setPrefix("Font: ");
fontSize.setPreferredSize(new Dimension(70, 25));
menu.add(fontSize);
return menu;
}
Aggregations