微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

javax.swing.BoxLayout的实例源码

项目:jaer    文件DeepLearnCnnNetwork_HJ.java   
@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();
}
项目:incubator-netbeans    文件ResultViewPanel.java   
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
}
项目:Logisim    文件ExperimentalOptions.java   
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());
}
项目:Logisim    文件Toolbar.java   
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;
}
项目:JITRAX    文件TableEditor.java   
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());
}
项目:jothelloT    文件Results.java   
@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);
}
项目:jdk8u-jdk    文件Test4903007.java   
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;
}
项目:incubator-netbeans    文件HierarchyTopComponent.java   
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);
}
项目:chipKIT-importer    文件SerialMonitordisplayPane.java   
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,0) );

    return pane;
}
项目:javaportfolio    文件BaseDialog.java   
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));
        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);
    }
项目:JuggleMasterPro    文件Preferencesjdialog.java   
/**
 * @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;
}
项目:TwitchBot    文件MainView.java   
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();

}
项目:JITRAX    文件TablePanel.java   
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);
}
项目:Equella    文件ProgressWindow.java   
@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));

    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);
}
项目:marathonv5    文件DialogDemo.java   
/**
 * 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;
}
项目:sstore-soft    文件TableGui.java   
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;
}
项目:SE2017-Team2    文件InitPage.java   
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);

}
项目:Java_GestionProjet    文件FenetreOption.java   
/**
 * 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);
}
项目:iTrace-Archive    文件JSONGazeExportSolver.java   
@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
    }
}
项目:jdigitalSimulator    文件Application.java   
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;
}
项目:OpenDA    文件Query.java   
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;
}
项目:snake-game    文件MainWindow.java   
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);
}
项目:WL4Edit    文件DataTester.java   
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();
}
项目:WL4Edit    文件DataTester.java   
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();
}
项目:WL4Edit    文件DataTester.java   
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();
}
项目:VISNode    文件InputEditor.java   
/**
 * Creates the editor for the MultiFile input
 * 
 * @return Component
 */
private Component buildMultiFile() {
    Panel panel = new Panel();
    panel.setBorder(BorderFactory.createEmptyBorder(5,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;
}
项目:VISNode    文件AboutVISNodePanel.java   
/**
     * Builds the tool @R_769_4045@ion
     *
     * @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;
    }
项目:VISNode    文件ImageNodeComponent.java   
/**
 * 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);
            }
        }
    });
}
项目:incubator-netbeans    文件SearchPanel.java   
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();
    }
}
项目:jaer    文件SimpleVPot.java   
/** 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();
}
项目:jaer    文件MultiInputPanel.java   
/** 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);


        }
项目:s-store    文件InitConfigGui.java   
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);
}
项目:jaer    文件SPIConfigInt.java   
@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;
}
项目:vexillo    文件ExportDialog.java   
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;
}
项目:jaer    文件CochleaLPControlPanel.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.
 */
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));
}
项目:incubator-netbeans    文件FiltersManager.java   
/** 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();
    }
}
项目:incubator-netbeans    文件ExpandableMessage.java   
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_ShowMore@R_769_4045@ion")); //NOI18N
    toggleButton.addActionListener(this);
}
项目:JavaGraph    文件CheckBoxEditor.java   
/**
 * 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);
}
项目:owa-notifier    文件TextNotification.java   
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()),(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);
}
项目:hml    文件MyPanel.java   
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;
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。