當前位置: 首頁>>代碼示例>>Java>>正文


Java Spring類代碼示例

本文整理匯總了Java中javax.swing.Spring的典型用法代碼示例。如果您正苦於以下問題:Java Spring類的具體用法?Java Spring怎麽用?Java Spring使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Spring類屬於javax.swing包,在下文中一共展示了Spring類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: resize

import javax.swing.Spring; //導入依賴的package包/類
public void resize(){
    layout.removeLayoutComponent(this);
    layout.removeLayoutComponent(this.apiSelectLabel);
    layout.removeLayoutComponent(this.apiSelectDropdown);
    
    
    layout.putConstraint(SpringLayout.EAST, this, ViewUtils.WINDOW_WIDTH-30, SpringLayout.WEST, this);
    layout.putConstraint(SpringLayout.SOUTH, this, 40, SpringLayout.NORTH, this);
    
    layout.putConstraint(SpringLayout.WEST, apiSelectLabel, Spring.constant(5, 5, 20), SpringLayout.WEST, this);
    layout.putConstraint(SpringLayout.NORTH, apiSelectLabel, Spring.constant(10, 10, 10), SpringLayout.NORTH, this);
    
    layout.putConstraint(SpringLayout.EAST, apiSelectDropdown, ViewUtils.WINDOW_WIDTH - 350, SpringLayout.WEST, apiSelectDropdown);
    layout.putConstraint(SpringLayout.SOUTH, apiSelectDropdown, 30, SpringLayout.NORTH, apiSelectDropdown);
    layout.putConstraint(SpringLayout.WEST, apiSelectDropdown, Spring.constant(20, 20, 20), SpringLayout.EAST, apiSelectLabel);
    layout.putConstraint(SpringLayout.NORTH, apiSelectDropdown, Spring.constant(5, 5, 10), SpringLayout.NORTH, this);
    
    layout.putConstraint(SpringLayout.WEST, help, Spring.constant(20, 20, 20), SpringLayout.EAST, apiSelectDropdown);
    layout.putConstraint(SpringLayout.NORTH, help, Spring.constant(10, 10, 10), SpringLayout.NORTH, this);
    
    this.revalidate();
    this.repaint();
}
 
開發者ID:mwilhelm42,項目名稱:RequestTool,代碼行數:24,代碼來源:APIPanel.java

示例2: initLayout

import javax.swing.Spring; //導入依賴的package包/類
private void initLayout() {
    SpringLayout layout = new SpringLayout();
    setLayout(layout);

    add(introLabel);
    layout.putConstraint(north, introLabel, panelMargin, north, this);
    layout.putConstraint(west, introLabel, panelMargin, west, this);

    add(checkingLabel2);
    layout.putConstraint(north, checkingLabel2, 8 * panelMargin, north, introLabel);
    layout.putConstraint(west, checkingLabel2, 6 * panelMargin, west, this);

    add(checkingLabel);
    layout.putConstraint(north, checkingLabel, 9 * panelMargin, north, introLabel);
    layout.putConstraint(west, checkingLabel, 6 * panelMargin, west, this);

    add(introScrollPane);
    layout.getConstraints(introScrollPane).setConstraint(east, Spring.sum(Spring.constant(-panelMargin), layout.getConstraint(east, this)));
    layout.getConstraints(introScrollPane).setConstraint(south, Spring.sum(Spring.constant(-panelMargin), layout.getConstraint(south, this)));
    layout.putConstraint(north, introScrollPane, vDist, south, introLabel);
    layout.putConstraint(west, introScrollPane, 0, west, introLabel);
}
 
開發者ID:ResilientScience,項目名稱:loni-dps-installer,代碼行數:23,代碼來源:IntroductionPanel.java

示例3: initLayout

import javax.swing.Spring; //導入依賴的package包/類
private void initLayout() {
    SpringLayout layout = new SpringLayout();
    setLayout(layout);

    add(licenseTitleLabel);
    layout.putConstraint(north, licenseTitleLabel, panelMargin, north, this);
    layout.putConstraint(west, licenseTitleLabel, panelMargin, west, this);

    add(licenseScrollPane);
    layout.getConstraints(licenseScrollPane).setConstraint(east, Spring.sum(Spring.constant(-panelMargin), layout.getConstraint(east, this)));
    layout.getConstraints(licenseScrollPane).setConstraint(south, Spring.sum(Spring.constant(-vDist*2), layout.getConstraint(north, agreeButton)));
    layout.putConstraint(north, licenseScrollPane, vDist, south, licenseTitleLabel);
    layout.putConstraint(west, licenseScrollPane, 0, west, licenseTitleLabel);

    add(agreeButton);
    layout.putConstraint(south, agreeButton, -panelMargin, south, this);
    layout.putConstraint(east, agreeButton, -panelMargin*6, east, this);
    add(disagreeButton);
    layout.putConstraint(south, disagreeButton, 0, south, agreeButton);
    layout.putConstraint(east, disagreeButton, -panelMargin*2, west, agreeButton);

}
 
開發者ID:ResilientScience,項目名稱:loni-dps-installer,代碼行數:23,代碼來源:LicensePanel.java

示例4: resize

