use of beast.app.util.FileDrop in project beast2 by CompEvol.
the class AlignmentListInputEditor method init.
@Override
@SuppressWarnings("unchecked")
public void init(Input<?> input, BEASTInterface beastObject, int itemNr, ExpandOption isExpandOption, boolean addButtons) {
this.itemNr = itemNr;
if (input.get() instanceof List) {
alignments = (List<Alignment>) input.get();
} else {
// we just have a single Alignment
alignments = new ArrayList<>();
alignments.add((Alignment) input.get());
}
linkButtons = new ArrayList<>();
unlinkButtons = new ArrayList<>();
partitionCount = alignments.size();
// override BoxLayout in superclass
setLayout(new BorderLayout());
add(createLinkButtons(), BorderLayout.NORTH);
add(createListBox(), BorderLayout.CENTER);
// Box box = Box.createVerticalBox();
// box.add(Box.createVerticalStrut(STRUT_SIZE));
// box.add(createLinkButtons());
// box.add(Box.createVerticalStrut(STRUT_SIZE));
// box.add(createListBox());
// box.add(Box.createVerticalStrut(STRUT_SIZE));
// box.add(Box.createVerticalGlue());
// add(box, BorderLayout.CENTER);
Color focusColor = UIManager.getColor("Focus.color");
Border focusBorder = BorderFactory.createMatteBorder(2, 2, 2, 2, focusColor);
new FileDrop(null, scrollPane, focusBorder, new FileDrop.Listener() {
@Override
public void filesDropped(java.io.File[] files) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
addItem(files);
}
});
}
});
// end FileDrop.Listener
// this should place the add/remove/split buttons at the bottom of the window.
add(createAddRemoveSplitButtons(), BorderLayout.SOUTH);
updateStatus();
}
Aggregations