List of usage examples for java.awt BorderLayout WEST
String WEST
To view the source code for java.awt BorderLayout WEST.
Click Source Link
From source file:edu.ku.brc.specify.config.init.SpecifyDBSetupWizard.java
/** * @param wizardType// w ww . j av a2 s.co m * @param listener */ public SpecifyDBSetupWizard(final WizardType wizardType, final WizardListener listener) { super(); this.wizardType = wizardType; this.listener = listener; System.setProperty(DBMSUserMgr.factoryName, "edu.ku.brc.dbsupport.MySQLDMBSUserMgr"); /*setupXMLPath = UIRegistry.getUserHomeAppDir() + File.separator + "setup_prefs.xml"; try { props.loadFromXML(new FileInputStream(new File(setupXMLPath))); } catch (Exception ex) { edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(SpecifyDBSetupWizard.class, ex); }*/ HelpMgr.setLoadingPage("Load"); cardPanel = new JPanel(cardLayout); cancelBtn = createButton(UIRegistry.getResourceString("CANCEL")); helpBtn = createButton(UIRegistry.getResourceString("HELP")); JPanel btnBar; backBtn = createButton(UIRegistry.getResourceString("BACK")); nextBtn = createButton(UIRegistry.getResourceString("NEXT")); CellConstraints cc = new CellConstraints(); PanelBuilder bbpb = new PanelBuilder(new FormLayout("f:p:g,p,4px,p,4px,p,4px,p,4px", "p")); bbpb.add(helpBtn, cc.xy(2, 1)); bbpb.add(backBtn, cc.xy(4, 1)); bbpb.add(nextBtn, cc.xy(6, 1)); bbpb.add(cancelBtn, cc.xy(8, 1)); btnBar = bbpb.getPanel(); boolean doTesting = AppPreferences.getLocalPrefs().getBoolean("wizard.defaults", false); if (doTesting && wizardType == WizardType.Institution) { props.put("hostName", "localhost"); props.put("dbName", "testfish"); props.put("dbUserName", "Specify"); props.put("dbPassword", "Specify"); props.put("saUserName", "Master"); props.put("saPassword", "Master"); props.put("firstName", "Test"); props.put("lastName", "User"); props.put("middleInitial", "a"); props.put("email", "tester@ku.edu"); props.put("usrUsername", "testuser"); props.put("usrPassword", "testuser"); props.put("instName", "KU natural History Museum"); props.put("instAbbrev", "KU-NHM"); props.put("divName", "Fish"); props.put("divAbbrev", "IT"); props.put("collName", "Fish"); props.put("collPrefix", "KUFSH"); // Address props.put("addr1", "1345 Jayhawk Blvd"); props.put("addr2", "606 Dyche Hall"); props.put("city", "Lawrence"); props.put("state", "KS"); props.put("country", "USA"); props.put("zip", "66044"); props.put("phone", "785-864-5555"); props.put("addtaxon", true); } else { props.put("hostName", "localhost"); props.put("dbName", "specify"); } props.put("userType", SpecifyUserTypes.UserType.Manager.toString()); UIFieldFormatterMgr.setDoingLocal(true); String accessionFmt = null; if (wizardType == WizardType.Institution) { props.put("fromwizard", "true"); dbPanel = new DatabasePanel(nextBtn, backBtn, getHelpCntxt("wizard_mysql_username"), true); panels.add(dbPanel); HelpMgr.registerComponent(helpBtn, dbPanel.getHelpContext()); if (listener != null) { listener.helpContextChanged(dbPanel.getHelpContext()); } panels.add(new MasterUserPanel("SA", "ENTER_SA_INFO", getHelpCntxt("wizard_master_username"), new String[] { "SA_USERNAME", "SA_PASSWORD" }, new String[] { "saUserName", "saPassword" }, new Integer[] { 32, 32 }, nextBtn, backBtn, true)); panels.add(new GenericFormPanel("SECURITY", "SECURITY_INFO", getHelpCntxt("wizard_security_on"), new String[] { "SECURITY_ON" }, new String[] { "security_on" }, new String[] { "checkbox" }, nextBtn, backBtn, true)); userInfoPanel = new UserInfoPanel("AGENT", "ENTER_COLMGR_INFO", getHelpCntxt("wizard_create_it_user"), new String[] { "FIRSTNAME", "LASTNAME", "MIDNAME", "EMAIL", null, "USERLOGININFO", "USERNAME", "PASSWORD" }, new String[] { "firstName", "lastName", "middleInitial", "email", " ", "-", "usrUsername", "usrPassword" }, new boolean[] { true, true, false, true, true, false, true, true }, new Integer[] { 50, 120, 50, 50, null, null, 64, 32 }, nextBtn, backBtn); panels.add(userInfoPanel); panels.add(new GenericFormPanel("INST", "ENTER_INST_INFO", getHelpCntxt("wizard_create_institution"), new String[] { "NAME", "ABBREV", null, "INST_ADDR", "ADDR1", "ADDR2", "CITY", "STATE", "COUNTRY", "ZIP", "PHONE" }, new String[] { "instName", "instAbbrev", " ", "-", "addr1", "addr2", "city", "state", "country", "zip", "phone" }, new boolean[] { true, true, false, false, true, false, true, true, true, true, true }, new Integer[] { 255, 32, 50, null, 255, 255, 64, 64, 64, 32, 50 }, nextBtn, backBtn, true)); accessionPanel = new GenericFormPanel("ACCESSIONGLOBALLY", "ENTER_ACC_INFO", getHelpCntxt("wizard_choose_accession_level"), new String[] { "ACCGLOBALLY" }, new String[] { "accglobal" }, new String[] { "checkbox" }, nextBtn, backBtn, true); panels.add(accessionPanel); if (wizardType == WizardType.Institution) { accessionPickerGbl = new FormatterPickerPanel("ACCNOFMT", getHelpCntxt("wizard_create_accession_number"), nextBtn, backBtn, false, null); panels.add(accessionPickerGbl); } storageTDPanel = new TreeDefSetupPanel(StorageTreeDef.class, getResourceString("Storage"), "Storage", getHelpCntxt("wizard_configure_storage_tree"), "CONFIG_TREEDEF", nextBtn, backBtn, null); panels.add(storageTDPanel); panels.add(new InstSetupPanel("CREATEINST", "CREATEINST", getHelpCntxt("wizard_create_institution"), new String[] {}, new String[] {}, new Integer[] {}, nextBtn, backBtn, true)); } if (wizardType == WizardType.Institution || wizardType == WizardType.Division) { DivisionPanel divPanel = new DivisionPanel("DIV", "ENTER_DIV_INFO", getHelpCntxt("wizard_enter_division"), new String[] { "NAME", "ABBREV" }, new String[] { "divName", "divAbbrev" }, new Integer[] { 255, 64 }, nextBtn, backBtn, true); panels.add(divPanel); if (wizardType == WizardType.Division) { HelpMgr.registerComponent(helpBtn, divPanel.getHelpContext()); } } if (wizardType != WizardType.Institution) { Institution institution = AppContextMgr.getInstance().getClassObject(Institution.class); Division division = AppContextMgr.getInstance().getClassObject(Division.class); if (!institution.getIsAccessionsGlobal()) { String sql = "SELECT ans.FormatName FROM autonumberingscheme ans Inner Join autonumsch_div ad ON ans.AutoNumberingSchemeID = ad.AutoNumberingSchemeID " + "INNER JOIN division d ON ad.DivisionID = d.UserGroupScopeId WHERE d.DivisionID = " + division.getId(); log.debug(sql); Vector<Object> rows = BasicSQLUtils.querySingleCol(sql); if (rows.size() == 1) { accessionFmt = rows.get(0).toString(); } else { log.error("The return " + rows.size()); } } } if (wizardType == WizardType.Institution || wizardType == WizardType.Division || wizardType == WizardType.Discipline) { nextBtn.setEnabled(false); disciplinePanel = new DisciplinePanel(getHelpCntxt("wizard_choose_discipline_type"), nextBtn, backBtn); panels.add(disciplinePanel); if (wizardType == WizardType.Discipline) { HelpMgr.registerComponent(helpBtn, disciplinePanel.getHelpContext()); } taxonTDPanel = new TreeDefSetupPanel(TaxonTreeDef.class, getResourceString("Taxon"), "Taxon", getHelpCntxt("wizard_configure_taxon_tree"), "CONFIG_TREEDEF", nextBtn, backBtn, disciplinePanel); panels.add(taxonTDPanel); panels.add(new TaxonLoadSetupPanel(getHelpCntxt("wizard_preload_taxon"), nextBtn, backBtn)); geoTDPanel = new TreeDefSetupPanel(GeographyTreeDef.class, getResourceString("Geography"), "Geography", getHelpCntxt("wizard_configure_geography_tree"), "CONFIG_TREEDEF", nextBtn, backBtn, disciplinePanel); panels.add(geoTDPanel); } CollectionPanel colPanel = new CollectionPanel("COLLECTION", "ENTER_COL_INFO", getHelpCntxt("wizard_create_collection"), new String[] { "NAME", "PREFIX", }, new String[] { "collName", "collPrefix", }, new Integer[] { 50, 50 }, nextBtn, backBtn, true); panels.add(colPanel); if (wizardType == WizardType.Collection) { HelpMgr.registerComponent(helpBtn, colPanel.getHelpContext()); } catNumPicker = new FormatterPickerPanel("CATNOFMT", getHelpCntxt("wizard_create_catalog_number"), nextBtn, backBtn, true, null); panels.add(catNumPicker); if (wizardType != WizardType.Institution) { Division division = AppContextMgr.getInstance().getClassObject(Division.class); String sql = "SELECT COUNT(*) FROM division d INNER JOIN collection c ON d.UserGroupScopeId = c.DisciplineID WHERE d.UserGroupScopeId = " + division.getId(); log.debug(sql); int numCollectionsByDiv = BasicSQLUtils.getCountAsInt(sql); if (numCollectionsByDiv == 0) { Institution inst = AppContextMgr.getInstance().getClassObject(Institution.class); if (inst != null && !inst.getIsAccessionsGlobal()) { //if (wizardType != WizardType.Division) { accessionPickerCol = new FormatterPickerPanel("ACCNOFMT", getHelpCntxt("wizard_create_accession_number"), nextBtn, backBtn, false, accessionFmt); accessionPickerCol.setDoingDisciplineCollection(wizardType != WizardType.Division); panels.add(accessionPickerCol); } } } } else { accessionPickerCol = new FormatterPickerPanel("ACCNOFMT", getHelpCntxt("wizard_create_accession_number"), nextBtn, backBtn, false, null); panels.add(accessionPickerCol); } panels.add(new SummaryPanel("SUMMARY", getHelpCntxt("wizard_summary"), nextBtn, backBtn, panels)); lastStep = panels.size(); if (backBtn != null) { backBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { if (step > 0) { if (disciplinePanel != null) { DisciplineType disciplineType = disciplinePanel.getDisciplineType(); if (disciplineType != null && disciplineType.isPaleo() && panels.get(step - 1) instanceof TaxonLoadSetupPanel) { //step--; } } if (panels.get(step - 1) == accessionPickerGbl) { if (!((Boolean) props.get("accglobal"))) { step--; } } if (panels.get(step - 1) == accessionPickerCol) { boolean isAccGlobal; if (accessionPanel != null) { accessionPanel.getValues(props); isAccGlobal = (Boolean) props.get("accglobal"); } else { Institution inst = AppContextMgr.getInstance().getClassObject(Institution.class); isAccGlobal = inst != null && !inst.getIsAccessionsGlobal(); } if (isAccGlobal) { step--; } } step--; panels.get(step).doingPrev(); HelpMgr.registerComponent(helpBtn, panels.get(step).getHelpContext()); cardLayout.show(cardPanel, Integer.toString(step)); } updateBtnBar(); if (listener != null) { listener.panelChanged(getResourceString(panels.get(step).getPanelName() + ".TITLE")); listener.helpContextChanged(panels.get(step).getHelpContext()); } } }); backBtn.setEnabled(false); } nextBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { if (step == lastStep - 2) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { Component c = SpecifyDBSetupWizard.this.getParent(); while (!(c instanceof Window) && c != null) { c = c.getParent(); } if (c != null) { ((Window) c).pack(); } } }); } if (step < lastStep - 1) { DisciplineType disciplineType = null; if (disciplinePanel == null) { Discipline discipline = AppContextMgr.getInstance().getClassObject(Discipline.class); disciplineType = DisciplineType.getByName(discipline.getType()); } else { disciplineType = disciplinePanel.getDisciplineType(); } panels.get(step).getValues(props); panels.get(step).aboutToLeave(); if (step == 1) { String isCnvUploadVal = props.getProperty(DatabasePanel.DB_STRUCT_ONLY); boolean isCnvUpload = StringUtils.isNotEmpty(isCnvUploadVal) ? isCnvUploadVal.equals("true") : false; if (isCnvUpload) { setupLoginPrefs(); JOptionPane.showMessageDialog(UIRegistry.getTopWindow(), getResourceString("CONVUPLD_DONE"), getResourceString("COMPLETE"), JOptionPane.INFORMATION_MESSAGE); SpecifyDBSetupWizard.this.listener.finished(); return; } } if (disciplineType != null && disciplineType.isPaleo() && panels.get(step) instanceof TreeDefSetupPanel && ((TreeDefSetupPanel) panels.get(step)).getClassType() == TaxonTreeDef.class) { //step++; } if (panels.get(step) == accessionPanel) { accessionPanel.getValues(props); if (!((Boolean) props.get("accglobal"))) { step++; } } if (panels.get(step) == catNumPicker) { if (accessionPanel != null) { accessionPanel.getValues(props); boolean isAccGlobal = (Boolean) props.get("accglobal"); if (isAccGlobal) { step++; } } } advanceToNextPanel(); } else { nextBtn.setEnabled(false); if (wizardType == WizardType.Institution) { configSetup(); configureDatabase(); } else { //SpecifyDBSetupWizard.this.listener.hide(); SpecifyDBSetupWizard.this.listener.finished(); } } } }); cancelBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { if (SpecifyDBSetupWizard.this.listener != null) { if (step == lastStep) { SpecifyDBSetupWizard.this.listener.finished(); } else { if (UIHelper.promptForAction("QUIT", "NO", "CANCEL", getResourceString("SURE_QUIT"))) { SpecifyDBSetupWizard.this.listener.cancelled(); } } } } }); for (int i = 0; i < panels.size(); i++) { cardPanel.add(Integer.toString(i), panels.get(i)); panels.get(i).setValues(props); } cardLayout.show(cardPanel, "0"); if (dbPanel != null) { dbPanel.updateBtnUI(); } PanelBuilder builder = new PanelBuilder(new FormLayout("f:p:g", "f:p:g,10px,p")); builder.add(cardPanel, cc.xy(1, 1)); builder.add(btnBar, cc.xy(1, 3)); builder.setDefaultDialogBorder(); setLayout(new BorderLayout()); PanelBuilder iconBldr = new PanelBuilder(new FormLayout("20px, f:p:g,p,f:p:g,8px", "20px,t:p,f:p:g, 8px")); JLabel iconLbl = new JLabel(IconManager.getIcon(getIconName())); iconLbl.setVerticalAlignment(SwingConstants.TOP); iconBldr.add(iconLbl, cc.xy(2, 3)); add(iconBldr.getPanel(), BorderLayout.WEST); add(builder.getPanel(), BorderLayout.CENTER); progressBar = new JProgressBar(0, lastStep - 1); progressBar.setStringPainted(true); add(progressBar, BorderLayout.SOUTH); panels.get(0).updateBtnUI(); }
From source file:org.apache.jmeter.config.gui.ArgumentsPanel.java
/** * Initialize the components and layout of this component. *///w w w . j av a2 s. c om private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) JPanel p = this; if (standalone) { setLayout(new BorderLayout(0, 5)); setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); p = new JPanel(); } p.setLayout(new BorderLayout()); p.add(makeLabelPanel(), BorderLayout.NORTH); p.add(makeMainPanel(), BorderLayout.CENTER); // Force a minimum table height of 70 pixels p.add(Box.createVerticalStrut(70), BorderLayout.WEST); p.add(makeButtonPanel(), BorderLayout.SOUTH); if (standalone) { add(p, BorderLayout.CENTER); } table.revalidate(); sizeColumns(table); }
From source file:com.att.aro.diagnostics.GraphPanel.java
/** * Initializes a new instance of the GraphPanel class. *///from w ww .j av a 2 s . c om public GraphPanel() { subplotMap.put(ChartPlotOptions.GPS, new GraphPanelPlotLabels(rb.getString("chart.gps"), createBarPlot(Color.gray), 1)); subplotMap.put(ChartPlotOptions.RADIO, new GraphPanelPlotLabels(rb.getString("chart.radio"), createRadioPlot(), 2)); subplotMap.put(ChartPlotOptions.BLUETOOTH, new GraphPanelPlotLabels(rb.getString("chart.bluetooth"), createBarPlot(Color.gray), 1)); subplotMap.put(ChartPlotOptions.CAMERA, new GraphPanelPlotLabels(rb.getString("chart.camera"), createBarPlot(Color.gray), 1)); subplotMap.put(ChartPlotOptions.SCREEN, new GraphPanelPlotLabels(rb.getString("chart.screen"), createBarPlot(new Color(34, 177, 76)), 1)); subplotMap.put(ChartPlotOptions.BATTERY, new GraphPanelPlotLabels(rb.getString("chart.battery"), createBatteryPlot(), 2)); subplotMap.put(ChartPlotOptions.WAKELOCK, new GraphPanelPlotLabels(rb.getString("chart.wakelock"), createWakelockStatePlot(), 1)); subplotMap.put(ChartPlotOptions.WIFI, new GraphPanelPlotLabels(rb.getString("chart.wifi"), createBarPlot(Color.gray), 1)); subplotMap.put(ChartPlotOptions.ALARM, new GraphPanelPlotLabels(rb.getString("chart.alarm"), createAlarmPlot(), 2)); subplotMap.put(ChartPlotOptions.NETWORK_TYPE, new GraphPanelPlotLabels(rb.getString("chart.networkType"), createBarPlot(Color.gray), 1)); subplotMap.put(ChartPlotOptions.THROUGHPUT, new GraphPanelPlotLabels(rb.getString("chart.throughput"), createThroughputPlot(), 2)); subplotMap.put(ChartPlotOptions.BURSTS, new GraphPanelPlotLabels(rb.getString("chart.bursts"), createBurstPlot(), 1)); subplotMap.put(ChartPlotOptions.USER_INPUT, new GraphPanelPlotLabels(rb.getString("chart.userInput"), createUserEventPlot(), 1)); subplotMap.put(ChartPlotOptions.RRC, new GraphPanelPlotLabels(rb.getString("chart.rrc"), createRrcPlot(), 1)); subplotMap.put(ChartPlotOptions.CPU, new GraphPanelPlotLabels(rb.getString("chart.cpu"), createCpuPlot(), 1)); this.pp = new PacketPlots(); subplotMap.put(ChartPlotOptions.UL_PACKETS, new GraphPanelPlotLabels(rb.getString("chart.ul"), pp.getUlPlot(), 1)); subplotMap.put(ChartPlotOptions.DL_PACKETS, new GraphPanelPlotLabels(rb.getString("chart.dl"), pp.getDlPlot(), 1)); this.axis = new NumberAxis(); this.axis.setStandardTickUnits(UNITS); this.axis.setRange(new Range(0, DEFAULT_TIMELINE)); this.axis.setLowerBound(0); this.axis.setAutoTickUnitSelection(true); this.axis.setTickMarkInsideLength(1); this.axis.setTickMarkOutsideLength(1); this.axis.setMinorTickMarksVisible(true); this.axis.setMinorTickMarkInsideLength(2f); this.axis.setMinorTickMarkOutsideLength(2f); this.axis.setTickMarkInsideLength(4f); this.axis.setTickMarkOutsideLength(4f); this.axisLabel = new JLabel(rb.getString("chart.timeline")); this.axisLabel.setHorizontalAlignment(SwingConstants.CENTER); this.setLayout(new BorderLayout()); this.setPreferredSize(new Dimension(200, 310)); this.add(getZoomSavePanel(), BorderLayout.EAST); this.add(getPane(), BorderLayout.CENTER); this.add(getLabelsPanel(), BorderLayout.WEST); setChartOptions(UserPreferences.getInstance().getChartPlotOptions()); }
From source file:org.pentaho.reporting.ui.datasources.olap4j.Olap4JDataSourceEditor.java
protected Component createContentPane() { // Create the connection panel final JPanel queryContentPanel = new JPanel(new BorderLayout()); queryContentPanel.add(BorderLayout.NORTH, createQueryListPanel()); queryContentPanel.add(BorderLayout.CENTER, createQueryDetailsPanel()); // Create the content panel final JPanel dialogContent = new JPanel(new BorderLayout()); dialogContent.add(BorderLayout.WEST, connectionComponent); dialogContent.add(BorderLayout.CENTER, queryContentPanel); final JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.addTab(Messages.getString("Olap4JDataSourceEditor.DataSource"), dialogContent); tabbedPane.addTab(Messages.getString("Olap4JDataSourceEditor.GlobalScripting"), createGlobalScriptTab()); final JPanel contentPane = new JPanel(new BorderLayout()); contentPane.add(BorderLayout.SOUTH, createPreviewButtonsPanel()); contentPane.add(BorderLayout.CENTER, tabbedPane); contentPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); return contentPane; }
From source file:op.controlling.PnlControlling.java
private JPanel createContentPanel4Fall() { JPanel pnlContent = new JPanel(new VerticalLayout()); /***//from w w w . j a v a 2 s . c om * _____ _ _ _ * | ___|_ _| | |___ / \ _ __ ___ _ __ _ _ _ __ ___ ___ _ _ ___ * | |_ / _` | | / __| / _ \ | '_ \ / _ \| '_ \| | | | '_ ` _ \ / _ \| | | / __| * | _| (_| | | \__ \ / ___ \| | | | (_) | | | | |_| | | | | | | (_) | |_| \__ \ * |_| \__,_|_|_|___/ /_/ \_\_| |_|\___/|_| |_|\__, |_| |_| |_|\___/ \__,_|___/ * |___/ */ JPanel pnlFallsAnon = new JPanel(new BorderLayout()); final JButton btnFallsAnon = GUITools.createHyperlinkButton("opde.controlling.nursing.falls.anonymous", null, null); int fallsMonthsBack; try { fallsMonthsBack = Integer.parseInt(OPDE.getProps().getProperty("opde.controlling::fallsMonthsBack")); } catch (NumberFormatException nfe) { fallsMonthsBack = 7; } final JTextField txtFallsMonthsBack = GUITools.createIntegerTextField(1, 120, fallsMonthsBack); txtFallsMonthsBack.setToolTipText(SYSTools.xx("misc.msg.monthsback")); btnFallsAnon.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { OPDE.getMainframe().setBlocked(true); SwingWorker worker = new SwingWorker() { @Override protected Object doInBackground() throws Exception { SYSPropsTools.storeProp("opde.controlling::fallsMonthsBack", txtFallsMonthsBack.getText(), OPDE.getLogin().getUser()); SYSFilesTools.print(ResInfoTools.getFallsAnonymous( Integer.parseInt(txtFallsMonthsBack.getText()), progressClosure), false); return null; } @Override protected void done() { OPDE.getDisplayManager().setProgressBarMessage(null); OPDE.getMainframe().setBlocked(false); } }; worker.execute(); } }); pnlFallsAnon.add(btnFallsAnon, BorderLayout.WEST); pnlFallsAnon.add(txtFallsMonthsBack, BorderLayout.EAST); pnlContent.add(pnlFallsAnon); /*** * _____ _ _ _ ____ _ _ _ * | ___|_ _| | |___ | |__ _ _| _ \ ___ ___(_) __| | ___ _ __ | |_ * | |_ / _` | | / __| | '_ \| | | | |_) / _ \/ __| |/ _` |/ _ \ '_ \| __| * | _| (_| | | \__ \ | |_) | |_| | _ < __/\__ \ | (_| | __/ | | | |_ * |_| \__,_|_|_|___/ |_.__/ \__, |_| \_\___||___/_|\__,_|\___|_| |_|\__| * |___/ */ JPanel pnlFallsRes = new JPanel(new BorderLayout()); final JButton btnFallsRes = GUITools.createHyperlinkButton("opde.controlling.nursing.falls.byResident", null, null); int fallsResMonthsBack; try { fallsResMonthsBack = Integer .parseInt(OPDE.getProps().getProperty("opde.controlling::fallsResMonthsBack")); } catch (NumberFormatException nfe) { fallsResMonthsBack = 7; } final JTextField txtResFallsMonthsBack = GUITools.createIntegerTextField(1, 120, fallsResMonthsBack); txtResFallsMonthsBack.setToolTipText(SYSTools.xx("misc.msg.monthsback")); btnFallsRes.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { OPDE.getMainframe().setBlocked(true); SwingWorker worker = new SwingWorker() { @Override protected Object doInBackground() throws Exception { SYSPropsTools.storeProp("opde.controlling::fallsResMonthsBack", txtResFallsMonthsBack.getText(), OPDE.getLogin().getUser()); SYSFilesTools.print(ResInfoTools.getFallsByResidents( Integer.parseInt(txtResFallsMonthsBack.getText()), progressClosure), false); return null; } @Override protected void done() { OPDE.getDisplayManager().setProgressBarMessage(null); OPDE.getMainframe().setBlocked(false); } }; worker.execute(); } }); pnlFallsRes.add(btnFallsRes, BorderLayout.WEST); pnlFallsRes.add(txtResFallsMonthsBack, BorderLayout.EAST); pnlContent.add(pnlFallsRes); /*** * _____ _ _ ___ _ _ _ * | ___|_ _| | |___|_ _|_ __ __| (_) ___ __ _| |_ ___ _ __ * | |_ / _` | | / __|| || '_ \ / _` | |/ __/ _` | __/ _ \| '__| * | _| (_| | | \__ \| || | | | (_| | | (_| (_| | || (_) | | * |_| \__,_|_|_|___/___|_| |_|\__,_|_|\___\__,_|\__\___/|_| * */ JPanel pnlFallsIndicator = new JPanel(new BorderLayout()); final JButton btnFallsIndicator = GUITools .createHyperlinkButton("opde.controlling.nursing.fallsindicators.byMonth", null, null); int fallsIndicatorBack; try { fallsIndicatorBack = Integer .parseInt(OPDE.getProps().getProperty("opde.controlling::fallsIndicatorMonthsBack")); } catch (NumberFormatException nfe) { fallsIndicatorBack = 7; } final JTextField txtFallsIndicatorsMonthsBack = GUITools.createIntegerTextField(1, 120, fallsIndicatorBack); txtFallsIndicatorsMonthsBack.setToolTipText(SYSTools.xx("misc.msg.monthsback")); btnFallsIndicator.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { OPDE.getMainframe().setBlocked(true); SwingWorker worker = new SwingWorker() { @Override protected Object doInBackground() throws Exception { SYSPropsTools.storeProp("opde.controlling::fallsIndicatorMonthsBack", txtFallsIndicatorsMonthsBack.getText(), OPDE.getLogin().getUser()); return ResInfoTools.getFallsIndicatorsByMonth( Integer.parseInt(txtFallsIndicatorsMonthsBack.getText()), progressClosure); } @Override protected void done() { try { SYSFilesTools.print(get().toString(), true); } catch (ExecutionException ee) { OPDE.fatal(ee); } catch (InterruptedException ie) { // nop } OPDE.getDisplayManager().setProgressBarMessage(null); OPDE.getMainframe().setBlocked(false); } }; worker.execute(); } }); pnlFallsIndicator.add(btnFallsIndicator, BorderLayout.WEST); pnlFallsIndicator.add(txtFallsIndicatorsMonthsBack, BorderLayout.EAST); pnlContent.add(pnlFallsIndicator); return pnlContent; }
From source file:jduagui.Controller.java
private JPanel addSwingNode() { JPanel p = new JPanel(); p.setLayout(new BorderLayout()); JLabel n = new JLabel("testing SwingNode north"); JLabel s = new JLabel("testing SwingNode south"); JLabel w = new JLabel("testing SwingNode west"); JLabel e = new JLabel("testing SwingNode east"); JLabel c = new JLabel("testing SwingNode center"); p.add(c, BorderLayout.CENTER); p.add(n, BorderLayout.NORTH); p.add(s, BorderLayout.SOUTH); p.add(w, BorderLayout.WEST); p.add(e, BorderLayout.EAST);/*from w w w.j av a 2 s.c om*/ return p; }
From source file:de.tor.tribes.ui.views.DSWorkbenchTagFrame.java
/** This method is called from within the constructor to * initialize the form.// w w w. j a v a 2s . co m * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; jTagsPanel = new javax.swing.JPanel(); jTagTablePanel = new org.jdesktop.swingx.JXPanel(); infoPanel = new org.jdesktop.swingx.JXCollapsiblePane(); jXLabel1 = new org.jdesktop.swingx.JXLabel(); jScrollPane4 = new javax.swing.JScrollPane(); villageListPanel = new javax.swing.JPanel(); jScrollPane5 = new javax.swing.JScrollPane(); jVillageList = new javax.swing.JList(); jAlwaysOnTopBox = new javax.swing.JCheckBox(); jTagPanel = new org.jdesktop.swingx.JXPanel(); capabilityInfoPanel1 = new de.tor.tribes.ui.components.CapabilityInfoPanel(); jTagsPanel.setLayout(new java.awt.BorderLayout(10, 0)); jTagTablePanel.setLayout(new java.awt.BorderLayout()); infoPanel.setCollapsed(true); infoPanel.setInheritAlpha(false); jXLabel1.setText("Keine Meldung"); jXLabel1.setOpaque(true); jXLabel1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { jXLabel1fireHideInfoEvent(evt); } }); infoPanel.add(jXLabel1, java.awt.BorderLayout.CENTER); jTagTablePanel.add(infoPanel, java.awt.BorderLayout.SOUTH); jTagsTable .setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null }, { null, null, null, null }, { null, null, null, null }, { null, null, null, null } }, new String[] { "Title 1", "Title 2", "Title 3", "Title 4" })); jScrollPane4.setViewportView(jTagsTable); jTagTablePanel.add(jScrollPane4, java.awt.BorderLayout.CENTER); jTagsPanel.add(jTagTablePanel, java.awt.BorderLayout.CENTER); villageListPanel.setPreferredSize(new java.awt.Dimension(180, 80)); villageListPanel.setLayout(new java.awt.BorderLayout()); jScrollPane5.setBorder(javax.swing.BorderFactory.createTitledBorder("Zugeordnete Drfer")); jScrollPane5.setViewportView(jVillageList); villageListPanel.add(jScrollPane5, java.awt.BorderLayout.CENTER); jTagsPanel.add(villageListPanel, java.awt.BorderLayout.WEST); setTitle("Gruppen"); getContentPane().setLayout(new java.awt.GridBagLayout()); jAlwaysOnTopBox.setText("Immer im Vordergrund"); jAlwaysOnTopBox.setOpaque(false); jAlwaysOnTopBox.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { fireAlwaysOnTopEvent(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(jAlwaysOnTopBox, gridBagConstraints); jTagPanel.setBackground(new java.awt.Color(239, 235, 223)); jTagPanel.setPreferredSize(new java.awt.Dimension(500, 300)); jTagPanel.setLayout(new java.awt.BorderLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; getContentPane().add(jTagPanel, gridBagConstraints); capabilityInfoPanel1.setCopyable(false); capabilityInfoPanel1.setSearchable(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); getContentPane().add(capabilityInfoPanel1, gridBagConstraints); pack(); }
From source file:net.technicpack.launcher.ui.LauncherFrame.java
private void initComponents() { BorderLayout layout = new BorderLayout(); setLayout(layout);//from w ww .ja v a 2s. c om ///////////////////////////////////////////////////////////// //HEADER ///////////////////////////////////////////////////////////// JPanel header = new JPanel(); header.setLayout(new BoxLayout(header, BoxLayout.LINE_AXIS)); header.setBackground(COLOR_BLUE); header.setForeground(COLOR_WHITE_TEXT); header.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 10)); this.add(header, BorderLayout.PAGE_START); ImageIcon headerIcon = resources.getIcon("platform_icon_title.png"); JButton headerLabel = new JButton(headerIcon); headerLabel.setBorder(BorderFactory.createEmptyBorder(5, 8, 5, 0)); headerLabel.setContentAreaFilled(false); headerLabel.setFocusPainted(false); headerLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); headerLabel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { DesktopUtils.browseUrl("http://beta.technicpack.net/"); } }); header.add(headerLabel); header.add(Box.createRigidArea(new Dimension(6, 0))); ActionListener tabListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { selectTab(e.getActionCommand()); } }; discoverTab = new HeaderTab(resources.getString("launcher.title.discover"), resources); header.add(discoverTab); discoverTab.setActionCommand(TAB_DISCOVER); discoverTab.addActionListener(tabListener); modpacksTab = new HeaderTab(resources.getString("launcher.title.modpacks"), resources); modpacksTab.setIsActive(true); modpacksTab.setHorizontalTextPosition(SwingConstants.LEADING); modpacksTab.addActionListener(tabListener); modpacksTab.setActionCommand(TAB_MODPACKS); header.add(modpacksTab); newsTab = new HeaderTab(resources.getString("launcher.title.news"), resources); newsTab.setLayout(null); newsTab.addActionListener(tabListener); newsTab.setActionCommand(TAB_NEWS); header.add(newsTab); CountCircle newsCircle = new CountCircle(); newsCircle.setBackground(COLOR_RED); newsCircle.setForeground(COLOR_WHITE_TEXT); newsCircle.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS_BOLD, 14)); newsTab.add(newsCircle); newsCircle.setBounds(10, 17, 25, 25); header.add(Box.createHorizontalGlue()); JPanel rightHeaderPanel = new JPanel(); rightHeaderPanel.setOpaque(false); rightHeaderPanel.setLayout(new BoxLayout(rightHeaderPanel, BoxLayout.PAGE_AXIS)); rightHeaderPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0)); JPanel windowGadgetPanel = new JPanel(); windowGadgetPanel.setOpaque(false); windowGadgetPanel.setLayout(new BoxLayout(windowGadgetPanel, BoxLayout.LINE_AXIS)); windowGadgetPanel.setAlignmentX(RIGHT_ALIGNMENT); ImageIcon minimizeIcon = resources.getIcon("minimize.png"); JButton minimizeButton = new JButton(minimizeIcon); minimizeButton.setBorder(BorderFactory.createEmptyBorder()); minimizeButton.setContentAreaFilled(false); minimizeButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); minimizeButton.setFocusable(false); minimizeButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { minimizeWindow(); } }); windowGadgetPanel.add(minimizeButton); ImageIcon closeIcon = resources.getIcon("close.png"); JButton closeButton = new JButton(closeIcon); closeButton.setBorder(BorderFactory.createEmptyBorder()); closeButton.setContentAreaFilled(false); closeButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { closeWindow(); } }); closeButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); closeButton.setFocusable(false); windowGadgetPanel.add(closeButton); rightHeaderPanel.add(windowGadgetPanel); rightHeaderPanel.add(Box.createVerticalGlue()); JButton launcherOptionsLabel = new JButton(resources.getString("launcher.title.options")); launcherOptionsLabel.setIcon(resources.getIcon("options_cog.png")); launcherOptionsLabel.setFont(resources.getFont(ResourceLoader.FONT_RALEWAY, 14)); launcherOptionsLabel.setForeground(COLOR_WHITE_TEXT); launcherOptionsLabel.setHorizontalAlignment(SwingConstants.RIGHT); launcherOptionsLabel.setHorizontalTextPosition(SwingConstants.LEADING); launcherOptionsLabel.setAlignmentX(RIGHT_ALIGNMENT); launcherOptionsLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); launcherOptionsLabel.setBorder(BorderFactory.createEmptyBorder()); launcherOptionsLabel.setContentAreaFilled(false); launcherOptionsLabel.setFocusPainted(false); launcherOptionsLabel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { openLauncherOptions(); } }); rightHeaderPanel.add(launcherOptionsLabel); header.add(rightHeaderPanel); ///////////////////////////////////////////////////////////// // CENTRAL AREA ///////////////////////////////////////////////////////////// centralPanel = new TintablePanel(); centralPanel.setBackground(COLOR_CHARCOAL); centralPanel.setForeground(COLOR_WHITE_TEXT); centralPanel.setTintColor(COLOR_CENTRAL_BACK); this.add(centralPanel, BorderLayout.CENTER); centralPanel.setLayout(new BorderLayout()); modpackPanel = new ModpackInfoPanel(resources, iconRepo, logoRepo, backgroundRepo, avatarRepo, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { openModpackOptions((ModpackModel) e.getSource()); } }, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { refreshModpackOptions((ModpackModel) e.getSource()); } }); modpackSelector.setInfoPanel(modpackPanel); playButton = modpackPanel.getPlayButton(); playButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (e.getSource() instanceof ModpackModel) { setupPlayButtonText((ModpackModel) e.getSource(), userModel.getCurrentUser()); } else if (installer.isCurrentlyRunning()) { installer.cancel(); setupPlayButtonText(modpackSelector.getSelectedPack(), userModel.getCurrentUser()); } else { launchModpack(); } } }); modpackPanel.getDeleteButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (JOptionPane.showConfirmDialog(LauncherFrame.this, resources.getString("modpackoptions.delete.confirmtext"), resources.getString("modpackoptions.delete.confirmtitle"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { modpackSelector.getSelectedPack().delete(); modpackSelector.forceRefresh(); } } }); infoSwap = new JPanel(); infoLayout = new CardLayout(); infoSwap.setLayout(infoLayout); infoSwap.setOpaque(false); newsInfoPanel = new NewsInfoPanel(resources, avatarRepo); infoSwap.add(discoverInfoPanel, "discover"); JPanel newsHost = new JPanel(); infoSwap.add(newsHost, "news"); JPanel modpackHost = new JPanel(); infoSwap.add(modpackHost, "modpacks"); centralPanel.add(infoSwap, BorderLayout.CENTER); newsSelector = new NewsSelector(resources, newsInfoPanel, platformApi, avatarRepo, newsCircle, settings); newsHost.setLayout(new BorderLayout()); newsHost.add(newsInfoPanel, BorderLayout.CENTER); newsHost.add(newsSelector, BorderLayout.WEST); modpackHost.setLayout(new BorderLayout()); modpackHost.add(modpackPanel, BorderLayout.CENTER); modpackHost.add(modpackSelector, BorderLayout.WEST); footer = new TintablePanel(); footer.setTintColor(COLOR_CENTRAL_BACK); footer.setBackground(COLOR_FOOTER); footer.setLayout(new BoxLayout(footer, BoxLayout.LINE_AXIS)); footer.setForeground(COLOR_WHITE_TEXT); footer.setBorder(BorderFactory.createEmptyBorder(3, 6, 3, 12)); userWidget = new UserWidget(resources, skinRepository); userWidget.setMaximumSize(userWidget.getPreferredSize()); footer.add(userWidget); JLabel dashText = new JLabel("| "); dashText.setForeground(LauncherFrame.COLOR_WHITE_TEXT); dashText.setFont(resources.getFont(ResourceLoader.FONT_RALEWAY, 15)); footer.add(dashText); JButton logout = new JButton(resources.getString("launcher.user.logout")); logout.setBorder(BorderFactory.createEmptyBorder()); logout.setContentAreaFilled(false); logout.setFocusable(false); logout.setForeground(LauncherFrame.COLOR_WHITE_TEXT); logout.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); logout.setFont(resources.getFont(ResourceLoader.FONT_RALEWAY, 15)); logout.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { logout(); } }); footer.add(logout); installProgress = new ProgressBar(); installProgress.setForeground(Color.white); installProgress.setBackground(LauncherFrame.COLOR_GREEN); installProgress.setBorder(BorderFactory.createEmptyBorder(5, 45, 4, 45)); installProgress.setIcon(resources.getIcon("download_icon.png")); installProgress.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 12)); installProgress.setVisible(false); footer.add(installProgress); installProgressPlaceholder = Box.createHorizontalGlue(); footer.add(installProgressPlaceholder); JLabel buildCtrl = new JLabel(resources.getString("launcher.build.text", resources.getLauncherBuild(), resources.getString("launcher.build." + settings.getBuildStream()))); buildCtrl.setForeground(COLOR_WHITE_TEXT); buildCtrl.setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 14)); buildCtrl.setHorizontalTextPosition(SwingConstants.RIGHT); buildCtrl.setHorizontalAlignment(SwingConstants.RIGHT); footer.add(buildCtrl); this.add(footer, BorderLayout.PAGE_END); }
From source file:org.pentaho.reporting.ui.datasources.pmd.PmdDataSourceEditor.java
protected Component createContentPane() { final JPanel queryTextAreaHeaderPanel = new JPanel(new BorderLayout()); queryTextAreaHeaderPanel.add(new JLabel(Messages.getString("PmdDataSourceEditor.QueryLabel")), BorderLayout.WEST); queryTextAreaHeaderPanel.add(queryDesignerButton, BorderLayout.EAST); final JPanel queryConfigurationPanel = new JPanel(); queryConfigurationPanel.setLayout(new BorderLayout()); queryConfigurationPanel.add(queryTextAreaHeaderPanel, BorderLayout.NORTH); queryConfigurationPanel.add(new RTextScrollPane(700, 500, queryTextArea, true), BorderLayout.CENTER); final JTabbedPane queryScriptTabPane = new JTabbedPane(); queryScriptTabPane.addTab(Messages.getString("PmdDataSourceEditor.StaticQuery"), queryConfigurationPanel); queryScriptTabPane.addTab(Messages.getString("PmdDataSourceEditor.QueryScripting"), createQueryScriptTab()); final JPanel queryAreaPanel = new JPanel(); queryAreaPanel.setLayout(new BorderLayout()); queryAreaPanel.add(createGlobalPropertiesPanel(), BorderLayout.NORTH); queryAreaPanel.add(queryScriptTabPane, BorderLayout.CENTER); final JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.addTab(Messages.getString("PmdDataSourceEditor.DataSource"), queryAreaPanel); tabbedPane.addTab(Messages.getString("PmdDataSourceEditor.GlobalScripting"), createGlobalScriptTab()); final JPanel contentPanel = new JPanel(new BorderLayout()); contentPanel.add(tabbedPane, BorderLayout.CENTER); contentPanel.add(createPreviewButtonsPanel(), BorderLayout.SOUTH); contentPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); return contentPanel; }
From source file:org.pentaho.reporting.ui.datasources.olap4j.Olap4JDataSourceEditor.java
private JPanel createQueryDetailsPanel() { final JPanel queryNamePanel = new JPanel(new BorderLayout()); queryNamePanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8)); queryNamePanel.add(new JLabel(Messages.getString("Olap4JDataSourceEditor.QueryNameLabel")), BorderLayout.NORTH);//from www .j a va 2s . c om queryNamePanel.add(queryNameTextField, BorderLayout.SOUTH); final JPanel queryControlsPanel = new JPanel(new BorderLayout()); queryControlsPanel.add(new JLabel(Messages.getString("Olap4JDataSourceEditor.QueryLabel")), BorderLayout.WEST); final JPanel queryPanel = new JPanel(new BorderLayout()); queryPanel.add(queryControlsPanel, BorderLayout.NORTH); queryPanel.add(new JScrollPane(queryTextArea), BorderLayout.CENTER); queryPanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8)); final JTabbedPane queryScriptTabPane = new JTabbedPane(); queryScriptTabPane.addTab(Messages.getString("Olap4JDataSourceEditor.StaticQuery"), queryPanel); queryScriptTabPane.addTab(Messages.getString("Olap4JDataSourceEditor.QueryScripting"), createQueryScriptTab()); // Create the query details panel final JPanel queryDetailsPanel = new JPanel(new BorderLayout()); queryDetailsPanel.add(BorderLayout.NORTH, queryNamePanel); queryDetailsPanel.add(BorderLayout.CENTER, queryScriptTabPane); return queryDetailsPanel; }