import javax.swing.Spring; //導入依賴的package包/類
public void resize(){
    layout.removeLayoutComponent(this);
    layout.removeLayoutComponent(this.loggedInButton);
    layout.removeLayoutComponent(this.loginButton);
    layout.removeLayoutComponent(this.loginNameLabel);
    layout.removeLayoutComponent(this.loginNameTextfield);
    layout.removeLayoutComponent(this.loginPasswordField);
    layout.removeLayoutComponent(this.loginPasswordLabel);
    
    layout.putConstraint(SpringLayout.EAST, this, ViewUtils.WINDOW_WIDTH-30, SpringLayout.WEST, this);
    layout.putConstraint(SpringLayout.SOUTH, this, 40, SpringLayout.NORTH, this);
    
    layout.putConstraint(SpringLayout.WEST, loginNameLabel, Spring.constant(5, 5, 20), SpringLayout.WEST, this);
    layout.putConstraint(SpringLayout.NORTH, loginNameLabel, Spring.constant(10, 10, 10), SpringLayout.NORTH, this);
    
    layout.putConstraint(SpringLayout.WEST, loginNameTextfield, Spring.constant(10, 10, 20), SpringLayout.EAST, loginNameLabel);
    layout.putConstraint(SpringLayout.NORTH, loginNameTextfield, Spring.constant(10, 10, 10), SpringLayout.NORTH, this);
    
    layout.putConstraint(SpringLayout.WEST, loginPasswordLabel, Spring.constant(10, 10, 20), SpringLayout.EAST, loginNameTextfield);
    layout.putConstraint(SpringLayout.NORTH, loginPasswordLabel, Spring.constant(10, 10, 10), SpringLayout.NORTH, this);
    
    layout.putConstraint(SpringLayout.WEST, loginPasswordField, Spring.constant(10, 10, 20), SpringLayout.EAST, loginPasswordLabel);
    layout.putConstraint(SpringLayout.NORTH, loginPasswordField, Spring.constant(10, 10, 10), SpringLayout.NORTH, this);
    
    layout.putConstraint(SpringLayout.WEST, loginButton, Spring.constant(20, 20, 20), SpringLayout.EAST, loginPasswordField);
    layout.putConstraint(SpringLayout.NORTH, loginButton, Spring.constant(10, 10, 10), SpringLayout.NORTH, this);
    
    layout.putConstraint(SpringLayout.WEST, loggedInButton, Spring.constant(20, 20, 20), SpringLayout.EAST, loginButton);
    layout.putConstraint(SpringLayout.NORTH, loggedInButton, Spring.constant(10, 10, 10), SpringLayout.NORTH, this);
    
    this.revalidate();
    this.repaint();
}
 
開發者ID:mwilhelm42,項目名稱:RequestTool,代碼行數:34,代碼來源:LoginPanel.java

示例5: getBestWidth

import javax.swing.Spring; //導入依賴的package包/類
private Spring getBestWidth(Container parent, int rows, int cols) {
	Spring x = Spring.constant(0);
	Spring width = Spring.constant(0);
	for (int c = 0; c < cols; c++) {
		
		for (int r = 0; r < rows; r++) {
			width = Spring.max(width, getConstraintsForCell(r, c, parent, cols).getWidth());
		}
	}
	return width;
}
 
開發者ID:laurent-clouet,項目名稱:sheepit-client,代碼行數:12,代碼來源:Working.java

示例6: initLayout

import javax.swing.Spring; //導入依賴的package包/類
private void initLayout() {
    SpringLayout layout = new SpringLayout();
    setLayout(layout);

    add(titleLabel);
    layout.putConstraint(north, titleLabel, panelMargin, north, this);
    layout.putConstraint(west, titleLabel, panelMargin, west, this);

    add(additionalActionsLabel);
    layout.putConstraint(north, additionalActionsLabel, vDist * 3, south, titleLabel);
    layout.putConstraint(west, additionalActionsLabel, panelMargin, west, this);

    add(startPLConfigButton);
    layout.putConstraint(north, startPLConfigButton, vDist * 3, south, additionalActionsLabel);
    layout.putConstraint(west, startPLConfigButton, panelMargin * 3, west, this);

    add(startPLServerCheckbox);
    layout.putConstraint(north, startPLServerCheckbox, vDist * 3, south, startPLConfigButton);
    layout.putConstraint(west, startPLServerCheckbox, panelMargin * 3, west, this);

    add(startPLClientCheckbox);
    layout.putConstraint(north, startPLClientCheckbox, vDist, south, startPLServerCheckbox);
    layout.putConstraint(west, startPLClientCheckbox, 0, west, startPLServerCheckbox);

    add(testWorkflowsLabel);
    layout.putConstraint(north, testWorkflowsLabel, vDist, south, startPLClientCheckbox);
    layout.putConstraint(west, testWorkflowsLabel, 5 * dist, west, startPLClientCheckbox);


    add(workflowsTableScrollPane);
    //layout.getConstraints(workflowsTableScrollPane).setConstraint(east, Spring.sum(Spring.constant( -panelMargin ), layout.getConstraint(east, this)));
    layout.getConstraints(workflowsTableScrollPane).setConstraint(south, Spring.sum(Spring.constant( -vDist ), layout.getConstraint(north, bottomNoteLabel)));
    layout.putConstraint(north, workflowsTableScrollPane, vDist, south, testWorkflowsLabel);
    layout.putConstraint(west, workflowsTableScrollPane, 5 * dist, west, testWorkflowsLabel);

    add(bottomNoteLabel);
    layout.putConstraint(north, bottomNoteLabel, -panelMargin, south, this);
    layout.putConstraint(west, bottomNoteLabel, panelMargin, west, this);

}
 
