Java Code Examples for java.awt.FlowLayout#LEFT

The following examples show how to use java.awt.FlowLayout#LEFT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AuthenticationOptionsPanel.java    From fosstrak-epcis with GNU Lesser General Public License v2.1 6 votes vote down vote up
private BasicOptionsPanel() {
    super(new FlowLayout(FlowLayout.LEFT, 10, 0));

    userNameLabel = new JLabel("Username:");
    add(userNameLabel);

    userNameInput = new JTextField(10);
    userNameInput.getDocument().addDocumentListener(this);
    add(userNameInput);

    passwordLabel = new JLabel("Password:");
    add(passwordLabel);

    passwordInput = new JPasswordField(10);
    passwordInput.getDocument().addDocumentListener(this);
    add(passwordInput);

    setVisible(false);
}
 
Example 2
Source File: ProgramEditor.java    From FancyBing with GNU General Public License v3.0 6 votes vote down vote up
private JTextField createEntry(String labelText, int cols, String text,
                               boolean editable)
{
    JComponent label = createEntryLabel(labelText);
    m_panelLeft.add(label);
    Box box = Box.createVerticalBox();
    JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
    box.add(Box.createVerticalGlue());
    box.add(panel);
    box.add(Box.createVerticalGlue());
    JTextField field = new JTextField(cols);
    field.setText(text);
    if (! editable)
        GuiUtil.setEditableFalse(field);
    panel.add(field);
    m_panelRight.add(box);
    return field;
}
 
Example 3
Source File: SchemaTreeTraverser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Simple constructor.
 */
public SchemaTreeCellRenderer() {
    FlowLayout fl = new FlowLayout(FlowLayout.LEFT, 1, 1);
    this.setLayout(fl);
    this.iconLabel = new JLabel();
    this.iconLabel.setOpaque(false);
    this.iconLabel.setBorder(null);
    this.add(this.iconLabel);

    // add some space
    this.add(Box.createHorizontalStrut(5));

    this.nameLabel = new JLabel();
    this.nameLabel.setOpaque(false);
    this.nameLabel.setBorder(null);
    this.nameLabel.setFont(nameFont);
    this.add(this.nameLabel);

    this.isSelected = false;

    this.setOpaque(false);
    this.setBorder(null);
}
 
Example 4
Source File: EditCustomCategoryDialog.java    From tda with GNU Lesser General Public License v2.1 5 votes vote down vote up
private JPanel createNamePanel() {
    JPanel panel = new JPanel(new BorderLayout());
    name = new JTextField(30);
    JPanel innerPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    innerPanel.add(new JLabel(ResourceManager.translate("customcategory.name.label")));
    innerPanel.add(name);
    panel.add(innerPanel, BorderLayout.CENTER);
    return(panel);
}
 
Example 5
Source File: ReqBodyPanelByteArray.java    From rest-client with Apache License 2.0 5 votes vote down vote up
@PostConstruct
protected void init() {
    setLayout(new BorderLayout());
    
    JPanel jp_north = new JPanel(new FlowLayout(FlowLayout.LEFT));
    jp_north.add(jp_content_type_charset.getComponent());
    
    jb_body.setToolTipText("Select file having body content");
    jb_body.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent ae) {
            fileOpen();
        }
    });
    jp_north.add(jb_body);
    
    add(jp_north, BorderLayout.NORTH);
    
    jta.setFont(UIUtil.FONT_MONO_PLAIN);
    jta.setEditable(false);
    
    add(new JScrollPane(jta), BorderLayout.CENTER);
    
    // DnD:
    FileDropTargetListener l = new FileDropTargetListener();
    l.addDndAction(new DndAction() {
        @Override
        public void onDrop(List<File> files) {
            fileOpen(files.get(0));
        }
    });
    new DropTarget(jta, l);
    new DropTarget(jb_body, l);
}
 
Example 6
Source File: ClosableTabHost.java    From SmartIM with Apache License 2.0 5 votes vote down vote up
public Component createTab(String text) {
    JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
    JLabel label = new JLabel(text);
    label.setOpaque(false);
    panel.add(label);
    TabButton btn = new TabButton();
    panel.add(btn);
    panel.setBackground(Color.black);
    panel.setOpaque(false);
    return panel;
}
 
