List of usage examples for com.jgoodies.forms.factories Borders createEmptyBorder
public static Border createEmptyBorder(String encodedSizes)
From source file:de.dal33t.powerfolder.ui.status.StatusTab.java
License:Open Source License
/** * Initialise class components.//from w ww . ja v a 2s. c o m */ private void initComponents() { synchronizationStatusLabel = new JLabel(); synchronizationDateLabel = new JLabel(); numberOfFoldersLine = new StatusTabLine(getController(), Translation.getTranslation("status_tab.folders"), Translation.getTranslation("status_tab.no_folders"), false, true, null, null); sizeOfFoldersLine = new StatusTabLine(getController(), Translation.getTranslation("status_tab.total", "kB"), null, true, false, null, null); filesAvailableLine = new StatusTabLine(getController(), Translation.getTranslation("status_tab.files_available"), null, true, true, new AbstractAction() { public void actionPerformed(ActionEvent e) { getUIController().getMainFrame().showFoldersTab(); } }, null); newNoticesLine = new StatusTabLine(getController(), Translation.getTranslation("status_tab.unread_notices"), null, false, true, getApplicationModel().getActionModel().getViewNoticesAction(), Icons.getIconById(Icons.WARNING)); downloadsLine = new StatusTabLine(getController(), Translation.getTranslation("status_tab.files_downloads"), null, false, true, getApplicationModel().getActionModel().getOpenDownloadsInformationAction(), null); uploadsLine = new StatusTabLine(getController(), Translation.getTranslation("status_tab.files_uploads"), null, false, true, getApplicationModel().getActionModel().getOpenUploadsInformationAction(), null); onlineStorageAccountLabel = new ActionLabel(getController(), new AbstractAction() { public void actionPerformed(ActionEvent e) { boolean changeLoginAllowed = ConfigurationEntry.SERVER_CONNECT_CHANGE_LOGIN_ALLOWED .getValueBoolean(getController()); if (changeLoginAllowed) { PFWizard.openLoginWizard(getController(), getController().getOSClient()); } } }); onlineStorageAccountLabel.getUIComponent().setBorder(Borders.createEmptyBorder("0, 0, 3dlu, 0")); onlineStorageSection = new OnlineStorageSection(getController()); onlineStorageSection.getUIComponent().setBorder(Borders.createEmptyBorder("0, 0, 3dlu, 0")); licenseInfoSection = new LicenseInfoSection(getController()); buyNowLabel = new LinkLabel(getController(), "", ""); buyNowLabel.convertToBigLabel(); UIUtil.setFontStyle(buyNowLabel.getUIComponent(), Font.BOLD); buyNowLabel.getUIComponent().setVisible(false); buyNowLabel.getUIComponent().setBorder(Borders.createEmptyBorder("20dlu, 0, 0, 0")); if (!ProUtil.isRunningProVersion() && Feature.BETA.isDisabled()) { updateBuyNowLink(Translation.getTranslation("pro.status_tab.upgrade_powerfolder"), true); } tellFriendLabel = SimpleComponentFactory.createTellAFriendLabel(getController()); updateTransferText(); updateFoldersText(); recalculateFilesAvailable(); updateOnlineStorageDetails(); updateLicenseDetails(); updateNewNoticesText(); updateSyncStats(); registerListeners(); // Start periodical updates getController().scheduleAndRepeat(new MyTimerTask(), 5000, 5000); }
From source file:de.dal33t.powerfolder.ui.status.StatusTab.java
License:Open Source License
/** * Build the main panel with all the detail lines. * /*from w w w. j a va2s . c om*/ * @return */ private JPanel buildMainPanel() { FormLayout layout = new FormLayout("pref:grow", "pref, 3dlu, pref, 3dlu, pref, 12dlu, pref, 3dlu, pref, pref, " + "pref, pref, 9dlu, pref, 3dlu, pref, " + "pref, pref, pref, 0:grow, pref"); PanelBuilder builder = new PanelBuilder(layout); // Bottom border builder.setBorder(Borders.createEmptyBorder("1dlu, 3dlu, 2dlu, 3dlu")); CellConstraints cc = new CellConstraints(); int row = 1; builder.addSeparator(Translation.getTranslation("status_tab.status"), cc.xy(1, row)); row += 2; builder.add(synchronizationStatusLabel, cc.xy(1, row)); row += 2; builder.add(synchronizationDateLabel, cc.xy(1, row)); row += 2; builder.addSeparator(Translation.getTranslation("status_tab.you_have"), cc.xy(1, row)); row += 2; builder.add(newNoticesLine.getUIComponent(), cc.xy(1, row)); row++; builder.add(filesAvailableLine.getUIComponent(), cc.xy(1, row)); row++; builder.add(downloadsLine.getUIComponent(), cc.xy(1, row)); row++; builder.add(uploadsLine.getUIComponent(), cc.xy(1, row)); row += 2; builder.addSeparator(Translation.getTranslation("status_tab.online_storage.title"), cc.xy(1, row)); row += 2; builder.add(onlineStorageAccountLabel.getUIComponent(), cc.xy(1, row)); row++; builder.add(onlineStorageSection.getUIComponent(), cc.xy(1, row)); row++; builder.add(licenseInfoSection.getUIComponent(), cc.xy(1, row)); row++; builder.add(buyNowLabel.getUIComponent(), cc.xy(1, row)); if (PreferencesEntry.SHOW_TELL_A_FRIEND.getValueBoolean(getController())) { row += 2; builder.add(tellFriendLabel.getUIComponent(), cc.xy(1, row)); } return builder.getPanel(); }
From source file:de.dal33t.powerfolder.ui.StatusBar.java
License:Open Source License
public Component getUIComponent() { if (comp == null) { boolean showPort = getController().getConnectionListener().getPort() != ConnectionListener.DEFAULT_PORT; initComponents();// w w w . jav a 2 s. c om String debugArea = ""; if (getController().isVerbose()) { debugArea = "pref, 3dlu, "; } String portArea = ""; if (showPort) { portArea = "pref, 3dlu, "; } FormLayout mainLayout = new FormLayout("1dlu, pref, 3dlu, pref, center:pref:grow, pref, 3dlu, " + portArea + debugArea + " pref, 3dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu", "pref"); DefaultFormBuilder mainBuilder = new DefaultFormBuilder(mainLayout); mainBuilder.setBorder(Borders.createEmptyBorder("3dlu, 0, 0, 0")); CellConstraints cc = new CellConstraints(); int col = 2; mainBuilder.add(syncButton, cc.xy(col, 1)); col += 2; mainBuilder.add(newNoticesButton, cc.xy(col, 1)); col += 1; mainBuilder.add(networkModeLabel, cc.xy(col, 1)); col += 1; mainBuilder.add(pendingMessagesButton, cc.xy(col, 1)); col += 2; if (portArea.length() > 0) { mainBuilder.add(portLabel, cc.xy(col, 1)); col += 2; } if (debugArea.length() > 0) { mainBuilder.add(openDebugButton, cc.xy(col, 1)); col += 2; } // mainBuilder.add(openStatsChartButton, cc.xy(col, 1)); // col += 2; mainBuilder.add(openPreferencesButton, cc.xy(col, 1)); // col += 2; // mainBuilder.add(openAboutBoxButton, cc.xy(col, 1)); if (Feature.COMPACT_MODE.isEnabled()) { col += 2; mainBuilder.add(compactModeButton, cc.xy(col, 1)); } comp = mainBuilder.getPanel(); comp.setOpaque(false); } return comp; }
From source file:de.dal33t.powerfolder.ui.widget.JButtonMini.java
License:Open Source License
public JButtonMini(Icon icon, String toolTipText) { if (icon == null) { setText("???"); } else {//from w w w. j a va 2s . co m setIcon(icon); } setOpaque(true); setBorder(null); setBorder(Borders.createEmptyBorder("0dlu, 0dlu, 0dlu, 0dlu")); setMargin(new Insets(0, 0, 0, 0)); setBorderPainted(false); if (toolTipText != null && toolTipText.trim().length() > 0) { setToolTipText(toolTipText); } }
From source file:de.dal33t.powerfolder.ui.widget.LinkLabel.java
License:Open Source License
public LinkLabel(Controller controller, String text, String url) { super(controller); this.text = text; this.url = url; uiComponent = new JLabel(); setText();//from www. j ava2s . co m uiComponent.addMouseListener(new MyMouseAdapter()); CursorUtils.setHandCursor(uiComponent); // FIXME This is a hack because of "Fusch!" uiComponent.setBorder(Borders.createEmptyBorder("0, 1px, 0, 0")); }
From source file:de.dal33t.powerfolder.ui.wizard.PFWizardPanel.java
License:Open Source License
/** * Builds the ui//from w w w . ja va2 s . c o m */ private void buildUI() { // init initComponents(); JComponent content = buildContent(); content.setOpaque(false); // content.setBackground(Color.WHITE); String title = getTitle(); Reject.ifBlank(title, "Title is blank"); Reject.ifNull(content, "Content is null"); setBorder(Borders.EMPTY_BORDER); FormLayout layout = new FormLayout("13px, fill:pref:grow", "pref, 7dlu, pref, 3dlu, fill:pref:grow"); PanelBuilder pageBuilder = new PanelBuilder(layout, this); pageBuilder.setBorder(Borders.createEmptyBorder("7dlu, 20dlu, 0dlu, 20dlu")); CellConstraints cc = new CellConstraints(); int row = 1; pageBuilder.add(new JLabel(Icons.getIconById(Icons.LOGO400UI)), cc.xywh(1, row, 2, 1, "left, default")); row += 2; titleLabel = createTitleLabel(title); pageBuilder.add(titleLabel, cc.xy(2, row)); row += 2; pageBuilder.add(content, cc.xy(2, row, CellConstraints.DEFAULT, CellConstraints.TOP)); // initalized initalized = true; }
From source file:de.dal33t.powerfolder.ui.wizard.WhatToDoPanel.java
License:Open Source License
protected JPanel buildContent() { FormLayout layout = new FormLayout("140dlu, 3dlu, pref", "pref, 12dlu, pref, 30dlu, pref"); PanelBuilder builder = new PanelBuilder(layout); builder.setBorder(Borders.createEmptyBorder("20dlu, 10dlu, 0, 0")); CellConstraints cc = new CellConstraints(); builder.add(synchronizedLink.getUIComponent(), cc.xy(1, 1)); builder.add(hostLink.getUIComponent(), cc.xy(1, 3)); builder.add(backupLink.getUIComponent(), cc.xy(3, 1)); builder.add(downloadLink.getUIComponent(), cc.xy(3, 3)); builder.add(moreLink.getUIComponent(), cc.xy(1, 5)); builder.add(customLink.getUIComponent(), cc.xy(1, 5)); builder.add(documentationLink.getUIComponent(), cc.xy(3, 5)); builder.getPanel().setOpaque(false); return builder.getPanel(); }
From source file:kg.nurolopher.MainForm.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - a b dialogPane = new JPanel(); buttonBar = new JPanel(); textFieldMessage = new JTextField(); okButton = new JButton(); textAreaMessages = new JTextArea(); //======== this ======== setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setMaximizedBounds(new Rectangle(0, 0, 500, 500)); setMinimumSize(new Dimension(500, 500)); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {/*from w ww. j a v a 2 s .c om*/ dialogPane.setBorder(Borders.createEmptyBorder("7dlu, 7dlu, 7dlu, 7dlu")); dialogPane.setMinimumSize(new Dimension(500, 500)); // JFormDesigner evaluation mark dialogPane.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), dialogPane.getBorder())); dialogPane.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); dialogPane.setLayout(new BorderLayout()); //======== buttonBar ======== { buttonBar.setBorder(Borders.createEmptyBorder("5dlu, 0dlu, 0dlu, 0dlu")); buttonBar.setLayout(new FormLayout("2*($lcgap, default), $glue, $button", "pref")); //---- textFieldMessage ---- textFieldMessage.setMinimumSize(new Dimension(20, 24)); textFieldMessage.setPreferredSize(new Dimension(350, 24)); buttonBar.add(textFieldMessage, CC.xywh(2, 1, 4, 1, CC.DEFAULT, CC.BOTTOM)); //---- okButton ---- okButton.setText("OK"); okButton.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { okButtonMouseClicked(e); } }); buttonBar.add(okButton, CC.xy(6, 1, CC.DEFAULT, CC.FILL)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); //---- textAreaMessages ---- textAreaMessages.setPreferredSize(new Dimension(350, 100)); dialogPane.add(textAreaMessages, BorderLayout.WEST); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(null); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:kr.pe.codda.gui.helper.projectmanager.screen.DBCPPartEditorPopup.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license dialogPane = new JPanel(); contentPanel = new JPanel(); mainProjectLinePanel = new JPanel(); mainProjectNameTitleLabel = new JLabel(); mainProjectNameValueLabel = new JLabel(); dbcpNameLinePanel = new JPanel(); dbcpNameTitleLabel = new JLabel(); dbcpNameValueLabel = new JLabel(); dbcpPartTitleLable = new JLabel(); dbcpPartScrollPane = new JScrollPane(); dbcpPartTable = new JTable(); buttonBar = new JPanel(); okButton = new JButton(); //======== this ======== Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {//from ww w . ja v a2 s . c om dialogPane.setBorder(Borders.createEmptyBorder("7dlu, 7dlu, 7dlu, 7dlu")); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout(new FormLayout("394dlu:grow", "3*(default, $lgap), 36dlu")); //======== mainProjectLinePanel ======== { mainProjectLinePanel.setLayout(new FormLayout("110dlu, $lcgap, 168dlu", "default")); //---- mainProjectNameTitleLabel ---- mainProjectNameTitleLabel.setText("Main Project Name :"); mainProjectLinePanel.add(mainProjectNameTitleLabel, CC.xy(1, 1)); mainProjectLinePanel.add(mainProjectNameValueLabel, CC.xy(3, 1)); } contentPanel.add(mainProjectLinePanel, CC.xy(1, 1)); //======== dbcpNameLinePanel ======== { dbcpNameLinePanel.setLayout(new FormLayout("110dlu, $lcgap, 200dlu", "default")); //---- dbcpNameTitleLabel ---- dbcpNameTitleLabel.setText("DBCP Name :"); dbcpNameLinePanel.add(dbcpNameTitleLabel, CC.xy(1, 1)); dbcpNameLinePanel.add(dbcpNameValueLabel, CC.xy(3, 1)); } contentPanel.add(dbcpNameLinePanel, CC.xy(1, 3)); //---- dbcpPartTitleLable ---- dbcpPartTitleLable.setText("DBCP Part Editor"); contentPanel.add(dbcpPartTitleLable, CC.xy(1, 5)); //======== dbcpPartScrollPane ======== { //---- dbcpPartTable ---- dbcpPartTable.setModel(new DefaultTableModel(new Object[][] { { null, null }, }, new String[] { "key", "value" }) { Class<?>[] columnTypes = new Class<?>[] { String.class, Object.class }; boolean[] columnEditable = new boolean[] { false, false }; @Override public Class<?> getColumnClass(int columnIndex) { return columnTypes[columnIndex]; } @Override public boolean isCellEditable(int rowIndex, int columnIndex) { return columnEditable[columnIndex]; } }); { TableColumnModel cm = dbcpPartTable.getColumnModel(); cm.getColumn(1).setMinWidth(150); } dbcpPartTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); dbcpPartTable.setAutoCreateColumnsFromModel(false); dbcpPartScrollPane.setViewportView(dbcpPartTable); } contentPanel.add(dbcpPartScrollPane, CC.xy(1, 7)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.createEmptyBorder("5dlu, 0dlu, 0dlu, 0dlu")); buttonBar.setLayout(new FormLayout("$glue, $button", "pref")); //---- okButton ---- okButton.setText("Close"); okButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { okButtonActionPerformed(e); } }); buttonBar.add(okButton, CC.xy(2, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:kr.pe.codda.gui.helper.projectmanager.screen.SubProjectPartEditorPopup.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license dialogPane = new JPanel(); contentPanel = new JPanel(); mainProjectNameLinePanel = new JPanel(); mainProjectNameTitleLabel = new JLabel(); mainProjectNameValueLabel = new JLabel(); subProjectNameLinePanel = new JPanel(); subProjectNameTitleLabel = new JLabel(); subProjectNameValueLabel = new JLabel(); subprojectPartTitleLable = new JLabel(); subProjectPartScrollPane = new JScrollPane(); subProjectPartTable = new JTable(); buttonBar = new JPanel(); okButton = new JButton(); //======== this ======== Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {// ww w . j a va 2s .c om dialogPane.setBorder(Borders.createEmptyBorder("7dlu, 7dlu, 7dlu, 7dlu")); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout(new FormLayout("${growing-button}", "12dlu, $lgap, [12dlu,default], $lgap, default, $lgap, 140dlu:grow")); //======== mainProjectNameLinePanel ======== { mainProjectNameLinePanel.setLayout(new FormLayout("default, $lcgap, default:grow", "default")); //---- mainProjectNameTitleLabel ---- mainProjectNameTitleLabel.setText("\uc8fc \ud504\ub85c\uc81d\ud2b8 \uc774\ub984 :"); mainProjectNameLinePanel.add(mainProjectNameTitleLabel, CC.xy(1, 1)); //---- mainProjectNameValueLabel ---- mainProjectNameValueLabel.setText("sample_test"); mainProjectNameLinePanel.add(mainProjectNameValueLabel, CC.xy(3, 1)); } contentPanel.add(mainProjectNameLinePanel, CC.xy(1, 1)); //======== subProjectNameLinePanel ======== { subProjectNameLinePanel.setLayout(new FormLayout("default, $lcgap, default:grow", "default")); //---- subProjectNameTitleLabel ---- subProjectNameTitleLabel.setText("\uc11c\ube0c \ud504\ub85c\uc81d\ud2b8 \uc774\ub984 :"); subProjectNameLinePanel.add(subProjectNameTitleLabel, CC.xy(1, 1)); //---- subProjectNameValueLabel ---- subProjectNameValueLabel.setText("sample_test_sub1"); subProjectNameLinePanel.add(subProjectNameValueLabel, CC.xy(3, 1)); } contentPanel.add(subProjectNameLinePanel, CC.xy(1, 3)); //---- subprojectPartTitleLable ---- subprojectPartTitleLable.setText("Subproject Part Editor"); contentPanel.add(subprojectPartTitleLable, CC.xy(1, 5)); //======== subProjectPartScrollPane ======== { //---- subProjectPartTable ---- subProjectPartTable .setModel(new DefaultTableModel(new Object[][] { { null, null }, { null, null }, }, new String[] { "\ud0a4", "\uac12" }) { Class<?>[] columnTypes = new Class<?>[] { String.class, Object.class }; @Override public Class<?> getColumnClass(int columnIndex) { return columnTypes[columnIndex]; } }); subProjectPartScrollPane.setViewportView(subProjectPartTable); } contentPanel.add(subProjectPartScrollPane, CC.xy(1, 7)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.createEmptyBorder("5dlu, 0dlu, 0dlu, 0dlu")); buttonBar.setLayout(new FormLayout("$glue, $button", "pref")); //---- okButton ---- okButton.setText("Close"); okButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { okButtonActionPerformed(e); } }); buttonBar.add(okButton, CC.xy(2, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }