当前位置: 首页>>代码示例>>Java>>正文


Java FlowLayout.LEFT属性代码示例

本文整理汇总了Java中java.awt.FlowLayout.LEFT属性的典型用法代码示例。如果您正苦于以下问题:Java FlowLayout.LEFT属性的具体用法?Java FlowLayout.LEFT怎么用?Java FlowLayout.LEFT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.awt.FlowLayout的用法示例。


在下文中一共展示了FlowLayout.LEFT属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: IsotonicMDSDemo

/**
 * Constructor.
 */
public IsotonicMDSDemo() {
    startButton = new JButton("Start");
    startButton.setActionCommand("startButton");
    startButton.addActionListener(this);

    datasetBox = new JComboBox<>();
    for (int i = 0; i < datasetName.length; i++) {
        datasetBox.addItem(datasetName[i]);
    }
    datasetBox.setSelectedIndex(0);
    datasetBox.setActionCommand("datasetBox");
    datasetBox.addActionListener(this);

    optionPane = new JPanel(new FlowLayout(FlowLayout.LEFT));
    optionPane.setBorder(BorderFactory.createRaisedBevelBorder());
    optionPane.add(startButton);
    optionPane.add(new JLabel("Dataset:"));
    optionPane.add(datasetBox);

    setLayout(new BorderLayout());
    add(optionPane, BorderLayout.NORTH);
}
 
开发者ID:takun2s,项目名称:smile_1.5.0_java7,代码行数:25,代码来源:IsotonicMDSDemo.java

示例2: MDSDemo

/**
 * Constructor.
 */
public MDSDemo() {
    startButton = new JButton("Start");
    startButton.setActionCommand("startButton");
    startButton.addActionListener(this);

    datasetBox = new JComboBox<>();
    for (int i = 0; i < datasetName.length; i++) {
        datasetBox.addItem(datasetName[i]);
    }
    datasetBox.setSelectedIndex(0);
    datasetBox.setActionCommand("datasetBox");
    datasetBox.addActionListener(this);

    optionPane = new JPanel(new FlowLayout(FlowLayout.LEFT));
    optionPane.setBorder(BorderFactory.createRaisedBevelBorder());
    optionPane.add(startButton);
    optionPane.add(new JLabel("Dataset:"));
    optionPane.add(datasetBox);

    setLayout(new BorderLayout());
    add(optionPane, BorderLayout.NORTH);
}
 
开发者ID:takun2s,项目名称:smile_1.5.0_java7,代码行数:25,代码来源:MDSDemo.java

示例3: ElementSelectorPanel

public ElementSelectorPanel(ElementNode.Description elementDescription, boolean singleSelection, boolean enableButtons ) {      
    setLayout(new BorderLayout());
    elementView = new CheckTreeView();
    elementView.setRootVisible(false);
    add(elementView, BorderLayout.CENTER);
    setRootElement(elementDescription, singleSelection);
    //make sure that the first element is pre-selected
    Node root = manager.getRootContext();
    Node[] children = root.getChildren().getNodes();
    if( null != children && children.length > 0 && !elementDescription.hasSelection(true)) {
        try {
            manager.setSelectedNodes(new org.openide.nodes.Node[]{children[0]});
        } catch (PropertyVetoException ex) {
            //ignore
        }
    }
    if (!singleSelection && hasMultipleSelectables(elementDescription)) {
        final JButton selectAll = new JButton();
        final JButton selectNone = new JButton();
        Mnemonics.setLocalizedText(selectAll, Bundle.BTN_SelectAll());
        Mnemonics.setLocalizedText(selectNone, Bundle.BTN_SelectNone());
        JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        buttonPanel.add(selectAll);
        buttonPanel.add(selectNone);

        add(buttonPanel, BorderLayout.SOUTH);
        
        ActionListener al = new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                selectAllNodes(e.getSource() == selectAll);
            }
        };
        selectAll.addActionListener(al);
        selectNone.addActionListener(al);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:ElementSelectorPanel.java

示例4: EventRenderer

