List of usage examples for javax.swing SwingConstants CENTER
int CENTER
To view the source code for javax.swing SwingConstants CENTER.
Click Source Link
From source file:com.diversityarrays.kdxplore.curate.fieldview.FieldLayoutViewPanel.java
@SuppressWarnings("unchecked") public FieldLayoutViewPanel(@SuppressWarnings("rawtypes") MutableComboBoxModel comboBoxModel, JCheckBox alwaysOnTopOption, CurationData cd, CurationTableModel ctm, SelectedValueStore svs, PlotCellChoicesPanel pccp, JPopupMenu popuMenu, Font fontForResizeControls, Action curationHelpAction, MessagePrinter mp, Closure<String> selectionClosure, CurationContext curationContext, CurationMenuProvider curationMenuProvider, FieldLayoutTableModel fieldLayoutTableModel, CellSelectableTable fieldLayoutTable, FieldViewSelectionModel fvsm,/*from w w w . ja v a 2s .c o m*/ JButton undockButton) { super(new BorderLayout()); this.traitInstanceCombo.setModel(comboBoxModel); this.curationData = cd; this.messagePrinter = mp; this.selectionClosure = selectionClosure; this.curationTableModel = ctm; this.fieldLayoutTableModel = fieldLayoutTableModel; this.fieldLayoutTable = fieldLayoutTable; this.fieldViewSelectionModel = fvsm; traitInstanceCombo.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Object item = comboBoxModel.getSelectedItem(); if (item instanceof TraitInstance) { TraitInstance ti = (TraitInstance) item; plotCellRenderer.setActiveInstance(ti); } } }); rhtm = new RowHeaderTableModel(true, fieldLayoutTable, rowRemovable) { public String getRowLabel(int rowIndex) { int yCoord = FieldLayoutUtil.convertRowIndexToYCoord(rowIndex, trial, fieldLayoutTableModel.getFieldLayout()); return String.valueOf(yCoord); } }; rowHeaderTable = new RowHeaderTable(SwingConstants.CENTER, false, fieldLayoutTable, rowRemovable, rhtm, RowHeaderTable.createDefaultColumnModel("X/Y")) { public String getMarkerIndexName(int viewRow) { return "MIN-" + viewRow; //$NON-NLS-1$ } }; rhtTableRowResizer = new TableRowResizer(rowHeaderTable, true); curationData.addCurationDataChangeListener(plotActivationListener); curationTableModel.addTableModelListener(new TableModelListener() { @Override public void tableChanged(TableModelEvent e) { fieldLayoutTable.repaint(); } }); plotCellRenderer = new PlotCellRenderer(plotAttributeProvider, curationTableModel); TraitInstanceCellRenderer tiCellRenderer = new TraitInstanceCellRenderer( curationData.getTraitColorProvider(), instanceNameProvider); traitInstanceCombo.setRenderer(tiCellRenderer); traitInstanceCombo.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { updateActiveTraitInstance(); } }); traitInstanceCombo.getModel().addListDataListener(new ListDataListener() { @Override public void intervalRemoved(ListDataEvent e) { updateActiveTraitInstance(); } @Override public void intervalAdded(ListDataEvent e) { updateActiveTraitInstance(); } @Override public void contentsChanged(ListDataEvent e) { updateActiveTraitInstance(); } }); this.trial = curationData.getTrial(); this.plotCellChoicesPanel = pccp; for (TraitInstance t : curationData.getTraitInstances()) { String id = InstanceIdentifierUtil.getInstanceIdentifier(t); traitById.put(id, t); } // fieldViewSelectionModel = new FieldViewSelectionModel( // fieldLayoutTable, // fieldLayoutTableModel, // svs); fieldLayoutTable.setSelectionModel(fieldViewSelectionModel); plotCellRenderer.setCurationData(curationData); plotCellRenderer.setSelectionModel(fieldViewSelectionModel); plotCellChoicesPanel.addPlotCellChoicesListener(plotCellChoicesListener); fieldLayoutTableModel.setTrial(trial); // IMPORTANT: DO NOT SORT THE FIELD LAYOUT TABLE fieldLayoutTable.setAutoCreateRowSorter(false); JScrollPane fieldTableScrollPane = new JScrollPane(fieldLayoutTable); if (undockButton != null) { fieldTableScrollPane.setCorner(JScrollPane.UPPER_RIGHT_CORNER, undockButton); } fieldTableScrollPane.setRowHeaderView(rowHeaderTable); ChangeListener scrollBarChangeListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { fireRefreshRequired(); } }; fieldTableScrollPane.getVerticalScrollBar().getModel().addChangeListener(scrollBarChangeListener); fieldTableScrollPane.getHorizontalScrollBar().getModel().addChangeListener(scrollBarChangeListener); fieldLayoutTable.setRowHeaderTable(rowHeaderTable); // fieldLayoutTable.setComponentPopupMenu(popuMenu); initFieldLayoutTable(); Map<Integer, Plot> plotById = new HashMap<>(); FieldLayout<Integer> plotIdLayout = FieldLayoutUtil.createPlotIdLayout(trial.getTrialLayout(), trial.getPlotIdentSummary(), curationData.getPlots(), plotById); KdxploreFieldLayout<Plot> kdxFieldLayout = new KdxploreFieldLayout<Plot>(Plot.class, plotIdLayout.imageId, plotIdLayout.xsize, plotIdLayout.ysize); kdxFieldLayout.warning = plotIdLayout.warning; for (int y = 0; y < plotIdLayout.ysize; ++y) { for (int x = 0; x < plotIdLayout.xsize; ++x) { Integer id = plotIdLayout.cells[y][x]; if (id != null) { Plot plot = plotById.get(id); kdxFieldLayout.store_xy(plot, x, y); } } } fieldLayoutTableModel.setFieldLayout(kdxFieldLayout); if (kdxFieldLayout.warning != null && !kdxFieldLayout.warning.isEmpty()) { warningMessage.setText(kdxFieldLayout.warning); } else { warningMessage.setText(""); //$NON-NLS-1$ } changeVisitOrderAction.putValue(Action.SMALL_ICON, KDClientUtils.getIcon(kdxFieldLayout.imageId)); List<Component> components = new ArrayList<>(); components.add(alwaysOnTopOption); Collections.addAll(components, new JButton(changeVisitOrderAction), new JButton(curationHelpAction), traitInstanceCombo); Box resizeControls = KDClientUtils.createResizeControls(fieldLayoutTable, fontForResizeControls, components.toArray(new Component[components.size()])); resizeCombo = KDClientUtils.findResizeCombo(resizeControls); if (RunMode.getRunMode().isDeveloper()) { new FieldLayoutViewPanel.DebugSettings(resizeControls, messagePrinter); } JPanel fieldPanel = new JPanel(new BorderLayout()); // if (useSeparator) { // SeparatorPanel separator = GuiUtil.createLabelSeparator("Field Layout:", resizeControls); // fieldPanel.add(separator, BorderLayout.NORTH); // fieldPanel.add(fieldTableScrollPane, BorderLayout.CENTER); // } // else { fieldPanel.add(resizeControls, BorderLayout.NORTH); fieldPanel.add(fieldTableScrollPane, BorderLayout.CENTER); // } // splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, // plotCellChoicesPanel, // fieldPanel); // splitPane.setResizeWeight(0.0); // splitPane.setOneTouchExpandable(true); add(warningMessage, BorderLayout.NORTH); add(fieldPanel, BorderLayout.CENTER); // splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, // plotCellChoicesPanel, // fieldPanel); // splitPane.setResizeWeight(0.0); // splitPane.setOneTouchExpandable(true); // // add(warningMessage, BorderLayout.NORTH); // add(splitPane, BorderLayout.CENTER); fieldLayoutTable.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent me) { if (SwingUtilities.isRightMouseButton(me) && 1 == me.getClickCount()) { me.consume(); List<Plot> plots = getSelectedPlots(); List<TraitInstance> checkedInstances = new ArrayList<>(); for (int index = traitInstanceCombo.getItemCount(); --index >= 1;) { Object item = traitInstanceCombo.getItemAt(index); if (item instanceof TraitInstance) { checkedInstances.add((TraitInstance) item); } } TraitInstance ti = fieldViewSelectionModel.getActiveTraitInstance(true); List<PlotOrSpecimen> plotSpecimens = new ArrayList<>(); plotSpecimens.addAll(plots); curationMenuProvider.showFieldViewToolMenu(me, plotSpecimens, ti, checkedInstances); } } }); }
From source file:cool.pandora.modeller.ui.jpanel.base.BagView.java
/** * createBagButtonPanel.//from w w w. j a va 2 s . c om * * @return buttonPanel */ private JPanel createBagButtonPanel() { addDataHandler = new AddDataHandler(this); removeDataHandler = new RemoveDataHandler(this); final JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 2, 2)); addDataToolBarAction = new JLabel(""); addDataToolBarAction.setEnabled(false); addDataToolBarAction.setHorizontalAlignment(SwingConstants.CENTER); addDataToolBarAction.setBorder(new LineBorder(addDataToolBarAction.getBackground(), 1)); addDataToolBarAction.setIcon(getPropertyImage("Bag_Content.add.icon")); addDataToolBarAction.setToolTipText(getMessage("bagView.payloadTree.addbutton.tooltip")); addDataToolBarAction.addMouseListener(new MouseAdapter() { @Override public void mousePressed(final MouseEvent e) { if (addDataToolBarAction.isEnabled()) { addDataHandler.actionPerformed(null); } } @Override public void mouseExited(final MouseEvent e) { addDataToolBarAction.setBorder(new LineBorder(addDataToolBarAction.getBackground(), 1)); } @Override public void mouseEntered(final MouseEvent e) { if (addDataToolBarAction.isEnabled()) { addDataToolBarAction.setBorder(new LineBorder(Color.GRAY, 1)); } } }); buttonPanel.add(addDataToolBarAction); removeDataToolBarAction = new JLabel(""); removeDataToolBarAction.setEnabled(false); removeDataToolBarAction.setHorizontalAlignment(SwingConstants.CENTER); removeDataToolBarAction.setBorder(new LineBorder(removeDataToolBarAction.getBackground(), 1)); removeDataToolBarAction.setIcon(getPropertyImage("Bag_Content.minus.icon")); removeDataToolBarAction.setToolTipText(getMessage("bagView.payloadTree.remove.tooltip")); buttonPanel.add(removeDataToolBarAction); removeDataToolBarAction.addMouseListener(new MouseAdapter() { @Override public void mousePressed(final MouseEvent e) { if (removeDataToolBarAction.isEnabled()) { removeDataHandler.actionPerformed(null); } } @Override public void mouseExited(final MouseEvent e) { removeDataToolBarAction.setBorder(new LineBorder(removeDataToolBarAction.getBackground(), 1)); } @Override public void mouseEntered(final MouseEvent e) { if (removeDataToolBarAction.isEnabled()) { removeDataToolBarAction.setBorder(new LineBorder(Color.GRAY, 1)); } } }); final JLabel spacerLabel = new JLabel(" "); buttonPanel.add(spacerLabel); addDataHandler = new AddDataHandler(this); removeDataHandler = new RemoveDataHandler(this); return buttonPanel; }
From source file:eu.crisis_economics.abm.dashboard.Page_Parameters.java
private Container initContainer() { JPanel containerPanel = new JPanel(new CardLayout()); JLabel loadingModelLabel = new JLabel("Loading model..."); loadingModelLabel.setHorizontalAlignment(SwingConstants.CENTER); containerPanel.add(loadingModelLabel, LOADING_MODEL_ID); tabbedPane = new JTabbedPane(); containerPanel.add(tabbedPane, PARAMETERS_PANEL_ID); // create two number of turns field numberOfTurnsField = new JFormattedTextField(); numberOfTurnsField.setFocusLostBehavior(JFormattedTextField.COMMIT); numberOfTurnsField.setInputVerifier(new InputVerifier() { @Override/*from w w w . j av a2s . co m*/ public boolean verify(final JComponent input) { if (!checkNumberOfTurnsField(true)) { final PopupFactory popupFactory = PopupFactory.getSharedInstance(); final Point locationOnScreen = numberOfTurnsField.getLocationOnScreen(); final JLabel message = new JLabel("Please specify a (possibly floating point) number!"); message.setBorder(new LineBorder(Color.RED, 2, true)); if (errorPopup != null) errorPopup.hide(); errorPopup = popupFactory.getPopup(numberOfTurnsField, message, locationOnScreen.x - 10, locationOnScreen.y - 30); errorPopup.show(); return false; } else { if (errorPopup != null) { errorPopup.hide(); errorPopup = null; } return true; } } }); numberOfTurnsField.setText(String.valueOf(Dashboard.NUMBER_OF_TURNS)); numberOfTurnsField .setToolTipText("The turn when the simulation should stop specified as an integer value."); numberOfTurnsField.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { wizard.clickDefaultButton(); } }); numberOfTurnsFieldPSW = new JFormattedTextField(); numberOfTurnsFieldPSW.setFocusLostBehavior(JFormattedTextField.COMMIT); numberOfTurnsFieldPSW.setInputVerifier(new InputVerifier() { @Override public boolean verify(final JComponent input) { if (!checkNumberOfTurnsField(false)) { final PopupFactory popupFactory = PopupFactory.getSharedInstance(); final Point locationOnScreen = numberOfTurnsFieldPSW.getLocationOnScreen(); final JLabel message = new JLabel("Please specify a (possibly floating point) number!"); message.setBorder(new LineBorder(Color.RED, 2, true)); if (errorPopup != null) errorPopup.hide(); errorPopup = popupFactory.getPopup(numberOfTurnsFieldPSW, message, locationOnScreen.x - 10, locationOnScreen.y - 30); errorPopup.show(); return false; } else { if (errorPopup != null) { errorPopup.hide(); errorPopup = null; } return true; } } }); numberOfTurnsFieldPSW.setText(String.valueOf(Dashboard.NUMBER_OF_TURNS)); numberOfTurnsFieldPSW .setToolTipText("The turn when the simulation should stop specified as an integer value."); numberOfTurnsFieldPSW.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { wizard.clickDefaultButton(); } }); // create two number of time-steps to ignore field numberTimestepsIgnored = new JFormattedTextField(); numberTimestepsIgnored.setFocusLostBehavior(JFormattedTextField.COMMIT); numberTimestepsIgnored.setInputVerifier(new InputVerifier() { @Override public boolean verify(final JComponent input) { if (!checkNumberTimestepsIgnored(true)) { final PopupFactory popupFactory = PopupFactory.getSharedInstance(); final Point locationOnScreen = numberTimestepsIgnored.getLocationOnScreen(); final JLabel message = new JLabel("Please specify an integer number!"); message.setBorder(new LineBorder(Color.RED, 2, true)); if (errorPopup != null) errorPopup.hide(); errorPopup = popupFactory.getPopup(numberTimestepsIgnored, message, locationOnScreen.x - 10, locationOnScreen.y - 30); errorPopup.show(); return false; } else { if (errorPopup != null) { errorPopup.hide(); errorPopup = null; } return true; } } }); numberTimestepsIgnored.setText(String.valueOf(Dashboard.NUMBER_OF_TIMESTEPS_TO_IGNORE)); numberTimestepsIgnored.setToolTipText( "The turn when the simulation should start charting specified as an integer value."); numberTimestepsIgnored.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { wizard.clickDefaultButton(); } }); numberTimestepsIgnoredPSW = new JFormattedTextField(); numberTimestepsIgnoredPSW.setFocusLostBehavior(JFormattedTextField.COMMIT); numberTimestepsIgnoredPSW.setInputVerifier(new InputVerifier() { @Override public boolean verify(final JComponent input) { if (!checkNumberTimestepsIgnored(false)) { final PopupFactory popupFactory = PopupFactory.getSharedInstance(); final Point locationOnScreen = numberTimestepsIgnoredPSW.getLocationOnScreen(); final JLabel message = new JLabel("Please specify an integer number!"); message.setBorder(new LineBorder(Color.RED, 2, true)); if (errorPopup != null) errorPopup.hide(); errorPopup = popupFactory.getPopup(numberTimestepsIgnoredPSW, message, locationOnScreen.x - 10, locationOnScreen.y - 30); errorPopup.show(); return false; } else { if (errorPopup != null) { errorPopup.hide(); errorPopup = null; } return true; } } }); numberTimestepsIgnoredPSW.setText(String.valueOf(Dashboard.NUMBER_OF_TIMESTEPS_TO_IGNORE)); numberTimestepsIgnoredPSW.setToolTipText( "The turn when the simulation should start charting specified as an integer value."); numberTimestepsIgnoredPSW.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { wizard.clickDefaultButton(); } }); onLineChartsCheckBox = new JCheckBox(); // onLineChartsCheckBoxPSW = new JCheckBox(); advancedChartsCheckBox = new JCheckBox(); advancedChartsCheckBox.setSelected(true); // create the scroll pane for the simple parameter setting page JLabel label = null; label = new JLabel(new ImageIcon(new ImageIcon(getClass().getResource(DECORATION_IMAGE)).getImage() .getScaledInstance(DECORATION_IMAGE_WIDTH, -1, Image.SCALE_SMOOTH))); Style.registerCssClasses(label, Dashboard.CSS_CLASS_COMMON_PANEL); parametersScrollPane = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); parametersScrollPane.setBorder(null); parametersScrollPane.setViewportBorder(null); breadcrumb = new Breadcrumb(); Style.registerCssClasses(breadcrumb, CSS_ID_BREADCRUMB); singleRunParametersPanel = new ScrollableJPanel(new SizeProvider() { @Override public int getHeight() { Component component = tabbedPane.getSelectedComponent(); if (component == null) { return 0; } JScrollBar scrollBar = parametersScrollPane.getHorizontalScrollBar(); return component.getSize().height - breadcrumb.getHeight() - (scrollBar.isVisible() ? scrollBar.getPreferredSize().height : 0); } @Override public int getWidth() { final int hScrollBarWidth = parametersScrollPane.getHorizontalScrollBar().getPreferredSize().width; final int width = dashboard.getSize().width - Page_Parameters.DECORATION_IMAGE_WIDTH - hScrollBarWidth; return width; } }); BoxLayout boxLayout = new BoxLayout(singleRunParametersPanel, BoxLayout.X_AXIS); singleRunParametersPanel.setLayout(boxLayout); parametersScrollPane.setViewportView(singleRunParametersPanel); JPanel breadcrumbPanel = new JPanel(new BorderLayout()); breadcrumbPanel.add(breadcrumb, BorderLayout.NORTH); breadcrumbPanel.add(parametersScrollPane, BorderLayout.CENTER); final JPanel simpleForm = FormsUtils.build("p ~ p:g", "01 t:p", label, breadcrumbPanel).getPanel(); Style.registerCssClasses(simpleForm, Dashboard.CSS_CLASS_COMMON_PANEL); tabbedPane.add("Single run", simpleForm); // create the form for the parameter sweep setting page tabbedPane.add("Parameter sweep", createParamsweepGUI()); gaSearchHandler = new GASearchHandler(currentModelHandler); gaSearchPanel = new GASearchPanel(gaSearchHandler, this); tabbedPane.add("Genetic Algorithm Search", gaSearchPanel); return containerPanel; }
From source file:com.mgmtp.perfload.loadprofiles.ui.AppFrame.java
/** * Mostly created by Eclipse WindowBuilder *///from w w w . ja v a 2s . c o m private void initComponents() { setTitle("perfLoad - Load Profile Configurator"); setSize(1032, 984); setLocationRelativeTo(null); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); SwingUtils.setUIFontStyle(Font.PLAIN); { JMenuBar menuBar = new JMenuBar(); menuBar.setName("menuBar"); setJMenuBar(menuBar); initMenuBar(menuBar); } contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(new MigLayout("insets 0", "[grow][]", "[25px][400][grow]")); { JToolBar toolBar = new JToolBar() { @Override protected JButton createActionComponent(final Action a) { JButton button = super.createActionComponent(a); button.setFocusable(false); button.setHideActionText(false); return button; } }; toolBar.setName("toolBar"); contentPane.add(toolBar, "cell 0 0 2 1,growx,aligny top"); initToolBar(toolBar); } { JScrollPane spTree = new JScrollPane(); spTree.setBorder(new CompoundBorder( new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Load Profile Elements", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)), new EmptyBorder(4, 4, 4, 4))); contentPane.add(spTree, "cell 0 1,grow"); spTree.setName("spTree"); { tree = new JTree(); tree.addKeyListener(new TreeKeyListener()); tree.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); tree.addTreeSelectionListener(new TreeTreeSelectionListener()); tree.setShowsRootHandles(true); tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); tree.setName("tree"); spTree.setViewportView(tree); } } { JPanel pnlMain = new JPanel(); contentPane.add(pnlMain, "cell 1 1"); pnlMain.setName("pnlMain"); pnlMain.setLayout(new MigLayout("insets 0", "[664!]", "[grow][]")); { JPanel pnlLoadProfileProperties = new JPanel(); pnlLoadProfileProperties.setBorder(new TitledBorder(null, "Load Profile Properties", TitledBorder.LEADING, TitledBorder.TOP, null, null)); pnlLoadProfileProperties.setName("pnlLoadProfileProperties"); pnlMain.add(pnlLoadProfileProperties, "flowx,cell 0 0,grow"); pnlLoadProfileProperties .setLayout(new MigLayout("insets 4", "[270,grow]8[]8[200]8[]8[200]", "[][][][grow]")); { lblName = new JLabel("Name"); lblName.setDisplayedMnemonic('N'); lblName.setHorizontalAlignment(SwingConstants.CENTER); lblName.setName("lblName"); pnlLoadProfileProperties.add(lblName, "cell 0 0"); } { JSeparator separator = new JSeparator(); separator.setPreferredSize(new Dimension(0, 200)); separator.setOrientation(SwingConstants.VERTICAL); separator.setName("separator"); pnlLoadProfileProperties.add(separator, "cell 1 0 1 4, growy"); } { JLabel lblClient = new JLabel("Clients"); lblClient.setName("lblClient"); pnlLoadProfileProperties.add(lblClient, "cell 2 0"); } { JSeparator separator = new JSeparator(); separator.setPreferredSize(new Dimension(0, 200)); separator.setOrientation(SwingConstants.VERTICAL); separator.setName("separator"); pnlLoadProfileProperties.add(separator, "cell 3 0 1 4, growy"); } { lblTargets = new JLabel("Targets"); lblTargets.setName("lblTargets"); pnlLoadProfileProperties.add(lblTargets, "cell 4 0"); } { txtName = new JTextField(); lblName.setLabelFor(txtName); txtName.setColumns(10); txtName.setName("txtName"); txtName.getDocument().addDocumentListener(dirtyListener); pnlLoadProfileProperties.add(txtName, "cell 0 1,growx"); } { JScrollPane spClients = new JScrollPane(); spClients.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); spClients.setName("spClients"); pnlLoadProfileProperties.add(spClients, "cell 2 1 1 3,grow"); { tblClients = new JCheckListTable(); tblClients.setName("tblClients"); spClients.setViewportView(tblClients); spClients.setColumnHeaderView(null); } } { JScrollPane spTargets = new JScrollPane(); spTargets.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); spTargets.setName("spTargets"); pnlLoadProfileProperties.add(spTargets, "cell 4 1 1 3,grow"); { tblTargets = new JCheckListTable(); tblTargets.setName("tblTargets"); spTargets.setViewportView(tblTargets); spTargets.setColumnHeaderView(null); } } { lblDescription = new JLabel("Description"); lblDescription.setDisplayedMnemonic('D'); lblDescription.setName("lblDescription"); pnlLoadProfileProperties.add(lblDescription, "cell 0 2"); } { JScrollPane spDescription = new JScrollPane(); spDescription.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); spDescription.setName("spDescription"); pnlLoadProfileProperties.add(spDescription, "cell 0 3,height 50:50:,grow"); { taDescription = new JTextArea(); taDescription.setFont(txtName.getFont()); lblDescription.setLabelFor(taDescription); taDescription.setRows(3); taDescription.setName("taDescription"); taDescription.getDocument().addDocumentListener(dirtyListener); spDescription.setViewportView(taDescription); } } } { JPanel pnlCurveAssignment = new JPanel(); pnlCurveAssignment.setBorder(new TitledBorder(null, "Active Load Curve Assignment", TitledBorder.LEADING, TitledBorder.TOP, null, null)); pnlMain.add(pnlCurveAssignment, "cell 0 1,grow"); pnlCurveAssignment.setLayout(new MigLayout("insets 4", "[grow]", "[grow][]")); { pnlCard = new JPanel(); pnlCard.setName("pnlCard"); pnlCurveAssignment.add(pnlCard, "cell 0 0,grow"); cardLayout = new CardLayout(0, 0); pnlCard.setLayout(cardLayout); { stairsPanel = new StairsPanel(); stairsPanel.setName("stairsPanel"); pnlCard.add(stairsPanel, "stairs"); } { oneTimePanel = new OneTimePanel(); oneTimePanel.setName("oneTimePanel"); pnlCard.add(oneTimePanel, "oneTime"); } { markerPanel = new MarkerPanel(); markerPanel.setName("markerPanel"); pnlCard.add(markerPanel, "marker"); } { JLabel lblNoActiveCurve = new JLabel("no active curve assignment"); lblNoActiveCurve.setHorizontalAlignment(SwingConstants.CENTER); pnlCard.add(lblNoActiveCurve, "none"); lblNoActiveCurve.setName("lblNoActiveCurve"); } } { btnOk = new JButtonExt("OK"); getRootPane().setDefaultButton(btnOk); btnOk.setEnabled(false); btnOk.addActionListener(new BtnOkActionListener()); btnOk.setMnemonic(KeyEvent.VK_O); btnOk.setName("btnOk"); pnlCurveAssignment.add(btnOk, "cell 0 1,alignx right"); } { btnCancel = new JButtonExt("Cancel"); btnCancel.setEnabled(false); btnCancel.addActionListener(new BtnCancelActionListener()); btnCancel.setMnemonic(KeyEvent.VK_C); btnCancel.setName("btnCancel"); pnlCurveAssignment.add(btnCancel, "cell 0 1,alignx right"); } } } }
From source file:gov.nih.nci.nbia.StandaloneDMV3.java
private JPanel constructLoginPanel() { JPanel contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(36, 36, 36, 36)); contentPane.setLayout(null);/*w w w.j av a 2s . c o m*/ JPanel guestPanel = new JPanel(); guestPanel.setBounds(38, 40, 825, 140); guestPanel.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED, new Color(153, 180, 209), null), " For Guest ", TitledBorder.CENTER, TitledBorder.TOP, null, new Color(0, 120, 215))); contentPane.add(guestPanel); guestPanel.setLayout(null); JButton guestBtn = new JButton(GuestBtnLbl); guestBtn.setBounds(606, 50, 140, 36); guestBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { submitRequest(null, null); } }); guestPanel.add(guestBtn); JLabel guestLbl = new JLabel("Log in as a guest to download public data only"); guestLbl.setBounds(70, 50, 460, 42); guestPanel.add(guestLbl); JPanel loginUserPanel = new JPanel(); loginUserPanel.setBounds(40, 258, 825, 306); contentPane.add(loginUserPanel); loginUserPanel .setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, new Color(153, 180, 209), null), " Login to Download Authorized Data ", TitledBorder.CENTER, TitledBorder.TOP, null, new Color(0, 120, 215))); loginUserPanel.setLayout(null); JLabel lblNewLabel_1 = new JLabel("User Name"); lblNewLabel_1.setBounds(70, 80, 118, 36); loginUserPanel.add(lblNewLabel_1); JButton submitBtn = new JButton(SubmitBtnLbl); submitBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { userId = userNameFld.getText(); password = passwdFld.getText(); if ((userId.length() < 1) || (password.length() < 1)) { statusLbl.setText("Please enter a valid user name and password."); statusLbl.setForeground(Color.red); } else { submitRequest(userId, password); } } }); submitBtn.setBounds(606, 238, 140, 36); loginUserPanel.add(submitBtn); userNameFld = new JTextField(); userNameFld.setBounds(200, 80, 333, 36); loginUserPanel.add(userNameFld); userNameFld.setColumns(10); JLabel lblPassword = new JLabel("Password"); lblPassword.setBounds(70, 156, 118, 36); loginUserPanel.add(lblPassword); passwdFld = new JPasswordField(); passwdFld.setBounds(200, 156, 333, 36); loginUserPanel.add(passwdFld); statusLbl = new JLabel(""); statusLbl.setBounds(70, 226, 463, 36); loginUserPanel.add(statusLbl); JLabel lblOr = new JLabel("--- OR ---"); lblOr.setBounds(419, 212, 81, 26); contentPane.add(lblOr); JLabel versionLabel = new JLabel("Release " + DownloaderProperties.getAppVersion() + " Build \"" + DownloaderProperties.getBuildTime() + "\""); versionLabel.setHorizontalAlignment(SwingConstants.CENTER); versionLabel.setForeground(new Color(70, 130, 180)); versionLabel.setBounds(315, 584, 260, 20); contentPane.add(versionLabel); userNameFld.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { passwdFld.requestFocus(); } }); userNameFld.addFocusListener(new FocusListener() { @Override public void focusGained(FocusEvent e) { statusLbl.setText(""); } @Override public void focusLost(FocusEvent e) { } }); passwdFld.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { userId = userNameFld.getText(); password = passwdFld.getText(); if ((userId.length() < 1) || (password.length() < 1)) { statusLbl.setText("Please enter a valid user name and password."); statusLbl.setForeground(Color.red); } else submitRequest(userId, password); } }); passwdFld.addFocusListener(new FocusListener() { @Override public void focusGained(FocusEvent e) { statusLbl.setText(""); } @Override public void focusLost(FocusEvent e) { } }); return contentPane; }
From source file:net.java.sip.communicator.impl.gui.main.chat.ChatPanel.java
/** * Initializes the typing notification label. * @param typingLabelParent the parent container * of typing notification label. *///from w w w. ja v a 2s . c om private void initTypingNotificationLabel(JPanel typingLabelParent) { typingNotificationLabel = new JLabel(" ", SwingConstants.CENTER); typingNotificationLabel.setPreferredSize(new Dimension(500, 20)); typingNotificationLabel.setForeground(Color.GRAY); typingNotificationLabel.setFont(typingNotificationLabel.getFont().deriveFont(11f)); typingNotificationLabel.setVerticalTextPosition(JLabel.BOTTOM); typingNotificationLabel.setHorizontalTextPosition(JLabel.LEFT); typingNotificationLabel.setIconTextGap(0); typingLabelParent.add(typingNotificationLabel, BorderLayout.SOUTH); }
From source file:Creator.WidgetPanel.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor./*from w w w . j av a 2s. com*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { _FileChooser_IoFile = new javax.swing.JFileChooser(); _ComboBox_DisplayPanel = new javax.swing.JComboBox(); _ScrollPane_VariableNames = new javax.swing.JScrollPane(); _List_WidgetVars = new javax.swing.JList(); _Label_VarNames = new javax.swing.JLabel(); _Button_LoadXls = new javax.swing.JButton(); _Label_Loaded = new javax.swing.JLabel(); _Panel_WidgetParams = new javax.swing.JPanel(); _Label_WidgetParams = new javax.swing.JLabel(); _Label_WigetParam_yPos = new javax.swing.JLabel(); _FTF_WigetParam_xPos = new javax.swing.JFormattedTextField(); _FTF_WigetParam_yPos = new javax.swing.JFormattedTextField(); _Label_WigetParam_xPos = new javax.swing.JLabel(); _FTF_WigetParam_xPosPer = new javax.swing.JFormattedTextField(); _Label_WigetParam_xPos1 = new javax.swing.JLabel(); _Label_WigetParam_yPos1 = new javax.swing.JLabel(); _FTF_WigetParam_yPosPer = new javax.swing.JFormattedTextField(); _Button_GenerateWidgetLink = new javax.swing.JButton(); _ScrollPane_Log = new javax.swing.JScrollPane(); _TextArea_Log = new javax.swing.JTextArea(); _ScrollPane_WidgetSettings = new javax.swing.JScrollPane(); _Panel_WidgetSettings = new javax.swing.JPanel(); _Button_LoadDefaults = new javax.swing.JButton(); _Button_LoadDefaults1 = new javax.swing.JButton(); _ScrollPane_WidgetNames = new javax.swing.JScrollPane(); _List_WidgetCodeList = new javax.swing.JList(); _Label_Widget = new javax.swing.JLabel(); _Button_widgetPositions = new javax.swing.JButton(); _ComboBox_Subgroup = new javax.swing.JComboBox(); _ScrollPane_MasterMap = new javax.swing.JScrollPane(); _List_MasterMapVariables = new javax.swing.JList(); _Label_VarsOnPanel = new javax.swing.JLabel(); _Button_ClearSelection = new javax.swing.JButton(); _Button_CreateImports = new javax.swing.JButton(); _Button_ClearLinks = new javax.swing.JButton(); _ScrollPane_Tree = new javax.swing.JScrollPane(); _JTree_WidgetLinks = new javax.swing.JTree(); _Panel_LinkPanel = new javax.swing.JPanel(); _Button_GenerateLinks = new javax.swing.JButton(); _ComboBox_Panels = new javax.swing.JComboBox(); _FTF_PanelID = new javax.swing.JFormattedTextField(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); _TF_PanelName = new javax.swing.JTextField(); _Button_Save = new javax.swing.JButton(); _FTF_XPOS = new javax.swing.JFormattedTextField(); jLabel5 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); _FTF_YPOS = new javax.swing.JFormattedTextField(); _Button_ClearCurrent = new javax.swing.JButton(); _Button_ClearAll = new javax.swing.JButton(); _Button_AddCurrent = new javax.swing.JButton(); _Button_AddAll = new javax.swing.JButton(); _FileChooser_IoFile.setApproveButtonText("Open"); _FileChooser_IoFile.setApproveButtonToolTipText("Open a xls file"); _FileChooser_IoFile.setCurrentDirectory( new java.io.File("C:\\Users\\EricGummerson\\Documents\\Background Creator Files")); _FileChooser_IoFile.setDialogTitle("Open a XLS File"); _FileChooser_IoFile.setFileFilter(new javax.swing.filechooser.FileNameExtensionFilter("XLS files", "xls")); setMinimumSize(new java.awt.Dimension(1031, 680)); setPreferredSize(new java.awt.Dimension(1031, 680)); _ComboBox_DisplayPanel.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _ComboBox_DisplayPanel.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Main" })); _ComboBox_DisplayPanel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { _ComboBox_DisplayPanelActionPerformed(evt); } }); _List_WidgetVars.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _List_WidgetVars.setModel(listModelWidgetsVars); _List_WidgetVars.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); _List_WidgetVars.addListSelectionListener(new javax.swing.event.ListSelectionListener() { public void valueChanged(javax.swing.event.ListSelectionEvent evt) { _List_WidgetVarsValueChanged(evt); } }); _ScrollPane_VariableNames.setViewportView(_List_WidgetVars); _Label_VarNames.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N _Label_VarNames.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); _Label_VarNames.setText("Widget Vars"); _Button_LoadXls.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _Button_LoadXls.setText("Load Export File (.xls)"); _Button_LoadXls.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { _Button_LoadXlsActionPerformed(evt); } }); _Label_Loaded.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _Label_Loaded.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); _Label_Loaded.setText("XLS File Not loaded"); _Label_WidgetParams.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N _Label_WidgetParams.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); _Label_WidgetParams.setText("Widget Parameters"); _Label_WigetParam_yPos.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N _Label_WigetParam_yPos.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); _Label_WigetParam_yPos.setText("Positon Y"); _FTF_WigetParam_xPos.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory( new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0")))); _FTF_WigetParam_xPos.setHorizontalAlignment(javax.swing.JTextField.CENTER); _FTF_WigetParam_xPos.setText("10"); _FTF_WigetParam_yPos.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory( new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0")))); _FTF_WigetParam_yPos.setHorizontalAlignment(javax.swing.JTextField.CENTER); _FTF_WigetParam_yPos.setText("10"); _Label_WigetParam_xPos.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N _Label_WigetParam_xPos.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); _Label_WigetParam_xPos.setText("Positon X"); _FTF_WigetParam_xPosPer.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory( new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0")))); _FTF_WigetParam_xPosPer.setHorizontalAlignment(javax.swing.JTextField.CENTER); _FTF_WigetParam_xPosPer.setText("0"); _Label_WigetParam_xPos1.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N _Label_WigetParam_xPos1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); _Label_WigetParam_xPos1.setText("Percentage X"); _Label_WigetParam_yPos1.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N _Label_WigetParam_yPos1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); _Label_WigetParam_yPos1.setText("Percentage Y"); _FTF_WigetParam_yPosPer.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory( new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0")))); _FTF_WigetParam_yPosPer.setHorizontalAlignment(javax.swing.JTextField.CENTER); _FTF_WigetParam_yPosPer.setText("0"); _Button_GenerateWidgetLink.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N _Button_GenerateWidgetLink.setText("Generate"); _Button_GenerateWidgetLink.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { _Button_GenerateWidgetLinkActionPerformed(evt); } }); _TextArea_Log.setEditable(false); _TextArea_Log.setColumns(20); _TextArea_Log.setFont(new java.awt.Font("Arial", 0, 10)); // NOI18N _TextArea_Log.setLineWrap(true); _TextArea_Log.setRows(5); _ScrollPane_Log.setViewportView(_TextArea_Log); _ScrollPane_WidgetSettings.setPreferredSize(new java.awt.Dimension(232, 265)); javax.swing.GroupLayout _Panel_WidgetSettingsLayout = new javax.swing.GroupLayout(_Panel_WidgetSettings); _Panel_WidgetSettings.setLayout(_Panel_WidgetSettingsLayout); _Panel_WidgetSettingsLayout.setHorizontalGroup(_Panel_WidgetSettingsLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 493, Short.MAX_VALUE)); _Panel_WidgetSettingsLayout.setVerticalGroup(_Panel_WidgetSettingsLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 362, Short.MAX_VALUE)); _ScrollPane_WidgetSettings.setViewportView(_Panel_WidgetSettings); _Button_LoadDefaults.setFont(new java.awt.Font("Arial", 0, 8)); // NOI18N _Button_LoadDefaults.setText("Load Defaults"); _Button_LoadDefaults.setToolTipText("Loads the default widget panel links from the /Home/ Directory"); _Button_LoadDefaults.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { _Button_LoadDefaultsActionPerformed(evt); } }); _Button_LoadDefaults1.setFont(new java.awt.Font("Arial", 0, 8)); // NOI18N _Button_LoadDefaults1.setText("Save Defaults"); _Button_LoadDefaults1.setToolTipText("Save the current set of widget links to the /Home/ directory"); _Button_LoadDefaults1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { _Button_LoadDefaults1ActionPerformed(evt); } }); _List_WidgetCodeList.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _List_WidgetCodeList.setModel(listModelCodeWidgets); _List_WidgetCodeList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); _List_WidgetCodeList.addListSelectionListener(new javax.swing.event.ListSelectionListener() { public void valueChanged(javax.swing.event.ListSelectionEvent evt) { _List_WidgetCodeListValueChanged(evt); } }); _ScrollPane_WidgetNames.setViewportView(_List_WidgetCodeList); _Label_Widget.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N _Label_Widget.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); _Label_Widget.setText("Widget Code"); javax.swing.GroupLayout _Panel_WidgetParamsLayout = new javax.swing.GroupLayout(_Panel_WidgetParams); _Panel_WidgetParams.setLayout(_Panel_WidgetParamsLayout); _Panel_WidgetParamsLayout.setHorizontalGroup(_Panel_WidgetParamsLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, _Panel_WidgetParamsLayout .createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(_Panel_WidgetParamsLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(_ScrollPane_WidgetSettings, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addComponent(_ScrollPane_WidgetNames, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addComponent(_Label_Widget, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(_Label_WidgetParams, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 209, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(_Panel_WidgetParamsLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(_Panel_WidgetParamsLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, _Panel_WidgetParamsLayout.createSequentialGroup() .addComponent(_Button_GenerateWidgetLink, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(_Panel_WidgetParamsLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(_Button_LoadDefaults, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_Button_LoadDefaults1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, _Panel_WidgetParamsLayout.createSequentialGroup() .addGroup(_Panel_WidgetParamsLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(_Label_WigetParam_yPos, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_Label_WigetParam_xPos, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(_Panel_WidgetParamsLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(_FTF_WigetParam_xPos) .addComponent(_FTF_WigetParam_yPos, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, _Panel_WidgetParamsLayout.createSequentialGroup() .addGroup(_Panel_WidgetParamsLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(_Label_WigetParam_xPos1, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_Label_WigetParam_yPos1, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(_Panel_WidgetParamsLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(_FTF_WigetParam_yPosPer, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_FTF_WigetParam_xPosPer, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addComponent(_ScrollPane_Log, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 236, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); _Panel_WidgetParamsLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] { _FTF_WigetParam_xPos, _FTF_WigetParam_yPos, _FTF_WigetParam_yPosPer, _Label_WigetParam_xPos, _Label_WigetParam_xPos1, _Label_WigetParam_yPos, _Label_WigetParam_yPos1 }); _Panel_WidgetParamsLayout.setVerticalGroup(_Panel_WidgetParamsLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(_Panel_WidgetParamsLayout.createSequentialGroup().addContainerGap() .addGroup(_Panel_WidgetParamsLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(_Panel_WidgetParamsLayout.createSequentialGroup() .addComponent(_Label_Widget, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(_ScrollPane_WidgetNames)) .addGroup(_Panel_WidgetParamsLayout.createSequentialGroup() .addGroup(_Panel_WidgetParamsLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(_FTF_WigetParam_xPos, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(_Panel_WidgetParamsLayout.createSequentialGroup() .addComponent(_Label_WigetParam_xPos, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(1, 1, 1))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(_Panel_WidgetParamsLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(_FTF_WigetParam_yPos, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_Label_WigetParam_yPos, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(_Panel_WidgetParamsLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(_Label_WigetParam_xPos1, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_FTF_WigetParam_xPosPer, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(_Panel_WidgetParamsLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(_FTF_WigetParam_yPosPer, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_Label_WigetParam_yPos1, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(_Panel_WidgetParamsLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(_Panel_WidgetParamsLayout.createSequentialGroup() .addComponent(_Button_LoadDefaults, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(_Button_LoadDefaults1, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(_Button_GenerateWidgetLink, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(_Panel_WidgetParamsLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(_Panel_WidgetParamsLayout.createSequentialGroup() .addComponent(_Label_WidgetParams, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(_ScrollPane_WidgetSettings, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)) .addComponent(_ScrollPane_Log, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); _Panel_WidgetParamsLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] { _Button_LoadDefaults, _Button_LoadDefaults1 }); _Panel_WidgetParamsLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] { _FTF_WigetParam_xPos, _FTF_WigetParam_xPosPer, _FTF_WigetParam_yPos, _FTF_WigetParam_yPosPer, _Label_WigetParam_xPos, _Label_WigetParam_xPos1, _Label_WigetParam_yPos, _Label_WigetParam_yPos1 }); _Button_widgetPositions.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _Button_widgetPositions.setText("Get Positions"); _Button_widgetPositions.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { _Button_widgetPositionsActionPerformed(evt); } }); _ComboBox_Subgroup.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _ComboBox_Subgroup.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Store" })); _ComboBox_Subgroup.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { _ComboBox_SubgroupActionPerformed(evt); } }); _List_MasterMapVariables.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _List_MasterMapVariables.setModel(listModelMasterMap); _ScrollPane_MasterMap.setViewportView(_List_MasterMapVariables); _Label_VarsOnPanel.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N _Label_VarsOnPanel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); _Label_VarsOnPanel.setText("Variables on Panel"); _Button_ClearSelection.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _Button_ClearSelection.setText("Clear Selection"); _Button_ClearSelection.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { _Button_ClearSelectionActionPerformed(evt); } }); _Button_CreateImports.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _Button_CreateImports.setText("Create Imports"); _Button_CreateImports.setEnabled(false); _Button_CreateImports.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { _Button_CreateImportsActionPerformed(evt); } }); _Button_ClearLinks.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _Button_ClearLinks.setText("Delete All Widgets"); _Button_ClearLinks.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { _Button_ClearLinksActionPerformed(evt); } }); _JTree_WidgetLinks.setModel(treeModel); _JTree_WidgetLinks.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() { public void valueChanged(javax.swing.event.TreeSelectionEvent evt) { _JTree_WidgetLinksValueChanged(evt); } }); _ScrollPane_Tree.setViewportView(_JTree_WidgetLinks); _Button_GenerateLinks.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _Button_GenerateLinks.setText("Create Links"); _Button_GenerateLinks.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { _Button_GenerateLinksActionPerformed(evt); } }); _ComboBox_Panels.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _ComboBox_Panels.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Main" })); _ComboBox_Panels.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { _ComboBox_PanelsActionPerformed(evt); } }); _FTF_PanelID.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory( new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0")))); _FTF_PanelID.setHorizontalAlignment(javax.swing.JTextField.CENTER); jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel2.setText("Panel Names"); jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel3.setText("Panel ID"); jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel4.setText("Panel Name"); _TF_PanelName.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _TF_PanelName.setHorizontalAlignment(javax.swing.JTextField.CENTER); _TF_PanelName.setText("Main"); _Button_Save.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _Button_Save.setText("Save & Next"); _Button_Save.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { _Button_SaveActionPerformed(evt); } }); _FTF_XPOS.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory( new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0")))); _FTF_XPOS.setHorizontalAlignment(javax.swing.JTextField.CENTER); jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel5.setText("X Position"); jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel7.setText("Y Position"); _FTF_YPOS.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory( new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0")))); _FTF_YPOS.setHorizontalAlignment(javax.swing.JTextField.CENTER); javax.swing.GroupLayout _Panel_LinkPanelLayout = new javax.swing.GroupLayout(_Panel_LinkPanel); _Panel_LinkPanel.setLayout(_Panel_LinkPanelLayout); _Panel_LinkPanelLayout.setHorizontalGroup(_Panel_LinkPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(_Panel_LinkPanelLayout.createSequentialGroup().addContainerGap() .addGroup(_Panel_LinkPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_ComboBox_Panels, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(_Panel_LinkPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(_Panel_LinkPanelLayout.createSequentialGroup() .addGroup(_Panel_LinkPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 64, Short.MAX_VALUE) .addComponent(_FTF_PanelID)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(_Panel_LinkPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(_TF_PanelName) .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE))) .addComponent(_Button_Save, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(_Panel_LinkPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(_Panel_LinkPanelLayout.createSequentialGroup() .addGroup(_Panel_LinkPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_FTF_XPOS, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(_Panel_LinkPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(_FTF_YPOS, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(_Button_GenerateLinks, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); _Panel_LinkPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] { _FTF_XPOS, _FTF_YPOS }); _Panel_LinkPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] { jLabel5, jLabel7 }); _Panel_LinkPanelLayout.setVerticalGroup(_Panel_LinkPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(_Panel_LinkPanelLayout.createSequentialGroup().addContainerGap() .addGroup(_Panel_LinkPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(_Panel_LinkPanelLayout.createSequentialGroup() .addGroup(_Panel_LinkPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(7, 7, 7) .addGroup(_Panel_LinkPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(_ComboBox_Panels, javax.swing.GroupLayout.DEFAULT_SIZE, 44, Short.MAX_VALUE) .addComponent(_FTF_PanelID).addComponent(_TF_PanelName))) .addGroup(_Panel_LinkPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(_Panel_LinkPanelLayout.createSequentialGroup().addGap(32, 32, 32) .addGroup(_Panel_LinkPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(_FTF_YPOS, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_FTF_XPOS, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(_Panel_LinkPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(_Button_Save, javax.swing.GroupLayout.DEFAULT_SIZE, 31, Short.MAX_VALUE) .addComponent(_Button_GenerateLinks, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); _Panel_LinkPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] { jLabel2, jLabel3, jLabel4, jLabel5, jLabel7 }); _Button_ClearCurrent.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _Button_ClearCurrent.setText("Clear Main Panel"); _Button_ClearCurrent.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { _Button_ClearCurrentActionPerformed(evt); } }); _Button_ClearAll.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _Button_ClearAll.setText("Clear All Panels"); _Button_ClearAll.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { _Button_ClearAllActionPerformed(evt); } }); _Button_AddCurrent.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _Button_AddCurrent.setText("Add Widgets Main Panel"); _Button_AddCurrent.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { _Button_AddCurrentActionPerformed(evt); } }); _Button_AddAll.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N _Button_AddAll.setText("Add Widgets All"); _Button_AddAll.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { _Button_AddAllActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(_Panel_WidgetParams, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addComponent(_Label_VarNames, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(_Button_ClearSelection, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(_ComboBox_Subgroup, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_ScrollPane_VariableNames, javax.swing.GroupLayout.PREFERRED_SIZE, 465, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(_Button_ClearCurrent, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(_Button_ClearAll, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(_Button_AddCurrent, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(_Button_AddAll, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(28, 28, 28) .addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(_Button_CreateImports, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(_Button_ClearLinks, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup().addGap(60, 60, 60) .addGroup(layout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(_Label_Loaded, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_Button_LoadXls, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGap(29, 29, 29)) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(_ComboBox_DisplayPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup() .addComponent(_Button_widgetPositions, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(_Label_VarsOnPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(0, 0, Short.MAX_VALUE)) .addComponent(_ScrollPane_Tree).addComponent(_ScrollPane_MasterMap) .addComponent(_Panel_LinkPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(27, 27, 27))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup().addGap(11, 11, 11) .addComponent(_Label_VarNames, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(5, 5, 5).addComponent(_ScrollPane_VariableNames, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(_Label_VarsOnPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(7, 7, 7)) .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(_Button_ClearSelection, javax.swing.GroupLayout.DEFAULT_SIZE, 29, Short.MAX_VALUE) .addComponent(_Button_widgetPositions, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))) .addComponent(_ScrollPane_MasterMap, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(6, 6, 6) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(_ComboBox_DisplayPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_ComboBox_Subgroup, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(_ScrollPane_Tree, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(_Panel_LinkPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(_Button_ClearCurrent, javax.swing.GroupLayout.DEFAULT_SIZE, 33, Short.MAX_VALUE) .addComponent(_Button_LoadXls, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(_Button_ClearAll).addComponent(_Label_Loaded, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(_Button_AddCurrent, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(_Button_AddAll).addGap(55, 55, 55)) .addGroup(layout.createSequentialGroup() .addGroup(layout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(_Button_CreateImports, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(_Button_ClearLinks, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 0, Short.MAX_VALUE)))) .addComponent(_Panel_WidgetParams, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] { _Button_AddAll, _Button_AddCurrent, _Button_ClearAll, _Button_ClearCurrent }); }
From source file:jmemorize.gui.swing.frames.MainFrame.java
private JPanel buildCategoryBar() { final JToolBar categoryToolbar = new JToolBar(); categoryToolbar.setFloatable(false); categoryToolbar.setMargin(new Insets(2, 2, 2, 2)); m_showTreeButton = new JButton(new ShowCategoryTreeAction()); m_showTreeButton.setPreferredSize(new Dimension(120, 21)); categoryToolbar.add(m_showTreeButton); final JLabel categoryLabel = new JLabel(Localization.get(LC.CATEGORY), SwingConstants.CENTER); categoryLabel.setPreferredSize(new Dimension(60, 15)); categoryToolbar.add(categoryLabel);//w ww.java 2s . c o m m_categoryBox = new CategoryComboBox(); m_categoryBox.setPreferredSize(new Dimension(24, 24)); m_categoryBox.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent evt) { categoryBoxActionPerformed(); } }); categoryToolbar.add(m_categoryBox); categoryToolbar.add(new JButton(new SplitMainFrameAction(this))); final JPanel categoryPanel = new JPanel(new BorderLayout()); categoryPanel.setBorder(new EtchedBorder()); categoryPanel.add(categoryToolbar, BorderLayout.NORTH); return categoryPanel; }
From source file:edu.ku.brc.specify.ui.AppBase.java
/** * Shows the About dialog.//from w w w. j av a2 s . co m */ public void doAbout() { AppContextMgr acm = AppContextMgr.getInstance(); boolean hasContext = acm.hasContext(); int baseNumRows = 9; String serverName = AppPreferences.getLocalPrefs().get("login.servers_selected", null); if (serverName != null) { baseNumRows++; } CellConstraints cc = new CellConstraints(); PanelBuilder infoPB = new PanelBuilder(new FormLayout("p,6px,f:p:g", "p,4px,p,4px," + UIHelper.createDuplicateJGoodiesDef("p", "2px", baseNumRows))); JLabel iconLabel = new JLabel(IconManager.getIcon("SpecifyLargeIcon"), SwingConstants.CENTER); //$NON-NLS-1$ PanelBuilder iconPB = new PanelBuilder(new FormLayout("p", "20px,t:p,f:p:g")); iconPB.add(iconLabel, cc.xy(1, 2)); if (hasContext) { DBTableIdMgr tableMgr = DBTableIdMgr.getInstance(); boolean hasReged = !RegisterSpecify.isAnonymous() && RegisterSpecify.hasInstitutionRegistered(); int y = 1; infoPB.addSeparator(getResourceString("Specify.SYS_INFO"), cc.xyw(1, y, 3)); y += 2; JLabel lbl = UIHelper.createLabel(databaseName); infoPB.add(UIHelper.createI18NFormLabel("Specify.DB"), cc.xy(1, y)); infoPB.add(lbl, cc.xy(3, y)); y += 2; lbl.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { openLocalPrefs(); } } }); infoPB.add(UIHelper.createFormLabel(tableMgr.getTitleForId(Institution.getClassTableId())), cc.xy(1, y)); infoPB.add(lbl = UIHelper.createLabel(acm.getClassObject(Institution.class).getName()), cc.xy(3, y)); y += 2; lbl.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { openRemotePrefs(); } } }); infoPB.add(UIHelper.createFormLabel(tableMgr.getTitleForId(Division.getClassTableId())), cc.xy(1, y)); infoPB.add(UIHelper.createLabel(acm.getClassObject(Division.class).getName()), cc.xy(3, y)); y += 2; infoPB.add(UIHelper.createFormLabel(tableMgr.getTitleForId(Discipline.getClassTableId())), cc.xy(1, y)); infoPB.add(UIHelper.createLabel(acm.getClassObject(Discipline.class).getName()), cc.xy(3, y)); y += 2; infoPB.add(UIHelper.createFormLabel(tableMgr.getTitleForId(Collection.getClassTableId())), cc.xy(1, y)); infoPB.add(UIHelper.createLabel(acm.getClassObject(Collection.class).getCollectionName()), cc.xy(3, y)); y += 2; infoPB.add(UIHelper.createI18NFormLabel("Specify.BLD"), cc.xy(1, y)); infoPB.add(UIHelper.createLabel(appBuildVersion), cc.xy(3, y)); y += 2; infoPB.add(UIHelper.createI18NFormLabel("Specify.REG"), cc.xy(1, y)); infoPB.add(UIHelper.createI18NLabel(hasReged ? "Specify.HASREG" : "Specify.NOTREG"), cc.xy(3, y)); y += 2; String isaNumber = RegisterSpecify.getISANumber(); infoPB.add(UIHelper.createI18NFormLabel("Specify.ISANUM"), cc.xy(1, y)); infoPB.add(UIHelper.createLabel(StringUtils.isNotEmpty(isaNumber) ? isaNumber : ""), cc.xy(3, y)); y += 2; if (serverName != null) { infoPB.add(UIHelper.createI18NFormLabel("Specify.SERVER"), cc.xy(1, y)); infoPB.add(UIHelper.createLabel(StringUtils.isNotEmpty(serverName) ? serverName : ""), cc.xy(3, y)); y += 2; } if (StringUtils.contains(DBConnection.getInstance().getConnectionStr(), "mysql")) { Vector<Object[]> list = BasicSQLUtils.query("select version() as ve"); if (list != null && list.size() > 0) { infoPB.add(UIHelper.createFormLabel("MySQL Version"), cc.xy(1, y)); infoPB.add(UIHelper.createLabel(list.get(0)[0].toString()), cc.xy(3, y)); y += 2; } } infoPB.add(UIHelper.createFormLabel("Java Version"), cc.xy(1, y)); infoPB.add(UIHelper.createLabel(System.getProperty("java.version")), cc.xy(3, y)); y += 2; } String txt = getAboutText(appName, appVersion); JLabel txtLbl = createLabel(txt); txtLbl.setFont(UIRegistry.getDefaultFont()); final JEditorPane txtPane = new JEditorPane("text/html", txt); txtPane.setEditable(false); txtPane.setBackground(new JPanel().getBackground()); PanelBuilder pb = new PanelBuilder(new FormLayout("p,20px,f:min(400px;p):g,10px,8px,10px,p:g", "f:p:g")); pb.add(iconPB.getPanel(), cc.xy(1, 1)); pb.add(txtPane, cc.xy(3, 1)); Color bg = getBackground(); if (hasContext) { pb.add(new VerticalSeparator(bg.darker(), bg.brighter()), cc.xy(5, 1)); pb.add(infoPB.getPanel(), cc.xy(7, 1)); } pb.setDefaultDialogBorder(); String title = getResourceString("Specify.ABOUT");//$NON-NLS-1$ CustomDialog aboutDlg = new CustomDialog(topFrame, title + " " + appName, true, CustomDialog.OK_BTN, //$NON-NLS-1$ pb.getPanel()); String okLabel = getResourceString("Specify.CLOSE");//$NON-NLS-1$ aboutDlg.setOkLabel(okLabel); aboutDlg.createUI(); aboutDlg.pack(); // for some strange reason I can't get the dialog to size itself correctly Dimension size = aboutDlg.getSize(); size.height += 120; aboutDlg.setSize(size); txtPane.addHyperlinkListener(new HyperlinkListener() { public void hyperlinkUpdate(HyperlinkEvent event) { if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { try { AttachmentUtils.openURI(event.getURL().toURI()); } catch (Exception e) { edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); } } } }); UIHelper.centerAndShow(aboutDlg); }
From source file:com.att.aro.main.GraphPanel.java
/** * Initializes a new instance of the GraphPanel class. */// www . j av a 2 s .c o m 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.WIFI, new GraphPanelPlotLabels(rb.getString("chart.wifi"), createBarPlot(Color.gray), 1)); 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()); }