use of javax.swing.border.EmptyBorder in project processdash by dtuma.
the class DefectImportForm method buildAndShowWindow.
private void buildAndShowWindow(Element xml, String windowName) {
frame = new JFrame(windowName) {
public void dispose() {
super.dispose();
disposeForm();
}
};
DashboardIconFactory.setWindowIcon(frame);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.getContentPane().setLayout(new BorderLayout());
((JComponent) getContainer()).setBorder(new EmptyBorder(5, 5, 5, 5));
frame.getContentPane().add(BorderLayout.NORTH, getContainer());
BoundDefectTable defectTable = new BoundDefectTable(this);
defectTable.setBorder(new EmptyBorder(0, 10, 0, 10));
frame.getContentPane().add(BorderLayout.CENTER, defectTable);
frame.getContentPane().add(BorderLayout.SOUTH, createButtonBox());
int width = XMLUtils.getXMLInt(xml, "windowWidth");
if (width <= 0)
width = 600;
int height = XMLUtils.getXMLInt(xml, "windowHeight");
if (height <= 0)
height = 500;
frame.setSize(width, height);
frame.setVisible(true);
}
use of javax.swing.border.EmptyBorder in project processdash by dtuma.
the class AbstractLibraryEditor method buildContents.
private void buildContents() {
GridBagLayout layout = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
JPanel panel = new JPanel(layout);
panel.setBorder(new EmptyBorder(10, 10, 10, 10));
Insets insets0 = new Insets(0, 0, 0, 0);
Insets insets10 = new Insets(10, 10, 10, 10);
projectTable = buildJTable(projectModel);
projectTable.setEditingEnabled(false);
JScrollPane sp = new JScrollPane(projectTable);
initConstraints(c, 0, 1, 2, 2, GridBagConstraints.BOTH, 2, 2, GridBagConstraints.CENTER, insets0);
layout.setConstraints(sp, c);
panel.add(sp);
libraryTable = buildJTable(libraryModel);
libraryTable.setEditingEnabled(false);
libraryTable.setBackground(LIGHT_SEPIA);
sp = new JScrollPane(libraryTable);
initConstraints(c, 3, 1, 2, 2, GridBagConstraints.BOTH, 2, 2, GridBagConstraints.CENTER, insets0);
layout.setConstraints(sp, c);
panel.add(sp);
selectedDefinitionNames = new NameSetPropertyEditor();
WBSNameSelectionModel wsm = new WBSNameSelectionModel(projectTable, selectedDefinitionNames);
projectTable.setSelectionModel(wsm);
WBSNameSelectionModel lsm = new WBSNameSelectionModel(libraryTable, selectedDefinitionNames);
libraryTable.setSelectionModel(lsm);
new SelectionListener(wsm, lsm, export);
addButton = new JButton(resources.getString("Overwrite"));
addButton.setIcon(export ? IconFactory.getRightArrowIcon() : IconFactory.getLeftArrowIcon());
addButton.setHorizontalTextPosition(export ? SwingConstants.LEFT : SwingConstants.RIGHT);
addButton.setMinimumSize(addButton.getPreferredSize());
addButton.setText(resources.getString("Add"));
addButton.setMnemonic('A');
addButton.setEnabled(false);
addButton.addActionListener(createActionListener("addDefinitionAction"));
initConstraints(c, 2, 1, 1, 1, GridBagConstraints.HORIZONTAL, 0, 1, GridBagConstraints.SOUTH, insets10);
layout.setConstraints(addButton, c);
panel.add(addButton);
addAllButton = new JButton(resources.getString("Add_All"));
addAllButton.setMnemonic('L');
addAllButton.setIcon(export ? IconFactory.getRightArrowIcon() : IconFactory.getLeftArrowIcon());
addAllButton.setHorizontalTextPosition(export ? SwingConstants.LEFT : SwingConstants.RIGHT);
addAllButton.addActionListener(createActionListener("addAllDefinitionsAction"));
initConstraints(c, 2, 2, 1, 1, GridBagConstraints.HORIZONTAL, 0, 1, GridBagConstraints.NORTH, insets10);
layout.setConstraints(addAllButton, c);
panel.add(addAllButton);
JLabel label = new JLabel(resources.format("Project_Heading_FMT", teamProject.getProjectName()));
initConstraints(c, 0, 0, 1, 1, GridBagConstraints.NONE, 0, 0, GridBagConstraints.WEST, insets0);
layout.setConstraints(label, c);
panel.add(label);
String libraryFileName = libraryFile.getFileName();
String header = (libraryFileName != null ? resources.format("Library_Heading_FMT", libraryFileName) : resources.getString("Org_Library_Heading"));
label = new JLabel(header);
initConstraints(c, 3, 0, 1, 1, GridBagConstraints.NONE, 0, 0, GridBagConstraints.WEST, insets0);
layout.setConstraints(label, c);
panel.add(label);
Box buttonPanel = Box.createHorizontalBox();
buttonPanel.add(Box.createHorizontalGlue());
okButton = new JButton(resources.getString(export ? "Export" : "Import"));
okButton.addActionListener(createActionListener("okAction"));
buttonPanel.add(okButton);
cancelButton = new JButton(resources.getString("Cancel"));
cancelButton.addActionListener(createActionListener("cancelAction"));
buttonPanel.add(Box.createHorizontalStrut(10));
buttonPanel.add(cancelButton);
initConstraints(c, 0, 3, 5, 1, GridBagConstraints.BOTH, 0, 0, GridBagConstraints.NORTH, new Insets(10, 0, 0, 0));
layout.setConstraints(buttonPanel, c);
panel.add(buttonPanel);
dialog.setContentPane(panel);
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
dialog.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
cancelAction();
}
});
}
use of javax.swing.border.EmptyBorder in project processdash by dtuma.
the class TimeLogEditor method constructFilterPanel.
private JPanel constructFilterPanel() {
JPanel retPanel = new JPanel(false);
retPanel.setLayout(new BoxLayout(retPanel, BoxLayout.X_AXIS));
retPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
DropDownButton button;
JLabel label;
retPanel.add(Box.createHorizontalGlue());
addTimeFormatControl(retPanel);
retPanel.add(new JLabel(" "));
label = new JLabel(getResource("Filter.Label") + " ");
retPanel.add(label);
retPanel.add(Box.createHorizontalStrut(5));
addScrollButton(retPanel, "Filter.Scroll_Backward", "scrollFilterBackward");
fromDate = addDateField(retPanel, "Filter.From");
toDate = addDateField(retPanel, "Filter.To");
addScrollButton(retPanel, "Filter.Scroll_Forward", "scrollFilterForward");
button = new DropDownButton(getResource("Filter.Apply"));
button.setRunFirstMenuOption(false);
button.getButton().addActionListener(createActionListener("applyFilter"));
JMenu menu = button.getMenu();
addFilterMenuItem(menu, "Filter.Today", "filterToday");
addFilterMenuItem(menu, "Filter.Week", "filterThisWeek");
menu.add(createWeekFilterStartDaySubmenu());
addFilterMenuItem(menu, "Filter.Month", "filterThisMonth");
menu.addSeparator();
addFilterMenuItem(menu, "Filter.Remove", "clearFilter");
retPanel.add(button);
retPanel.add(Box.createHorizontalGlue());
return retPanel;
}
use of javax.swing.border.EmptyBorder in project gephi by gephi.
the class BasicRichTooltipPanelUI method installDefaults.
/**
* Installs default settings for the associated rich tooltip panel.
*/
protected void installDefaults() {
Border b = this.richTooltipPanel.getBorder();
if (b == null || b instanceof UIResource) {
Border toSet = UIManager.getBorder("RichTooltipPanel.border");
if (toSet == null)
toSet = new BorderUIResource.CompoundBorderUIResource(new LineBorder(FlamingoUtilities.getBorderColor()), new EmptyBorder(2, 4, 3, 4));
this.richTooltipPanel.setBorder(toSet);
}
LookAndFeel.installProperty(this.richTooltipPanel, "opaque", Boolean.TRUE);
}
use of javax.swing.border.EmptyBorder in project gephi by gephi.
the class DirectoryChooserUI method installComponents.
@Override
public void installComponents(JFileChooser fc) {
fileChooser = fc;
fc.setFocusCycleRoot(true);
fc.setBorder(new EmptyBorder(4, 10, 10, 10));
fc.setLayout(new BorderLayout(8, 8));
updateUseShellFolder();
createCenterPanel(fc);
fc.add(centerPanel, BorderLayout.CENTER);
if (fc.isMultiSelectionEnabled()) {
setFileName(getStringOfFileNames(fc.getSelectedFiles()));
} else {
setFileName(getStringOfFileName(fc.getSelectedFile()));
}
if (fc.getControlButtonsAreShown()) {
addControlButtons();
}
createPopup();
}
Aggregations