開發者ID:ResilientScience,項目名稱:loni-dps-installer,代碼行數:41,代碼來源:SummaryPanel.java

示例7: resize

import javax.swing.Spring; //導入依賴的package包/類
public void resize(){
        basicLayout.removeLayoutComponent(basic);
        basicLayout.removeLayoutComponent(loginPanel);
        basicLayout.removeLayoutComponent(sep1);
        basicLayout.removeLayoutComponent(apiPanel);
        basicLayout.removeLayoutComponent(sep2);
        basicLayout.removeLayoutComponent(centralPanel);
        basicLayout.removeLayoutComponent(sep3);
        basicLayout.removeLayoutComponent(goPanel);
        basicLayout.removeLayoutComponent(sep4);
        basicLayout.removeLayoutComponent(progressPanel);
        
        basicLayout.putConstraint(SpringLayout.EAST, basic, Spring.constant(0, ViewUtils.WINDOW_WIDTH, 1200), SpringLayout.WEST, basic);
        basicLayout.putConstraint(SpringLayout.SOUTH, basic, Spring.constant(0, ViewUtils.WINDOW_HEIGHT, 1200), SpringLayout.NORTH, basic);
        
        basicLayout.putConstraint(SpringLayout.WEST, loginPanel, 10, SpringLayout.WEST, basic);
        basicLayout.putConstraint(SpringLayout.NORTH, loginPanel, 10, SpringLayout.NORTH, basic);
        
//        basicLayout.putConstraint(SpringLayout.WEST, sep1, 0, SpringLayout.WEST, basic);
//        basicLayout.putConstraint(SpringLayout.NORTH, sep1, 50, SpringLayout.NORTH, basic);
//        basicLayout.putConstraint(SpringLayout.EAST, sep1, 0, SpringLayout.EAST, basic);
        
        basicLayout.putConstraint(SpringLayout.WEST, apiPanel, 10, SpringLayout.WEST, basic);
        basicLayout.putConstraint(SpringLayout.NORTH, apiPanel, 65, SpringLayout.NORTH, basic);
        
//        basicLayout.putConstraint(SpringLayout.WEST, sep2, 0, SpringLayout.WEST, basic);
//        basicLayout.putConstraint(SpringLayout.NORTH, sep2, 100, SpringLayout.NORTH, basic);
//        basicLayout.putConstraint(SpringLayout.EAST, sep2, 0, SpringLayout.EAST, basic);
        
        basicLayout.putConstraint(SpringLayout.WEST, centralPanel, 10, SpringLayout.WEST, basic);
        basicLayout.putConstraint(SpringLayout.NORTH, centralPanel, 120, SpringLayout.NORTH, basic);
        
//        basicLayout.putConstraint(SpringLayout.WEST, sep3, 0, SpringLayout.WEST, basic);
//        basicLayout.putConstraint(SpringLayout.NORTH, sep3, 5, SpringLayout.SOUTH, centralPanel);
//        basicLayout.putConstraint(SpringLayout.EAST, sep3, 0, SpringLayout.EAST, basic);
        
        basicLayout.putConstraint(SpringLayout.WEST, goPanel, 10, SpringLayout.WEST, basic);
        basicLayout.putConstraint(SpringLayout.NORTH, goPanel, 10, SpringLayout.SOUTH, centralPanel);
        
//        basicLayout.putConstraint(SpringLayout.WEST, sep4, 0, SpringLayout.WEST, basic);
//        basicLayout.putConstraint(SpringLayout.NORTH, sep4, 5, SpringLayout.SOUTH, goPanel);
//        basicLayout.putConstraint(SpringLayout.EAST, sep4, 0, SpringLayout.EAST, basic);
        
        basicLayout.putConstraint(SpringLayout.WEST, progressPanel, 10, SpringLayout.WEST, basic);
        basicLayout.putConstraint(SpringLayout.NORTH, progressPanel, 10, SpringLayout.SOUTH, goPanel);
        
//        basic.revalidate();
//        this.repaint();
    }
 
開發者ID:mwilhelm42,項目名稱:RequestTool,代碼行數:50,代碼來源:View.java

示例8: makeProgressBars

import javax.swing.Spring; //導入依賴的package包/類
private void makeProgressBars(SpringLayout l) {
    JComponent prevLabel = null, prevBar = null;
    bars = new JProgressBar[SummaryItem.STATES.length];
    
    SpringLayout ls = new SpringLayout();
    JPanel appSummary = new JPanel();
    appSummary.setBorder(BorderFactory.createTitledBorder(
        BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "App Summary"));
    add(appSummary);
    l.putConstraint(SpringLayout.WEST, appSummary, 5, SpringLayout.WEST, this);
    l.putConstraint(SpringLayout.EAST, appSummary, -5, SpringLayout.EAST, this);
    l.putConstraint(SpringLayout.NORTH, appSummary, 25, SpringLayout.NORTH, this);
    
    appSummary.setLayout(ls);
    
    
    for (int i = 0; i < SummaryItem.STATES.length; i++) {
        JLabel label = new JLabel(SummaryItem.STATES[i] + ":");
        appSummary.add(label);
        
        JProgressBar lb = new JProgressBar();
        bars[i] = lb;
        lb.setString("0");
        lb.setStringPainted(true);
        appSummary.add(lb);
    
        fixEdges(ls, label, lb, appSummary);
        if (prevLabel == null) {
            ls.putConstraint(SpringLayout.NORTH, label, 5, SpringLayout.NORTH, appSummary);
        }
        else {
            ls.putConstraint(SpringLayout.NORTH, label, 10, SpringLayout.SOUTH, prevLabel);
        }
        prevLabel = label;
        prevBar = lb;
    }
    
    JLabel hl = new JLabel("Heap:");
    memory = makeProgress(l, hl);
    
    l.putConstraint(SpringLayout.SOUTH, appSummary, -25, SpringLayout.NORTH, hl);
    l.putConstraint(SpringLayout.SOUTH, hl, -25, SpringLayout.SOUTH, this);
    
    Spring maxW = Spring.constant(0);
    
    for (int i = 0; i < SummaryItem.STATES.length; i++) {
        maxW = Spring.max(maxW, ls.getConstraints(appSummary.getComponent(i * 2)).getWidth());
    }
    
    for (int i = 0; i < SummaryItem.STATES.length; i++) {
        SpringLayout.Constraints c = ls.getConstraints(appSummary.getComponent(i * 2));
        c.setWidth(maxW);
    }
}
 
