@Override public void drawActivations() { if (!isVisible() || (activations == null)) { return; } checkActivationsFrame(); if (imageDisplay == null) { JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); imageDisplay = ImageDisplay.createOpenGLCanvas(); imageDisplay.setBorderSpacePixels(0); imageDisplay.setImageSize(dimx, dimy); imageDisplay.setSize(200, 200); panel.add(imageDisplay); activationsFrame.getContentPane().add(panel); activationsFrame.pack(); } for (int x = 0; x < dimx; x++) { for (int y = 0; y < dimy; y++) { imageDisplay.setPixmapGray(x ,dimx - y - 1, (a(0, x, y))); // try to fit mean 0 std 1 into 0-1 range nicely by offset and gain of .5 } } imageDisplay.repaint(); }
public ResultViewPanel(SearchTask searchTask) { setLayout(resultViewCards = new CardLayout()); this.searchComposition = searchTask.getComposition(); this.searchTask = searchTask; SearchResultsDisplayer<?> displayer = searchComposition.getSearchResultsDisplayer(); setName(displayer.getTitle()); displayer.setInfoNode(this.createListener().getInfoNode()); resultsPanel = new JPanel(); resultsPanel.setLayout( new BoxLayout(resultsPanel, BoxLayout.PAGE_AXIS)); SearchResultsDisplayer<?> disp = searchComposition.getSearchResultsDisplayer(); visualComponent = disp.getVisualComponent(); lookup = (visualComponent instanceof Lookup.Provider) ? ((Lookup.Provider) visualComponent).getLookup() : Lookup.EMPTY; resultsPanel.add(visualComponent); add(resultsPanel, CARD_NAME_RESULTS); showInfo(UiUtils.getText("TEXT_WAITING_FOR_PREVIOUS")); //NOI18N }
public ExperimentalOptions(PreferencesFrame window) { super(window); accel = new PrefOptionList(AppPreferences.GRAPHICS_ACCELERATION, Strings.getter("accelLabel"), new PrefOption[] { new PrefOption(AppPreferences.ACCEL_DEFAULT, Strings.getter("accelDefault")), new PrefOption(AppPreferences.ACCEL_NONE, Strings.getter("accelNone")), new PrefOption(AppPreferences.ACCEL_OPENGL, Strings.getter("accelOpenGL")), new PrefOption(AppPreferences.ACCEL_D3D, Strings.getter("accelD3D")), }); JPanel accelPanel = new JPanel(new BorderLayout()); accelPanel.add(accel.getJLabel(), BorderLayout.LINE_START); accelPanel.add(accel.getJComboBox(), BorderLayout.CENTER); JPanel accelPanel2 = new JPanel(); accelPanel2.add(accelPanel); setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS)); add(Box.createGlue()); add(accelPanel2); add(Box.createGlue()); }
public void setOrientation(Object value) { int axis; String position; if (value == HORIZONTAL) { axis = BoxLayout.X_AXIS; position = BorderLayout.LINE_START; } else if (value == VERTICAL) { axis = BoxLayout.Y_AXIS; position = BorderLayout.NORTH; } else { throw new IllegalArgumentException(); } this.remove(subpanel); subpanel.setLayout(new BoxLayout(subpanel, axis)); this.add(subpanel, position); this.orientation = value; }
private void buildAttrEditorPanel() { attrEditorPanel.setLayout(new BorderLayout()); attrEditorPanel.setBorder(BorderFactory.createTitledBorder(NEW_ATTR_TITLE)); JPanel namePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); namePanel.add(new JLabel("Name: ")); namePanel.add(newAttrName); JPanel typePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); typePanel.add(new JLabel("Type: ")); typePanel.add(newAttrType); JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); mainPanel.add(namePanel); mainPanel.add(typePanel); JPanel buttonsPanel = new JPanel(); buttonsPanel.add(addAttrButton); attrEditorPanel.add(mainPanel, BorderLayout.CENTER); attrEditorPanel.add(buttonsPanel, BorderLayout.SOUTH); addAttrButton.addActionListener(new AddAttrListener()); newAttrName.addActionListener(new AddAttrListener()); }
@Override public void run() { frame = new JFrame(); frame.setTitle("Results - jOthelloT"); panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS)); JScrollPane mainScroll = new JScrollPane(panel); mainScroll.getVerticalScrollBar().setUnitIncrement(16); mainScroll.setPreferredSize(new Dimension(800, 600)); frame.getContentPane().add(mainScroll, BorderLayout.CENTER); JButton button = new JButton("Save"); button.addActionListener((ActionEvent e) -> { saveResults(othelloChampionship.getBtResult(), othelloChampionship.getPartialResults(),othelloChampionship.getlistQualifying()); }); frame.getContentPane().add(button, BorderLayout.SOUTH); frame.pack(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); }
protected JPanel getObject() { Box vBox = Box.createVerticalBox(); vBox.add(new JButton("button")); vBox.add(Box.createVerticalStrut(10)); vBox.add(new JLabel("label")); vBox.add(Box.createVerticalGlue()); vBox.add(new JButton("button")); vBox.add(Box.createVerticalStrut(10)); vBox.add(new JLabel("label")); Box hBox = Box.createHorizontalBox(); hBox.add(new JButton("button")); hBox.add(Box.createHorizontalStrut(10)); hBox.add(new JLabel("label")); hBox.add(Box.createHorizontalGlue()); hBox.add(new JButton("button")); hBox.add(Box.createHorizontalStrut(10)); hBox.add(new JLabel("label")); JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); panel.add(vBox); panel.add(Box.createGlue()); panel.add(hBox); return panel; }
MainToolBar(@NonNull final Pair<JComponent,GridBagConstraints>... components) { super(BoxLayout.X_AXIS); setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 5)); final JToolBar toolbar = new NoBorderToolBar(JToolBar.HORIZONTAL); toolbar.setFloatable(false); toolbar.setRollover(true); toolbar.setBorderPainted(false); toolbar.setBorder(BorderFactory.createEmptyBorder()); toolbar.setOpaque(false); toolbar.setFocusable(false); toolbar.setLayout(new GridBagLayout()); for (Pair<JComponent,GridBagConstraints> p : components) { toolbar.add(p.first(),p.second()); } add (toolbar); }
private JComponent createTopPane() { inputField = new JTextField(40); inputField.addActionListener( (e) -> sendMessage() ); inputField.setMaximumSize( inputField.getPreferredSize() ); JButton sendButton = new JButton( getLocalizedComponentText("sendButton") ); sendButton.addActionListener( (e) -> sendMessage() ); JPanel pane = new JPanel(); pane.setLayout( new BoxLayout(pane, BoxLayout.LINE_AXIS) ); crSwitch = new JToggleButton("CR", true); lfSwitch = new JToggleButton("LF", true); pane.add( inputField ); pane.add( Box.createRigidArea( new Dimension(5, 0) ) ); pane.add( sendButton ); pane.add( Box.createGlue() ); pane.add( crSwitch ); pane.add( Box.createRigidArea( new Dimension(5, 0) ) ); pane.add( lfSwitch ); pane.setBorder( BorderFactory.createEmptyBorder(3, 3, 3, 0) ); return pane; }
protected void init(JLabel[] labels, Component[] components) { // Lay out the buttons from left to right. JPanel buttonPane = new JPanel(); buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS)); buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); buttonPane.add(Box.createHorizontalGlue()); buttonPane.add(cancelButton); buttonPane.add(Box.createRigidArea(new Dimension(10, 0))); buttonPane.add(okButton); // Put everything together, using the content pane's BorderLayout. Container contentPane = getContentPane(); contentPane.add(setupTextFields(labels, components), BorderLayout.CENTER); contentPane.add(buttonPane, BorderLayout.PAGE_END); pack(); setLocationRelativeTo(frameComp); setVisible(true); }
/** * @return */ final private JPanel getSoundsJPanel() { final JPanel objLsoundsJCheckBoxesJPanel = new JPanel(new GridBagLayout()); objLsoundsJCheckBoxesJPanel.setOpaque(true); final ExtendedGridBagConstraints objLjCheckBoxesExtendedGridBagConstraints = new ExtendedGridBagConstraints(GridBagConstraints.RELATIVE, 0); objLsoundsJCheckBoxesJPanel.add(this.objGbooleanLocalJCheckBoxA[PreferencesJDialog.bytS_BOOLEAN_LOCAL_PREFERENCE_SOUNDS]); final JPanel objLsoundsJCheckBoxJPanel = new JPanel(); objLsoundsJCheckBoxJPanel.setLayout(new BoxLayout(objLsoundsJCheckBoxJPanel, BoxLayout.LINE_AXIS)); objLsoundsJCheckBoxJPanel.add(this.objGbooleanLocalJLabelA[PreferencesJDialog.bytS_BOOLEAN_LOCAL_PREFERENCE_SOUNDS]); objLsoundsJCheckBoxJPanel.add(new JLabel(" :")); objLsoundsJCheckBoxesJPanel.add(objLsoundsJCheckBoxJPanel, objLjCheckBoxesExtendedGridBagConstraints); byte bytLposY = 1; for (final byte bytLbooleanLocalIndex : new byte[] { PreferencesJDialog.bytS_BOOLEAN_LOCAL_PREFERENCE_CATCH_SOUNDS, PreferencesJDialog.bytS_BOOLEAN_LOCAL_PREFERENCE_THROW_SOUNDS, PreferencesJDialog.bytS_BOOLEAN_LOCAL_PREFERENCE_METRONOME }) { final JPanel objLjPanel = new JPanel(); objLjPanel.setLayout(new BoxLayout(objLjPanel, BoxLayout.LINE_AXIS)); objLjPanel.add(this.objGbooleanLocalJCheckBoxA[bytLbooleanLocalIndex]); objLjPanel.add(this.objGbooleanLocalJLabelA[bytLbooleanLocalIndex]); this.setSoundsJLabelsEnabled(); objLjCheckBoxesExtendedGridBagConstraints.setGridLocation(1, bytLposY++); objLsoundsJCheckBoxesJPanel.add(objLjPanel, objLjCheckBoxesExtendedGridBagConstraints); } return objLsoundsJCheckBoxesJPanel; }
public MainView() { super("CormagBot (TwitchChatBot)"); this.essentials = new ScreenEssentials(); this.setLayout(new BoxLayout(this.getContentPane(), BoxLayout.X_AXIS)); this.setVisible(true); this.setResizable(false); this.setPreferredSize(this.essentials.getFrameSize()); this.setLocation(this.essentials.getFrameLocation()); managePanels(); manageTextFields(); manageButtons(); addComponents(); pack(); }
public TablePanel(Table aTable) { table = aTable; innerPanel = new JPanel(); add(innerPanel); // Adding the panel's border padding setLayout(new FlowLayout(FlowLayout.LEFT)); innerPanel.setLayout(new BoxLayout(innerPanel, BoxLayout.Y_AXIS)); innerPanel.setBorder(BorderFactory.createEmptyBorder(NEW_TABLE_PANEL_TOP_PADDING, NEW_TABLE_PANEL_LEFT_PADDING, NEW_TABLE_PANEL_BOTTOM_PADDING, NEW_TABLE_PANEL_RIGHT_PADDING)); // Fill the panel with the attributes info addAttributes(); // Common settings setBackground(BACKGROUND_COLOR); innerPanel.setBackground(BACKGROUND_COLOR); }
@Override public void setup(String title, int total) { JPanel all = new JPanel(); all.setLayout(new BoxLayout(all, BoxLayout.Y_AXIS)); all.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); all.add(createHeader()); all.add(Box.createRigidArea(new Dimension(0, 10))); all.add(createWholeProgress(total)); all.add(Box.createRigidArea(new Dimension(0, 10))); all.add(createCurrentProgress()); all.add(Box.createRigidArea(new Dimension(0, 10))); all.add(createMessageArea()); all.add(Box.createRigidArea(new Dimension(0, 10))); all.add(createButtons()); getContentPane().add(all); setTitle(title); setSize(500, 500); setDefaultCloseOperation(EXIT_ON_CLOSE); ComponentHelper.centreOnScreen(this); setVisible(true); }
/** * Like createPane, but creates a pane with 2 columns of radio buttons. The * number of buttons passed in *must* be even. */ private JPanel create2ColPane(String description, JRadioButton[] radioButtons, JButton showButton) { JLabel label = new JLabel(description); int numPerColumn = radioButtons.length / 2; JPanel grid = new JPanel(new GridLayout(0, 2)); for (int i = 0; i < numPerColumn; i++) { grid.add(radioButtons[i]); grid.add(radioButtons[i + numPerColumn]); } JPanel box = new JPanel(); box.setLayout(new BoxLayout(box, BoxLayout.PAGE_AXIS)); box.add(label); grid.setAlignmentX(0.0f); box.add(grid); JPanel pane = new JPanel(new BorderLayout()); pane.add(box, BorderLayout.PAGE_START); pane.add(showButton, BorderLayout.PAGE_END); return pane; }
private JPanel createTableCSVArea() { JPanel paneCSV = new JPanel(); paneCSV.setLayout(new BoxLayout(paneCSV, BoxLayout.X_AXIS)); paneCSV.setBorder(BorderFactory.createLineBorder(Color.GRAY)); paneCSV.add(m_checkLinkCsv); paneCSV.add(m_txtLinkCsvPath); m_txtLinkCsvPath.setEditable(false); paneCSV.setBounds(m_scrollTblName.getWidth() + GuiConstants.GAP_COMPONENT, m_nYOffsetInRightPane, s_nRightPaneWidth, s_nOneRowPaneHeight); m_nYOffsetInRightPane += (s_nOneRowPaneHeight + GuiConstants.GAP_COMPONENT); return paneCSV; }
public InitPage(Menu crMenu) { this.crMenu = crMenu; setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JButton newPetriButton = new JButton("New Petri Net"); JButton newCrButton = new JButton("New CR Graph"); newCrButton.addActionListener(this); newCrButton.setActionCommand("new_cr"); newCrButton.setAlignmentX(Component.CENTER_ALIGNMENT); newPetriButton.addActionListener(this); newPetriButton.setActionCommand("new_petri"); newPetriButton.setAlignmentX(Component.CENTER_ALIGNMENT); JLabel statusLabel = new JLabel("Please create a new graph"); statusLabel.setAlignmentX(Component.CENTER_ALIGNMENT); // statusLabel.setLocation(150, 150); add(statusLabel); add(newCrButton); add(newPetriButton); }
/** * Initialise le panneau du bouton de validation */ private void initPanneauBoutonValidation(){ this.setPanneauBoutousValidation(new JPanel()); this.getPanneauBoutousValidation().setLayout(new BoxLayout(this.getPanneauBoutousValidation(), BoxLayout.LINE_AXIS)); this.getPanneauBoutousValidation().setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); this.setBoutonValider(new JButton("Valider")); this.setBoutonAnnule(new JButton("Annuler")); this.getPanneauBoutousValidation().add(this.getBoutonValider()); this.getPanneauBoutousValidation().add(Box.createRigidArea(new Dimension(10, 0))); this.getPanneauBoutousValidation().add(this.getBoutonAnnule()); this.getPanneauBoutousValidation().add(Box.createHorizontalGlue()); this.getContentPane().add(this.getPanneauBoutousValidation()); this.getPanneauBoutousValidation().setVisible(true); }
@Override public void displayExportFile() { JTextField displayVal = new JTextField(filename); displayVal.setEditable(false); JPanel displayPanel = new JPanel(); displayPanel.setLayout(new BoxLayout(displayPanel, BoxLayout.Y_AXIS)); //vertically align displayPanel.add(new JLabel("Export Filename")); displayPanel.add(displayVal); displayPanel.setPreferredSize(new Dimension(400,40)); //resize appropriately final int displayDialog = JOptionPane.showConfirmDialog(null, displayPanel, friendlyName() + " Display", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); if (displayDialog == JOptionPane.OK_OPTION) { //do nothing } }
private JPanel createTitlePanel() { JPanel title = new JPanel(new BorderLayout()); title.add(Guitilities.createGradientTitle(getTranslation("components.title")), BorderLayout.NORTH); JPanel interact = new JPanel(); interact.setBackground(UIManager.getColor(Guitilities.SUB_PANEL_BACKGROUND)); interact.setLayout(new BoxLayout(interact, BoxLayout.X_AXIS)); interact.setBorder(new CompoundBorder(Guitilities.CHISEL_BORDER, new EmptyBorder(12, 8, 12, 8))); final JCheckBox checkImages = new JCheckBox(getTranslation("group.images"), true); checkImages.setBackground(UIManager.getColor(Guitilities.SUB_PANEL_BACKGROUND)); checkImages.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent event) { for(ComponentButton button:componentButtons) button.setIconVisible(checkImages.isSelected()); for(CollapsiblePanel panel:collapsiblePanels) panel.setExpanded(false); } }); interact.add(checkImages); title.add(interact, BorderLayout.CENTER); return title; }
public QueryFileChooser( String name, String defaultName, URI base, File startingDirectory, Color background) { super(BoxLayout.X_AXIS); _base = base; _startingDirectory = startingDirectory; _entryBox = new JTextField(defaultName, _width); _entryBox.setBackground(background); JButton button = new JButton("Browse"); button.addActionListener(this); add(_entryBox); add(button); // Add the listener last so that there is no notification // of the first value. _entryBox.addActionListener(new QueryActionListener(name)); // Add a listener for loss of focus. When the entry gains // and then loses focus, listeners are notified of an update, // but only if the value has changed since the last notification. // FIXME: Unfortunately, Java calls this listener some random // time after the window has been closed. It is not even a // a queued event when the window is closed. Thus, we have // a subtle bug where if you enter a value in a line, do not // hit return, and then click on the X to close the window, // the value is restored to the original, and then sometime // later, the focus is lost and the entered value becomes // the value of the parameter. I don't know of any workaround. _entryBox.addFocusListener(new QueryFocusListener(name)); _name = name; }
private void initRightPanel() { JPanel tempPanel = new JPanel(); tempPanel.setBackground(Color.BLACK); tempPanel.setLayout(new BoxLayout(tempPanel, BoxLayout.Y_AXIS)); tempPanel.add(getStylizedLabel("- - - - - - - - - - - - - - - -")); tempPanel.add(getStylizedTitleLabel(" GENERAL STATS")); tempPanel.add(getStylizedLabel("- - - - - - - - - - - - - - - -")); tempPanel.add(scoreLabel); tempPanel.add(highScoreLabel); tempPanel.add(elapsedTimeLabel); tempPanel.add(new JLabel(".")); tempPanel.add(getStylizedLabel("- - - - - - - - - - - - - - - -")); tempPanel.add(getStylizedTitleLabel(" MOVEMENT CONTROLS")); tempPanel.add(getStylizedLabel("- - - - - - - - - - - - - - - -")); tempPanel.add(getStylizedLabel("\tMove up - Up Arrow")); tempPanel.add(getStylizedLabel("\tMove down - Down Arrow")); tempPanel.add(getStylizedLabel("\tMove left - Left Arrow")); tempPanel.add(getStylizedLabel("\tMove right - Right Arrow")); tempPanel.add(new JLabel(".")); tempPanel.add(getStylizedLabel("- - - - - - - - - - - - - - - -")); tempPanel.add(getStylizedTitleLabel(" OTHER CONTROLS")); tempPanel.add(getStylizedLabel("- - - - - - - - - - - - - - - -")); tempPanel.add(getStylizedLabel("Pause/Resume - Escape")); tempPanel.add(getStylizedLabel("New Game - N")); tempPanel.add(getStylizedLabel("Sound ON/OFF - S")); tempPanel.add(getStylizedLabel("Reset Highscore - C")); tempPanel.add(getStylizedLabel("")); rightPanel.setBackground(Color.BLACK); rightPanel.setLayout(new GridBagLayout()); GridBagConstraints constraints = new GridBagConstraints(); rightPanel.add(tempPanel, constraints); }
private void initializePanel(int lidx, int aidx) { this.setTitle(String.format("Area View: Level %02X, Area %02X", lidx, aidx)); getContentPane().removeAll(); JPanel panel = new TestPanel(levels[lidx].areas[aidx]); panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); panel.add(Box.createRigidArea(new Dimension(levels[lidx].areas[aidx].width * 16 * SCALE, levels[lidx].areas[aidx].height * 16 * SCALE))); add(panel); pack(); }
private void initializePanel(int idx) { this.setTitle(String.format("Map16 View: Level %02X", idx)); getContentPane().removeAll(); JPanel panel = new TestPanel(map16arr[mapIdx]); panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); panel.add(Box.createRigidArea(new Dimension(TILE_COUNT_X * 16 * SCALE, TILE_COUNT_Y * 16 * SCALE))); add(panel); pack(); }
private void initializePanel(int idx) { this.setTitle(String.format("8x8 Tile View: Level %02X", idx)); setPalette(palIdx); getContentPane().removeAll(); JPanel panel = new TestPanel(tilesArr[idx]); panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); panel.add(Box.createRigidArea(new Dimension(TILE_COUNT_X * 8 * SCALE, TILE_COUNT_Y * 8 * SCALE))); add(panel); pack(); }
/** * Creates the editor for the MultiFile input * * @return Component */ private Component buildMultiFile() { Panel panel = new Panel(); panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); panel.setLayout(new BorderLayout()); Panel psup = new Panel(); psup.setLayout(new BoxLayout(psup, BoxLayout.X_AXIS)); psup.put(Inputs.text().enabled(false).preferredSize(100, 22).id("multiFileName")); psup.put(Buttons.create().focusable(false).icon(IconFactory.get().create("fa:folder-open")).onClick((evt) -> { FileChooserFactory.openImages().accept((filesSelected) -> { input = new MultiFileInput(filesSelected, 0); fireValueChanged(); }); })); psup.put(Buttons.create().focusable(false).icon(IconFactory.get().create("fa:chevron-down")).onClick((evt) -> { JPopupMenu menu = new JPopupMenu(); for (File file : VISNode.get().getModel().getUserPreferences().getRecentInput()) { JMenuItem item = new JMenuItem(file.getAbsolutePath()); item.addActionListener((e) -> { input = new MultiFileInput(file); fireValueChanged(); }); menu.add(item); } menu.show(evt.getComponent(), evt.getPoint().x, evt.getPoint().y); })); panel.add(psup); panel.add(buidSlider(), BorderLayout.SOUTH); SwingUtilities.invokeLater(() -> updateMultifileFields((MultiFileInput) input)); return panel; }
/** * Builds the tool information * * @return JComponent */ private JComponent buildInfo() { JPanel info = new JPanel(); info.setLayout(new BoxLayout(info, BoxLayout.Y_AXIS)); JLabel title = new JLabel("VISNode"); title.setFont(new Font("Segoe UI", Font.PLAIN, 32)); JLabel version = new JLabel(VERSION); version.setBackground(Color.red); // github = new JButton(); // github.setIcon(IconFactory.get().create("fa:github")); // github.setText(GITHUB_URL); // github.setBorder(BorderFactory.createEmptyBorder()); // github.setBorderPainted(false); // github.setContentAreaFilled(false); // github.setFocusPainted(false); // github.setOpaque(false); info.add(title); info.add(version); info.add(Labels.create(GITHUB_URL).icon(IconFactory.get().create("fa:github")).onClick((ev) -> { try { Desktop.getDesktop().browse(new URL(GITHUB_URL).toURI()); } catch (IOException | URISyntaxException e) { ExceptionHandler.get().handle(e); } })); return info; }
/** * Initializes the interface */ private void initGui() { setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(buildImage()); updateImage(); addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() % 2 == 0) { ImageViewerPanel.showDialog(value); } } }); }
PresenterProxy(SearchProvider searchProvider, Presenter presenter) { this.searchProvider = searchProvider; this.presenter = presenter; this.panel = new JPanel(); this.panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS)); this.panel.setName(getTitle()); if (presenter != null) { initUI(); } }
/** Creates a new instance of IPotGUIControl */ public SimpleVPotGUIControl(final VPot pot) { setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); setAlignmentX(Component.LEFT_ALIGNMENT); generalControls = new PotGUIControl(pot); sliderTextControl = new SimpleVPotSliderTextControl(pot); generalControls.getSliderAndValuePanel().add(sliderTextControl); add(generalControls); revalidate(); }
/** Add a source controller that changes the packet source streams upon selection */ public SourceControl(final ArrayList<PacketStream> sources, final ProcessingNetwork.Node f, final String name, final int sourceIndex) { super(); filter = f; setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); setAlignmentX(LEFT_ALIGNMENT); final JLabel label = new JLabel(name); label.setAlignmentX(LEFT_ALIGNMENT); label.setFont(label.getFont().deriveFont(fontSize)); // addTip(f, label); add(label); String[] names=new String[sources.size()]; for (int i=0; i<sources.size();i++) names[i]=sources.get(i).getName(); control = new JComboBox(names); control.setFont(control.getFont().deriveFont(fontSize)); // control.setHorizontalAlignment(SwingConstants.LEADING); control.addActionListener(new ActionListener(){ @Override public void actionPerformed(ActionEvent e) { try { node.setSource(sourceIndex, sources.get(control.getSelectedIndex())); } catch (Exception ex) { node.setEnabled(false); Logger.getLogger(MultiInputPanel.class.getName()).log(Level.SEVERE, "Source index higher than number of sources", ex); } } }); add(label); add(control); }
private void establishGuiTree() { JPanel pane_north = new JPanel(); this.add(pane_north, BorderLayout.NORTH); pane_north.setLayout(new BoxLayout(pane_north, BoxLayout.Y_AXIS)); JPanel pane_srcFolder = new JPanel(); JPanel pane_packageName = new JPanel(); JPanel pane_workloadName = new JPanel(); pane_north.add(pane_srcFolder); pane_north.add(pane_packageName); pane_north.add(pane_workloadName); pane_srcFolder.setLayout(new FlowLayout()); pane_srcFolder.add(m_lblSrcFolder); pane_srcFolder.add(m_txtSrcFolder); pane_srcFolder.add(m_btChooseSrcFolder); pane_packageName.setLayout(new FlowLayout()); pane_packageName.add(m_lblPackName); pane_packageName.add(m_txtPackName); pane_workloadName.setLayout(new FlowLayout()); pane_workloadName.add(m_lblBenchmarkName); pane_workloadName.add(m_txtBenchmarkName); }
@Override public JComponent makeGUIControl() { final JPanel pan = new JPanel(); pan.setAlignmentX(Component.LEFT_ALIGNMENT); pan.setLayout(new BoxLayout(pan, BoxLayout.X_AXIS)); final JLabel label = new JLabel(getName()); label.setToolTipText( "<html>" + toString() + "<br>" + getDescription() + "<br>Enter value or use mouse wheel or arrow keys to change value."); pan.add(label); final JTextField tf = new JTextField(); tf.setText(Integer.toString(get())); tf.setPreferredSize(prefDimensions); tf.setMaximumSize(maxDimensions); SPIConfigIntActions actionListeners = new SPIConfigIntActions(this); tf.addActionListener(actionListeners); tf.addFocusListener(actionListeners); tf.addKeyListener(actionListeners); tf.addMouseWheelListener(actionListeners); pan.add(tf); setControl(tf); addObserver(biasgen); // This observer is responsible for sending data to hardware addObserver(this); // This observer is responsible for GUI update. It calls the updateControl() method return pan; }
private static JPanel makeRow(Object... cc) { JPanel p1 = new JPanel(); p1.setLayout(new BoxLayout(p1, BoxLayout.LINE_AXIS)); for (int i = 0; i < cc.length; i++) { if (i > 0) p1.add(Box.createHorizontalStrut(HGAP)); if (cc[i] instanceof Component) p1.add((Component)cc[i]); else p1.add(new JLabel(cc[i].toString())); } JPanel p2 = new JPanel(new BorderLayout()); p2.add(p1, BorderLayout.LINE_START); return p2; }
/** * 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. */ private void initComponents() { onchipBiasgenPanel = new JPanel(); onchipBiasgenPanel.setLayout(new BoxLayout(onchipBiasgenPanel, BoxLayout.Y_AXIS)); onchipBiasgenPanel.setAlignmentX(LEFT_ALIGNMENT); addTab("On-chip biases (biasgen)", (onchipBiasgenPanel)); offchipDACPanel = new JPanel(); offchipDACPanel.setLayout(new BoxLayout(offchipDACPanel, BoxLayout.Y_AXIS)); addTab("Off-chip biases (DAC)", (offchipDACPanel)); channelPanel = new JPanel(); channelPanel.setLayout(new BoxLayout(channelPanel, BoxLayout.Y_AXIS)); addTab("Channels", (channelPanel)); scannerPanel = new JPanel(); scannerPanel.setLayout(new BoxLayout(scannerPanel, BoxLayout.Y_AXIS)); addTab("Scanner Config", (scannerPanel)); aerPanel = new JPanel(); aerPanel.setLayout(new BoxLayout(aerPanel, BoxLayout.Y_AXIS)); addTab("AER Config", (aerPanel)); adcPanel = new JPanel(); adcPanel.setLayout(new BoxLayout(adcPanel, BoxLayout.Y_AXIS)); addTab("ADC", (adcPanel)); chipDiagPanel = new JPanel(); chipDiagPanel.setAlignmentX(LEFT_ALIGNMENT); chipDiagPanel.setLayout(new BoxLayout(chipDiagPanel, BoxLayout.Y_AXIS)); addTab("Chip Diag Config", (chipDiagPanel)); }
/** Not public, instances created using factory method createPanel */ FiltersComponent(FiltersDescription descr) { super(BoxLayout.X_AXIS); this.filtersDesc = descr; // always create swing content in AWT thread if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(new Runnable () { public void run () { initPanel(); } }); } else { initPanel(); } }
ExpandableMessage(String topMsgKey, Collection<String> messages, String bottomMsgKey, JButton toggleButton) { super(null); this.messages = messages; this.toggleButton = toggleButton; lblTopMsg = new JLabel(getMessage(topMsgKey)); lblBotMsg = (bottomMsgKey != null) ? new JLabel(getMessage(bottomMsgKey)) : null; setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS)); add(lblTopMsg); lblTopMsg.setAlignmentX(LEFT_ALIGNMENT); if (lblBotMsg != null) { add(makeVerticalStrut(lblTopMsg, lblBotMsg)); add(lblBotMsg); lblBotMsg.setAlignmentX(LEFT_ALIGNMENT); } Mnemonics.setLocalizedText(toggleButton, getMessage("LBL_ShowMoreInformation")); //NOI18N toggleButton.addActionListener(this); }
/** * Creates a button editor for a given explore key. */ public CheckBoxEditor(ExploreConfigDialog dialog, ExploreKey key, String title) { this.dialog = dialog; this.key = key; setBorder(BorderFactory.createTitledBorder(title)); setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); add(createCheckBoxPanel()); add(Box.createGlue()); setMaximumSize(new Dimension(getMaximumSize().width, getPreferredSize().height)); dialog.addRefreshable(this); }
public TextNotification() { m_fromLabel = new JLabel(); m_titleLabel = new JLabel(); m_titleLabel.addMouseListener(new NotificationMouseAdapter(m_titleLabel)); m_subtitleArea = new JTextArea(); m_subtitleArea.addMouseListener(new NotificationMouseAdapter(m_titleLabel)); JPanel panelHeader = new JPanel(); panelHeader.setLayout(new BoxLayout(panelHeader, BoxLayout.PAGE_AXIS)); JButton dimissButton = new JButton(); dimissButton.setText("X"); final TextNotification me = this; dimissButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { // TODO Auto-generated method stub me.removeFromManager(); } }); dimissButton.setOpaque(false); dimissButton.setContentAreaFilled(false); dimissButton.setBorderPainted(false); dimissButton.setBounds((int) (this.getWidth() - dimissButton.getPreferredSize().getWidth()), 0, (int) dimissButton.getPreferredSize().getWidth(), (int) dimissButton.getPreferredSize().getHeight()); m_panel.add(dimissButton); panelHeader.add(m_fromLabel); panelHeader.add(m_titleLabel); this.addComponent(panelHeader, BorderLayout.NORTH); this.addComponent(m_subtitleArea, BorderLayout.CENTER); }
public JPanel createPaneH(JComponent pane1, JComponent pane2 ) { JPanel pane = new JPanel(); pane.setLayout(new BoxLayout(pane, BoxLayout.X_AXIS)); pane1.setAlignmentY(Component.LEFT_ALIGNMENT); pane2.setAlignmentY(Component.LEFT_ALIGNMENT); pane.add(pane1); pane.add(pane2); return pane; }