public EventRenderer () {
    pathLabel = new JLabel();
    actionLabel = new JLabel();
    actionButton = new LinkButton("..."); //NOI18N
    actionButton.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));

    FlowLayout l = new FlowLayout(FlowLayout.LEFT, 0, 0);
    l.setAlignOnBaseline(true);
    setLayout(l);
    add(actionLabel);
    actionLabel.setBorder(BorderFactory.createEmptyBorder(0, INDENT, 0, 10));
    add(pathLabel);
    add(actionButton);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:SummaryCellRenderer.java

示例5: LoadFromParalelDialog

public LoadFromParalelDialog(final JFrame frame, Engine engine) {
    super(frame, true);
    setTitle("loadFromParalel");

    JPanel qPanel = new JPanel();
    qPanel.setLayout(new BoxLayout(qPanel, BoxLayout.Y_AXIS));
    //qPanel.setLayout(new FlowLayout());

    List<Qualifier> list = engine.getQualifiers();

    for (Qualifier qualifier : list) {
        if (IDEF0Plugin.isFunction(qualifier)) {
            qualifiers.add(qualifier);
            JCheckBox box = new JCheckBox();
            box.setText(qualifier.getName());
            boxes.add(box);
            qPanel.add(box);
        }
    }

    JScrollPane pane = new JScrollPane();


    panel.add(pane, BorderLayout.CENTER);

    JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT));
    p.add(importAllClasificators);
    panel.add(p, BorderLayout.SOUTH);

    setMainPane(panel);

    ResourceLoader.setJComponentsText(this);
    pane.setViewportView(qPanel);
    pack();
    centerDialog();
    Options.loadOptions("loadFromParalel", this);
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:37,代码来源:LoadFromParalelDialog.java

示例6: ROCViewer

public ROCViewer(AreaUnderCurve auc) {
	setLayout(new BorderLayout());

	String message = auc.toString();

	criterionName = auc.getName();

	// info string
	JPanel infoPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
	infoPanel.setOpaque(true);
	infoPanel.setBackground(Colors.WHITE);
	JTextPane infoText = new JTextPane();
	infoText.setEditable(false);
	infoText.setBackground(infoPanel.getBackground());
	infoText.setFont(infoText.getFont().deriveFont(Font.BOLD));
	infoText.setText(message);
	infoPanel.add(infoText);
	add(infoPanel, BorderLayout.NORTH);

	// plot panel
	plotter = new ROCChartPlotter();
	plotter.addROCData("ROC", auc.getRocData());
	JPanel innerPanel = new JPanel(new BorderLayout());
	innerPanel.add(plotter, BorderLayout.CENTER);
	innerPanel.setBorder(BorderFactory.createMatteBorder(5, 0, 10, 10, Colors.WHITE));
	add(innerPanel, BorderLayout.CENTER);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:27,代码来源:ROCViewer.java

示例7: CurveViewer

public CurveViewer(CurveCollection curves) {
   setLayout(new BorderLayout());

    String message = curves.toString();

    criterionName = curves.getName();

    // info string
    JPanel infoPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    infoPanel.setOpaque(true);
    infoPanel.setBackground(Colors.WHITE);
    JTextPane infoText = new JTextPane();
    infoText.setEditable(false);
    infoText.setBackground(infoPanel.getBackground());
    infoText.setFont(infoText.getFont().deriveFont(Font.BOLD));
    infoText.setText(message);
    infoPanel.add(infoText);
    add(infoPanel, BorderLayout.NORTH);

    // plot panel
    plotter = new CurveChartPlotter();
    plotter.setCurve(curves);

    JPanel innerPanel = new JPanel(new BorderLayout());
    innerPanel.add(plotter, BorderLayout.CENTER);
    innerPanel.setBorder(BorderFactory.createMatteBorder(5, 0, 10, 10, Colors.WHITE));
    add(innerPanel, BorderLayout.CENTER);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:28,代码来源:CurveViewer.java

示例8: createField

protected void createField(String label, JComponent tf, String tooltip) {
    JLabel jl = new JLabel(label+": ");
    jl.setToolTipText(tooltip);
    tf.setToolTipText(tooltip);
    pLabels.add(jl);
    JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT));
    p.add(tf);
    pFields.add(p);
}
 