開發者ID:swift-lang,項目名稱:swift-k,代碼行數:55,代碼來源:SummaryPanel.java

示例9: mouseDragged

import javax.swing.Spring; //導入依賴的package包/類
/**
 * Called when the mouse is dragged and the shift key is down.
 * @param event the event
 */
private void mouseDragged(MouseEvent event) {
    // How much we've moved from the original location
    int deltaX = event.getXOnScreen() - screenX;
    int deltaY = event.getYOnScreen() - screenY;

    Container parent = legend.getParent();
    SpringLayout layout = (SpringLayout) parent.getLayout();
    layout.removeLayoutComponent(legend);

    // The new location, in parent coordinates
    int x = myX + deltaX;
    int y = myY + deltaY;

    // See if we snap to anything.
    boolean snapLeft = false;
    boolean snapRight = false;
    boolean snapTop = false;
    boolean snapBottom = false;
    int legendWidth = legend.getWidth();
    int legendHeight = legend.getHeight();
    for(Component snapTo : this.snapTo) {
        // Current location of the top left corner of the legend, in snapTo coordinates.
        Point p = SwingUtilities.convertPoint(parent, x, y, snapTo);
        if(!snapLeft && !snapRight) {
            if(Math.abs(p.x) <= snapDist) {
                snapLeft = true;
                layout.putConstraint(SpringLayout.WEST, legend, 0, SpringLayout.WEST, snapTo);
                x = SwingUtilities.convertPoint(snapTo, 0, 0, parent).x;
            } else if(Math.abs(p.x + legendWidth - snapTo.getWidth()) <= snapDist) {
                snapRight = true;
                layout.putConstraint(SpringLayout.EAST, legend, 0, SpringLayout.EAST, snapTo);
                x = SwingUtilities.convertPoint(snapTo, snapTo.getWidth() - legendWidth, 0, parent).x;
            }
        }
        if(!snapTop && !snapBottom) {
            if(Math.abs(p.y) <= snapDist) {
                snapTop = true;
                layout.putConstraint(SpringLayout.NORTH, legend, 0, SpringLayout.NORTH, snapTo);
                y = SwingUtilities.convertPoint(snapTo, 0, 0, parent).y;
            } else if(Math.abs(p.y + legendHeight - snapTo.getHeight()) <= snapDist) {
                snapBottom = true;
                layout.putConstraint(SpringLayout.SOUTH, legend, 0, SpringLayout.SOUTH, snapTo);
                y = SwingUtilities.convertPoint(snapTo, 0, snapTo.getHeight() - legendHeight, parent).y;
            }
        }
    }

    // Set the location directly for immediate effect
    legend.setLocation(x, y);

    // Set the location in the layout so it stays where it was, percentagewise.
    // In other words, if the center of the legend was 33% of the way from the left to the right of the parent,
    // it will remain 33% of the way from the left to the right of the parent even if the parent is resized.
    Constraints constraints = layout.getConstraints(legend);
    if(!snapTop && !snapBottom) {
        float py = (y + legendHeight * .5f) / (float) parent.getHeight();
        constraints.setConstraint(SpringLayout.VERTICAL_CENTER, Spring.scale(new HeightSpring(parent), py));
    }
    if(!snapLeft && !snapRight) {
        float px = (x + legendWidth * .5f) / (float) parent.getWidth();
        constraints.setConstraint(SpringLayout.HORIZONTAL_CENTER, Spring.scale(new WidthSpring(parent), px));
    }

    // Hide borders on the sides that have been snapped to.
    Border outsideBorder = BorderFactory.createMatteBorder(snapTop ? 0 : 1, snapLeft ? 0 : 1, snapBottom ? 0 : 1,
            snapRight ? 0 : 1, Color.darkGray);
    Border insideBorder = ((CompoundBorder) legend.getBorder()).getInsideBorder();
    legend.setBorder(BorderFactory.createCompoundBorder(outsideBorder, insideBorder));
}
 
開發者ID:adamcrume,項目名稱:TailPlot,代碼行數:74,代碼來源:LegendDragListener.java

示例10: displaySteps