Example 7
Source File: ToolbarPool.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Updates the default configuration. */
private synchronized void updateDefault () {
    Toolbar[] bars = getToolbarsNow ();
    name = ""; // NOI18N
    
    if (bars.length == 1) {
        revalidate(bars[0]);
    } else {
        JPanel tp = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
        for (int i = 0; i < bars.length; i++) {
            tp.add(bars[i]);
        }
        revalidate(tp); 
    }
}
 
Example 8
Source File: SamplesPanel.java    From CodenameOne with GNU General Public License v2.0 4 votes vote down vote up
private JComponent wrapFlowLeft(JComponent cmp) {
    JPanel out = new JPanel(new FlowLayout(FlowLayout.LEFT));
    out.setOpaque(false);
    out.add(cmp);
    return out;
}
 
Example 9
Source File: XOpenTypeViewer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
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);
}
 
Example 10
Source File: XOperations.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public void loadOperations(XMBean mbean, MBeanInfo mbeanInfo) {
    this.mbean = mbean;
    this.mbeanInfo = mbeanInfo;
    // add operations information
    MBeanOperationInfo operations[] = mbeanInfo.getOperations();
    invalidate();

    // remove listeners, if any
    Component listeners[] = getComponents();
    for (int i = 0; i < listeners.length; i++) {
        if (listeners[i] instanceof JButton) {
            ((JButton) listeners[i]).removeActionListener(this);
        }
    }

    removeAll();
    setLayout(new BorderLayout());

    JButton methodButton;
    JLabel methodLabel;
    JPanel innerPanelLeft, innerPanelRight;
    JPanel outerPanelLeft, outerPanelRight;
    outerPanelLeft = new JPanel(new GridLayout(operations.length, 1));
    outerPanelRight = new JPanel(new GridLayout(operations.length, 1));

    for (int i = 0; i < operations.length; i++) {
        innerPanelLeft = new JPanel(new FlowLayout(FlowLayout.RIGHT));
        innerPanelRight = new JPanel(new FlowLayout(FlowLayout.LEFT));
        String returnType = operations[i].getReturnType();
        if (returnType == null) {
            methodLabel = new JLabel("null", JLabel.RIGHT);
            if (JConsole.isDebug()) {
                System.err.println(
                        "WARNING: The operation's return type " +
                        "shouldn't be \"null\". Check how the " +
                        "MBeanOperationInfo for the \"" +
                        operations[i].getName() + "\" operation has " +
                        "been defined in the MBean's implementation code.");
            }
        } else {
            methodLabel = new JLabel(
                    Utils.getReadableClassName(returnType), JLabel.RIGHT);
        }
        innerPanelLeft.add(methodLabel);
        if (methodLabel.getText().length() > 20) {
            methodLabel.setText(methodLabel.getText().
                    substring(methodLabel.getText().
                    lastIndexOf(".") + 1,
                    methodLabel.getText().length()));
        }

        methodButton = new JButton(operations[i].getName());
        methodButton.setToolTipText(operations[i].getDescription());
        boolean callable = isCallable(operations[i].getSignature());
        if (callable) {
            methodButton.addActionListener(this);
        } else {
            methodButton.setEnabled(false);
        }

        MBeanParameterInfo[] signature = operations[i].getSignature();
        OperationEntry paramEntry = new OperationEntry(operations[i],
                callable,
                methodButton,
                this);
        operationEntryTable.put(methodButton, paramEntry);
        innerPanelRight.add(methodButton);
        if (signature.length == 0) {
            innerPanelRight.add(new JLabel("( )", JLabel.CENTER));
        } else {
            innerPanelRight.add(paramEntry);
        }

        outerPanelLeft.add(innerPanelLeft, BorderLayout.WEST);
        outerPanelRight.add(innerPanelRight, BorderLayout.CENTER);
    }
    add(outerPanelLeft, BorderLayout.WEST);
    add(outerPanelRight, BorderLayout.CENTER);
    validate();
}
 
Example 11
Source File: XOpenTypeViewer.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
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);
}
 
