use of javax.swing.JComponent in project android-parcelable-intellij-plugin by mcharmas.
the class GenerateDialog method createSouthPanel.
@Nullable
@Override
protected JComponent createSouthPanel() {
JComponent southPanel = super.createSouthPanel();
if (showCheckbox && southPanel != null) {
final VerticalBox combinedView = new VerticalBox();
combinedView.add(includeSubclasses);
combinedView.add(southPanel);
return combinedView;
} else {
return southPanel;
}
}
use of javax.swing.JComponent in project openblocks by mikaelhg.
the class CWheeler method scrollLeft.
public void scrollLeft() {
int v = scroll.getHorizontalModel().getValue();
int accumulatedWidth = 0;
for (JComponent element : elements) {
accumulatedWidth = accumulatedWidth + element.getWidth();
if (accumulatedWidth >= v) {
accumulatedWidth = accumulatedWidth - element.getWidth();
break;
}
}
scroll.getHorizontalModel().setValue(accumulatedWidth);
scroll.revalidate();
scroll.repaint();
}
use of javax.swing.JComponent in project openblocks by mikaelhg.
the class CWheeler method scrollRight.
public void scrollRight() {
int v = scroll.getHorizontalModel().getValue();
int accumulatedWidth = 0;
for (JComponent element : elements) {
accumulatedWidth = accumulatedWidth + element.getWidth();
if (accumulatedWidth > v) {
break;
}
}
scroll.getHorizontalModel().setValue(accumulatedWidth);
scroll.revalidate();
scroll.repaint();
}
use of javax.swing.JComponent in project openblocks by mikaelhg.
the class CWheeler method reformItems.
private void reformItems() {
int totalWidth = 0;
int maxHeight = 0;
for (JComponent element : elements) {
element.setBounds(totalWidth, 0, element.getPreferredSize().width, element.getPreferredSize().height);
totalWidth = totalWidth + element.getPreferredSize().width;
maxHeight = Math.max(maxHeight, element.getPreferredSize().height);
}
view.setPreferredSize(new Dimension(totalWidth, maxHeight));
view.setBounds(0, 0, totalWidth, maxHeight);
this.revalidate();
this.repaint();
}
use of javax.swing.JComponent in project openblocks by mikaelhg.
the class TabbedExplorer method setDrawersCard.
/**
* Reassigns the set of canvases that this explorer controls.
* Though the collection of canvas mnay be empty, it may not be null.
* @param items
*
* @requires items != null &&
* for each element in item, element!= null
*/
public void setDrawersCard(List<? extends Canvas> items) {
drawerCards.clear();
menu.removeAll();
List<JComponent> buttons = new ArrayList<JComponent>();
for (int i = 0; i < items.size(); i++) {
TabCard card = new TabCard(i, items.get(i), this, scrollable);
drawerCards.add(card);
buttons.add(card.getButton());
card.getButton().setPreferredSize(new Dimension(125, BUTTON_HEIGHT));
menu.add(card.getMenuItem());
}
wheeler.setElements(buttons);
this.selectCanvas(0);
}
Aggregations