import javax.swing.Spring; //導入依賴的package包/類
private void displaySteps() {
    setNextEnabled(false);
    StringBuilder sb = new StringBuilder("<html><br><br>");
    int counter = 1;
    for(String s : stepsList) {
        sb.append("<font color=\"");
        
        if(counter < currentStepIndex) {
            if (stepsPanelList.get(counter - 1) instanceof ServerConfigurationPanel) {
               if (!Boolean.parseBoolean(Configuration.getConfig(Configuration.CONFIG_INSTALL_PIPELINE)) )
                   sb.append("gray");
            } else if  (stepsPanelList.get(counter - 1) instanceof SGEConfigurationPanel ) {
                if (!Boolean.parseBoolean(Configuration.getConfig(Configuration.CONFIG_INSTALL_SGE)) )
                   sb.append("gray");
            } else if  (stepsPanelList.get(counter - 1) instanceof NIToolsConfigurationPanel ) {
                if (!Boolean.parseBoolean(Configuration.getConfig(Configuration.CONFIG_INSTALL_NI_TOOLS)) )
                   sb.append("gray");
            } else if  (stepsPanelList.get(counter - 1) instanceof BioinformaticsToolsConfigurationPanel ) {
                if (!Boolean.parseBoolean(Configuration.getConfig(Configuration.CONFIG_INSTALL_BI_TOOLS)) )
                   sb.append("gray");
            } else sb.append("darkGray");
        } else if ( counter == currentStepIndex ) {
            sb.append("#273791");
        } else {
            sb.append("gray");
        }
        sb.append("\">");

        if ( counter == currentStepIndex )
            sb.append("<b>");

        sb.append(counter);
        sb.append(". ");
        sb.append(s);

        if ( counter == currentStepIndex )
            sb.append("</b>");

        sb.append("</font><br><br>");

        counter++;
    }
    sb.append("</html>");
    stepsLabel.setText(sb.toString());

    if(currentPanel!=null)
        remove(currentPanel);
    AbstractStepPanel panel = stepsPanelList.get(currentStepIndex-1);
    add(panel);

    

    layout.getConstraints(panel).setConstraint(south, Spring.sum(Spring.constant(-vDist), layout.getConstraint(north, helpButton)));
    layout.getConstraints(panel).setConstraint(east, Spring.sum(Spring.constant(-panelMargin), layout.getConstraint(east, getContentPane())));
    layout.putConstraint(north, panel, vDist, south, topSeparator);
    layout.putConstraint(west, panel, dist, east, sideSeparator);
    currentPanel = panel;

    panel.panelActivated();
    validate();
    repaint();
}
 
開發者ID:ResilientScience,項目名稱:loni-dps-installer,代碼行數:63,代碼來源:ServerInstallerFrame.java

示例11: initLayout

import javax.swing.Spring; //導入依賴的package包/類
private void initLayout() {
    layout = new SpringLayout();
    this.setLayout(layout);
    Container pane = this.getContentPane();

    add(titleIconLabel);
    layout.putConstraint(north, titleIconLabel, panelMargin, north, pane);
    layout.putConstraint(west, titleIconLabel, panelMargin*2, west, pane);

    add(titleLabel);
    layout.putConstraint(south, titleLabel, -2 * vDist, south, titleIconLabel);
    layout.putConstraint(west, titleLabel, dist, west, topSeparator);

    add(subTitleLabel);
    layout.putConstraint(south, subTitleLabel, 0, south, versionLabel);
    layout.putConstraint(east, subTitleLabel, -dist * 2, west, versionLabel);

    add(versionLabel);
    layout.putConstraint(south, versionLabel, -dist, north, topSeparator);
    layout.putConstraint(east, versionLabel, -panelMargin, east, pane);

    add(topSeparator);
    layout.getConstraints(topSeparator).setConstraint(east, Spring.sum(Spring.constant(-panelMargin), layout.getConstraint(east, pane)));
    layout.putConstraint(north, topSeparator, vDist, south, titleLabel);
    layout.putConstraint(west, topSeparator, 0, west, sideSeparator);

    add(stepsLabel);
    layout.putConstraint(north, stepsLabel, vDist, south, topSeparator);
    layout.putConstraint(west, stepsLabel, panelMargin, west, pane);

    add(sideSeparator);
    layout.getConstraints(sideSeparator).setConstraint(south, Spring.sum(Spring.constant(-vDist), layout.getConstraint(north, helpButton)));
    layout.putConstraint(north, sideSeparator, vDist, south, titleLabel);
    layout.putConstraint(west, sideSeparator, dist, east, stepsLabel);
    
    add(copyrightLabel);
    layout.putConstraint(south, copyrightLabel, -5, south, pane);
    layout.putConstraint(west, copyrightLabel, dist, west, pane);

    add(helpButton);
    layout.putConstraint(south, helpButton, -panelMargin, north, copyrightLabel);
    layout.putConstraint(west, helpButton, panelMargin*2, west, pane);

    add(cancelButton);
    layout.putConstraint(south, cancelButton, 0, south, helpButton);
    layout.putConstraint(east, cancelButton, -panelMargin*2, west, backButton);

    add(finishButton);
    layout.putConstraint(south, finishButton, 0, south, helpButton);
    layout.putConstraint(east, finishButton, -panelMargin*2, east, pane);

    add(nextButton);
    layout.putConstraint(south, nextButton, 0, south, helpButton);
    layout.putConstraint(east, nextButton, -dist*2, west, finishButton);

    add(backButton);
    layout.putConstraint(south, backButton, 0, south, helpButton);
    layout.putConstraint(east, backButton, -dist*2, west, nextButton);
    

}
 
