List of usage examples for java.awt Font ITALIC
int ITALIC
To view the source code for java.awt Font ITALIC.
Click Source Link
From source file:ca.phon.ipamap.IpaMap.java
private void init() { setLayout(new BorderLayout()); // favorites//from w w w . ja va2 s .c om IpaGrids favData = getFavData(); final Grid fg = favData.getGrid().get(0); favPanel = getGridPanel(fg); favPanel.setCollapsed(getSavedSectionToggle(fg.getName())); favToggleButton = getToggleButton(fg, favPanel); favToggleButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setSavedSectionToggle(fg.getName(), !getSavedSectionToggle(fg.getName())); } }); JPanel favSection = new JPanel(new VerticalLayout(0)); favSection.add(favToggleButton); favSection.add(favPanel); favContainer = favSection; // search Grid emptyGrid = (new ObjectFactory()).createGrid(); emptyGrid.setName("Search Results (0)"); emptyGrid.setRows(0); emptyGrid.setCols(0); searchPanel = getGridPanel(emptyGrid); searchToggleButton = getToggleButton(emptyGrid, searchPanel); final JButton searchButton = new JButton("Search"); searchButton.putClientProperty("JComponent.sizeVariant", "small"); searchButton.addActionListener(this::showSearchFrame); JPanel searchSection = new JPanel(new VerticalLayout(0)); searchSection.add(searchButton); searchSection.add(searchToggleButton); searchContainer = searchSection; // static content final JPanel centerPanel = new JPanel(new VerticalLayout(0)); IpaGrids grids = getGridData(); for (final Grid grid : grids.getGrid()) { final JXCollapsiblePane cp = getGridPanel(grid); cp.setCollapsed(getSavedSectionToggle(grid.getName())); JXButton toggleBtn = getToggleButton(grid, cp); toggleBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setSavedSectionToggle(grid.getName(), !getSavedSectionToggle(grid.getName())); } }); toggleButtons.add(toggleBtn); centerPanel.add(toggleBtn); centerPanel.add(cp); gridPanels.add(cp); } scrollPane = new JScrollPane(centerPanel); scrollPane.setAutoscrolls(true); scrollPane.setWheelScrollingEnabled(true); // scrollPane.setViewportView(centerPanel); add(scrollPane, BorderLayout.CENTER); // JPanel btmPanel = new JPanel(new BorderLayout()); // scalePanel.add(smallLbl, BorderLayout.WEST); // scalePanel.add(scaleSlider, BorderLayout.CENTER); // scalePanel.add(largeLbl, BorderLayout.EAST); final JButton scrollBtn = new JButton("-"); scrollBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { // popupMenu.show(scrollBtn, 0, scrollBtn.getHeight()); JPopupMenu ctxMenu = new JPopupMenu(); setupContextMenu(ctxMenu, scrollBtn); ctxMenu.show(scrollBtn, 0, scrollBtn.getHeight()); } }); // Font infoFont = new Font("Courier New", Font.PLAIN, 12); infoLabel = new JLabel(); infoLabel.setFont(infoLabel.getFont().deriveFont(Font.ITALIC)); infoLabel.setText("[]"); infoLabel.setOpaque(false); statusBar = new JXStatusBar(); statusBar.setLayout(new BorderLayout()); statusBar.add(infoLabel, BorderLayout.CENTER); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setCorner(ScrollPaneConstants.LOWER_RIGHT_CORNER, scrollBtn); add(statusBar, BorderLayout.SOUTH); JPanel topPanel = new JPanel(new VerticalLayout(0)); topPanel.add(searchSection); topPanel.add(favSection); add(topPanel, BorderLayout.NORTH); }
From source file:skoa.helpers.ConfiguracionGraficas.java
private void vistaIntermedia1() { datos.removeAll();/*from w ww.ja v a2 s.com*/ panel.removeAll(); panel = new JPanel(); panel.setLayout(new GridLayout(2, 1)); panel.setBorder(BorderFactory.createEtchedBorder()); panel.add(opciones); opciones2.removeAll(); opciones2.add(fichero); //seleccionadas=""; String DG = ""; seleccionadas.removeAllElements(); seleccionadas.add("Desplegar para ver"); for (int i = 0; i < direcciones.size(); i++) { if (direcciones.elementAt(i).charAt(0) == 'C') { //Es un fichero //La ruta es: ruta_del_ejecutable\Consultas\... //TENGO QUE LLEGAR consultas y despues buscar el fichero Y PONER LO QUE SIGUE EN SELECCIONADAS. String aux = direcciones.elementAt(i).substring(direcciones.elementAt(i).indexOf("Consultas") + 1); if (aux.indexOf("A") > 0) aux = aux.substring(aux.indexOf("A")); if (aux.indexOf("B") > 0) aux = aux.substring(aux.indexOf("B")); if (aux.indexOf("C") > 0) aux = aux.substring(aux.indexOf("C")); if (aux.indexOf("D") > 0) aux = aux.substring(aux.indexOf("D")); aux = aux.substring(0, aux.indexOf(".txt"));//quito el .txt al nombre //if (i==0)seleccionadas=seleccionadas+aux; //else seleccionadas = seleccionadas + ", " + aux; DG = aux; } else {//Es una DG //if (i==0) seleccionadas = seleccionadas + direcciones.elementAt(i); //else seleccionadas = seleccionadas + ", " + direcciones.elementAt(i); DG = direcciones.elementAt(i); } seleccionadas.add(DG); //if(nd1==0) lo.append("Seleccionadas "+"("+(nd1+1)+" de "+nd+")"+": "+DG); //else lo.append("\n "+DG); } p = new JPanel(); p.setLayout(new GridLayout(1, 3)); lo = new JComboBox(seleccionadas); lo.setEditable(false); lo.setSelectedIndex(0); lo.setFont(new Font("Tahoma", Font.ITALIC, 12)); //l=new JLabel("Seleccionadas "+"("+(nd1+1)+" de "+nd+")"+": "+seleccionadas); l = new JLabel("Seleccionadas " + "(" + (nd1 + 1) + " de " + nd + ")" + ": "); l.setFont(new Font("Tahoma", Font.ITALIC, 12)); p.add(l); p.add(lo); p.add(new JPanel()); //lo = new javax.swing.JTextArea(1,1); //jScrollPane = new javax.swing.JScrollPane(lo); //jScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); //jScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); //lo.append("Seleccionadas "+"("+(nd1+1)+" de "+nd+")"+": "+seleccionadas); //lo.setFont(new Font("Tahoma", Font.ITALIC, 12)); //opciones2.add(l); opciones2.add(p); //opciones2.add(jScrollPane); panel.add(opciones2); ndirs.setEnabled(false); //Una vez elegida al menos 1 DG, desactivamos la posibilidad de poder boton2.setEnabled(false); //cambiar el nmero de DGs a seleccionar. cargarVista(); }
From source file:org.openmicroscopy.shoola.agents.metadata.editor.UserProfile.java
/** * Builds the panel hosting the user's details. * // w ww. ja va2s.co m * @return See above. */ private JPanel buildContentPanel() { ExperimenterData user = (ExperimenterData) model.getRefObject(); boolean editable = model.isUserOwner(user); if (!editable) editable = MetadataViewerAgent.isAdministrator(); details = EditorUtil.convertExperimenter(user); JPanel content = new JPanel(); content.setBorder(BorderFactory.createTitledBorder("User")); content.setBackground(UIUtilities.BACKGROUND_COLOR); Entry<String, String> entry; Iterator<Entry<String, String>> i = details.entrySet().iterator(); JComponent label; JTextField area; String key, value; content.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.WEST; c.insets = new Insets(0, 2, 2, 0); //Add log in name but cannot edit. c.gridx = 0; c.gridy = 0; c.gridwidth = GridBagConstraints.REMAINDER;//end row c.fill = GridBagConstraints.HORIZONTAL; content.add(buildProfileCanvas(), c); c.gridy++; c.gridx = 0; label = EditorUtil.getLabel(EditorUtil.DISPLAY_NAME, true); label.setBackground(UIUtilities.BACKGROUND_COLOR); c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last c.fill = GridBagConstraints.NONE;//reset to default c.weightx = 0.0; content.add(label, c); c.gridx++; content.add(Box.createHorizontalStrut(5), c); c.gridx++; c.gridwidth = GridBagConstraints.REMAINDER;//end row c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; loginArea.setText(user.getUserName()); loginArea.setEnabled(false); loginArea.setEditable(false); if (MetadataViewerAgent.isAdministrator() && !model.isSystemUser(user.getId()) && !model.isSelf()) { loginArea.setEnabled(true); loginArea.getDocument().addDocumentListener(this); } content.add(loginArea, c); while (i.hasNext()) { ++c.gridy; c.gridx = 0; entry = i.next(); key = entry.getKey(); value = entry.getValue(); label = EditorUtil.getLabel(key, EditorUtil.FIRST_NAME.equals(key) || EditorUtil.LAST_NAME.equals(key)); area = new JTextField(value); area.setBackground(UIUtilities.BACKGROUND_COLOR); area.setEditable(editable); area.setEnabled(editable); if (editable) area.getDocument().addDocumentListener(this); items.put(key, area); label.setBackground(UIUtilities.BACKGROUND_COLOR); c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last c.fill = GridBagConstraints.NONE;//reset to default c.weightx = 0.0; content.add(label, c); c.gridx++; content.add(Box.createHorizontalStrut(5), c); c.gridx++; c.gridwidth = GridBagConstraints.REMAINDER;//end row c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; content.add(area, c); } c.gridx = 0; c.gridy++; label = EditorUtil.getLabel(EditorUtil.DEFAULT_GROUP, false); c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last c.fill = GridBagConstraints.NONE;//reset to default c.weightx = 0.0; content.add(label, c); c.gridx++; content.add(Box.createHorizontalStrut(5), c); c.gridx++; c.gridwidth = GridBagConstraints.REMAINDER; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1.0; content.add(groupsBox, c); c.gridy++; content.add(permissionsPane, c); c.gridx = 0; c.gridy++; label = EditorUtil.getLabel(EditorUtil.GROUP_OWNER, false); c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last c.fill = GridBagConstraints.NONE; //reset to default c.weightx = 0.0; content.add(label, c); c.gridx++; content.add(Box.createHorizontalStrut(5), c); c.gridx++; c.gridwidth = GridBagConstraints.REMAINDER; //end row c.fill = GridBagConstraints.NONE; c.weightx = 1.0; content.add(ownerBox, c); if (activeBox.isVisible()) { c.gridx = 0; c.gridy++; label = EditorUtil.getLabel(EditorUtil.ACTIVE, false); c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last c.fill = GridBagConstraints.NONE; c.weightx = 0.0; content.add(label, c); c.gridx++; content.add(Box.createHorizontalStrut(5), c); c.gridx++; c.gridwidth = GridBagConstraints.REMAINDER; c.fill = GridBagConstraints.NONE; c.weightx = 1.0; content.add(activeBox, c); } if (adminBox.isVisible()) { c.gridx = 0; c.gridy++; label = EditorUtil.getLabel(EditorUtil.ADMINISTRATOR, false); c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last c.fill = GridBagConstraints.NONE; c.weightx = 0.0; content.add(label, c); c.gridx++; content.add(Box.createHorizontalStrut(5), c); c.gridx++; c.gridwidth = GridBagConstraints.REMAINDER; c.fill = GridBagConstraints.NONE; c.weightx = 1.0; content.add(adminBox, c); } c.gridx = 0; c.gridy++; content.add(Box.createHorizontalStrut(10), c); c.gridy++; label = UIUtilities.setTextFont(EditorUtil.MANDATORY_DESCRIPTION, Font.ITALIC); label.setForeground(UIUtilities.REQUIRED_FIELDS_COLOR); c.weightx = 0.0; content.add(label, c); return content; }
From source file:hpssim.grafica.HPSsim.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY // //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Lgc M DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance(); HPSsimWindow = new JFrame(); hpssimWindow = new JPanel(); hpssimTab = new JTabbedPane(); panelConfiguration = new JPanel(); label10 = new JLabel(); label3 = new JLabel(); ncpu = new JTextField(); label4 = new JLabel(); ngpu = new JTextField(); vSpacer1 = new JPanel(null); label11 = new JLabel(); label2 = new JLabel(); sliderSimulationTime = new JSlider(); textFieldSimTime = new JLabel(); label1 = new JLabel(); sliderJob = new JSlider(); textFieldNjob = new JLabel(); label9 = new JLabel(); textFieldQVGA = new JTextField(); label43 = new JLabel(); tex_mediaexe = new JTextField(); checkBoxEndJob = new JCheckBox(); label6 = new JLabel(); comboBoxScheduler = new JComboBox<>(); label8 = new JLabel(); textFieldTimeSlice = new JTextField(); label7 = new JLabel(); comboBoxQueue = new JComboBox<>(); vSpacer2 = new JPanel(null); label21 = new JLabel(); sliderclassRate = new JSlider(); labelclassRate = new JLabel(); label12 = new JLabel(); sliderRTJob = new JSlider(); labelRT = new JLabel(); label14 = new JLabel(); sliderOpenCl = new JSlider(); labelOPENCL = new JLabel(); checkBox_enableLog = new JCheckBox(); panelPerformance = new JPanel(); separator1 = new JSeparator(); tabbedPane1 = new JTabbedPane(); panelCPU = new JPanel(); labelCPUUsage = new JLabel(); panelCPUQueue = new JPanel(); tabbedPane2 = new JTabbedPane(); panelGPU = new JPanel(); labelGPUUsage = new JLabel(); panelGPUQueue = new JPanel(); panel2 = new JPanel(); label18 = new JLabel(); virtualTime = new JTextField(); label5 = new JLabel(); processiNelSistema = new JTextField(); label17 = new JLabel(); processiElaborazione = new JTextField(); label16 = new JLabel(); processiInCoda = new JTextField(); label15 = new JLabel(); ldavg_1 = new JTextField(); label19 = new JLabel(); ldavg_5 = new JTextField(); label20 = new JLabel(); ldavg_15 = new JTextField(); panel3 = new JPanel(); progressBar = new JProgressBar(); panelGraph = new JPanel(); graphPanel = new JPanel(); label23 = new JLabel(); label38 = new JLabel(); text_ClassRate = new JTextField(); label24 = new JLabel(); button_CostanteCodaSuMedia = new JButton(); label39 = new JLabel(); button_ClassRateCodaSuMedia = new JButton(); label25 = new JLabel(); button_CostanteTempoMedioArrivo = new JButton(); hSpacer1 = new JPanel(null); label40 = new JLabel(); button_ClassRateTempoMedioArrivo = new JButton(); label26 = new JLabel(); label41 = new JLabel(); label27 = new JLabel(); label42 = new JLabel(); label28 = new JLabel(); label33 = new JLabel(); label29 = new JLabel(); label30 = new JLabel(); label31 = new JLabel(); label32 = new JLabel(); button_CrescenteCodaSuMedia = new JButton(); label34 = new JLabel(); button_BurstCodaSuMedia = new JButton(); button_CrescenteCarico = new JButton(); label35 = new JLabel(); button_BurstTempoMedioArrivo = new JButton(); label36 = new JLabel(); label37 = new JLabel(); label22 = new JLabel(); title1 = compFactory.createTitle("HPSsim 2.0 "); button1 = new JButton(); okButton = new JButton(); button3 = new JButton(); dialog1 = new JDialog(); button2 = new JButton(); label13 = new JLabel(); erroreLabel = new JLabel(); Grafici = new JFrame(); panelGraficoFinestra = new JPanel(); //======== HPSsimWindow ======== {//from w w w.java2s .c om HPSsimWindow.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); HPSsimWindow.setResizable(false); Container HPSsimWindowContentPane = HPSsimWindow.getContentPane(); //======== hpssimWindow ======== { hpssimWindow.setForeground(Color.blue); // JFormDesigner evaluation mark hpssimWindow.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), hpssimWindow.getBorder())); hpssimWindow.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); hpssimWindow.setLayout(null); //======== hpssimTab ======== { //======== panelConfiguration ======== { panelConfiguration.setLayout(new TableLayout( new double[][] { { 1, 70, 70, 70, 68, 70, 70, 74 }, { 0.01, 27, 21, 26, 27, 25, 25, 25, 21, 21, TableLayout.PREFERRED, 12, TableLayout.PREFERRED, 22, 23 } })); ((TableLayout) panelConfiguration.getLayout()).setHGap(5); ((TableLayout) panelConfiguration.getLayout()).setVGap(5); //---- label10 ---- label10.setText("Hardware"); label10.setFont(new Font("Segoe UI", Font.ITALIC, 16)); panelConfiguration.add(label10, new TableLayoutConstraints(1, 1, 7, 1, TableLayoutConstraints.CENTER, TableLayoutConstraints.FULL)); //---- label3 ---- label3.setText("CPU"); label3.setFont(new Font("Segoe UI", Font.PLAIN, 12)); label3.setLabelFor(ncpu); panelConfiguration.add(label3, new TableLayoutConstraints(1, 2, 1, 2, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); //---- ncpu ---- ncpu.setText("4"); panelConfiguration.add(ncpu, new TableLayoutConstraints(2, 2, 3, 2, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label4 ---- label4.setText("GPU"); label4.setFont(new Font("Segoe UI", Font.PLAIN, 12)); label4.setLabelFor(ngpu); panelConfiguration.add(label4, new TableLayoutConstraints(4, 2, 4, 2, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); //---- ngpu ---- ngpu.setText("0"); panelConfiguration.add(ngpu, new TableLayoutConstraints(5, 2, 6, 2, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); panelConfiguration.add(vSpacer1, new TableLayoutConstraints(1, 3, 7, 3, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label11 ---- label11.setText("Simulation"); label11.setFont(new Font("Segoe UI", Font.ITALIC, 16)); panelConfiguration.add(label11, new TableLayoutConstraints(1, 4, 7, 4, TableLayoutConstraints.CENTER, TableLayoutConstraints.FULL)); //---- label2 ---- label2.setText("Sim Time"); panelConfiguration.add(label2, new TableLayoutConstraints(1, 5, 1, 5, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); //---- sliderSimulationTime ---- sliderSimulationTime.setValue(100000); sliderSimulationTime.setMaximum(1200000); sliderSimulationTime.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { sliderSimulationTimeStateChanged(e); } }); panelConfiguration.add(sliderSimulationTime, new TableLayoutConstraints(2, 5, 6, 5, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- textFieldSimTime ---- textFieldSimTime.setText("100000 ms"); panelConfiguration.add(textFieldSimTime, new TableLayoutConstraints(7, 5, 7, 5, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label1 ---- label1.setText("Numero di job"); panelConfiguration.add(label1, new TableLayoutConstraints(1, 6, 1, 6, TableLayoutConstraints.RIGHT, TableLayoutConstraints.CENTER)); //---- sliderJob ---- sliderJob.setMaximum(20000); sliderJob.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { sliderJobStateChanged(e); } }); panelConfiguration.add(sliderJob, new TableLayoutConstraints(2, 6, 6, 6, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- textFieldNjob ---- textFieldNjob.setText("50"); panelConfiguration.add(textFieldNjob, new TableLayoutConstraints(7, 6, 7, 6, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label9 ---- label9.setText("Media arrivo"); panelConfiguration.add(label9, new TableLayoutConstraints(1, 7, 1, 7, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); //---- textFieldQVGA ---- textFieldQVGA.setText("230"); panelConfiguration.add(textFieldQVGA, new TableLayoutConstraints(2, 7, 2, 7, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label43 ---- label43.setText("Media exe"); panelConfiguration.add(label43, new TableLayoutConstraints(3, 7, 3, 7, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); //---- tex_mediaexe ---- tex_mediaexe.setText("1000"); panelConfiguration.add(tex_mediaexe, new TableLayoutConstraints(4, 7, 4, 7, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- checkBoxEndJob ---- checkBoxEndJob.setText("End Job"); panelConfiguration.add(checkBoxEndJob, new TableLayoutConstraints(6, 7, 6, 7, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label6 ---- label6.setText("Scheduler"); panelConfiguration.add(label6, new TableLayoutConstraints(1, 9, 1, 9, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); //---- comboBoxScheduler ---- comboBoxScheduler.setModel(new DefaultComboBoxModel<>( new String[] { "Priority Round Robin", "Completely Fair Scheduler" })); comboBoxScheduler.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { comboBoxSchedulerActionPerformed(e); } }); panelConfiguration.add(comboBoxScheduler, new TableLayoutConstraints(2, 9, 5, 9, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label8 ---- label8.setText("Time Slice"); panelConfiguration.add(label8, new TableLayoutConstraints(6, 9, 6, 9, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); //---- textFieldTimeSlice ---- textFieldTimeSlice.setText("210"); panelConfiguration.add(textFieldTimeSlice, new TableLayoutConstraints(7, 9, 7, 9, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label7 ---- label7.setText("Queue"); panelConfiguration.add(label7, new TableLayoutConstraints(1, 10, 1, 10, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); //---- comboBoxQueue ---- comboBoxQueue.setModel(new DefaultComboBoxModel<>(new String[] { "FIFO", "Highest Priority First", "Shortest Job First", "Round Robin", "Random Queue" })); panelConfiguration.add(comboBoxQueue, new TableLayoutConstraints(2, 10, 5, 10, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); panelConfiguration.add(vSpacer2, new TableLayoutConstraints(1, 11, 7, 11, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label21 ---- label21.setText("Class Rate"); panelConfiguration.add(label21, new TableLayoutConstraints(1, 12, 1, 12, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); //---- sliderclassRate ---- sliderclassRate.setValue(99); sliderclassRate.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { sliderclassRateStateChanged(e); } }); panelConfiguration.add(sliderclassRate, new TableLayoutConstraints(2, 12, 4, 12, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- labelclassRate ---- labelclassRate.setText("99%"); panelConfiguration.add(labelclassRate, new TableLayoutConstraints(5, 12, 5, 12, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label12 ---- label12.setText("RT Job Prob"); panelConfiguration.add(label12, new TableLayoutConstraints(1, 13, 1, 13, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); //---- sliderRTJob ---- sliderRTJob.setValue(45); sliderRTJob.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { sliderRTJobStateChanged(e); } }); panelConfiguration.add(sliderRTJob, new TableLayoutConstraints(2, 13, 4, 13, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- labelRT ---- labelRT.setText("45%"); panelConfiguration.add(labelRT, new TableLayoutConstraints(5, 13, 5, 13, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label14 ---- label14.setText("OpenCL Job "); panelConfiguration.add(label14, new TableLayoutConstraints(1, 14, 1, 14, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); //---- sliderOpenCl ---- sliderOpenCl.setValue(20); sliderOpenCl.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { sliderOpenClStateChanged(e); } }); panelConfiguration.add(sliderOpenCl, new TableLayoutConstraints(2, 14, 4, 14, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- labelOPENCL ---- labelOPENCL.setText("20%"); panelConfiguration.add(labelOPENCL, new TableLayoutConstraints(5, 14, 5, 14, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- checkBox_enableLog ---- checkBox_enableLog.setText("log"); panelConfiguration.add(checkBox_enableLog, new TableLayoutConstraints(7, 14, 7, 14, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); } hpssimTab.addTab("Configuration", panelConfiguration); //======== panelPerformance ======== { //======== tabbedPane1 ======== { //======== panelCPU ======== { panelCPU.setLayout(new BorderLayout()); //---- labelCPUUsage ---- labelCPUUsage.setText("0\\0"); labelCPUUsage.setHorizontalAlignment(SwingConstants.CENTER); panelCPU.add(labelCPUUsage, BorderLayout.SOUTH); } tabbedPane1.addTab("Usage", panelCPU); //======== panelCPUQueue ======== { panelCPUQueue.setLayout(new BorderLayout()); } tabbedPane1.addTab("Queue", panelCPUQueue); } //======== tabbedPane2 ======== { //======== panelGPU ======== { panelGPU.setLayout(new BorderLayout()); //---- labelGPUUsage ---- labelGPUUsage.setText("0\\0"); labelGPUUsage.setHorizontalAlignment(SwingConstants.CENTER); panelGPU.add(labelGPUUsage, BorderLayout.SOUTH); } tabbedPane2.addTab("Usage", panelGPU); //======== panelGPUQueue ======== { panelGPUQueue.setLayout(new BorderLayout()); } tabbedPane2.addTab("Queue", panelGPUQueue); } //======== panel2 ======== { panel2.setLayout(new TableLayout(new double[][] { { TableLayout.PREFERRED, TableLayout.FILL }, { TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED } })); //---- label18 ---- label18.setText("Virtual Time"); panel2.add(label18, new TableLayoutConstraints(0, 0, 0, 0, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); panel2.add(virtualTime, new TableLayoutConstraints(1, 0, 1, 0, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label5 ---- label5.setText("Processi nel sistema"); panel2.add(label5, new TableLayoutConstraints(0, 2, 0, 2, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); //---- processiNelSistema ---- processiNelSistema.setText("0"); panel2.add(processiNelSistema, new TableLayoutConstraints(1, 2, 1, 2, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label17 ---- label17.setText("Processi in elaborazione"); panel2.add(label17, new TableLayoutConstraints(0, 3, 0, 3, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); //---- processiElaborazione ---- processiElaborazione.setText("0"); panel2.add(processiElaborazione, new TableLayoutConstraints(1, 3, 1, 3, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label16 ---- label16.setText("Processi in coda"); panel2.add(label16, new TableLayoutConstraints(0, 4, 0, 4, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); //---- processiInCoda ---- processiInCoda.setText("0"); panel2.add(processiInCoda, new TableLayoutConstraints(1, 4, 1, 4, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label15 ---- label15.setText("ldavg_1"); panel2.add(label15, new TableLayoutConstraints(0, 5, 0, 5, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); panel2.add(ldavg_1, new TableLayoutConstraints(1, 5, 1, 5, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label19 ---- label19.setText("ldavg_5"); panel2.add(label19, new TableLayoutConstraints(0, 6, 0, 6, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); panel2.add(ldavg_5, new TableLayoutConstraints(1, 6, 1, 6, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label20 ---- label20.setText("ldavg_15"); panel2.add(label20, new TableLayoutConstraints(0, 7, 0, 7, TableLayoutConstraints.RIGHT, TableLayoutConstraints.FULL)); panel2.add(ldavg_15, new TableLayoutConstraints(1, 7, 1, 7, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); } //======== panel3 ======== { panel3.setLayout(new TableLayout(new double[][] { { TableLayout.PREFERRED, TableLayout.PREFERRED }, { TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED } })); } GroupLayout panelPerformanceLayout = new GroupLayout(panelPerformance); panelPerformance.setLayout(panelPerformanceLayout); panelPerformanceLayout.setHorizontalGroup(panelPerformanceLayout.createParallelGroup() .addGroup(panelPerformanceLayout.createSequentialGroup().addContainerGap() .addGroup(panelPerformanceLayout.createParallelGroup() .addComponent(separator1) .addGroup(panelPerformanceLayout.createSequentialGroup() .addGroup(panelPerformanceLayout.createParallelGroup() .addGroup(panelPerformanceLayout .createSequentialGroup() .addComponent(panel2, GroupLayout.PREFERRED_SIZE, 256, GroupLayout.PREFERRED_SIZE) .addPreferredGap( LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(panelPerformanceLayout .createParallelGroup() .addComponent(progressBar, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(panelPerformanceLayout .createSequentialGroup() .addComponent(panel3, GroupLayout.PREFERRED_SIZE, 256, GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)))) .addGroup(panelPerformanceLayout .createSequentialGroup() .addComponent(tabbedPane1, GroupLayout.PREFERRED_SIZE, 261, GroupLayout.PREFERRED_SIZE) .addPreferredGap( LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(tabbedPane2, GroupLayout.PREFERRED_SIZE, 261, GroupLayout.PREFERRED_SIZE))) .addContainerGap(8, Short.MAX_VALUE))))); panelPerformanceLayout.setVerticalGroup(panelPerformanceLayout.createParallelGroup() .addGroup(panelPerformanceLayout.createSequentialGroup() .addContainerGap(15, Short.MAX_VALUE) .addGroup(panelPerformanceLayout.createParallelGroup() .addComponent(tabbedPane2, GroupLayout.DEFAULT_SIZE, 218, GroupLayout.PREFERRED_SIZE) .addComponent(tabbedPane1, GroupLayout.PREFERRED_SIZE, 218, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(separator1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE) .addGroup(panelPerformanceLayout .createParallelGroup(GroupLayout.Alignment.TRAILING, false) .addComponent(panel2, GroupLayout.PREFERRED_SIZE, 155, GroupLayout.PREFERRED_SIZE) .addGroup(panelPerformanceLayout.createSequentialGroup() .addComponent(progressBar, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(18, 18, 18).addComponent(panel3, GroupLayout.PREFERRED_SIZE, 119, GroupLayout.PREFERRED_SIZE))) .addContainerGap())); } hpssimTab.addTab("Performance", panelPerformance); //======== panelGraph ======== { //======== graphPanel ======== { graphPanel.setLayout(new TableLayout(new double[][] { { TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED }, { 27, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, 25, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED } })); //---- label23 ---- label23.setText("Carico costante"); label23.setFont(label23.getFont().deriveFont(Font.BOLD | Font.ITALIC)); graphPanel.add(label23, new TableLayoutConstraints(0, 0, 1, 0, TableLayoutConstraints.CENTER, TableLayoutConstraints.FULL)); //---- label38 ---- label38.setText("Classification Rate"); label38.setFont(label38.getFont().deriveFont(Font.BOLD | Font.ITALIC)); graphPanel.add(label38, new TableLayoutConstraints(5, 0, 6, 0, TableLayoutConstraints.CENTER, TableLayoutConstraints.FULL)); graphPanel.add(text_ClassRate, new TableLayoutConstraints(7, 0, 7, 0, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label24 ---- label24.setText("Coda\\Media"); graphPanel.add(label24, new TableLayoutConstraints(0, 1, 0, 1, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- button_CostanteCodaSuMedia ---- button_CostanteCodaSuMedia.setText("Esegui"); button_CostanteCodaSuMedia.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { button_CostanteCodaSuMediaActionPerformed(e); } }); graphPanel.add(button_CostanteCodaSuMedia, new TableLayoutConstraints(2, 1, 2, 1, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label39 ---- label39.setText("Coda\\Media"); graphPanel.add(label39, new TableLayoutConstraints(5, 1, 5, 1, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- button_ClassRateCodaSuMedia ---- button_ClassRateCodaSuMedia.setText("Esegui"); button_ClassRateCodaSuMedia.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { button_ClassRateCodaSuMediaActionPerformed(e); } }); graphPanel.add(button_ClassRateCodaSuMedia, new TableLayoutConstraints(7, 1, 7, 1, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label25 ---- label25.setText("Tempo Medio Arrivo"); graphPanel.add(label25, new TableLayoutConstraints(0, 2, 0, 2, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- button_CostanteTempoMedioArrivo ---- button_CostanteTempoMedioArrivo.setText("Esegui"); button_CostanteTempoMedioArrivo.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { button_CostanteTempoMedioArrivoActionPerformed(e); } }); graphPanel.add(button_CostanteTempoMedioArrivo, new TableLayoutConstraints(2, 2, 2, 4, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); graphPanel.add(hSpacer1, new TableLayoutConstraints(3, 0, 3, 15, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label40 ---- label40.setText("Tempo Medio Arrivo"); graphPanel.add(label40, new TableLayoutConstraints(5, 2, 5, 2, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- button_ClassRateTempoMedioArrivo ---- button_ClassRateTempoMedioArrivo.setText("Esegui"); button_ClassRateTempoMedioArrivo.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { button_ClassRateTempoMedioArrivoActionPerformed(e); } }); graphPanel.add(button_ClassRateTempoMedioArrivo, new TableLayoutConstraints(7, 2, 7, 4, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label26 ---- label26.setText("Troughput"); graphPanel.add(label26, new TableLayoutConstraints(0, 3, 0, 3, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label41 ---- label41.setText("Troughput"); graphPanel.add(label41, new TableLayoutConstraints(5, 3, 5, 3, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label27 ---- label27.setText("Carico"); graphPanel.add(label27, new TableLayoutConstraints(0, 4, 0, 4, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label42 ---- label42.setText("Carico"); graphPanel.add(label42, new TableLayoutConstraints(5, 4, 5, 4, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label28 ---- label28.setText("Carico Crescente"); label28.setFont(label28.getFont().deriveFont(Font.BOLD | Font.ITALIC)); graphPanel.add(label28, new TableLayoutConstraints(0, 5, 1, 5, TableLayoutConstraints.CENTER, TableLayoutConstraints.FULL)); //---- label33 ---- label33.setText("Carico Burst"); label33.setFont(label33.getFont().deriveFont(Font.BOLD | Font.ITALIC)); graphPanel.add(label33, new TableLayoutConstraints(5, 5, 6, 5, TableLayoutConstraints.CENTER, TableLayoutConstraints.FULL)); //---- label29 ---- label29.setText("Coda\\Media"); graphPanel.add(label29, new TableLayoutConstraints(0, 6, 0, 6, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label30 ---- label30.setText("Tempo Medio Arrivo"); graphPanel.add(label30, new TableLayoutConstraints(0, 7, 0, 7, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label31 ---- label31.setText("Troughput"); graphPanel.add(label31, new TableLayoutConstraints(0, 8, 0, 8, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label32 ---- label32.setText("Carico"); graphPanel.add(label32, new TableLayoutConstraints(0, 9, 0, 9, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- button_CrescenteCodaSuMedia ---- button_CrescenteCodaSuMedia.setText("Esegui"); button_CrescenteCodaSuMedia.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { button_CrescenteCodaSuMediaActionPerformed(e); } }); graphPanel.add(button_CrescenteCodaSuMedia, new TableLayoutConstraints(2, 6, 2, 6, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label34 ---- label34.setText("Coda\\Media"); graphPanel.add(label34, new TableLayoutConstraints(5, 6, 5, 6, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- button_BurstCodaSuMedia ---- button_BurstCodaSuMedia.setText("Esegui"); button_BurstCodaSuMedia.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { button_BurstCodaSuMediaActionPerformed(e); } }); graphPanel.add(button_BurstCodaSuMedia, new TableLayoutConstraints(7, 6, 7, 6, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- button_CrescenteCarico ---- button_CrescenteCarico.setText("Esegui"); button_CrescenteCarico.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { button_CrescenteCaricoActionPerformed(e); } }); graphPanel.add(button_CrescenteCarico, new TableLayoutConstraints(2, 7, 2, 9, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label35 ---- label35.setText("Tempo Medio Arrivo"); graphPanel.add(label35, new TableLayoutConstraints(5, 7, 5, 7, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- button_BurstTempoMedioArrivo ---- button_BurstTempoMedioArrivo.setText("Esegui"); button_BurstTempoMedioArrivo.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { button_BurstTempoMedioArrivoActionPerformed(e); } }); graphPanel.add(button_BurstTempoMedioArrivo, new TableLayoutConstraints(7, 7, 7, 9, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label36 ---- label36.setText("Troughput"); graphPanel.add(label36, new TableLayoutConstraints(5, 8, 5, 8, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); //---- label37 ---- label37.setText("Carico"); graphPanel.add(label37, new TableLayoutConstraints(5, 9, 5, 9, TableLayoutConstraints.FULL, TableLayoutConstraints.FULL)); } //---- label22 ---- label22.setText("Grafici"); label22.setFont(label22.getFont().deriveFont(label22.getFont().getStyle() | Font.BOLD, label22.getFont().getSize() + 4f)); GroupLayout panelGraphLayout = new GroupLayout(panelGraph); panelGraph.setLayout(panelGraphLayout); panelGraphLayout.setHorizontalGroup(panelGraphLayout.createParallelGroup() .addGroup(panelGraphLayout.createSequentialGroup().addGroup(panelGraphLayout .createParallelGroup() .addGroup(panelGraphLayout.createSequentialGroup().addGap(243, 243, 243) .addComponent(label22).addGap(0, 246, Short.MAX_VALUE)) .addGroup(GroupLayout.Alignment.TRAILING, panelGraphLayout.createSequentialGroup().addContainerGap() .addComponent(graphPanel, GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE))) .addContainerGap())); panelGraphLayout.setVerticalGroup(panelGraphLayout.createParallelGroup().addGroup( GroupLayout.Alignment.TRAILING, panelGraphLayout.createSequentialGroup().addContainerGap().addComponent(label22) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(graphPanel, GroupLayout.DEFAULT_SIZE, 370, Short.MAX_VALUE) .addContainerGap())); } hpssimTab.addTab("Graph", panelGraph); } hpssimWindow.add(hpssimTab); hpssimTab.setBounds(10, 40, 555, 450); //---- title1 ---- title1.setFont(title1.getFont().deriveFont(title1.getFont().getSize() + 8f)); hpssimWindow.add(title1); title1.setBounds(10, 11, 132, title1.getPreferredSize().height); //---- button1 ---- button1.setText("Stop"); button1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { button1ActionPerformed(e); } }); hpssimWindow.add(button1); button1.setBounds(385, 495, 74, button1.getPreferredSize().height); //---- okButton ---- okButton.setText("Start"); okButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { okButtonActionPerformed(e); } }); hpssimWindow.add(okButton); okButton.setBounds(470, 495, 74, okButton.getPreferredSize().height); //---- button3 ---- button3.setText("Resume"); button3.setVisible(false); button3.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { pauseActionPerformed(e); } }); hpssimWindow.add(button3); button3.setBounds(300, 495, 74, button3.getPreferredSize().height); { // compute preferred size Dimension preferredSize = new Dimension(); for (int i = 0; i < hpssimWindow.getComponentCount(); i++) { Rectangle bounds = hpssimWindow.getComponent(i).getBounds(); preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width); preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height); } Insets insets = hpssimWindow.getInsets(); preferredSize.width += insets.right; preferredSize.height += insets.bottom; hpssimWindow.setMinimumSize(preferredSize); hpssimWindow.setPreferredSize(preferredSize); } } GroupLayout HPSsimWindowContentPaneLayout = new GroupLayout(HPSsimWindowContentPane); HPSsimWindowContentPane.setLayout(HPSsimWindowContentPaneLayout); HPSsimWindowContentPaneLayout.setHorizontalGroup(HPSsimWindowContentPaneLayout.createParallelGroup() .addGroup(HPSsimWindowContentPaneLayout.createSequentialGroup() .addComponent(hpssimWindow, GroupLayout.PREFERRED_SIZE, 565, GroupLayout.PREFERRED_SIZE) .addGap(0, 4, Short.MAX_VALUE))); HPSsimWindowContentPaneLayout.setVerticalGroup(HPSsimWindowContentPaneLayout.createParallelGroup() .addGroup(HPSsimWindowContentPaneLayout.createSequentialGroup() .addComponent(hpssimWindow, GroupLayout.PREFERRED_SIZE, 528, GroupLayout.PREFERRED_SIZE) .addGap(0, 1, Short.MAX_VALUE))); HPSsimWindow.pack(); HPSsimWindow.setLocationRelativeTo(HPSsimWindow.getOwner()); } //======== dialog1 ======== { dialog1.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); Container dialog1ContentPane = dialog1.getContentPane(); //---- button2 ---- button2.setText("ok"); button2.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { button2ActionPerformed(e); } }); //---- label13 ---- label13.setText("Attenzione!"); GroupLayout dialog1ContentPaneLayout = new GroupLayout(dialog1ContentPane); dialog1ContentPane.setLayout(dialog1ContentPaneLayout); dialog1ContentPaneLayout.setHorizontalGroup(dialog1ContentPaneLayout.createParallelGroup() .addGroup(dialog1ContentPaneLayout.createSequentialGroup().addContainerGap() .addGroup(dialog1ContentPaneLayout.createParallelGroup() .addComponent(label13, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE) .addGroup(GroupLayout.Alignment.TRAILING, dialog1ContentPaneLayout.createSequentialGroup() .addGap(0, 281, Short.MAX_VALUE).addComponent(button2)) .addComponent(erroreLabel, GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE)) .addContainerGap())); dialog1ContentPaneLayout.setVerticalGroup(dialog1ContentPaneLayout.createParallelGroup().addGroup( GroupLayout.Alignment.TRAILING, dialog1ContentPaneLayout.createSequentialGroup().addContainerGap() .addComponent(label13, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE) .addComponent(erroreLabel, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(button2) .addContainerGap())); dialog1.pack(); dialog1.setLocationRelativeTo(dialog1.getOwner()); } //======== Grafici ======== { Container GraficiContentPane = Grafici.getContentPane(); //======== panelGraficoFinestra ======== { // JFormDesigner evaluation mark panelGraficoFinestra.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), panelGraficoFinestra.getBorder())); panelGraficoFinestra.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); panelGraficoFinestra.setLayout(new BorderLayout()); } GroupLayout GraficiContentPaneLayout = new GroupLayout(GraficiContentPane); GraficiContentPane.setLayout(GraficiContentPaneLayout); GraficiContentPaneLayout.setHorizontalGroup(GraficiContentPaneLayout.createParallelGroup() .addGroup(GraficiContentPaneLayout.createSequentialGroup().addContainerGap() .addComponent(panelGraficoFinestra, GroupLayout.DEFAULT_SIZE, 519, Short.MAX_VALUE) .addContainerGap())); GraficiContentPaneLayout.setVerticalGroup(GraficiContentPaneLayout.createParallelGroup() .addGroup(GraficiContentPaneLayout.createSequentialGroup().addContainerGap() .addComponent(panelGraficoFinestra, GroupLayout.DEFAULT_SIZE, 457, Short.MAX_VALUE) .addContainerGap())); Grafici.pack(); Grafici.setLocationRelativeTo(Grafici.getOwner()); } // //GEN-END:initComponents }
From source file:au.org.ala.delta.editor.ui.image.ImageSettingsDialog.java
private Font fontFromComponents(JComboBox name, JComboBox sizeCombo, JCheckBox bold, JCheckBox italic) { String family = (String) name.getSelectedItem(); int size = (Integer) sizeCombo.getSelectedItem(); int style = 0; if (bold.isSelected()) { style |= Font.BOLD;//ww w.j av a 2s .co m } if (italic.isSelected()) { style |= Font.ITALIC; } Font font = new Font(family, style, size); return font; }
From source file:CircleOfSquares.java
MemoryView(int methodAreaMemSectionSize) { setLayout(new GridLayout(memoryLocationsVisibleCount, 4)); setBackground(Color.lightGray); Font plainFont = new Font("TimesRoman", Font.PLAIN, 11); setFont(plainFont);//from w ww . ja v a 2 s.c om Font italicFont = new Font("TimesRoman", Font.ITALIC, 11); for (int i = 0; i < memoryLocationsVisibleCount; ++i) { pointer[i] = new Label("", Label.RIGHT); pointer[i].setFont(italicFont); add(pointer[i]); address[i] = new Label("", Label.CENTER); add(address[i]); byteValue[i] = new Label("", Label.CENTER); add(byteValue[i]); logicalValue[i] = new Label("", Label.LEFT); add(logicalValue[i]); } }
From source file:util.program.ProgramTextCreator.java
private static String getCssStyle(final int style) { StringBuilder result = new StringBuilder(); if ((style & Font.BOLD) == Font.BOLD) { result.append("font-weight:bold;"); }//from ww w . j a va 2 s.c o m if ((style & Font.ITALIC) == Font.ITALIC) { result.append("font-style:italic;"); } return result.toString(); }
From source file:skoa.helpers.ConfiguracionGraficas.java
private void vistaIntermedia3() { panel.removeAll();/*from w w w. j a v a 2 s . com*/ panel = new JPanel(); panel.setLayout(new GridLayout(2, 1)); panel.setBorder(BorderFactory.createEtchedBorder()); panel.add(opciones); opciones2.removeAll(); opciones2.add(fichero); //opciones2.add(l); opciones2.add(p); opciones2.add(fechas); if (c == 1) { //Consulta A if (f == 1) { // Intervalo opciones2.add(fechaI); opciones2.add(fechaF); // fecha final } else { // Completa -->panel4 vacio opciones2.add(new JPanel()); opciones2.add(new JPanel()); } opciones2.add(new JPanel()); } else if (c > 4) {//Consulta D, Mayor que 4 por 5 y 6, son las subopciones % y Diferencia de 4. if (f == 1) { // Intervalo opciones2.add(fechaI); opciones2.add(fechaF); // fecha final } else { // Completa -->panel4 vacio opciones2.add(new JPanel()); opciones2.add(new JPanel()); } JPanel paux = new JPanel(); JLabel l = new JLabel("Rango: "); l.setFont(new Font("Tahoma", Font.PLAIN, 12)); paux.add(l); paux.add(r); l = new JLabel(" en minutos "); l.setFont(new Font("Tahoma", Font.ITALIC, 10)); paux.add(l); opciones2.add(paux); } else { //Consulta B o C. JPanel paux = new JPanel(); JLabel l = new JLabel("Rango: "); l.setFont(new Font("Tahoma", Font.PLAIN, 12)); paux.add(l); paux.add(r); l = new JLabel(" en horas "); l.setFont(new Font("Tahoma", Font.ITALIC, 10)); paux.add(l); if (f == 1) { //Consulta B, intervalo opciones2.add(fechaI); opciones2.add(fechaF); // fecha final opciones2.add(paux); } else { //Consulta B, completo opciones2.add(new JPanel()); opciones2.add(new JPanel()); opciones2.add(paux); } } opciones2.add(pAdd); //Boton de aadir panel.add(opciones2); datos.removeAll(); cargarVista(); }
From source file:view.AppearanceSettingsDialog.java
private void changeLabel() { String fontLocation = getFontCbBox(); try {//from w w w . j a v a2 s . c o m Font newFont = Font.createFont(Font.TRUETYPE_FONT, new File(getFontLocationByName(fontLocation))); Font font = null; if (cbBold.isSelected() && cbItalic.isSelected()) { font = newFont.deriveFont(Font.ITALIC + Font.BOLD, 36); } else if (cbBold.isSelected() && !cbItalic.isSelected()) { font = newFont.deriveFont(Font.BOLD, 36); } else if (!cbBold.isSelected() && cbItalic.isSelected()) { font = newFont.deriveFont(Font.ITALIC, 36); } else { font = newFont.deriveFont(Font.PLAIN, 36); } lblSampleText.setFont(font); return; } catch (FontFormatException ex) { Logger.getLogger(AppearanceSettingsDialog.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(AppearanceSettingsDialog.class.getName()).log(Level.SEVERE, null, ex); } if (cbBold.isSelected() && cbItalic.isSelected()) { lblSampleText.setFont(new Font(fontLocation, Font.BOLD + Font.ITALIC, 36)); } else if (cbBold.isSelected() && !cbItalic.isSelected()) { lblSampleText.setFont(new Font(fontLocation, Font.BOLD, 36)); } else if (!cbBold.isSelected() && cbItalic.isSelected()) { lblSampleText.setFont(new Font(fontLocation, Font.ITALIC, (Integer) 36)); } else { lblSampleText.setFont(new Font(cbFontType.getSelectedItem().toString(), Font.PLAIN, (Integer) 36)); } }
From source file:it.eng.spagobi.engines.chart.bo.charttypes.barcharts.OverlaidBarLine.java
public JFreeChart createChart(DatasetMap datasets) { logger.debug("IN"); // create the first renderer... CategoryPlot plot = new CategoryPlot(); NumberFormat nf = NumberFormat.getNumberInstance(locale); NumberAxis rangeAxis = new NumberAxis(getValueLabel()); rangeAxis.setLabelFont(new Font(styleXaxesLabels.getFontName(), Font.PLAIN, styleXaxesLabels.getSize())); rangeAxis.setLabelPaint(styleXaxesLabels.getColor()); rangeAxis/* w ww . j ava2 s. co m*/ .setTickLabelFont(new Font(styleXaxesLabels.getFontName(), Font.PLAIN, styleXaxesLabels.getSize())); rangeAxis.setTickLabelPaint(styleXaxesLabels.getColor()); // rangeAxis.setLowerBound(600); // rangeAxis.setUpperBound(720); if (firstAxisLB != null && firstAxisUB != null) { rangeAxis.setLowerBound(firstAxisLB); rangeAxis.setUpperBound(firstAxisUB); } rangeAxis.setUpperMargin(0.10); plot.setRangeAxis(0, rangeAxis); if (rangeIntegerValues == true) { rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); } rangeAxis.setNumberFormatOverride(nf); CategoryAxis domainAxis = new CategoryAxis(getCategoryLabel()); domainAxis.setLabelFont(new Font(styleYaxesLabels.getFontName(), Font.PLAIN, styleYaxesLabels.getSize())); domainAxis.setLabelPaint(styleYaxesLabels.getColor()); domainAxis .setTickLabelFont(new Font(styleYaxesLabels.getFontName(), Font.PLAIN, styleYaxesLabels.getSize())); domainAxis.setTickLabelPaint(styleYaxesLabels.getColor()); domainAxis.setUpperMargin(0.10); plot.setDomainAxis(domainAxis); plot.setOrientation(PlotOrientation.VERTICAL); plot.setRangeGridlinesVisible(true); plot.setDomainGridlinesVisible(true); DefaultCategoryDataset datasetLineFirstAxis = (DefaultCategoryDataset) datasets.getDatasets().get("1-line"); DefaultCategoryDataset datasetBarFirstAxis = (DefaultCategoryDataset) datasets.getDatasets().get("1-bar"); DefaultCategoryDataset datasetLineSecondAxis = (DefaultCategoryDataset) datasets.getDatasets() .get("2-line"); DefaultCategoryDataset datasetBarSecondAxis = (DefaultCategoryDataset) datasets.getDatasets().get("2-bar"); //I create one bar renderer and one line MyStandardCategoryItemLabelGenerator generator = null; // value labels and additional values are mutually exclusive if (showValueLabels == true) additionalLabels = false; if (additionalLabels) { generator = new MyStandardCategoryItemLabelGenerator(catSerLabels, "{1}", NumberFormat.getInstance()); } if (useBars) { CategoryItemRenderer barRenderer = null; if (stackedBarRenderer_1 == true) { barRenderer = new StackedBarRenderer(); } else { barRenderer = new BarRenderer(); } CategoryItemRenderer barRenderer2 = new BarRenderer(); if (stackedBarRenderer_2 == true) { barRenderer2 = new StackedBarRenderer(); } else { barRenderer2 = new BarRenderer(); } if (maxBarWidth != null) { ((BarRenderer) barRenderer).setMaximumBarWidth(maxBarWidth.doubleValue()); ((BarRenderer) barRenderer2).setMaximumBarWidth(maxBarWidth.doubleValue()); } if (showValueLabels) { barRenderer.setBaseItemLabelGenerator(new FilterZeroStandardCategoryItemLabelGenerator()); barRenderer.setBaseItemLabelsVisible(true); barRenderer.setBaseItemLabelFont( new Font(styleValueLabels.getFontName(), Font.PLAIN, styleValueLabels.getSize())); barRenderer.setBaseItemLabelPaint(styleValueLabels.getColor()); // barRenderer.setBasePositiveItemLabelPosition(new ItemLabelPosition( // ItemLabelAnchor.OUTSIDE12, TextAnchor.BASELINE_LEFT)); // // barRenderer.setBaseNegativeItemLabelPosition(new ItemLabelPosition( // ItemLabelAnchor.OUTSIDE12, TextAnchor.BASELINE_LEFT)); if (valueLabelsPosition.equalsIgnoreCase("inside")) { barRenderer.setBasePositiveItemLabelPosition( new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.BASELINE_LEFT)); barRenderer.setBaseNegativeItemLabelPosition( new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.BASELINE_LEFT)); } else { barRenderer.setBasePositiveItemLabelPosition( new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BASELINE_LEFT)); barRenderer.setBaseNegativeItemLabelPosition( new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BASELINE_LEFT)); } } else if (additionalLabels) { barRenderer.setToolTipGenerator(new StandardCategoryToolTipGenerator()); barRenderer.setBaseItemLabelGenerator(generator); double orient = (-Math.PI / 2.0); if (styleValueLabels.getOrientation().equalsIgnoreCase("horizontal")) { orient = 0.0; } barRenderer.setBasePositiveItemLabelPosition(new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.CENTER, TextAnchor.CENTER, orient)); barRenderer.setBaseNegativeItemLabelPosition(new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.CENTER, TextAnchor.CENTER, orient)); barRenderer.setBaseItemLabelFont( new Font(defaultLabelsStyle.getFontName(), Font.PLAIN, defaultLabelsStyle.getSize())); barRenderer.setBaseItemLabelPaint(defaultLabelsStyle.getColor()); barRenderer.setBaseItemLabelsVisible(true); } if (showValueLabels) { barRenderer2.setBaseItemLabelGenerator(new FilterZeroStandardCategoryItemLabelGenerator()); barRenderer2.setBaseItemLabelsVisible(true); barRenderer2.setBaseItemLabelFont( new Font(styleValueLabels.getFontName(), Font.PLAIN, styleValueLabels.getSize())); barRenderer2.setBaseItemLabelPaint(styleValueLabels.getColor()); // barRenderer2.setBasePositiveItemLabelPosition(new ItemLabelPosition( // ItemLabelAnchor.OUTSIDE12, TextAnchor.BASELINE_LEFT)); // // barRenderer2.setBaseNegativeItemLabelPosition(new ItemLabelPosition( // ItemLabelAnchor.OUTSIDE12, TextAnchor.BASELINE_LEFT)); if (valueLabelsPosition.equalsIgnoreCase("inside")) { barRenderer2.setBasePositiveItemLabelPosition( new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.BASELINE_LEFT)); barRenderer2.setBaseNegativeItemLabelPosition( new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.BASELINE_LEFT)); } else { barRenderer2.setBasePositiveItemLabelPosition( new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BASELINE_LEFT)); barRenderer2.setBaseNegativeItemLabelPosition( new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BASELINE_LEFT)); } } else if (additionalLabels) { barRenderer2.setBaseItemLabelGenerator(generator); double orient = (-Math.PI / 2.0); if (styleValueLabels.getOrientation().equalsIgnoreCase("horizontal")) { orient = 0.0; } barRenderer2.setBasePositiveItemLabelPosition(new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.CENTER, TextAnchor.CENTER, orient)); barRenderer2.setBaseNegativeItemLabelPosition(new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.CENTER, TextAnchor.CENTER, orient)); barRenderer2.setBaseItemLabelFont( new Font(defaultLabelsStyle.getFontName(), Font.PLAIN, defaultLabelsStyle.getSize())); barRenderer2.setBaseItemLabelPaint(defaultLabelsStyle.getColor()); barRenderer2.setBaseItemLabelsVisible(true); } if (colorMap != null) { int idx = -1; for (Iterator iterator = datasetBarFirstAxis.getRowKeys().iterator(); iterator.hasNext();) { idx++; String serName = (String) iterator.next(); String labelName = ""; int index = -1; if (seriesCaptions != null && seriesCaptions.size() > 0) { labelName = serName; serName = (String) seriesCaptions.get(serName); index = datasetBarFirstAxis.getRowIndex(labelName); } else index = datasetBarFirstAxis.getRowIndex(serName); Color color = (Color) colorMap.get(serName); if (color != null) { barRenderer.setSeriesPaint(index, color); } } for (Iterator iterator = datasetBarSecondAxis.getRowKeys().iterator(); iterator.hasNext();) { idx++; String serName = (String) iterator.next(); String labelName = ""; int index = -1; if (seriesCaptions != null && seriesCaptions.size() > 0) { labelName = serName; serName = (String) seriesCaptions.get(serName); index = datasetBarSecondAxis.getRowIndex(labelName); } else index = datasetBarSecondAxis.getRowIndex(serName); Color color = (Color) colorMap.get(serName); if (color != null) { barRenderer2.setSeriesPaint(index, color); /* test con un renderer if (idx > index){ index = idx+1; } barRenderer.setSeriesPaint(index, color);*/ } } } // add tooltip if enabled if (enableToolTips) { MyCategoryToolTipGenerator generatorToolTip = new MyCategoryToolTipGenerator(freeToolTips, seriesTooltip, categoriesTooltip, seriesCaptions); barRenderer.setToolTipGenerator(generatorToolTip); barRenderer2.setToolTipGenerator(generatorToolTip); } //defines url for drill boolean document_composition = false; if (mode.equalsIgnoreCase(SpagoBIConstants.DOCUMENT_COMPOSITION)) document_composition = true; logger.debug("Calling Url Generation"); MyCategoryUrlGenerator mycatUrl = null; if (super.rootUrl != null) { logger.debug("Set MycatUrl"); mycatUrl = new MyCategoryUrlGenerator(super.rootUrl); mycatUrl.setDocument_composition(document_composition); mycatUrl.setCategoryUrlLabel(super.categoryUrlName); mycatUrl.setSerieUrlLabel(super.serieUrlname); mycatUrl.setDrillDocTitle(drillDocTitle); mycatUrl.setTarget(target); } if (mycatUrl != null && (!mycatUrl.getCategoryUrlLabel().equals("") || !mycatUrl.getSerieUrlLabel().equals(""))) { barRenderer.setItemURLGenerator(mycatUrl); barRenderer2.setItemURLGenerator(mycatUrl); } plot.setDataset(2, datasetBarFirstAxis); plot.setDataset(3, datasetBarSecondAxis); plot.setRenderer(2, barRenderer); plot.setRenderer(3, barRenderer2); } if (useLines) { LineAndShapeRenderer lineRenderer = new LineAndShapeRenderer(); LineAndShapeRenderer lineRenderer2 = new LineAndShapeRenderer(); //lineRenderer.setShapesFilled(false); lineRenderer.setShapesFilled(true); lineRenderer2.setShapesFilled(true); // no shapes for line_no_shapes series for (Iterator iterator = lineNoShapeSeries1.iterator(); iterator.hasNext();) { String ser = (String) iterator.next(); // if there iS a abel associated search for that String label = null; if (seriesLabelsMap != null) { label = (String) seriesLabelsMap.get(ser); } if (label == null) label = ser; int index = datasetLineFirstAxis.getRowIndex(label); if (index != -1) { lineRenderer.setSeriesShapesVisible(index, false); } } for (Iterator iterator = lineNoShapeSeries2.iterator(); iterator.hasNext();) { String ser = (String) iterator.next(); // if there iS a abel associated search for that String label = null; if (seriesLabelsMap != null) { label = (String) seriesLabelsMap.get(ser); } if (label == null) label = ser; int index = datasetLineSecondAxis.getRowIndex(label); if (index != -1) { lineRenderer2.setSeriesShapesVisible(index, false); } } if (enableToolTips) { MyCategoryToolTipGenerator generatorToolTip = new MyCategoryToolTipGenerator(freeToolTips, seriesTooltip, categoriesTooltip, seriesCaptions); lineRenderer.setToolTipGenerator(generatorToolTip); lineRenderer2.setToolTipGenerator(generatorToolTip); } if (showValueLabels) { lineRenderer.setBaseItemLabelGenerator(new FilterZeroStandardCategoryItemLabelGenerator()); lineRenderer.setBaseItemLabelsVisible(true); lineRenderer.setBaseItemLabelFont( new Font(styleValueLabels.getFontName(), Font.ITALIC, styleValueLabels.getSize())); lineRenderer.setBaseItemLabelPaint(styleValueLabels.getColor()); lineRenderer.setBasePositiveItemLabelPosition( new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BASELINE_RIGHT)); lineRenderer.setBaseNegativeItemLabelPosition( new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BASELINE_RIGHT)); } else if (additionalLabels) { lineRenderer.setBaseItemLabelGenerator(generator); lineRenderer.setBaseItemLabelFont( new Font(defaultLabelsStyle.getFontName(), Font.PLAIN, defaultLabelsStyle.getSize())); lineRenderer.setBaseItemLabelPaint(defaultLabelsStyle.getColor()); lineRenderer.setBaseItemLabelsVisible(true); } if (showValueLabels) { lineRenderer2.setBaseItemLabelGenerator(new FilterZeroStandardCategoryItemLabelGenerator()); lineRenderer2.setBaseItemLabelsVisible(true); lineRenderer2.setBaseItemLabelFont( new Font(styleValueLabels.getFontName(), Font.ITALIC, styleValueLabels.getSize())); lineRenderer2.setBaseItemLabelPaint(styleValueLabels.getColor()); lineRenderer2.setBasePositiveItemLabelPosition( new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BASELINE_RIGHT)); lineRenderer2.setBaseNegativeItemLabelPosition( new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BASELINE_RIGHT)); } else if (additionalLabels) { lineRenderer2.setBaseItemLabelGenerator(generator); lineRenderer2.setBaseItemLabelFont( new Font(defaultLabelsStyle.getFontName(), Font.PLAIN, defaultLabelsStyle.getSize())); lineRenderer2.setBaseItemLabelPaint(defaultLabelsStyle.getColor()); lineRenderer2.setBaseItemLabelsVisible(true); } // DefaultCategoryDataset datasetSecondAxis=(DefaultCategoryDataset)datasets.getDatasets().get("2"); if (colorMap != null) { for (Iterator iterator = datasetLineSecondAxis.getRowKeys().iterator(); iterator.hasNext();) { String serName = (String) iterator.next(); String labelName = ""; int index = -1; if (seriesCaptions != null && seriesCaptions.size() > 0) { labelName = serName; serName = (String) seriesCaptions.get(serName); index = datasetLineSecondAxis.getRowIndex(labelName); } else index = datasetLineSecondAxis.getRowIndex(serName); Color color = (Color) colorMap.get(serName); if (color != null) { lineRenderer2.setSeriesPaint(index, color); } } for (Iterator iterator = datasetLineFirstAxis.getRowKeys().iterator(); iterator.hasNext();) { String serName = (String) iterator.next(); String labelName = ""; int index = -1; if (seriesCaptions != null && seriesCaptions.size() > 0) { labelName = serName; serName = (String) seriesCaptions.get(serName); index = datasetLineFirstAxis.getRowIndex(labelName); } else index = datasetLineFirstAxis.getRowIndex(serName); Color color = (Color) colorMap.get(serName); if (color != null) { lineRenderer.setSeriesPaint(index, color); } } } plot.setDataset(0, datasetLineFirstAxis); plot.setRenderer(0, lineRenderer); plot.setDataset(1, datasetLineSecondAxis); plot.setRenderer(1, lineRenderer2); } if (secondAxis) { NumberAxis na = new NumberAxis(secondAxisLabel); na.setLabelFont(new Font(styleXaxesLabels.getFontName(), Font.PLAIN, styleXaxesLabels.getSize())); na.setLabelPaint(styleXaxesLabels.getColor()); na.setTickLabelFont(new Font(styleXaxesLabels.getFontName(), Font.PLAIN, styleXaxesLabels.getSize())); na.setTickLabelPaint(styleXaxesLabels.getColor()); na.setUpperMargin(0.10); na.setNumberFormatOverride(nf); // rangeAxis.setLowerBound(270); // rangeAxis.setUpperBound(340); if (secondAxisLB != null && secondAxisUB != null) { rangeAxis.setLowerBound(secondAxisLB); rangeAxis.setUpperBound(secondAxisUB); } plot.setRangeAxis(1, na); plot.mapDatasetToRangeAxis(0, 0); plot.mapDatasetToRangeAxis(2, 0); plot.mapDatasetToRangeAxis(1, 1); plot.mapDatasetToRangeAxis(3, 1); if (rangeIntegerValues == true) { na.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); } } //plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD); plot.getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_45); JFreeChart chart = new JFreeChart(plot); TextTitle title = setStyleTitle(name, styleTitle); chart.setTitle(title); if (subName != null && !subName.equals("")) { TextTitle subTitle = setStyleTitle(subName, styleSubTitle); chart.addSubtitle(subTitle); } chart.setBackgroundPaint(Color.white); if (legend == true) drawLegend(chart); logger.debug("OUT"); return chart; }