开发者ID:nickrfer,项目名称:code-sentinel,代码行数:9,代码来源:BaseDialogGUI.java

示例9: ManifoldDemo

/**
 * Constructor.
 */
public ManifoldDemo() {
    startButton = new JButton("Start");
    startButton.setActionCommand("startButton");
    startButton.addActionListener(this);

    datasetBox = new JComboBox<>();
    for (int i = 0; i < datasetName.length; i++) {
        datasetBox.addItem(datasetName[i]);
    }
    datasetBox.setSelectedIndex(0);
    datasetBox.setActionCommand("datasetBox");
    datasetBox.addActionListener(this);

    optionPane = new JPanel(new FlowLayout(FlowLayout.LEFT));
    optionPane.setBorder(BorderFactory.createRaisedBevelBorder());
    optionPane.add(startButton);
    optionPane.add(new JLabel("Dataset:"));
    optionPane.add(datasetBox);

    knnField = new JTextField(Integer.toString(k), 5);
    optionPane.add(new JLabel("K:"));
    optionPane.add(knnField);

    setLayout(new BorderLayout());
    add(optionPane, BorderLayout.NORTH);
}
 
开发者ID:takun2s,项目名称:smile_1.5.0_java7,代码行数:29,代码来源:ManifoldDemo.java

示例10: generate

@Override
public void generate(JPanel panel)
{
	JPanel all = new JPanel(new FlowLayout(FlowLayout.LEFT));
	all.add(button);
	panel.add(all);
}
 
开发者ID:equella,项目名称:Equella,代码行数:7,代码来源:HelpButton.java

示例11: moveComponents

/**
 * Centers the elements in the specified row, if there is any slack.
 * @param target the component which needs to be moved
 * @param x the x coordinate
 * @param y the y coordinate
 * @param width the width dimensions
 * @param height the height dimensions
 * @param rowStart the beginning of the row
 * @param rowEnd the the ending of the row
 * @param ltr 
 * @param ruler 
 */
protected void moveComponents(Container target, int x, int y, int width,
		int height, int rowStart, int rowEnd, boolean ltr, Ruler ruler) {
	synchronized (target.getTreeLock()) {
		switch (getAlignment()) {
		case FlowLayout.LEFT:
			x += ltr ? 0 : width;
			break;
		case FlowLayout.CENTER:
			x += width / 2;
			break;
		case FlowLayout.RIGHT:
			x += ltr ? width : 0;
			break;
		case LEADING:
			break;
		case TRAILING:
			x += width;
			break;
		}
		int tabIndex = 0;
		for (int i = rowStart; i < rowEnd; i++) {
			Component m = target.getComponent(i);
			//          if (m.isVisible()) {
			if (hasConstraint(m, TAB_STOP))
				x = getInsets(target).left + ruler.getTab(tabIndex++);
			int dy = (valign == VTOP) ? 0 : (height - m.getHeight()) / 2;
			if (ltr) {
				m.setLocation(x, y + dy);
			} else {
				m.setLocation(target.getWidth() - x - m.getWidth(), y + dy);
			}
			x += m.getWidth() + hgap;
			//            }
		}
	}
}
 
开发者ID:CLARIN-PL,项目名称:WordnetLoom,代码行数:48,代码来源:RiverLayout.java

示例12: createFilterPanel

