use of org.twak.tweed.tools.AlignTool in project chordatlas by twak.
the class MiniGen method getUI.
@Override
public JComponent getUI() {
JPanel out = new JPanel(new ListDownLayout());
JButton clear = new JButton("hide all");
clear.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
bounds.clear();
tweed.enqueue(new Runnable() {
public void run() {
calculate();
}
});
}
});
JButton all = new JButton("load all");
all.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
bounds.clear();
bounds.add(new double[] { -Double.MAX_VALUE, Double.MAX_VALUE, -Double.MAX_VALUE, Double.MAX_VALUE });
tweed.enqueue(new Runnable() {
public void run() {
calculate();
}
});
}
});
final JCheckBox renderLines = new JCheckBox("wireframe");
renderLines.setSelected(this.renderLines);
renderLines.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
tweed.enqueue(new Callable<Spatial>() {
public Spatial call() throws Exception {
MiniGen.this.renderLines = renderLines.isSelected();
calculate();
return null;
}
});
}
});
final JSlider renderTransparent = new JSlider(0, MAX, (int) (MAX * transparency));
renderTransparent.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
tweed.enqueue(new Callable<Spatial>() {
public Spatial call() throws Exception {
MiniGen.this.transparency = (renderTransparent.getValue() / (float) MAX);
calculate();
return null;
}
});
}
});
JButton align = new JButton("align tool");
align.addActionListener(e -> tweed.setTool(new AlignTool(tweed)));
out.add(all);
out.add(clear);
out.add(renderLines);
out.add(renderTransparent);
out.add(align);
return out;
}
Aggregations