Example 12
Source File: XOperations.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void loadOperations(XMBean mbean, MBeanInfo mbeanInfo) {
    this.mbean = mbean;
    this.mbeanInfo = mbeanInfo;
    // add operations information
    MBeanOperationInfo operations[] = mbeanInfo.getOperations();
    invalidate();

    // remove listeners, if any
    Component listeners[] = getComponents();
    for (int i = 0; i < listeners.length; i++) {
        if (listeners[i] instanceof JButton) {
            ((JButton) listeners[i]).removeActionListener(this);
        }
    }

    removeAll();
    setLayout(new BorderLayout());

    JButton methodButton;
    JLabel methodLabel;
    JPanel innerPanelLeft, innerPanelRight;
    JPanel outerPanelLeft, outerPanelRight;
    outerPanelLeft = new JPanel(new GridLayout(operations.length, 1));
    outerPanelRight = new JPanel(new GridLayout(operations.length, 1));

    for (int i = 0; i < operations.length; i++) {
        innerPanelLeft = new JPanel(new FlowLayout(FlowLayout.RIGHT));
        innerPanelRight = new JPanel(new FlowLayout(FlowLayout.LEFT));
        String returnType = operations[i].getReturnType();
        if (returnType == null) {
            methodLabel = new JLabel("null", JLabel.RIGHT);
            if (JConsole.isDebug()) {
                System.err.println(
                        "WARNING: The operation's return type " +
                        "shouldn't be \"null\". Check how the " +
                        "MBeanOperationInfo for the \"" +
                        operations[i].getName() + "\" operation has " +
                        "been defined in the MBean's implementation code.");
            }
        } else {
            methodLabel = new JLabel(
                    Utils.getReadableClassName(returnType), JLabel.RIGHT);
        }
        innerPanelLeft.add(methodLabel);
        if (methodLabel.getText().length() > 20) {
            methodLabel.setText(methodLabel.getText().
                    substring(methodLabel.getText().
                    lastIndexOf(".") + 1,
                    methodLabel.getText().length()));
        }

        methodButton = new JButton(operations[i].getName());
        methodButton.setToolTipText(operations[i].getDescription());
        boolean callable = isCallable(operations[i].getSignature());
        if (callable) {
            methodButton.addActionListener(this);
        } else {
            methodButton.setEnabled(false);
        }

        MBeanParameterInfo[] signature = operations[i].getSignature();
        OperationEntry paramEntry = new OperationEntry(operations[i],
                callable,
                methodButton,
                this);
        operationEntryTable.put(methodButton, paramEntry);
        innerPanelRight.add(methodButton);
        if (signature.length == 0) {
            innerPanelRight.add(new JLabel("( )", JLabel.CENTER));
        } else {
            innerPanelRight.add(paramEntry);
        }

        outerPanelLeft.add(innerPanelLeft, BorderLayout.WEST);
        outerPanelRight.add(innerPanelRight, BorderLayout.CENTER);
    }
    add(outerPanelLeft, BorderLayout.WEST);
    add(outerPanelRight, BorderLayout.CENTER);
    validate();
}
 