開發者ID:ResilientScience,項目名稱:loni-dps-installer,代碼行數:62,代碼來源:ServerInstallerFrame.java

示例12: initLayout

import javax.swing.Spring; //導入依賴的package包/類
private void initLayout() {
    SpringLayout layout = new SpringLayout();
    setLayout(layout);


    add(titleLabel);
    layout.putConstraint(north, titleLabel, panelMargin, north, this);
    layout.putConstraint(west, titleLabel, panelMargin, west, this);

    add(topSeparator);
    layout.getConstraints(topSeparator).setConstraint(east, Spring.sum(Spring.constant(-panelMargin),layout.getConstraint(east, this)));
    layout.putConstraint(north, topSeparator, vDist, south, titleLabel);
    layout.putConstraint(west, topSeparator, panelMargin, west, this);

    add(sideSeparator);
    layout.getConstraints(sideSeparator).setConstraint(south, layout.getConstraint(south, this));
    layout.putConstraint(north, sideSeparator, 2 * vDist, south, titleLabel);
    layout.putConstraint(west, sideSeparator, 15 * dist, east, titleLabel);

    add(sgeLocationLabel);
    layout.putConstraint(north, sgeLocationLabel, vDist, north, sideSeparator);
    layout.putConstraint(west, sgeLocationLabel, 4 * dist, west, titleLabel);

    add(sgeLocationField);
    layout.putConstraint(north, sgeLocationField, vDist, south, sgeLocationLabel);
    layout.putConstraint(west, sgeLocationField, 0, west, sgeLocationLabel);

    add(sgeClusterLabel);
    layout.putConstraint(north, sgeClusterLabel, 2 * vDist, south, sgeLocationField);
    layout.putConstraint(west, sgeClusterLabel, 0 , west, sgeLocationLabel);

    add(sgeClusterField);
    layout.putConstraint(north, sgeClusterField, vDist, south, sgeClusterLabel);
    layout.putConstraint(west, sgeClusterField, 0, west, sgeLocationLabel);

    add(sgeSpoolDirLabel);
    layout.putConstraint(north, sgeSpoolDirLabel, 2 * vDist, south, sgeClusterField);
    layout.putConstraint(west, sgeSpoolDirLabel, 0 , west, sgeLocationLabel);

    add(sgeSpoolDirField);
    layout.putConstraint(north, sgeSpoolDirField, vDist, south, sgeSpoolDirLabel);
    layout.putConstraint(west, sgeSpoolDirField, 0, west, sgeLocationLabel);

    add(sgeAdminCheckbox);
    layout.putConstraint(north, sgeAdminCheckbox, vDist, south, sgeSpoolDirField);
    layout.putConstraint(west, sgeAdminCheckbox, 0, west, sgeLocationLabel);

    add(sgeAdminLabel);
    layout.putConstraint(north, sgeAdminLabel, vDist, south, sgeAdminCheckbox);
    layout.putConstraint(west, sgeAdminLabel, 0, west, sgeLocationLabel);

    add(sgeAdminField);
    layout.putConstraint(north, sgeAdminField, vDist, south, sgeAdminLabel);
    layout.putConstraint(west, sgeAdminField, 0, west, sgeLocationLabel);

    add(sgeAdminWarningArea);
    layout.putConstraint(north, sgeAdminWarningArea, vDist / 2, south, sgeAdminField);
    layout.getConstraints(sgeAdminWarningArea).setConstraint(east, Spring.sum(Spring.constant(-dist),layout.getConstraint(west, sideSeparator)));
    layout.putConstraint(west, sgeAdminWarningArea, 0, west, sgeLocationLabel);

    add(sgeExecHostsLabel);
    layout.putConstraint(north, sgeExecHostsLabel, vDist, north, sideSeparator);
    layout.putConstraint(west, sgeExecHostsLabel, 4 * dist , east, sideSeparator);

    add(sgeExecHostsScrollPane);
    layout.getConstraints(sgeExecHostsScrollPane).setConstraint(east, Spring.sum(Spring.constant(-panelMargin),layout.getConstraint(east, this)));
    layout.getConstraints(sgeExecHostsScrollPane).setConstraint(south, Spring.sum(Spring.constant(-vDist),layout.getConstraint(north, sgeExecHostsExampleScrollPane)));
    layout.putConstraint(north, sgeExecHostsScrollPane, vDist, south, sgeExecHostsLabel);
    layout.putConstraint(west, sgeExecHostsScrollPane, 0, west, sgeExecHostsLabel);

    add(sgeExecHostsExampleScrollPane);
    layout.getConstraints(sgeExecHostsExampleScrollPane).setConstraint(east, Spring.sum(Spring.constant(-panelMargin),layout.getConstraint(east, this)));
    layout.getConstraints(sgeExecHostsExampleScrollPane).setConstraint(south, Spring.sum(Spring.constant(-panelMargin),layout.getConstraint(south, this)));
    layout.putConstraint(west, sgeExecHostsExampleScrollPane, 0, west, sgeExecHostsLabel);

    add(validatingHostsLabel);
    layout.putConstraint(north, validatingHostsLabel, vDist, south, sgeExecHostsScrollPane);
    layout.putConstraint(west, validatingHostsLabel, 0, west, sgeExecHostsScrollPane);


}
 
開發者ID:ResilientScience,項目名稱:loni-dps-installer,代碼行數:82,代碼來源:SGEConfigurationPanel.java