private JComponent createFilterPanel(RecipientFilter... filters)
{
	ButtonGroup group = new ButtonGroup();
	for( RecipientFilter filter : filters )
	{
		switch( filter )
		{
			case USERS:
				users = createFilterButton(group, "searching.userGroupRole.filter.users");
				break;

			case GROUPS:
				groups = createFilterButton(group, "searching.userGroupRole.filter.groups");
				break;

			case ROLES:
				roles = createFilterButton(group, "searching.userGroupRole.filter.roles");
				break;

			default:
				break;
		}
	}

	if( filters.length == 1 )
	{
		// We don't need to show this panel
		return null;
	}
	else
	{
		// Add each of the buttons to the panel
		JPanel all = new JPanel(new FlowLayout(FlowLayout.LEFT));
		for( Enumeration<AbstractButton> e = group.getElements(); e.hasMoreElements(); )
		{
			all.add(e.nextElement());
		}
		return all;
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:40,代码来源:SearchFinder.java

示例13: setupDisplay

private void setupDisplay(XOpenTypeData data) {
    setBackground(Color.white);
    container =
            new JScrollPane(data,
            JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);

    JPanel buttons = new JPanel(new FlowLayout(FlowLayout.LEFT));
    tabularPrev = new JButton(Messages.LESS_THAN);
    tabularNext = new JButton(Messages.GREATER_THAN);
    JPanel tabularButtons = new JPanel(new FlowLayout(FlowLayout.LEFT));
    tabularButtons.add(tabularPrev);
    tabularPrev.addActionListener(this);
    tabularLabel = new JLabel(tabularNavigationSingle);
    tabularLabel.setEnabled(false);
    tabularButtons.add(tabularLabel);
    tabularButtons.add(tabularNext);
    tabularNext.addActionListener(this);
    tabularButtons.setBackground(Color.white);

    prev = new JButton(Messages.A_LOT_LESS_THAN);
    prev.addActionListener(this);
    buttons.add(prev);

    incr = new JButton(Messages.GREATER_THAN);
    incr.addActionListener(this);
    decr = new JButton(Messages.LESS_THAN);
    decr.addActionListener(this);

    JPanel array = new JPanel();
    array.setBackground(Color.white);
    array.add(decr);
    compositeLabel = new JLabel(compositeNavigationSingle);
    compositeLabel.setEnabled(false);
    array.add(compositeLabel);
    array.add(incr);

    buttons.add(array);
    setLayout(new BorderLayout());
    buttons.setBackground(Color.white);

    JPanel navigationPanel = new JPanel(new BorderLayout());
    navigationPanel.setBackground(Color.white);
    navigationPanel.add(tabularButtons, BorderLayout.NORTH);
    navigationPanel.add(buttons, BorderLayout.WEST);
    add(navigationPanel, BorderLayout.NORTH);

    add(container, BorderLayout.CENTER);
    Dimension d = new Dimension((int)container.getPreferredSize().
            getWidth() + 20,
            (int)container.getPreferredSize().
            getHeight() + 20);
    setPreferredSize(d);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:54,代码来源:XOpenTypeViewer.java

示例14: DataTableViewer

public DataTableViewer(DataTable dataTable, LinkedHashMap<String, Class<? extends Plotter>> availablePlotters,
		boolean showPlotter, String tableMode, boolean autoResize) {
	super(new BorderLayout());

	// create empty buttonCard
	ButtonBarCardPanel bCard = new ButtonBarCardPanel();

	// Build table view
	this.dataTableViewerTable = new DataTableViewerTable(autoResize);
	this.tablePanel = new JPanel(new BorderLayout());
	JPanel infoPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
	infoPanel.setBorder(BorderFactory.createEmptyBorder(10, 5, 5, 5));
	infoPanel.add(generalInfo);
	infoPanel.setOpaque(true);
	infoPanel.setBackground(Colors.WHITE);
	tablePanel.add(infoPanel, BorderLayout.NORTH);
	JScrollPane tableScrollPane = new ExtendedJScrollPane(dataTableViewerTable);
	tableScrollPane.setBorder(BorderFactory.createEmptyBorder(1, 10, 10, 5));
	tableScrollPane.setBackground(Colors.WHITE);
	tableScrollPane.getViewport().setBackground(Colors.WHITE);
	tablePanel.add(tableScrollPane, BorderLayout.CENTER);

	// add data table to the result view
	bCard.addCard(new ResourceCard("data_view", "result_view.data_view"), tablePanel);

	// Add plotters if desired
	if (showPlotter) {
		this.plotterSettings = new PlotterConfigurationModel(availablePlotters, dataTable);
		this.plotterPanel = new PlotterPanel(plotterSettings);
		DataTable plotData = plotterSettings.getDataTable();

		// preface to create ChartConfigationPanel:
		ExampleSet exampleSet = DataTableExampleSetAdapter.createExampleSetFromDataTable(plotData);
		Map<DatasetTransformationType, PlotConfiguration> plotConfigurationMap = PlotConfigurationHistory
				.getPlotConfigurationMap(exampleSet, plotData);
		PlotInstance plotInstance = new PlotInstance(plotConfigurationMap.get(DatasetTransformationType.ORIGINAL),
				plotData);
		this.advancedPanel = new ChartConfigurationPanel(true, plotInstance, plotData,
				plotConfigurationMap.get(DatasetTransformationType.DE_PIVOTED));

		// add Plotter to the result view
		bCard.addCard(new ResourceCard("plot_view", "result_view.plot_view"), plotterPanel);

		// add advanced Charts to the result view
		bCard.addCard(new ResourceCard("advanced_charts", "result_view.advanced_charts"), advancedPanel);
	} // end if (showPlotter)

	// check select desired view
	if (PLOT_MODE.equals(tableMode) && showPlotter) {
		bCard.selectCard("plot_view");
	} else if (ADVANCED_MODE.equals(tableMode) && showPlotter) {
		bCard.selectCard("advanced_charts");
	}

	add(bCard, BorderLayout.CENTER);
	setDataTable(dataTable);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:57,代码来源:DataTableViewer.java

示例15: LogisticDistributionDemo

public LogisticDistributionDemo() {
    super(new BorderLayout());

    Hashtable<Integer, JLabel> labelTable = new Hashtable<>();
    for (int i = 0; i <= 50; i+=10) {
        labelTable.put(new Integer(i), new JLabel(String.valueOf(i/10)));
    }

    sigmaSlider = new JSlider(0, 50, (int) Math.round(sigma * 10));
    sigmaSlider.addChangeListener(this);
    sigmaSlider.setLabelTable(labelTable);
    sigmaSlider.setMajorTickSpacing(10);
    sigmaSlider.setMinorTickSpacing(2);
    sigmaSlider.setPaintTicks(true);
    sigmaSlider.setPaintLabels(true);

    optionPane = new JPanel(new FlowLayout(FlowLayout.LEFT));
    optionPane.setBorder(BorderFactory.createRaisedBevelBorder());
    optionPane.add(new JLabel("Scale:"));
    optionPane.add(sigmaSlider);

    add(optionPane, BorderLayout.NORTH);

    canvas = new JPanel(new GridLayout(2, 2));
    add(canvas, BorderLayout.CENTER);

    LogisticDistribution dist = new LogisticDistribution(0, sigma);

    double[][] p = new double[200][2];
    double[][] q = new double[200][2];
    for (int i = 0; i < p.length; i++) {
        p[i][0] = (i - 100) / 10.0;
        p[i][1] = dist.p(p[i][0]);
        q[i][0] = (i - 100) / 10.0;
        q[i][1] = dist.cdf(p[i][0]);
    }

    pdf = LinePlot.plot(p, Line.Style.SOLID, Color.BLUE);
    pdf.setTitle("PDF");
    canvas.add(pdf);

    cdf = LinePlot.plot(q, Line.Style.SOLID, Color.BLUE);
    cdf.setTitle("CDF");
    canvas.add(cdf);

    double[] data = new double[500];
    for (int i = 0; i < data.length; i++) {
        data[i] = dist.rand();
    }

    histogram = Histogram.plot(data, 20);
    histogram.setTitle("Histogram");
    canvas.add(histogram);

    qqplot = QQPlot.plot(data, dist);
    qqplot.setTitle("Q-Q Plot");
    canvas.add(qqplot);
}
 
开发者ID:takun2s,项目名称:smile_1.5.0_java7,代码行数:58,代码来源:LogisticDistributionDemo.java


注:本文中的java.awt.FlowLayout.LEFT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。