Example 13
Source File: XOperations.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void loadOperations(XMBean mbean, MBeanInfo mbeanInfo) {
    this.mbean = mbean;
    this.mbeanInfo = mbeanInfo;
    // add operations information
    MBeanOperationInfo operations[] = mbeanInfo.getOperations();
    invalidate();

    // remove listeners, if any
    Component listeners[] = getComponents();
    for (int i = 0; i < listeners.length; i++) {
        if (listeners[i] instanceof JButton) {
            ((JButton) listeners[i]).removeActionListener(this);
        }
    }

    removeAll();
    setLayout(new BorderLayout());

    JButton methodButton;
    JLabel methodLabel;
    JPanel innerPanelLeft, innerPanelRight;
    JPanel outerPanelLeft, outerPanelRight;
    outerPanelLeft = new JPanel(new GridLayout(operations.length, 1));
    outerPanelRight = new JPanel(new GridLayout(operations.length, 1));

    for (int i = 0; i < operations.length; i++) {
        innerPanelLeft = new JPanel(new FlowLayout(FlowLayout.RIGHT));
        innerPanelRight = new JPanel(new FlowLayout(FlowLayout.LEFT));
        String returnType = operations[i].getReturnType();
        if (returnType == null) {
            methodLabel = new JLabel("null", JLabel.RIGHT);
            if (JConsole.isDebug()) {
                System.err.println(
                        "WARNING: The operation's return type " +
                        "shouldn't be \"null\". Check how the " +
                        "MBeanOperationInfo for the \"" +
                        operations[i].getName() + "\" operation has " +
                        "been defined in the MBean's implementation code.");
            }
        } else {
            methodLabel = new JLabel(
                    Utils.getReadableClassName(returnType), JLabel.RIGHT);
        }
        innerPanelLeft.add(methodLabel);
        if (methodLabel.getText().length() > 20) {
            methodLabel.setText(methodLabel.getText().
                    substring(methodLabel.getText().
                    lastIndexOf(".") + 1,
                    methodLabel.getText().length()));
        }

        methodButton = new JButton(operations[i].getName());
        methodButton.setToolTipText(operations[i].getDescription());
        boolean callable = isCallable(operations[i].getSignature());
        if (callable) {
            methodButton.addActionListener(this);
        } else {
            methodButton.setEnabled(false);
        }

        MBeanParameterInfo[] signature = operations[i].getSignature();
        OperationEntry paramEntry = new OperationEntry(operations[i],
                callable,
                methodButton,
                this);
        operationEntryTable.put(methodButton, paramEntry);
        innerPanelRight.add(methodButton);
        if (signature.length == 0) {
            innerPanelRight.add(new JLabel("( )", JLabel.CENTER));
        } else {
            innerPanelRight.add(paramEntry);
        }

        outerPanelLeft.add(innerPanelLeft, BorderLayout.WEST);
        outerPanelRight.add(innerPanelRight, BorderLayout.CENTER);
    }
    add(outerPanelLeft, BorderLayout.WEST);
    add(outerPanelRight, BorderLayout.CENTER);
    validate();
}
 
Example 14
Source File: XOpenTypeViewer.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
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);
}
 
Example 15
Source File: XOpenTypeViewer.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
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);
}
 
Example 16
Source File: DataTableViewer.java    From rapidminer-studio with GNU Affero General Public License v3.0 4 votes vote down vote up
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);
}
 
Example 17
Source File: XOpenTypeViewer.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
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);
}
 
Example 18
Source File: OptionalModuleComponent.java    From mzmine2 with GNU General Public License v2.0 4 votes vote down vote up
public OptionalModuleComponent(ParameterSet embeddedParameters) {

    super(new FlowLayout(FlowLayout.LEFT));

    this.embeddedParameters = embeddedParameters;

    checkBox = new JCheckBox();
    checkBox.addActionListener(this);
    add(checkBox);

    setButton = new JButton("Setup..");
    setButton.addActionListener(this);
    setButton.setEnabled(false);
    add(setButton);

  }
 
Example 19
Source File: GedPanel.java    From MtgDesktopCompanion with GNU General Public License v3.0 4 votes vote down vote up
public GedPanel() {
	setLayout(new BorderLayout());

	JPanel panneauHaut = new JPanel();
	panneauCenter = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 5));
	viewPanel = new ZoomableJPanel();
	
	
	AbstractBuzyIndicatorComponent buzy = AbstractBuzyIndicatorComponent.createProgressComponent();
	add(panneauHaut, BorderLayout.NORTH);
	add(panneauCenter, BorderLayout.CENTER);
	
	panneauHaut.add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("DRAG_HERE")));
	panneauHaut.add(buzy);
	
	
	
	new FileDropDecorator().init(panneauCenter, (File[] files) -> {
		buzy.start(files.length);
		SwingWorker<Void, GedEntry<?>> sw = new SwingWorker<>() {

			@Override
			protected Void doInBackground() throws Exception {
				for(File f : files)
				{
					try {
						GedEntry<T> entry = new GedEntry<>(f,classe);
									entry.setObject(instance);
						
						GedService.inst().store(entry);
						publish(entry);
						
					} catch (Exception e) {
						logger.error("Error uploading " + f,e);
					}	
					
				}
				return null;
			}

			@Override
			protected void done() {
				buzy.end();
				revalidate();
			}

			@Override
			protected void process(List<GedEntry<?>> chunks) {
				chunks.forEach(c->{
					addEntry(c);
					buzy.progressSmooth(1);
				});
			}

		};
		ThreadManager.getInstance().runInEdt(sw, "Upload File");
	});
}
 
Example 20
Source File: XOpenTypeViewer.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
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);
}