示例13: initLayout

import javax.swing.Spring; //導入依賴的package包/類
private void initLayout() {
    SpringLayout layout = new SpringLayout();
    setLayout(layout);

    add(titleLabel);
    layout.putConstraint(north, titleLabel, panelMargin, north, this);
    layout.putConstraint(west, titleLabel, panelMargin, west, this);

    add(topSeparator);
    layout.getConstraints(topSeparator).setConstraint(east, Spring.sum(Spring.constant(-panelMargin),layout.getConstraint(east, this)));
    layout.putConstraint(north, topSeparator, vDist, south, titleLabel);
    layout.putConstraint(west, topSeparator, panelMargin, west, this);

    add(fsPathLabel);
    layout.putConstraint(north, fsPathLabel, vDist * 3, south, titleLabel);
    layout.putConstraint(west, fsPathLabel, dist * 4, west, titleLabel);
    
    add(fsPathField);
    layout.putConstraint(north, fsPathField, 0, north, fsPathLabel);
    layout.putConstraint(west, fsPathField, dist, east, fsPathLabel);

    add(fsPathBrowseButton);
    layout.putConstraint(north, fsPathBrowseButton, -dist, north, fsPathLabel);
    layout.getConstraints(fsPathBrowseButton).setConstraint(east, Spring.sum(Spring.constant(-panelMargin),layout.getConstraint(east, this)));
    layout.putConstraint(west, fsPathBrowseButton, dist, east, fsPathField);
    
    add(middleSeparator);
    layout.getConstraints(middleSeparator).setConstraint(east, Spring.sum(Spring.constant(-panelMargin),layout.getConstraint(east, this)));
    layout.putConstraint(north, middleSeparator, vDist, south, fsPathBrowseButton);
    layout.putConstraint(west, middleSeparator, panelMargin, west, this);

    add(selectComponentsLabel);
    layout.putConstraint(north, selectComponentsLabel, vDist * 2, south, middleSeparator);
    layout.putConstraint(west, selectComponentsLabel, panelMargin, west, this);

    add(pipelineCheckbox);
    layout.putConstraint(north, pipelineCheckbox, vDist * 2, south, selectComponentsLabel);
    layout.putConstraint(west, pipelineCheckbox, 0, west, fsPathLabel);

    add(pipelineDescription);
    layout.putConstraint(north, pipelineDescription, vDist, south, pipelineCheckbox);
    layout.putConstraint(west, pipelineDescription, dist * 5, west, pipelineCheckbox);

    add(sgeCheckbox);
    layout.putConstraint(north, sgeCheckbox, vDist, south, pipelineDescription);
    layout.putConstraint(west, sgeCheckbox, 0, west, pipelineCheckbox);

    add(sgeDescription);
    layout.putConstraint(north, sgeDescription, vDist, south, sgeCheckbox);
    layout.putConstraint(west, sgeDescription, dist * 5, west, pipelineCheckbox);

    add(niToolsCheckbox);
    layout.putConstraint(north, niToolsCheckbox, vDist, south, sgeDescription);
    layout.putConstraint(west, niToolsCheckbox, 0, west, pipelineCheckbox);

    add(niToolsDescription);
    layout.putConstraint(north, niToolsDescription, vDist, south, niToolsCheckbox);
    layout.putConstraint(west, niToolsDescription, dist * 5, west, pipelineCheckbox);

    add(biToolsCheckbox);
    layout.putConstraint(north, biToolsCheckbox, vDist, south, niToolsDescription);
    layout.putConstraint(west, biToolsCheckbox, 0, west, pipelineCheckbox);

    add(biToolsDescription);
    layout.putConstraint(north, biToolsDescription, vDist, south, biToolsCheckbox);
    layout.putConstraint(west, biToolsDescription, dist * 5, west, pipelineCheckbox);
    
    add(bottomSeparator);
    layout.getConstraints(bottomSeparator).setConstraint(east, Spring.sum(Spring.constant(-panelMargin),layout.getConstraint(east, this)));
    layout.putConstraint(south, bottomSeparator, -panelMargin, south, this);
    layout.putConstraint(west, bottomSeparator, panelMargin, west, this);

    

}
 
開發者ID:ResilientScience,項目名稱:loni-dps-installer,代碼行數:76,代碼來源:GeneralConfigurationPanel.java

示例14: initLayout

