List of usage examples for javax.swing JLabel setFont
@BeanProperty(preferred = true, visualUpdate = true, description = "The font for the component.") public void setFont(Font font)
From source file:com.diversityarrays.kdxplore.KDXploreFrame.java
private Component makeComponentForTab(KdxApp kdxApp, Component uiComponent) { Component appComponent = uiComponent; DevelopmentState devState = kdxApp.getDevelopmentState(); if (devState.getShouldShowHeading()) { JLabel heading = new JLabel(devState.getHeadingText(), JLabel.CENTER); heading.setOpaque(true);//from w w w .j a v a 2s. com heading.setForeground(devState.getHeadingFontColor()); heading.setBackground(Color.LIGHT_GRAY); heading.setFont(heading.getFont().deriveFont(Font.BOLD)); JPanel p = new JPanel(new BorderLayout()); p.add(heading, BorderLayout.NORTH); //Color.DARK_GRAY, Font.BOLD, Color.LIGHT_GRAY, Color.GRAY // p.add(GuiUtil.createLabelSeparator(devState.getHeadingText(), fontColor, Font.BOLD, Color.LIGHT_GRAY, Color.GRAY), // BorderLayout.NORTH); p.add(uiComponent, BorderLayout.CENTER); appComponent = p; } return appComponent; }
From source file:edu.ku.brc.specify.plugins.PartialDateUI.java
@Override public void setParent(final FormViewObj parent) { this.parent = parent; JLabel lbl = parent.getLabelFor(this); if (lbl != null && StringUtils.isNotEmpty(dateFieldName)) { DBTableInfo tblInfo = DBTableIdMgr.getInstance().getByClassName(parent.getView().getClassName()); if (tblInfo != null) { final DBFieldInfo fi = tblInfo.getFieldByName(dateFieldName); if (fi != null) { title = fi.getTitle();/*from w ww . j a v a2 s . c om*/ isRequired = fi.isRequired(); if (uivs[0] instanceof ValFormattedTextFieldSingle) { ((ValFormattedTextFieldSingle) uivs[0]).setRequired(isRequired); } else { for (UIValidatable uiv : uivs) { ((ValFormattedTextField) uiv).setRequired(isRequired); } } if (StringUtils.isNotEmpty(fi.getTitle())) { lbl.setText(fi.getTitle() + ":"); if (isRequired) { lbl.setFont(lbl.getFont().deriveFont(Font.BOLD)); } } if (lbl != null) { lbl.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { super.mouseClicked(e); if (e.getClickCount() == 2) { JOptionPane.showMessageDialog(UIRegistry.getMostRecentWindow(), "<html>" + fi.getDescription(), UIRegistry.getResourceString("FormViewObj.UNOTES"), JOptionPane.INFORMATION_MESSAGE); } } }); } } else { log.error("PartialDateUI - Couldn't find date field [" + dateFieldName + "] in data obj View: " + parent.getView().getName()); } } } }
From source file:com.funambol.exchange.admin.DefaultExchangeConnectorConfigPanel.java
/** * Create the panel//from ww w .ja va 2 s . c om */ private void init() { JLabel title, contactFolderLabel, eventFolderLabel, taskFolderLabel, noteFolderLabel, seccServerLabel, seccPortLabel, exchangeServerLabel; JPanel seccPanel, exchangePanel, sslPanel; title = new JLabel(); exchangePanel = new JPanel(); seccPanel = new JPanel(); sslPanel = new JPanel(); contactFolderValue = new JTextField(); eventFolderValue = new JTextField(); taskFolderValue = new JTextField(); noteFolderValue = new JTextField(); seccServerLabel = new JLabel(); seccServerValue = new JTextField(); seccPortLabel = new JLabel(); seccPortValue = new JTextField(); useSSLValue = new JCheckBox(); useFBAValue = new JCheckBox(); useKeyStoreValue = new JCheckBox(); keyStoreFileNameLabel = new JLabel(); keyStoreFileNameValue = new JTextField(); keyStorePasswordLabel = new JLabel(); keyStorePasswordValue = new JTextField(); exchangeServerLabel = new JLabel(); exchangeServerValue = new JTextField(); exchangeServerNameLabel = new JLabel(); exchangeServerNameValue = new JTextField(); setLayout(null); title.setFont(GuiFactory.titlePanelFont); title.setText("Funambol Exchange Connector"); title.setBounds(new Rectangle(14, 5, 316, 28)); title.setAlignmentX(SwingConstants.CENTER); title.setBorder(new TitledBorder("")); contactFolderLabel = new JLabel(); contactFolderLabel.setText("Contact Folder: "); contactFolderLabel.setBounds(14, 35, 116, 15); add(contactFolderLabel); contactFolderValue.setBounds(150, 35, 220, 19); add(contactFolderValue); eventFolderLabel = new JLabel(); eventFolderLabel.setText("Event Folder: "); eventFolderLabel.setBounds(14, 65, 116, 15); add(eventFolderLabel); eventFolderValue.setBounds(150, 65, 220, 19); add(eventFolderValue); taskFolderLabel = new JLabel(); taskFolderLabel.setText("Task Folder: "); taskFolderLabel.setBounds(14, 95, 116, 15); add(taskFolderLabel); taskFolderValue.setBounds(150, 95, 220, 19); add(taskFolderValue); noteFolderLabel = new JLabel(); noteFolderLabel.setText("Note Folder: "); noteFolderLabel.setBounds(14, 125, 116, 15); add(noteFolderLabel); noteFolderValue.setBounds(150, 125, 220, 19); add(noteFolderValue); seccPanel.setLayout(null); seccPanel.setBorder(new TitledBorder("HTTP Server Configuration")); seccServerLabel.setText("Server:"); seccPanel.add(seccServerLabel); seccServerLabel.setBounds(10, 20, 116, 15); seccPanel.add(seccServerValue); seccServerValue.setBounds(150, 20, 220, 19); seccServerValue.setFont(GuiFactory.defaultFont); seccPortLabel.setText("Port:"); seccPanel.add(seccPortLabel); seccPortLabel.setBounds(10, 50, 131, 15); seccPanel.add(seccPortValue); seccPortValue.setBounds(150, 50, 220, 19); seccPortValue.setFont(GuiFactory.defaultFont); add(seccPanel); seccPanel.setBounds(10, 155, 380, 80); exchangePanel.setLayout(null); exchangePanel.setBorder(new TitledBorder("WebDav Message Configuration")); exchangeServerLabel.setText("Server: "); exchangePanel.add(exchangeServerLabel); exchangeServerLabel.setBounds(10, 20, 150, 19); exchangePanel.add(exchangeServerValue); exchangeServerValue.setBounds(150, 20, 220, 19); exchangeServerValue.setFont(GuiFactory.defaultFont); exchangeServerNameLabel.setText("Name:"); exchangeServerNameLabel.setBounds(10, 50, 150, 19); exchangePanel.add(exchangeServerNameLabel); exchangeServerNameValue.setBounds(150, 50, 220, 19); exchangeServerNameValue.setFont(GuiFactory.defaultFont); exchangePanel.add(exchangeServerNameValue); add(exchangePanel); exchangePanel.setBounds(10, 255, 380, 80); //the ssl option panel sslPanel.setLayout(null); sslPanel.setBorder(new TitledBorder("SSL")); useSSLValue.setText("Use SSL"); useSSLValue.setSelected(false); useSSLValue.setBounds(5, 20, 150, 19); sslPanel.add(useSSLValue); useFBAValue.setText("Use Form-Based Authentication"); useFBAValue.setSelected(true); useFBAValue.setBounds(5, 40, 250, 19); sslPanel.add(useFBAValue); useKeyStoreValue.setText("Use Keystore"); useKeyStoreValue.setSelected(false); useKeyStoreValue.setBounds(5, 60, 200, 19); sslPanel.add(useKeyStoreValue); useKeyStoreValue.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent acEvent) { boolean enabled = useKeyStoreValue.isSelected(); keyStoreFileNameLabel.setEnabled(enabled); keyStoreFileNameValue.setEnabled(enabled); keyStorePasswordLabel.setEnabled(enabled); keyStorePasswordValue.setEnabled(enabled); } }); keyStoreFileNameLabel.setText("Key Store File: "); sslPanel.add(keyStoreFileNameLabel); keyStoreFileNameLabel.setEnabled(false); keyStoreFileNameLabel.setBounds(10, 80, 131, 15); sslPanel.add(keyStoreFileNameValue); keyStoreFileNameValue.setEnabled(false); keyStoreFileNameValue.setBounds(150, 80, 220, 19); keyStoreFileNameValue.setFont(GuiFactory.defaultFont); keyStorePasswordLabel.setText("Key Store Password: "); sslPanel.add(keyStorePasswordLabel); keyStorePasswordLabel.setEnabled(false); keyStorePasswordLabel.setBounds(10, 110, 131, 15); sslPanel.add(keyStorePasswordValue); keyStorePasswordValue.setEnabled(false); keyStorePasswordValue.setBounds(150, 110, 220, 19); keyStorePasswordValue.setFont(GuiFactory.defaultFont); add(sslPanel); sslPanel.setBounds(10, 355, 450, 140); confirmButton.setFont(GuiFactory.defaultFont); confirmButton.setText("Save"); add(confirmButton); confirmButton.setBounds(120, 500, 70, 25); confirmButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { getValues(); configPanel.saveDefaultConfig(event.getActionCommand()); configPanel.finishedDefaultConfig(); } }); cancelButton.setFont(GuiFactory.defaultFont); cancelButton.setText("Cancel"); add(cancelButton); cancelButton.setBounds(200, 500, 70, 25); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { configPanel.finishedDefaultConfig(); } }); // // Setting font... // Component[] components = getComponents(); for (int i = 0; (components != null) && (i < components.length); ++i) { components[i].setFont(GuiFactory.defaultFont); } // // We add it as the last one so that the font won't be changed // add(title); }
From source file:beproject.MainGUI.java
void createTagCloud() throws SQLException { TreeMap tmp = getFrequentWords(); Cloud cld = new Cloud(); JPanel tmpPanel = new JPanel(); FlowLayout t1 = new FlowLayout(); tmpPanel.setPreferredSize(new Dimension(512, 512)); tmpPanel.setLayout(t1);/* w w w . j a v a 2s . c o m*/ tmpPanel.setBounds(0, 0, 512, 512); //FlowLayout lm=(FlowLayout) tmpPanel.getLayout(); for (int i = 0; i < 40 && !tmp.isEmpty(); i++) { Map.Entry mp = tmp.pollFirstEntry(); Tag t = new Tag((String) mp.getKey(), (int) (mp.getValue())); cld.addTag(t); } Random rand = new Random(); for (Tag tag : cld.tags()) { final JLabel label = new JLabel(tag.getName()); label.setOpaque(false); label.setFont(label.getFont().deriveFont(rand.nextFloat() * 39)); label.setForeground(new Color(rand.nextInt())); tmpPanel.add(label); } if (tagCloudPanel == null) { tagCloudPanel = new JScrollPane(tmpPanel, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); } else { jPanel3.remove(tagCloudPanel); jPanel3.validate(); tagCloudPanel = new JScrollPane(tmpPanel, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); } //tagCloudPanel.setLayout(new ScrollPaneLayout()); //tagCloudPanel.setAutoscrolls(true); tmpPanel.validate(); tagCloudPanel.validate(); jPanel3.add(tagCloudPanel, BorderLayout.CENTER); jPanel3.validate(); }
From source file:com.isencia.passerelle.hmi.generic.GenericHMI.java
@SuppressWarnings("unchecked") private void renderModelComponentAnnotations(final NamedObj e, final JPanel b) { final List<TextAttribute> annotations = e.attributeList(TextAttribute.class); if (!annotations.isEmpty()) { final Box annotationsBox = new Box(BoxLayout.Y_AXIS); // annotationsBox.setBorder(BorderFactory.createTitledBorder("Info")); for (final TextAttribute textAttribute : annotations) { if (isAnnotionAuthorizedForEditor(textAttribute)) { final Box subBox = new Box(BoxLayout.Y_AXIS); // subBox.setBorder(BorderFactory.createTitledBorder(textAttribute.getName())); final String[] annotationLines = textAttribute.text.getExpression().split("\n"); for (final String annotationLine : annotationLines) { final JLabel lab = new JLabel(annotationLine); textAttribute.fontFamily.getExpression(); int bold = 0; if (textAttribute.bold.getExpression().compareTo("true") == 0) { bold = Font.BOLD; }//from w ww .ja v a2 s .co m int italic = 0; if (textAttribute.italic.getExpression().compareTo("true") == 0) { italic = Font.ITALIC; } final int textSize = Integer.valueOf(textAttribute.textSize.getExpression()); final Font font = new Font(textAttribute.fontFamily.getExpression(), bold | italic, textSize); lab.setFont(font); final String colorString = textAttribute.textColor.getExpression(); final String sub = colorString.substring(1, colorString.lastIndexOf("}")); final String[] rgba = sub.split(","); final float r = Float.valueOf(rgba[0]); final float g = Float.valueOf(rgba[1]); final float bl = Float.valueOf(rgba[2]); final float a = Float.valueOf(rgba[3]); final Color color = new Color(r, g, bl, a); lab.setForeground(color); subBox.add(lab); } annotationsBox.add(subBox); } } b.add(annotationsBox); } }
From source file:com.juanhg.cicloc.cicloCApplet.java
private void autogeneratedCode() { JPanel panel_control = new JPanel(); panel_control.setBorder(new CompoundBorder(new EtchedBorder(EtchedBorder.RAISED, null, null), new BevelBorder(BevelBorder.RAISED, null, null, null, null))); JPanel panelInputs = new JPanel(); panelInputs.setToolTipText(""); panelInputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0))); JPanel panelOutputs = new JPanel(); panelOutputs.setToolTipText(""); panelOutputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0))); JPanel panelTitleOutputs = new JPanel(); panelTitleOutputs.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); JLabel labelOutputData = new JLabel("Datos de la Simulaci\u00F3n"); labelOutputData.setFont(new Font("Tahoma", Font.PLAIN, 14)); panelTitleOutputs.add(labelOutputData); lblPhase = new JLabel("Trabajo Ciclo:"); lblPhase.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblTrabajoCValue = new JLabel(); lblTrabajoCValue.setText("0"); lblTrabajoCValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel lblPosicion = new JLabel("Trabajo:"); lblPosicion.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblTrabajoValue = new JLabel(); lblTrabajoValue.setText("0"); lblTrabajoValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); hotImage = loadImage(hot);//from w ww . j a va 2 s. c om coldImage = loadImage(cold); lblE = new JLabel("Rendimiento:"); lblE.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblEValue = new JLabel(); lblEValue.setText("0"); lblEValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); GroupLayout gl_panelOutputs = new GroupLayout(panelOutputs); gl_panelOutputs.setHorizontalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs.createSequentialGroup().addGap(22).addGroup(gl_panelOutputs .createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblE, GroupLayout.PREFERRED_SIZE, 84, GroupLayout.PREFERRED_SIZE) .addGap(26).addComponent(lblEValue, GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE)) .addGroup(gl_panelOutputs.createSequentialGroup() .addGroup(gl_panelOutputs.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblPhase, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(26)) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblPosicion, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE) .addGap(29))) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING, false) .addComponent(lblTrabajoValue, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lblTrabajoCValue, GroupLayout.PREFERRED_SIZE, 103, GroupLayout.PREFERRED_SIZE)))) .addGap(109)) .addGroup(gl_panelOutputs.createSequentialGroup().addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE, 262, GroupLayout.PREFERRED_SIZE) .addContainerGap(82, Short.MAX_VALUE))); gl_panelOutputs .setVerticalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblTrabajoCValue).addComponent(lblPhase)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblPosicion, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblTrabajoValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addComponent(lblE, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblEValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addGap(79))); panelOutputs.setLayout(gl_panelOutputs); panel_1 = new JPanel(); panel_1.setBorder(new LineBorder(new Color(0, 0, 0))); JPanel panel_6 = new JPanel(); panel_6.setBorder(new LineBorder(new Color(0, 0, 0))); GroupLayout gl_panel_control = new GroupLayout(panel_control); gl_panel_control.setHorizontalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panel_control.createSequentialGroup().addContainerGap() .addGroup(gl_panel_control.createParallelGroup(Alignment.LEADING, false) .addComponent(panelOutputs, 0, 0, Short.MAX_VALUE) .addComponent(panelInputs, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panel_6, 0, 0, Short.MAX_VALUE).addComponent(panel_1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(92, Short.MAX_VALUE))); gl_panel_control.setVerticalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panel_control.createSequentialGroup().addContainerGap() .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 213, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 129, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_6, GroupLayout.PREFERRED_SIZE, 146, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED).addComponent(panel_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(17))); btnLaunchSimulation = new JButton("Iniciar"); btnLaunchSimulation.setFont(new Font("Tahoma", Font.PLAIN, 16)); btnLaunchSimulation.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { btnLaunchSimulationEvent(event); } }); btnCold = new JButton(""); btnCold.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { btnHot.setEnabled(true); btnCold.setEnabled(false); isHot = false; lblE.setText("Eficiencia"); lblModeValue.setText("Modo Frig"); panelMode.setBackground(Color.BLUE); } }); btnCold.setIcon(new ImageIcon(coldImage)); btnCold.setEnabled(true); panelMode = new JPanel(); panelMode.setBorder(new LineBorder(new Color(0, 0, 0))); panelMode.setBackground(Color.ORANGE); btnHot = new JButton(""); btnHot.setIcon(new ImageIcon(hotImage)); btnHot.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { btnHot.setEnabled(false); btnCold.setEnabled(true); isHot = true; lblE.setText("Rendimiento"); lblModeValue.setText("Modo Motor"); panelMode.setBackground(Color.ORANGE); } }); btnHot.setEnabled(false); GroupLayout gl_panel_6 = new GroupLayout(panel_6); gl_panel_6.setHorizontalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING).addGroup(gl_panel_6 .createSequentialGroup().addContainerGap() .addGroup(gl_panel_6.createParallelGroup(Alignment.LEADING, false) .addComponent(panelMode, Alignment.TRAILING, 0, 0, Short.MAX_VALUE) .addComponent(btnHot, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE)) .addGap(10) .addGroup(gl_panel_6.createParallelGroup(Alignment.TRAILING, false) .addComponent(btnCold, GroupLayout.PREFERRED_SIZE, 112, GroupLayout.PREFERRED_SIZE) .addComponent(btnLaunchSimulation, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); gl_panel_6.setVerticalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_6.createSequentialGroup().addGap(10) .addGroup(gl_panel_6.createParallelGroup(Alignment.LEADING) .addComponent(panelMode, 0, 0, Short.MAX_VALUE).addComponent(btnLaunchSimulation, GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panel_6.createParallelGroup(Alignment.TRAILING) .addComponent(btnCold, GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE) .addComponent(btnHot, GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE)) .addContainerGap())); lblModeValue = new JLabel("Modo Motor"); lblModeValue.setFont(new Font("Tahoma", Font.PLAIN, 17)); GroupLayout gl_panelMode = new GroupLayout(panelMode); gl_panelMode.setHorizontalGroup(gl_panelMode.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelMode.createSequentialGroup().addContainerGap() .addComponent(lblModeValue, GroupLayout.PREFERRED_SIZE, 113, GroupLayout.PREFERRED_SIZE) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); gl_panelMode .setVerticalGroup(gl_panelMode.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelMode .createSequentialGroup().addContainerGap().addComponent(lblModeValue, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(52))); panelMode.setLayout(gl_panelMode); panel_6.setLayout(gl_panel_6); JLabel lblNewLabel = new JLabel("GNU GENERAL PUBLIC LICENSE"); panel_1.add(lblNewLabel); JLabel LabelT1 = new JLabel("T1"); LabelT1.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel labelT2 = new JLabel("T2"); labelT2.setFont(new Font("Tahoma", Font.PLAIN, 14)); JLabel labelVmin = new JLabel("Vm\u00EDn"); labelVmin.setFont(new Font("Tahoma", Font.PLAIN, 14)); JPanel panelTitle = new JPanel(); panelTitle.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); lblT2Value = new JLabel("300"); lblT2Value.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblVminValue = new JLabel("2"); lblVminValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblT1Value = new JLabel("400"); lblT1Value.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderT1 = new JSlider(); sliderT1.setMinimum(350); sliderT1.setMaximum(450); sliderT1.setMinorTickSpacing(1); sliderT1.setValue(400); sliderT1.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent event) { sliderT1Event(); } }); sliderT2 = new JSlider(); sliderT2.setMinimum(270); sliderT2.setMaximum(330); sliderT2.setMinorTickSpacing(1); sliderT2.setValue(300); sliderT2.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderT2Event(); } }); sliderVMin = new JSlider(); sliderVMin.setMaximum(4); sliderVMin.setMinimum(1); sliderVMin.setValue(2); sliderVMin.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderVminEvent(); } }); JLabel lblVmax = new JLabel("Vm\u00E1x"); lblVmax.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblVmaxValue = new JLabel("7"); lblVmaxValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderVMax = new JSlider(); sliderVMax.setMaximum(10); sliderVMax.setMinimum(6); sliderVMax.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent arg0) { sliderVmaxEvent(); } }); sliderVMax.setValue(7); sliderVMax.setMinorTickSpacing(1); JLabel labelN = new JLabel("N"); labelN.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblNValue = new JLabel("10"); lblNValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderN = new JSlider(); sliderN.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderNEvent(); } }); sliderN.setValue(10); sliderN.setMinorTickSpacing(1); GroupLayout gl_panelInputs = new GroupLayout(panelInputs); gl_panelInputs.setHorizontalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createSequentialGroup().addGap(19).addGroup(gl_panelInputs .createParallelGroup(Alignment.LEADING, false) .addComponent(labelN, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lblVmax, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(labelVmin, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(labelT2, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(LabelT1, GroupLayout.PREFERRED_SIZE, 65, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING, false) .addGroup(gl_panelInputs.createSequentialGroup() .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblT1Value, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE) .addComponent(lblT2Value, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addComponent(lblVminValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE)) .addGap(18) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING, false) .addComponent(sliderT1, 0, 0, Short.MAX_VALUE) .addComponent(sliderT2, 0, 0, Short.MAX_VALUE) .addComponent(sliderVMin, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE))) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(lblVmaxValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addGap(18).addComponent(sliderVMax, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(lblNValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addGap(18) .addComponent(sliderN, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED))) .addContainerGap()) .addComponent(panelTitle, GroupLayout.DEFAULT_SIZE, 259, Short.MAX_VALUE)); gl_panelInputs.setVerticalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(panelTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(18) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createSequentialGroup().addComponent(LabelT1).addGap(12) .addComponent(labelT2).addGap(17).addComponent(labelVmin).addGap(17) .addComponent(lblVmax, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addGap(17).addComponent(labelN, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panelInputs.createSequentialGroup() .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblT1Value, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderT1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblT2Value, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderT2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(11) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblVminValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderVMin, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblVmaxValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderVMax, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING) .addComponent(lblNValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderN, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))) .addGap(8))); JLabel lblDatosDeEntrada = new JLabel("Datos de Entrada"); lblDatosDeEntrada.setFont(new Font("Tahoma", Font.PLAIN, 14)); panelTitle.add(lblDatosDeEntrada); panelInputs.setLayout(gl_panelInputs); panel_control.setLayout(gl_panel_control); JPanel panel_visualizar = new JPanel(); panel_visualizar.setBackground(Color.WHITE); GroupLayout groupLayout = new GroupLayout(getContentPane()); groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.TRAILING) .addGroup(Alignment.LEADING, groupLayout.createSequentialGroup().addContainerGap() .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 286, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED).addComponent(panel_visualizar, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap(93, Short.MAX_VALUE))); groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING).addGroup(groupLayout .createSequentialGroup().addContainerGap() .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING) .addComponent(panel_visualizar, GroupLayout.DEFAULT_SIZE, 567, Short.MAX_VALUE) .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 568, GroupLayout.PREFERRED_SIZE)) .addContainerGap())); JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP); panelPiston = new JPanelGrafica(); panelPiston.setBackground(Color.WHITE); JPanel panel_5 = new JPanel(); panel_5.setBackground(Color.WHITE); JPanel panel = new JPanel(); panel.setBackground(Color.WHITE); GroupLayout gl_panel_visualizar = new GroupLayout(panel_visualizar); gl_panel_visualizar.setHorizontalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING) .addComponent(tabbedPane, GroupLayout.DEFAULT_SIZE, 845, Short.MAX_VALUE) .addGroup(gl_panel_visualizar.createSequentialGroup().addContainerGap() .addComponent(panelPiston, GroupLayout.PREFERRED_SIZE, 355, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel, GroupLayout.PREFERRED_SIZE, 183, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_5, GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE).addContainerGap())); gl_panel_visualizar.setVerticalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_visualizar.createSequentialGroup() .addComponent(tabbedPane, GroupLayout.PREFERRED_SIZE, 289, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING) .addComponent(panel, GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE) .addComponent(panelPiston, GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE) .addComponent(panel_5, GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE)) .addContainerGap())); panelTermo = new JPanelGrafica(); panelTermo.setBackground(Color.WHITE); GroupLayout gl_panel = new GroupLayout(panel); gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(panelTermo, GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE)); gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(panelTermo, GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE)); panel.setLayout(gl_panel); panelPistonInterno = new JPanelGrafica(); panelPistonInterno.setBackground(Color.WHITE); GroupLayout gl_panelPiston = new GroupLayout(panelPiston); gl_panelPiston.setHorizontalGroup(gl_panelPiston.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelPiston.createSequentialGroup() .addComponent(panelPistonInterno, GroupLayout.PREFERRED_SIZE, 354, GroupLayout.PREFERRED_SIZE) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); gl_panelPiston.setVerticalGroup(gl_panelPiston.createParallelGroup(Alignment.LEADING) .addComponent(panelPistonInterno, GroupLayout.DEFAULT_SIZE, 261, Short.MAX_VALUE)); panelPiston.setLayout(gl_panelPiston); JPanel panelBulb = new JPanel(); panelBulb.setBackground(Color.WHITE); JPanel panelLED = new JPanel(); panelLED.setBackground(Color.WHITE); lblBulbValue = new JLabel("- Horas"); lblLEDValue = new JLabel("- Horas"); GroupLayout gl_panel_5 = new GroupLayout(panel_5); gl_panel_5.setHorizontalGroup(gl_panel_5.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_5.createSequentialGroup() .addGroup(gl_panel_5.createParallelGroup(Alignment.LEADING, false) .addComponent(panelLED, 0, 0, Short.MAX_VALUE) .addComponent(panelBulb, GroupLayout.PREFERRED_SIZE, 132, Short.MAX_VALUE)) .addGap(18).addGroup(gl_panel_5.createParallelGroup(Alignment.LEADING) .addComponent(lblBulbValue).addComponent(lblLEDValue)) .addContainerGap(87, Short.MAX_VALUE))); gl_panel_5.setVerticalGroup(gl_panel_5.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_5.createSequentialGroup() .addComponent(panelBulb, GroupLayout.PREFERRED_SIZE, 143, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(panelLED, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)) .addGroup(gl_panel_5.createSequentialGroup().addGap(64).addComponent(lblBulbValue) .addPreferredGap(ComponentPlacement.RELATED, 135, Short.MAX_VALUE).addComponent(lblLEDValue) .addGap(64))); LEDOnImage = loadImage(LEDOn); LEDOffImage = loadImage(LEDOff); lblLED = new JLabel(new ImageIcon(LEDOffImage)); lblLED.setBackground(Color.WHITE); GroupLayout gl_panelLED = new GroupLayout(panelLED); gl_panelLED.setHorizontalGroup(gl_panelLED.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelLED.createSequentialGroup() .addComponent(lblLED, GroupLayout.PREFERRED_SIZE, 131, GroupLayout.PREFERRED_SIZE) .addContainerGap(33, Short.MAX_VALUE))); gl_panelLED.setVerticalGroup(gl_panelLED.createParallelGroup(Alignment.TRAILING).addGroup(Alignment.LEADING, gl_panelLED.createSequentialGroup().addContainerGap().addComponent(lblLED, GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE))); panelLED.setLayout(gl_panelLED); bulbOnImage = loadImage(bulbOn); bulbOffImage = loadImage(bulbOff); lblBulb = new JLabel(new ImageIcon(bulbOffImage)); lblBulb.setBackground(Color.WHITE); GroupLayout gl_panelBulb = new GroupLayout(panelBulb); gl_panelBulb.setHorizontalGroup(gl_panelBulb.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelBulb.createSequentialGroup() .addComponent(lblBulb, GroupLayout.PREFERRED_SIZE, 134, GroupLayout.PREFERRED_SIZE) .addContainerGap(30, Short.MAX_VALUE))); gl_panelBulb.setVerticalGroup(gl_panelBulb.createParallelGroup(Alignment.LEADING).addComponent(lblBulb, GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE)); panelBulb.setLayout(gl_panelBulb); panel_5.setLayout(gl_panel_5); JPanel panelXV = new JPanel(); panelXV.setBackground(Color.WHITE); tabbedPane.addTab("Grficas V", null, panelXV, null); JPanel panel_2 = new JPanel(); JPanel panel_3 = new JPanel(); JPanel panel_4 = new JPanel(); panelTV = new JPanelGrafica(); GroupLayout gl_panel_4 = new GroupLayout(panel_4); gl_panel_4.setHorizontalGroup( gl_panel_4.createParallelGroup(Alignment.LEADING).addGap(0, 272, Short.MAX_VALUE) .addComponent(panelTV, GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)); gl_panel_4 .setVerticalGroup(gl_panel_4.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE) .addGroup(gl_panel_4.createSequentialGroup() .addComponent(panelTV, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE) .addContainerGap(306, Short.MAX_VALUE))); panel_4.setLayout(gl_panel_4); GroupLayout gl_panelXV = new GroupLayout(panelXV); gl_panelXV.setHorizontalGroup(gl_panelXV.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelXV.createSequentialGroup().addContainerGap() .addComponent(panel_2, GroupLayout.PREFERRED_SIZE, 263, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_4, GroupLayout.PREFERRED_SIZE, 272, GroupLayout.PREFERRED_SIZE) .addContainerGap(11, Short.MAX_VALUE))); gl_panelXV.setVerticalGroup(gl_panelXV.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelXV.createSequentialGroup().addContainerGap() .addGroup(gl_panelXV.createParallelGroup(Alignment.LEADING) .addComponent(panel_4, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE) .addGroup(gl_panelXV.createParallelGroup(Alignment.TRAILING, false) .addComponent(panel_3, Alignment.LEADING, 0, 0, Short.MAX_VALUE) .addComponent(panel_2, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE))) .addContainerGap(317, Short.MAX_VALUE))); panelUV = new JPanelGrafica(); GroupLayout gl_panel_3 = new GroupLayout(panel_3); gl_panel_3.setHorizontalGroup(gl_panel_3.createParallelGroup(Alignment.LEADING).addComponent(panelUV, GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)); gl_panel_3.setVerticalGroup(gl_panel_3.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_3.createSequentialGroup() .addComponent(panelUV, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE) .addContainerGap(306, Short.MAX_VALUE))); panel_3.setLayout(gl_panel_3); panelPV = new JPanelGrafica(); GroupLayout gl_panel_2 = new GroupLayout(panel_2); gl_panel_2.setHorizontalGroup(gl_panel_2.createParallelGroup(Alignment.LEADING).addComponent(panelPV, GroupLayout.DEFAULT_SIZE, 249, Short.MAX_VALUE)); gl_panel_2.setVerticalGroup(gl_panel_2.createParallelGroup(Alignment.LEADING).addComponent(panelPV, GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE)); panel_2.setLayout(gl_panel_2); panelXV.setLayout(gl_panelXV); JPanel panelXT = new JPanel(); panelXT.setBackground(Color.WHITE); tabbedPane.addTab("Grficas T", null, panelXT, null); JPanel panel_9 = new JPanel(); panelPT = new JPanelGrafica(); GroupLayout gl_panel_9 = new GroupLayout(panel_9); gl_panel_9.setHorizontalGroup( gl_panel_9.createParallelGroup(Alignment.LEADING).addGap(0, 263, Short.MAX_VALUE) .addComponent(panelPT, GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)); gl_panel_9 .setVerticalGroup(gl_panel_9.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE) .addComponent(panelPT, GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE)); panel_9.setLayout(gl_panel_9); JPanel panel_10 = new JPanel(); panelST = new JPanelGrafica(); GroupLayout gl_panel_10 = new GroupLayout(panel_10); gl_panel_10.setHorizontalGroup( gl_panel_10.createParallelGroup(Alignment.LEADING).addGap(0, 272, Short.MAX_VALUE) .addComponent(panelST, GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)); gl_panel_10 .setVerticalGroup(gl_panel_10.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE) .addGroup(gl_panel_10.createSequentialGroup() .addComponent(panelST, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel_10.setLayout(gl_panel_10); JPanel panel_11 = new JPanel(); panelUT = new JPanelGrafica(); GroupLayout gl_panel_11 = new GroupLayout(panel_11); gl_panel_11.setHorizontalGroup( gl_panel_11.createParallelGroup(Alignment.LEADING).addGap(0, 272, Short.MAX_VALUE) .addComponent(panelUT, GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)); gl_panel_11 .setVerticalGroup(gl_panel_11.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE) .addGroup(gl_panel_11.createSequentialGroup() .addComponent(panelUT, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel_11.setLayout(gl_panel_11); GroupLayout gl_panelXT = new GroupLayout(panelXT); gl_panelXT.setHorizontalGroup(gl_panelXT.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelXT.createSequentialGroup().addContainerGap() .addComponent(panel_9, GroupLayout.PREFERRED_SIZE, 263, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_11, GroupLayout.PREFERRED_SIZE, 272, GroupLayout.PREFERRED_SIZE) .addContainerGap(11, Short.MAX_VALUE))); gl_panelXT.setVerticalGroup(gl_panelXT.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelXT.createSequentialGroup().addContainerGap() .addGroup(gl_panelXT.createParallelGroup(Alignment.LEADING) .addComponent(panel_11, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE) .addGroup(gl_panelXT.createParallelGroup(Alignment.TRAILING, false) .addComponent(panel_10, Alignment.LEADING, 0, 0, Short.MAX_VALUE) .addComponent(panel_9, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE))) .addContainerGap(317, Short.MAX_VALUE))); panelXT.setLayout(gl_panelXT); panel_visualizar.setLayout(gl_panel_visualizar); getContentPane().setLayout(groupLayout); }
From source file:com.juanhg.pot.PotApplet.java
private void autogeneratedCode() { JPanel panel_control = new JPanel(); panel_control.setBorder(new CompoundBorder(new EtchedBorder(EtchedBorder.RAISED, null, null), new BevelBorder(BevelBorder.RAISED, null, null, null, null))); JPanel panelInputs = new JPanel(); panelInputs.setToolTipText(""); panelInputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0))); JPanel panelOutputs = new JPanel(); panelOutputs.setToolTipText(""); panelOutputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0))); JPanel panelTitleOutputs = new JPanel(); panelTitleOutputs.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); JLabel labelOutputData = new JLabel("Datos de la Simulaci\u00F3n"); labelOutputData.setFont(new Font("Tahoma", Font.PLAIN, 14)); panelTitleOutputs.add(labelOutputData); JLabel lblW = new JLabel("W:"); lblW.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblWValue = new JLabel(); lblWValue.setText("-"); lblWValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblQ = new JLabel("Q:"); lblQ.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblQValue = new JLabel(); lblQValue.setText("-"); lblQValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblT2 = new JLabel("T:"); lblT2.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblTOValue = new JLabel(); lblTOValue.setText("-"); lblTOValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblU = new JLabel("U:"); lblU.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblP = new JLabel("P:"); lblP.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblVO = new JLabel("V:"); lblVO.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblVOValue = new JLabel(); lblVOValue.setText("-"); lblVOValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblPValue = new JLabel(); lblPValue.setText("-"); lblPValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblUValue = new JLabel(); lblUValue.setText("-"); lblUValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); GroupLayout gl_panelOutputs = new GroupLayout(panelOutputs); gl_panelOutputs.setHorizontalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addComponent(panelTitleOutputs, GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE) .addGroup(gl_panelOutputs.createSequentialGroup().addGap(31).addGroup(gl_panelOutputs .createParallelGroup(Alignment.TRAILING) .addGroup(gl_panelOutputs.createSequentialGroup() .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING, false) .addComponent(lblQ, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lblW, GroupLayout.PREFERRED_SIZE, 43, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addComponent(lblWValue, GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE) .addComponent(lblQValue, GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE))) .addGroup(Alignment.LEADING, gl_panelOutputs.createSequentialGroup() .addComponent(lblT2, GroupLayout.PREFERRED_SIZE, 43, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED).addComponent(lblTOValue, GroupLayout.PREFERRED_SIZE, 90, GroupLayout.PREFERRED_SIZE))) .addGap(18)// w ww . j av a 2s. c o m .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblU, GroupLayout.PREFERRED_SIZE, 43, GroupLayout.PREFERRED_SIZE) .addGap(6).addComponent(lblUValue, GroupLayout.PREFERRED_SIZE, 90, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblP, GroupLayout.PREFERRED_SIZE, 43, GroupLayout.PREFERRED_SIZE) .addGap(6).addComponent(lblPValue, GroupLayout.PREFERRED_SIZE, 90, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblVO, GroupLayout.PREFERRED_SIZE, 43, GroupLayout.PREFERRED_SIZE) .addGap(6).addComponent(lblVOValue, GroupLayout.PREFERRED_SIZE, 90, GroupLayout.PREFERRED_SIZE))) .addGap(25))); gl_panelOutputs.setVerticalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelOutputs .createSequentialGroup().addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING).addGroup(gl_panelOutputs .createSequentialGroup() .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addComponent(lblU, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblUValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addGap(6) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addComponent(lblP, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblPValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addGap(6) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addComponent(lblVO, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblVOValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE))) .addGroup(gl_panelOutputs.createSequentialGroup().addGroup(gl_panelOutputs .createParallelGroup(Alignment.TRAILING) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblW, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED).addComponent(lblQ, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_panelOutputs.createSequentialGroup() .addComponent(lblWValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED).addComponent(lblQValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE))) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING) .addComponent(lblT2, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblTOValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)))) .addContainerGap())); panelOutputs.setLayout(gl_panelOutputs); JPanel panelLicense = new JPanel(); panelLicense.setBorder(new LineBorder(new Color(0, 0, 0))); JPanel panel_6 = new JPanel(); panel_6.setBorder(new LineBorder(new Color(0, 0, 0))); GroupLayout gl_panel_control = new GroupLayout(panel_control); gl_panel_control .setHorizontalGroup(gl_panel_control.createParallelGroup(Alignment.LEADING) .addGroup(Alignment.TRAILING, gl_panel_control.createSequentialGroup().addContainerGap() .addGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING) .addComponent(panelInputs, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 346, Short.MAX_VALUE) .addComponent(panelOutputs, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panel_6, GroupLayout.PREFERRED_SIZE, 346, Short.MAX_VALUE) .addComponent(panelLicense, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 346, Short.MAX_VALUE)) .addContainerGap())); gl_panel_control.setVerticalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING) .addGroup(gl_panel_control.createSequentialGroup().addContainerGap() .addComponent(panelInputs, GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 108, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_6, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED).addComponent(panelLicense, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(24))); btnLaunchSimulation = new JButton("Iniciar"); btnLaunchSimulation.setFont(new Font("Tahoma", Font.PLAIN, 16)); btnLaunchSimulation.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { btnLaunchSimulationEvent(event); } }); GroupLayout gl_panel_6 = new GroupLayout(panel_6); gl_panel_6.setHorizontalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING).addGroup(Alignment.TRAILING, gl_panel_6.createSequentialGroup().addContainerGap() .addComponent(btnLaunchSimulation, GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE) .addContainerGap())); gl_panel_6.setVerticalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel_6 .createSequentialGroup().addContainerGap().addComponent(btnLaunchSimulation, GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE) .addContainerGap(69, Short.MAX_VALUE))); panel_6.setLayout(gl_panel_6); JLabel lblNewLabel = new JLabel("GNU GENERAL PUBLIC LICENSE"); panelLicense.add(lblNewLabel); lblT = new JLabel("Temperatura"); lblT.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblV = new JLabel("Volumen"); lblV.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblMo = new JLabel("Masa Inicial"); lblMo.setFont(new Font("Tahoma", Font.PLAIN, 14)); JPanel panelTitle = new JPanel(); panelTitle.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); lblVValue = new JLabel("15"); lblVValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblMoValue = new JLabel("5"); lblMoValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblTValue = new JLabel("300"); lblTValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderT = new JSlider(); sliderT.setMinimum(280); sliderT.setMaximum(330); sliderT.setMinorTickSpacing(1); sliderT.setValue(300); sliderT.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent event) { sliderI1Event(); } }); sliderV = new JSlider(); sliderV.setMinimum(3); sliderV.setMaximum(30); sliderV.setMinorTickSpacing(1); sliderV.setValue(15); sliderV.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderI2Event(); } }); sliderMo = new JSlider(); sliderMo.setMinimum(1); sliderMo.setMaximum(1000); sliderMo.setValue(5); sliderMo.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderI3Event(); } }); lblM = new JLabel("Masa Final"); lblM.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblMValue = new JLabel("4"); lblMValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderM = new JSlider(); sliderM.setMinimum(1); sliderM.setMaximum(1000); sliderM.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent arg0) { sliderI4Event(); } }); sliderM.setValue(4); sliderM.setMinorTickSpacing(1); lblType = new JLabel("Combustible"); lblType.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblTypeValue = new JLabel("Madera"); lblTypeValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderType = new JSlider(); sliderType.setMinimum(1); sliderType.setMaximum(4); sliderType.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { sliderI5Event(); } }); sliderType.setValue(1); sliderType.setMinorTickSpacing(1); lblMc = new JLabel("Masa Combustible"); lblMc.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblMcValue = new JLabel("10"); lblMcValue.setFont(new Font("Tahoma", Font.PLAIN, 14)); sliderMc = new JSlider(); sliderMc.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent arg0) { sliderI6Event(); } }); sliderMc.setMinimum(1); sliderMc.setValue(10); sliderMc.setMinorTickSpacing(1); sliderMc.setMaximum(50); btn1 = new JButton("1"); btn1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { btn1function(); } }); btn2 = new JButton("2"); btn2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { btn1.setEnabled(true); btn2.setEnabled(false); btn3.setEnabled(true); lblT.setEnabled(true); lblTValue.setEnabled(true); sliderT.setEnabled(true); lblV.setEnabled(true); lblVValue.setEnabled(true); sliderV.setEnabled(true); lblMo.setEnabled(false); lblMoValue.setEnabled(false); sliderMo.setEnabled(false); lblM.setEnabled(false); lblMValue.setEnabled(false); sliderM.setEnabled(false); lblType.setEnabled(true); lblTypeValue.setEnabled(true); sliderType.setEnabled(true); lblMc.setEnabled(true); lblMcValue.setEnabled(true); sliderMc.setEnabled(true); model.setCurrentPhase(2); readInputs(); updateFire(); updateScrews(); updatePot(); updatePanels(); repaint(); } }); btn3 = new JButton("3"); btn3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { btn1.setEnabled(true); btn2.setEnabled(true); btn3.setEnabled(false); lblT.setEnabled(true); lblTValue.setEnabled(true); sliderT.setEnabled(true); lblV.setEnabled(false); lblVValue.setEnabled(false); sliderV.setEnabled(false); lblMo.setEnabled(false); lblMoValue.setEnabled(false); sliderMo.setEnabled(false); lblM.setEnabled(true); lblMValue.setEnabled(true); sliderM.setEnabled(true); lblType.setEnabled(true); lblTypeValue.setEnabled(true); sliderType.setEnabled(true); lblMc.setEnabled(true); lblMcValue.setEnabled(true); sliderMc.setEnabled(true); model.setCurrentPhase(3); readInputs(); updateFire(); updateScrews(); updatePot(); updatePanels(); repaint(); } }); GroupLayout gl_panelInputs = new GroupLayout(panelInputs); gl_panelInputs.setHorizontalGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING) .addComponent(panelTitle, GroupLayout.DEFAULT_SIZE, 383, Short.MAX_VALUE) .addGroup(gl_panelInputs.createSequentialGroup().addGap(25) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING).addGroup(Alignment.TRAILING, gl_panelInputs.createSequentialGroup().addGroup(gl_panelInputs .createParallelGroup(Alignment.TRAILING).addGroup(gl_panelInputs .createSequentialGroup() .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblV, GroupLayout.PREFERRED_SIZE, 120, GroupLayout.PREFERRED_SIZE) .addComponent(lblMo, GroupLayout.DEFAULT_SIZE, 141, Short.MAX_VALUE) .addComponent(lblM, GroupLayout.PREFERRED_SIZE, 120, GroupLayout.PREFERRED_SIZE) .addComponent(lblType, GroupLayout.PREFERRED_SIZE, 120, GroupLayout.PREFERRED_SIZE) .addComponent(lblMc, GroupLayout.PREFERRED_SIZE, 118, GroupLayout.PREFERRED_SIZE)) .addGap(18)) .addComponent(lblT, GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblTValue, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE) .addComponent(lblVValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addComponent(lblMoValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addComponent(lblMValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE) .addComponent(lblTypeValue, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE) .addComponent(lblMcValue, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE)) .addGap(4).addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(sliderMc, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE) .addComponent(sliderType, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE) .addComponent(sliderM, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE) .addComponent(sliderMo, GroupLayout.DEFAULT_SIZE, 109, Short.MAX_VALUE) .addComponent(sliderV, 0, 0, Short.MAX_VALUE) .addComponent(sliderT, 0, 0, Short.MAX_VALUE))) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(btn1, GroupLayout.PREFERRED_SIZE, 94, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(btn2, GroupLayout.PREFERRED_SIZE, 93, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED).addComponent(btn3, GroupLayout.PREFERRED_SIZE, 91, GroupLayout.PREFERRED_SIZE))) .addContainerGap())); gl_panelInputs.setVerticalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(panelTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(18) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE).addComponent(lblT) .addComponent(lblTValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addComponent(sliderT, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE).addComponent(lblV) .addComponent(lblVValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addComponent(sliderV, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(11) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING).addComponent(lblMo) .addComponent(lblMoValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderMo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblM, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblMValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderM, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addComponent(lblType, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(sliderType, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(lblTypeValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE) .addComponent(lblMcValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE) .addComponent(lblMc, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)) .addComponent(sliderMc, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelInputs.createSequentialGroup() .addComponent(btn1, GroupLayout.DEFAULT_SIZE, 55, Short.MAX_VALUE) .addGap(12)) .addGroup(gl_panelInputs.createSequentialGroup() .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE) .addComponent(btn2, GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE) .addComponent(btn3, GroupLayout.DEFAULT_SIZE, 56, Short.MAX_VALUE)) .addContainerGap())))); JLabel lblDatosDeEntrada = new JLabel("Datos de Entrada"); lblDatosDeEntrada.setFont(new Font("Tahoma", Font.PLAIN, 14)); panelTitle.add(lblDatosDeEntrada); panelInputs.setLayout(gl_panelInputs); panel_control.setLayout(gl_panel_control); JPanel panel_visualizar = new JPanel(); panel_visualizar.setBackground(UIManager.getColor("Button.background")); GroupLayout groupLayout = new GroupLayout(getContentPane()); groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup().addContainerGap() .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 382, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel_visualizar, GroupLayout.PREFERRED_SIZE, 741, GroupLayout.PREFERRED_SIZE) .addContainerGap(31, Short.MAX_VALUE))); groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING) .addGroup(groupLayout.createSequentialGroup() .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING) .addGroup(groupLayout.createSequentialGroup().addContainerGap().addComponent( panel_visualizar, GroupLayout.DEFAULT_SIZE, 568, Short.MAX_VALUE)) .addGroup(groupLayout.createSequentialGroup().addGap(12).addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 568, Short.MAX_VALUE))) .addContainerGap())); JPanel panel = new JPanel(); panel.setBounds(0, 0, 345, 568); panel.setBackground(Color.WHITE); panel.setBorder(new LineBorder(new Color(0, 0, 0))); JPanel panel_1 = new JPanel(); panel_1.setBounds(351, 0, 390, 568); panel_1.setBackground(Color.WHITE); panel_1.setBorder(new LineBorder(new Color(0, 0, 0))); JPanel panel33 = new JPanel(); panel33.setBounds(1, 38, 388, 529); panel33.setBackground(Color.WHITE); JPanel panel_5 = new JPanel(); panel_5.setBounds(1, 1, 388, 31); panel_5.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); JLabel lblGrficas = new JLabel("Gr\u00E1ficas"); lblGrficas.setFont(new Font("Tahoma", Font.PLAIN, 14)); panel_5.add(lblGrficas); panel_visualizar.setLayout(null); JPanel panel32 = new JPanel(); panel32.setBounds(1, 38, 343, 529); panel32.setBackground(Color.WHITE); JPanel panel_4 = new JPanel(); panel_4.setBounds(1, 1, 343, 31); panel_4.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); JLabel lblSimulacion = new JLabel("Simulaci\u00F3n"); lblSimulacion.setFont(new Font("Tahoma", Font.PLAIN, 14)); panel_4.add(lblSimulacion); panel_visualizar.add(panel); panel.setLayout(null); panel.add(panel_4); panel.add(panel32); panelPot = new JPanelGrafica(); panelPot.setBackground(Color.WHITE); GroupLayout gl_panel32 = new GroupLayout(panel32); gl_panel32.setHorizontalGroup(gl_panel32.createParallelGroup(Alignment.LEADING).addComponent(panelPot, GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)); gl_panel32.setVerticalGroup(gl_panel32.createParallelGroup(Alignment.LEADING).addComponent(panelPot, GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)); panel32.setLayout(gl_panel32); panel_visualizar.add(panel_1); panel_1.setLayout(null); panel_1.add(panel33); panelGraficas = new JPanelGrafica(); panelGraficas.setBackground(Color.WHITE); GroupLayout gl_panel33 = new GroupLayout(panel33); gl_panel33.setHorizontalGroup(gl_panel33.createParallelGroup(Alignment.LEADING).addComponent(panelGraficas, GroupLayout.DEFAULT_SIZE, 388, Short.MAX_VALUE)); gl_panel33.setVerticalGroup(gl_panel33.createParallelGroup(Alignment.LEADING).addComponent(panelGraficas, GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)); panel33.setLayout(gl_panel33); panel_1.add(panel_5); getContentPane().setLayout(groupLayout); }
From source file:org.forester.archaeopteryx.ControlPanel.java
void startClickToOptions() { final JLabel spacer = new JLabel(""); spacer.setFont(ControlPanel.jcb_font); add(spacer);/*from w ww .j a v a 2 s. c o m*/ _click_to_label = new JLabel("Click on Node to:"); add(customizeLabel(_click_to_label, getConfiguration())); _click_to_combobox = new JComboBox(); _click_to_combobox.setFocusable(false); _click_to_combobox.setMaximumRowCount(14); _click_to_combobox.setFont(ControlPanel.js_font); if (!_configuration.isUseNativeUI()) { _click_to_combobox.setBackground(ControlPanel.background_color); } // don't add listener until all items are set (or each one will trigger // an event) // click_to_list.addActionListener(this); add(_click_to_combobox); // Correlates option names to titles _all_click_to_names = new HashMap<Integer, String>(); _click_to_names = new ArrayList<String>(); }
From source file:org.forester.archaeopteryx.ControlPanel.java
void setupSearchTools() { final String tip = "Enter text to search for. Use ',' for multiple searches (logical OR) and '+' for logical AND."; final JLabel search_label = new JLabel("Search:"); search_label.setFont(ControlPanel.jcb_bold_font); if (!getConfiguration().isUseNativeUI()) { search_label.setForeground(ControlPanel.jcb_text_color); }/*from w w w . j a v a2 s . com*/ add(search_label); search_label.setToolTipText(tip); _search_found_label = new JLabel(); getSearchFoundCountsLabel().setVisible(false); _search_found_label.setFont(ControlPanel.jcb_bold_font); if (!getConfiguration().isUseNativeUI()) { _search_found_label.setForeground(ControlPanel.jcb_text_color); //Color of Found: X } _search_tf = new JTextField(3); _search_tf.setToolTipText(tip); _search_tf.setEditable(true); if (!getConfiguration().isUseNativeUI()) { _search_tf.setForeground(Color.GREEN);//ControlPanel.jcb_text_color ); _search_tf.setBackground(ControlPanel.button_background_color); _search_tf.setBorder(null); } _search_reset_button = new JButton(); getSearchResetButton().setText("Reset"); getSearchResetButton().setEnabled(false); getSearchResetButton().setVisible(false); final JPanel s_panel_1 = new JPanel(new BorderLayout()); final JPanel s_panel_2 = new JPanel(new GridLayout(1, 2, 0, 0)); s_panel_1.setBackground(getBackground()); add(s_panel_1); s_panel_2.setBackground(getBackground()); add(s_panel_2); final KeyAdapter key_adapter = new KeyAdapter() { @Override public void keyReleased(final KeyEvent key_event) { search(); displayedPhylogenyMightHaveChanged(true); } }; final ActionListener action_listener = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { searchReset(); setSearchFoundCountsOnLabel(0); getSearchFoundCountsLabel().setVisible(false); getSearchTextField().setText(""); getSearchResetButton().setEnabled(false); getSearchResetButton().setVisible(false); displayedPhylogenyMightHaveChanged(true); } }; _search_reset_button.addActionListener(action_listener); _search_tf.addKeyListener(key_adapter); addJTextField(_search_tf, s_panel_1); s_panel_2.add(_search_found_label); addJButton(_search_reset_button, s_panel_2); }
From source file:org.forester.archaeopteryx.ControlPanel.java
private void addSequenceRelationBlock() { final JLabel spacer = new JLabel(""); spacer.setSize(1, 1);// w w w . j a v a2s .co m add(spacer); final JLabel mainLabel = new JLabel("Sequence relations to display"); final JLabel typeLabel = customizeLabel(new JLabel("(type) "), getConfiguration()); typeLabel.setFont(ControlPanel.js_font.deriveFont(7)); getSequenceRelationTypeBox().setFocusable(false); _sequence_relation_type_box.setFont(ControlPanel.js_font); if (!_configuration.isUseNativeUI()) { _sequence_relation_type_box.setBackground(Constants.BUTTON_BACKGROUND_COLOR_DEFAULT); _sequence_relation_type_box.setForeground(Constants.BUTTON_TEXT_COLOR_DEFAULT); } _sequence_relation_type_box.setRenderer(new ListCellRenderer() { @Override public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { final Component component = new DefaultListCellRenderer().getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); if ((value != null) && (value instanceof SequenceRelation.SEQUENCE_RELATION_TYPE)) { ((DefaultListCellRenderer) component).setText(SequenceRelation .getPrintableNameByType((SequenceRelation.SEQUENCE_RELATION_TYPE) value)); } return component; } }); final GridBagLayout gbl = new GridBagLayout(); _sequence_relation_type_box.setMinimumSize(new Dimension(115, 17)); _sequence_relation_type_box.setPreferredSize(new Dimension(115, 20)); final JPanel horizGrid = new JPanel(gbl); horizGrid.setBackground(getBackground()); horizGrid.add(typeLabel); horizGrid.add(_sequence_relation_type_box); add(customizeLabel(mainLabel, getConfiguration())); add(horizGrid); add(getSequenceRelationBox()); if (_configuration.doDisplayOption(Configuration.show_relation_confidence)) { addCheckbox(Configuration.show_relation_confidence, _configuration.getDisplayTitle(Configuration.show_relation_confidence)); setCheckbox(Configuration.show_relation_confidence, _configuration.doCheckOption(Configuration.show_relation_confidence)); } }