import javax.swing.Spring; //導入依賴的package包/類
private void initLayout() {
    SpringLayout layout = new SpringLayout();
    setLayout(layout);


    add(titleLabel);
    layout.putConstraint(north, titleLabel, 0, north, this);
    layout.putConstraint(west, titleLabel, panelMargin, west, this);
    
    add(executablesCheckbox);
    layout.putConstraint(north, executablesCheckbox, vDist * 2, south, titleLabel);
    layout.putConstraint(west, executablesCheckbox, panelMargin, west, this);

    add(serverLibCheckbox);
    layout.putConstraint(north, serverLibCheckbox, vDist, south, executablesCheckbox);
    layout.putConstraint(west, serverLibCheckbox, panelMargin, west, this);

    add(serverPrefsLabel);
    layout.putConstraint(north, serverPrefsLabel, vDist, south, serverLibCheckbox);
    layout.putConstraint(west, serverPrefsLabel, dist * 4, west, serverLibCheckbox);

    add(serverPrefsField);
    layout.putConstraint(north, serverPrefsField, vDist, south, serverLibCheckbox);
    layout.putConstraint(west, serverPrefsField, dist, east, serverPrefsLabel);

    add(serverPrefsBrowseButton);
    layout.putConstraint(north, serverPrefsBrowseButton, vDist, south, serverLibCheckbox);
    layout.putConstraint(west, serverPrefsBrowseButton, dist, east, serverPrefsField);

    add(toolsDescLabel);
    layout.putConstraint(north, toolsDescLabel, 0, south, serverPrefsBrowseButton);
    layout.putConstraint(west, toolsDescLabel, panelMargin, west, this);

    add(toolsTableScrollPane);
    layout.getConstraints(toolsTableScrollPane).setConstraint(east, Spring.sum(Spring.constant( -panelMargin ), layout.getConstraint(east, this)));
    layout.getConstraints(toolsTableScrollPane).setConstraint(south, Spring.sum(Spring.constant( -vDist ), layout.getConstraint(north, totalSizeLabel)));
    layout.putConstraint(north, toolsTableScrollPane, vDist, south, toolsDescLabel);
    layout.putConstraint(west, toolsTableScrollPane, 0, west, toolsDescLabel);

    add(totalSizeLabel);
    layout.putConstraint(south, totalSizeLabel, -vDist, north, descriptionTextArea);
    layout.putConstraint(east, totalSizeLabel, 0, east, toolsTableScrollPane);

    add(descriptionTextArea);
    layout.getConstraints(descriptionTextArea).setConstraint(east, Spring.sum(Spring.constant( -panelMargin ), layout.getConstraint(east, this)));
    layout.putConstraint(south, descriptionTextArea, -vDist, north, toolLocationLabel);
    layout.putConstraint(west, descriptionTextArea, 0, west, toolsTableScrollPane);

    add(toolLocationLabel);
    layout.putConstraint(south, toolLocationLabel, -panelMargin, south, this);
    layout.putConstraint(west, toolLocationLabel, panelMargin, west, this);


  
}
 
開發者ID:ResilientScience,項目名稱:loni-dps-installer,代碼行數:56,代碼來源:BioinformaticsToolsConfigurationPanel.java

示例15: initLayout

import javax.swing.Spring; //導入依賴的package包/類
private void initLayout() {
    SpringLayout layout = new SpringLayout();
    setLayout(layout);


    add(titleLabel);
    layout.putConstraint(north, titleLabel, 0, north, this);
    layout.putConstraint(west, titleLabel, panelMargin, west, this);
    
    add(executablesCheckbox);
    layout.putConstraint(north, executablesCheckbox, vDist * 2, south, titleLabel);
    layout.putConstraint(west, executablesCheckbox, panelMargin, west, this);

    add(serverLibCheckbox);
    layout.putConstraint(north, serverLibCheckbox, vDist, south, executablesCheckbox);
    layout.putConstraint(west, serverLibCheckbox, panelMargin, west, this);

    add(serverPrefsLabel);
    layout.putConstraint(north, serverPrefsLabel, vDist, south, serverLibCheckbox);
    layout.putConstraint(west, serverPrefsLabel, panelMargin, west, this);

    add(serverPrefsField);
    layout.putConstraint(north, serverPrefsField, vDist, south, serverLibCheckbox);
    layout.putConstraint(west, serverPrefsField, dist, east, serverPrefsLabel);

    add(serverPrefsBrowseButton);
    layout.putConstraint(north, serverPrefsBrowseButton, vDist, south, serverLibCheckbox);
    layout.putConstraint(west, serverPrefsBrowseButton, dist, east, serverPrefsField);

    add(toolsDescLabel);
    layout.putConstraint(north, toolsDescLabel, 0, south, serverPrefsBrowseButton);
    layout.putConstraint(west, toolsDescLabel, panelMargin, west, this);

    add(toolsTableScrollPane);
    layout.getConstraints(toolsTableScrollPane).setConstraint(east, Spring.sum(Spring.constant( -panelMargin ), layout.getConstraint(east, this)));
    layout.getConstraints(toolsTableScrollPane).setConstraint(south, Spring.sum(Spring.constant( -vDist ), layout.getConstraint(north, totalSizeLabel)));
    layout.putConstraint(north, toolsTableScrollPane, vDist, south, toolsDescLabel);
    layout.putConstraint(west, toolsTableScrollPane, 0, west, toolsDescLabel);

    add(totalSizeLabel);
    layout.putConstraint(south, totalSizeLabel, -vDist, north, descriptionTextArea);
    layout.putConstraint(east, totalSizeLabel, 0, east, toolsTableScrollPane);

    add(descriptionTextArea);
    layout.getConstraints(descriptionTextArea).setConstraint(east, Spring.sum(Spring.constant( -panelMargin ), layout.getConstraint(east, this)));
    layout.putConstraint(south, descriptionTextArea, -vDist, north, toolLocationLabel);
    layout.putConstraint(west, descriptionTextArea, 0, west, toolsTableScrollPane);

    add(toolLocationLabel);
    layout.putConstraint(south, toolLocationLabel, -panelMargin, south, this);
    layout.putConstraint(west, toolLocationLabel, panelMargin, west, this);


  
}
 
開發者ID:ResilientScience,項目名稱:loni-dps-installer,代碼行數:56,代碼來源:NIToolsConfigurationPanel.java


注:本文中的javax.swing.Spring類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。