List of usage examples for java.awt Color gray
Color gray
To view the source code for java.awt Color gray.
Click Source Link
From source file:dbseer.gui.panel.DBSeerExplainChartPanel.java
private void drawSelectRectangle(Graphics2D g2) { if (selectRectangle != null) { g2.setXORMode(Color.GRAY); g2.fill(this.selectRectangle); g2.setPaintMode();/*from ww w . j a v a 2s .com*/ } }
From source file:org.matsim.contrib.freight.usecases.analysis.LegHistogram.java
private JFreeChart getGraphic(final ModeData modeData, final String modeName) { final XYSeriesCollection xyData = new XYSeriesCollection(); final XYSeries departuresSerie = new XYSeries("departures", false, true); final XYSeries arrivalsSerie = new XYSeries("arrivals", false, true); final XYSeries onRouteSerie = new XYSeries("en route", false, true); int onRoute = 0; for (int i = 0; i < modeData.countsDep.length; i++) { onRoute = onRoute + modeData.countsDep[i] - modeData.countsArr[i] - modeData.countsStuck[i]; double hour = i * this.binSize / 60.0 / 60.0; departuresSerie.add(hour, modeData.countsDep[i]); arrivalsSerie.add(hour, modeData.countsArr[i]); onRouteSerie.add(hour, onRoute); }//from w ww. j a va2 s . co m xyData.addSeries(departuresSerie); xyData.addSeries(arrivalsSerie); xyData.addSeries(onRouteSerie); final JFreeChart chart = ChartFactory.createXYStepChart( "Leg Histogram, " + modeName + ", it." + this.iteration, "time", "# vehicles", xyData, PlotOrientation.VERTICAL, true, // legend false, // tooltips false // urls ); XYPlot plot = chart.getXYPlot(); final CategoryAxis axis1 = new CategoryAxis("hour"); axis1.setTickLabelFont(new Font("SansSerif", Font.PLAIN, 7)); plot.setDomainAxis(new NumberAxis("time")); plot.getRenderer().setSeriesStroke(0, new BasicStroke(2.0f)); plot.getRenderer().setSeriesStroke(1, new BasicStroke(2.0f)); plot.getRenderer().setSeriesStroke(2, new BasicStroke(2.0f)); plot.setBackgroundPaint(Color.white); plot.setRangeGridlinePaint(Color.gray); plot.setDomainGridlinePaint(Color.gray); return chart; }
From source file:CustomAlphaTest.java
protected void drawAxes(Graphics g, long lMaxTime) { // draw the frame drawAreaRect(g, 0, 0, m_nMaxWidth, m_nMaxHeight); drawGraphString(g, -1, "Alpha vs. Time (secs)", m_nGraphMaxWidth / 2, m_nGraphMaxHeight + 20); // draw the X axis drawGraphLine(g, 0, 0, m_nGraphMaxWidth, 0); // draw the Y axis drawGraphLine(g, 0, 0, 0, m_nGraphMaxHeight); // draw the horizontal Y axis lines for (double yAxisTick = 0; yAxisTick <= 1.0; yAxisTick += 0.2) { double yTick = yAxisTick * m_nGraphMaxHeight; g.setColor(Color.gray); drawGraphLine(g, 0, yTick, m_nGraphMaxWidth, yTick); g.setColor(Color.black);//from w w w . j ava 2s . c om drawGraphString(g, 3, "" + yAxisTick, -20, yTick); } }
From source file:com.icesoft.faces.component.outputchart.AbstractChart.java
public ColorMap() { this.put("black", Color.BLACK); this.put("blue", Color.BLUE); this.put("cyan", Color.CYAN); this.put("darkGray", Color.DARK_GRAY); this.put("gray", Color.GRAY); this.put("green", Color.GREEN); this.put("lightGray", Color.LIGHT_GRAY); this.put("magenta", Color.MAGENTA); this.put("orange", Color.ORANGE); this.put("pink", Color.PINK); this.put("red", Color.RED); this.put("white", Color.WHITE); this.put("yellow", Color.YELLOW); }
From source file:userinterface.DoctorWorkArea.DiagnosePatientJPanel.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor./*from w w w . ja v a 2s . com*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jTabbedPane2 = new javax.swing.JTabbedPane(); jPanel8 = new javax.swing.JPanel(); jButton6 = new javax.swing.JButton(); backJButton1 = new javax.swing.JButton(); jScrollPane5 = new javax.swing.JScrollPane(); skypeTxt = new javax.swing.JTextArea(); jLabel22 = new javax.swing.JLabel(); skypeId = new javax.swing.JTextField(); jLabel31 = new javax.swing.JLabel(); jLabel32 = new javax.swing.JLabel(); patientCombo6 = new javax.swing.JComboBox(); jPanel7 = new javax.swing.JPanel(); jLabel7 = new javax.swing.JLabel(); jScrollPane2 = new javax.swing.JScrollPane(); labTestRequestJTable = new javax.swing.JTable(); jLabel9 = new javax.swing.JLabel(); patientCombo2 = new javax.swing.JComboBox(); jLabel10 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jLabel11 = new javax.swing.JLabel(); dateChooser = new com.toedter.calendar.JDateChooser(); refreshJButton = new javax.swing.JButton(); backJButton2 = new javax.swing.JButton(); jPanel5 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); patientCombo = new javax.swing.JComboBox(); jScrollPane3 = new javax.swing.JScrollPane(); vitalSignTable = new javax.swing.JTable(); jLabel12 = new javax.swing.JLabel(); patientNameTextField = new javax.swing.JTextField(); jLabel13 = new javax.swing.JLabel(); respiratoryTextField = new javax.swing.JTextField(); heartRateTextField = new javax.swing.JTextField(); jLabel14 = new javax.swing.JLabel(); patientIdTextField = new javax.swing.JTextField(); jLabel15 = new javax.swing.JLabel(); jLabel16 = new javax.swing.JLabel(); ageTextField = new javax.swing.JTextField(); jLabel17 = new javax.swing.JLabel(); bloodPressureTextField = new javax.swing.JTextField(); weightTextField = new javax.swing.JTextField(); jLabel18 = new javax.swing.JLabel(); doctorTextField = new javax.swing.JTextField(); jLabel19 = new javax.swing.JLabel(); jLabel21 = new javax.swing.JLabel(); timestampTextField = new javax.swing.JTextField(); jButton2 = new javax.swing.JButton(); backJButton = new javax.swing.JButton(); barBtn = new javax.swing.JButton(); jPanel6 = new javax.swing.JPanel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); patientCombo1 = new javax.swing.JComboBox(); jScrollPane1 = new javax.swing.JScrollPane(); productTable = new javax.swing.JTable(); jLabel8 = new javax.swing.JLabel(); addtoCartButton6 = new javax.swing.JButton(); jLabel6 = new javax.swing.JLabel(); quantitySpinner = new javax.swing.JSpinner(); backJButton3 = new javax.swing.JButton(); jLabel33 = new javax.swing.JLabel(); emailTxt = new javax.swing.JTextField(); jPanel1 = new javax.swing.JPanel(); jLabel20 = new javax.swing.JLabel(); patientCombo4 = new javax.swing.JComboBox(); jLabel23 = new javax.swing.JLabel(); dateChooser1 = new com.toedter.calendar.JDateChooser(); jButton3 = new javax.swing.JButton(); jLabel24 = new javax.swing.JLabel(); jScrollPane4 = new javax.swing.JScrollPane(); dietRequestJTable = new javax.swing.JTable(); refreshJButton1 = new javax.swing.JButton(); jLabel25 = new javax.swing.JLabel(); backJButton4 = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); jLabel26 = new javax.swing.JLabel(); patientCombo5 = new javax.swing.JComboBox(); jButton4 = new javax.swing.JButton(); treatedCombo = new javax.swing.JComboBox(); jLabel27 = new javax.swing.JLabel(); jLabel28 = new javax.swing.JLabel(); jLabel29 = new javax.swing.JLabel(); resumeCombo = new javax.swing.JComboBox(); jLabel30 = new javax.swing.JLabel(); operationCombo = new javax.swing.JComboBox(); jButton7 = new javax.swing.JButton(); backJButton5 = new javax.swing.JButton(); jLabel34 = new javax.swing.JLabel(); setBackground(new java.awt.Color(255, 255, 255)); jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N jLabel1.setText("Diagnose Patient"); jTabbedPane2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white)); jTabbedPane2.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jPanel8.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, java.awt.Color.gray, java.awt.Color.gray, java.awt.Color.gray, java.awt.Color.gray)); jPanel8.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jButton6.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jButton6.setText("Send Skype Message"); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); jPanel8.add(jButton6, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 380, 279, 92)); backJButton1.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N backJButton1.setText("<< Back"); backJButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { backJButton1ActionPerformed(evt); } }); jPanel8.add(backJButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 570, -1, -1)); skypeTxt.setColumns(20); skypeTxt.setRows(5); jScrollPane5.setViewportView(skypeTxt); jPanel8.add(jScrollPane5, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 260, 280, -1)); jLabel22.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel22.setText("Enter Skype ID"); jPanel8.add(jLabel22, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 160, -1, -1)); skypeId.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N skypeId.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { skypeIdActionPerformed(evt); } }); jPanel8.add(skypeId, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 160, 160, -1)); jLabel31.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel31.setText("Enter Message"); jPanel8.add(jLabel31, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 220, -1, -1)); jLabel32.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel32.setText("Select Patient"); jPanel8.add(jLabel32, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 100, -1, 30)); patientCombo6.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N patientCombo6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { patientCombo6ActionPerformed(evt); } }); jPanel8.add(patientCombo6, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 100, 160, -1)); jTabbedPane2.addTab("Skype Diagnosis", jPanel8); jPanel7.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, java.awt.Color.black, java.awt.Color.black, java.awt.Color.black, java.awt.Color.black)); jPanel7.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel7.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel7.setText("Check Lab Technician's Request"); jPanel7.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 360, -1, -1)); labTestRequestJTable.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N labTestRequestJTable.setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null } }, new String[] { "Sender", "Patient Name", "Receiver", "Status", "Result" }) { Class[] types = new Class[] { java.lang.Object.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class }; boolean[] canEdit = new boolean[] { true, false, false, false, false }; public Class getColumnClass(int columnIndex) { return types[columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); jScrollPane2.setViewportView(labTestRequestJTable); jPanel7.add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 400, 730, 160)); jLabel9.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel9.setText("Select Patient"); jPanel7.add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 160, -1, -1)); patientCombo2.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N patientCombo2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { patientCombo2MouseClicked(evt); } }); patientCombo2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { patientCombo2ActionPerformed(evt); } }); jPanel7.add(patientCombo2, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 160, 140, -1)); jLabel10.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N jLabel10.setText("Request Lab Tests"); jPanel7.add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(411, 36, -1, -1)); jButton1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jButton1.setText("Order Test"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jPanel7.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(229, 287, 137, -1)); jLabel11.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel11.setText("Request Date"); jPanel7.add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(132, 227, -1, -1)); dateChooser.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jPanel7.add(dateChooser, new org.netbeans.lib.awtextra.AbsoluteConstraints(312, 221, 140, -1)); refreshJButton.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N refreshJButton.setText("Refresh"); refreshJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { refreshJButtonActionPerformed(evt); } }); jPanel7.add(refreshJButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(780, 360, -1, -1)); backJButton2.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N backJButton2.setText("<< Back"); backJButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { backJButton2ActionPerformed(evt); } }); jPanel7.add(backJButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 590, -1, -1)); jTabbedPane2.addTab("Request Tests", jPanel7); jPanel5.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, java.awt.Color.lightGray, java.awt.Color.lightGray, java.awt.Color.lightGray, java.awt.Color.lightGray)); jPanel5.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N jLabel2.setText("Check Vital Signs"); jPanel5.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 30, -1, -1)); jLabel3.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel3.setText("Select Patient"); jPanel5.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 130, -1, -1)); patientCombo.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N patientCombo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { patientComboActionPerformed(evt); } }); jPanel5.add(patientCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 130, 160, -1)); vitalSignTable.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N vitalSignTable.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { }, new String[] { "TimeStamp", "Vital Sign Status" })); jScrollPane3.setViewportView(vitalSignTable); jPanel5.add(jScrollPane3, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 170, 730, 170)); jLabel12.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel12.setText("Patient Name"); jPanel5.add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 100, -1, -1)); patientNameTextField.setEditable(false); patientNameTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { patientNameTextFieldActionPerformed(evt); } }); jPanel5.add(patientNameTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 100, 150, -1)); jLabel13.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel13.setText("Respiratory Rate"); jPanel5.add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 260, -1, -1)); respiratoryTextField.setEditable(false); jPanel5.add(respiratoryTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 260, 150, -1)); heartRateTextField.setEditable(false); jPanel5.add(heartRateTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 300, 150, -1)); jLabel14.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel14.setText("Heart Rate"); jPanel5.add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 300, -1, -1)); patientIdTextField.setEditable(false); jPanel5.add(patientIdTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 140, 150, -1)); jLabel15.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel15.setText("Patient ID"); jPanel5.add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 140, -1, -1)); jLabel16.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel16.setText("Age"); jPanel5.add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 180, -1, -1)); ageTextField.setEditable(false); ageTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ageTextFieldActionPerformed(evt); } }); jPanel5.add(ageTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 180, 150, -1)); jLabel17.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel17.setText("Blood Pressure"); jPanel5.add(jLabel17, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 340, -1, -1)); bloodPressureTextField.setEditable(false); jPanel5.add(bloodPressureTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 340, 150, -1)); weightTextField.setEditable(false); jPanel5.add(weightTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 380, 150, -1)); jLabel18.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel18.setText("Weight"); jPanel5.add(jLabel18, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 380, -1, -1)); doctorTextField.setEditable(false); doctorTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { doctorTextFieldActionPerformed(evt); } }); jPanel5.add(doctorTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 220, 150, -1)); jLabel19.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel19.setText("Primary Doctor"); jPanel5.add(jLabel19, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 220, -1, -1)); jLabel21.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel21.setText("Timestamp"); jPanel5.add(jLabel21, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 420, -1, -1)); timestampTextField.setEditable(false); timestampTextField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { timestampTextFieldActionPerformed(evt); } }); jPanel5.add(timestampTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 420, 150, -1)); jButton2.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N jButton2.setText("View Records"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jPanel5.add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(980, 120, 150, -1)); backJButton.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N backJButton.setText("<< Back"); backJButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { backJButtonActionPerformed(evt); } }); jPanel5.add(backJButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 570, -1, -1)); barBtn.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N barBtn.setText("Bar Chart"); barBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { barBtnActionPerformed(evt); } }); jPanel5.add(barBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 410, 120, -1)); jTabbedPane2.addTab("Check Vital Signs", jPanel5); jPanel6.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, java.awt.Color.darkGray, java.awt.Color.darkGray, java.awt.Color.darkGray, java.awt.Color.darkGray)); jPanel6.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N jLabel4.setText("Prescribe Medicines"); jPanel6.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 55, -1, -1)); jLabel5.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel5.setText("Select Patient"); jPanel6.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(216, 149, -1, -1)); patientCombo1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N patientCombo1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { patientCombo1ActionPerformed(evt); } }); jPanel6.add(patientCombo1, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 140, 200, -1)); productTable.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N productTable .setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null }, { null, null, null, null }, { null, null, null, null }, { null, null, null, null } }, new String[] { "Name", "Product Id", "Price", "Avail" }) { boolean[] canEdit = new boolean[] { false, false, false, false }; public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); jScrollPane1.setViewportView(productTable); jPanel6.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 280, 590, 100)); jLabel8.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel8.setText("Supplier Product Catalog"); jPanel6.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 250, 240, -1)); addtoCartButton6.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N addtoCartButton6.setText("Send Mail"); addtoCartButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addtoCartButton6ActionPerformed(evt); } }); jPanel6.add(addtoCartButton6, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 490, 150, -1)); jLabel6.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel6.setText("Quantity:"); jPanel6.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 390, 80, 30)); quantitySpinner.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1))); jPanel6.add(quantitySpinner, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 390, 100, -1)); backJButton3.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N backJButton3.setText("<< Back"); backJButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { backJButton3ActionPerformed(evt); } }); jPanel6.add(backJButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 600, -1, -1)); jLabel33.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel33.setText("Email- ID"); jPanel6.add(jLabel33, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 200, -1, -1)); emailTxt.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jPanel6.add(emailTxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 190, 200, -1)); jTabbedPane2.addTab("Prescribe Medicines", jPanel6); jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel20.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel20.setText("Select Patient"); jPanel1.add(jLabel20, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 160, -1, -1)); patientCombo4.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N patientCombo4.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { patientCombo4MouseClicked(evt); } }); patientCombo4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { patientCombo4ActionPerformed(evt); } }); jPanel1.add(patientCombo4, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 160, 140, -1)); jLabel23.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel23.setText("Request Date"); jPanel1.add(jLabel23, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 210, -1, -1)); dateChooser1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jPanel1.add(dateChooser1, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 210, 140, -1)); jButton3.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jButton3.setText("Order"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jPanel1.add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 290, 137, -1)); jLabel24.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel24.setText("Check Dietitian Request Status"); jPanel1.add(jLabel24, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 360, -1, -1)); dietRequestJTable.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N dietRequestJTable.setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null }, { null, null, null, null, null } }, new String[] { "Sender", "Patient Name", "Receiver", "Status", "Result" }) { Class[] types = new Class[] { java.lang.Object.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class }; boolean[] canEdit = new boolean[] { true, false, false, false, false }; public Class getColumnClass(int columnIndex) { return types[columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); jScrollPane4.setViewportView(dietRequestJTable); jPanel1.add(jScrollPane4, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 400, 700, 97)); refreshJButton1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N refreshJButton1.setText("Refresh"); refreshJButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { refreshJButton1ActionPerformed(evt); } }); jPanel1.add(refreshJButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(900, 360, -1, -1)); jLabel25.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N jLabel25.setText("Request Diet Plan from Dietitian"); jPanel1.add(jLabel25, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 20, -1, -1)); backJButton4.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N backJButton4.setText("<< Back"); backJButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { backJButton4ActionPerformed(evt); } }); jPanel1.add(backJButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 570, -1, -1)); jTabbedPane2.addTab("Request DietPlan", jPanel1); jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel26.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel26.setText("Select Patient"); jPanel2.add(jLabel26, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 100, -1, -1)); patientCombo5.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N patientCombo5.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { patientCombo5MouseClicked(evt); } }); patientCombo5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { patientCombo5ActionPerformed(evt); } }); jPanel2.add(patientCombo5, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 100, 130, -1)); jButton4.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N jButton4.setText("Generate Medical Report"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); jPanel2.add(jButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 440, 240, -1)); treatedCombo.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N treatedCombo.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "Cancer", "Post Operative Complication", "Wound Healing", "Multiple Trauma", "Trauma with Steroids", "Burns", "Bone Fracture" })); jPanel2.add(treatedCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 310, 100, 20)); jLabel27.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel27.setText("Resume Work"); jPanel2.add(jLabel27, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 230, -1, -1)); jLabel28.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel28.setText("Update Medical Record"); jPanel2.add(jLabel28, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 190, -1, -1)); jLabel29.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel29.setText("Operation Performed"); jPanel2.add(jLabel29, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 270, -1, -1)); resumeCombo.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N resumeCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Yes", "No" })); jPanel2.add(resumeCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 230, 100, 20)); jLabel30.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel30.setText("Treated For"); jPanel2.add(jLabel30, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 310, -1, -1)); operationCombo.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N operationCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Yes", "No" })); jPanel2.add(operationCombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 270, 100, 20)); jButton7.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jButton7.setText("Update"); jButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton7ActionPerformed(evt); } }); jPanel2.add(jButton7, new org.netbeans.lib.awtextra.AbsoluteConstraints(730, 260, 130, -1)); backJButton5.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N backJButton5.setText("<< Back"); backJButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { backJButton5ActionPerformed(evt); } }); jPanel2.add(backJButton5, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 590, -1, -1)); jLabel34.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N jLabel34.setText("Medical Report"); jPanel2.add(jLabel34, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 20, -1, -1)); jTabbedPane2.addTab("Generate Medical Report", jPanel2); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jTabbedPane2) .addGroup(layout.createSequentialGroup().addGap(413, 413, 413).addComponent(jLabel1) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(9, 9, 9).addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jTabbedPane2))); }
From source file:org.pentaho.plugin.jfreereport.reportcharts.RadarChartExpression.java
protected void configureChart(final JFreeChart chart) { super.configureChart(chart); //Create the stroke for the primary (= real) data series... final Stroke thick = new BasicStroke(thicknessprimaryseries); //...and apply that stroke to the series final SpiderWebPlot webPlot = (SpiderWebPlot) chart.getPlot(); webPlot.setLabelFont(Font.decode(getLabelFont())); if (StringUtils.isEmpty(getTooltipFormula()) == false) { webPlot.setToolTipGenerator(new FormulaCategoryTooltipGenerator(getRuntime(), getTooltipFormula())); }/*from ww w.j av a2 s . co m*/ if (StringUtils.isEmpty(getUrlFormula()) == false) { webPlot.setURLGenerator(new FormulaCategoryURLGenerator(getRuntime(), getUrlFormula())); } final CategoryDataset categoryDataset = webPlot.getDataset(); final int count = categoryDataset.getRowCount(); for (int t = 0; t < count; t++) { if (categoryDataset.getRowKey(t) instanceof GridCategoryItem) { continue; } webPlot.setSeriesOutlineStroke(t, thick); } //Set the spiderweb filled (or not) webPlot.setWebFilled(radarwebfilled); //Set the size of the datapoints on the axis webPlot.setHeadPercent(headsize); //Set the color of the fake datasets (gridlines) to grey for (int t = 0; t < count; t++) { if (categoryDataset.getRowKey(t) instanceof GridCategoryItem) { webPlot.setSeriesPaint(t, Color.GRAY); } } }
From source file:org.fhcrc.cpl.viewer.quant.gui.QuantitationReviewer.java
/** * Initialize all GUI components and display the UI *///w w w.jav a2s. c o m protected void initGUI() { settingsCLM = new ProteinQuantChartsCLM(false); setTitle("Qurate"); try { setIconImage(ImageIO.read(WorkbenchFrame.class.getResourceAsStream("icon.gif"))); } catch (Exception e) { } try { Localizer.renderSwixml("org/fhcrc/cpl/viewer/quant/gui/QuantitationReviewer.xml", this); assert null != contentPanel; } catch (Exception x) { ApplicationContext.errorMessage("error creating dialog", x); throw new RuntimeException(x); } //Menu openFileAction = new OpenFileAction(this); createChartsAction = new CreateChartsAction(); filterPepXMLAction = new FilterPepXMLAction(this); proteinSummaryAction = new ProteinSummaryAction(this); try { JMenuBar jmenu = (JMenuBar) Localizer.getSwingEngine(this) .render("org/fhcrc/cpl/viewer/quant/gui/QuantitationReviewerMenu.xml"); for (int i = 0; i < jmenu.getMenuCount(); i++) jmenu.getMenu(i).getPopupMenu().setLightWeightPopupEnabled(false); this.setJMenuBar(jmenu); } catch (Exception x) { ApplicationContext.errorMessage(TextProvider.getText("ERROR_LOADING_MENUS"), x); throw new RuntimeException(x); } //Global stuff setSize(fullWidth, fullHeight); setContentPane(contentPanel); ListenerHelper helper = new ListenerHelper(this); GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.BOTH; gbc.anchor = GridBagConstraints.PAGE_START; gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.insets = new Insets(5, 5, 5, 5); gbc.weighty = 1; gbc.weightx = 1; leftPanel.setLayout(new GridBagLayout()); leftPanel.setBorder(BorderFactory.createLineBorder(Color.gray)); //Properties panel stuff propertiesTable = new QuantEvent.QuantEventPropertiesTable(); propertiesScrollPane = new JScrollPane(); propertiesScrollPane.setViewportView(propertiesTable); propertiesScrollPane.setMinimumSize(new Dimension(propertiesWidth, propertiesHeight)); //event summary table; disembodied eventSummaryTable = new QuantEventsSummaryTable(); eventSummaryTable.setVisible(true); ListSelectionModel tableSelectionModel = eventSummaryTable.getSelectionModel(); tableSelectionModel.addListSelectionListener(new EventSummaryTableListSelectionHandler()); JScrollPane eventSummaryScrollPane = new JScrollPane(); eventSummaryScrollPane.setViewportView(eventSummaryTable); eventSummaryScrollPane.setSize(propertiesWidth, propertiesHeight); eventSummaryFrame = new Frame("All Events"); eventSummaryFrame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent event) { eventSummaryFrame.setVisible(false); } }); eventSummaryFrame.setSize(950, 450); eventSummaryFrame.add(eventSummaryScrollPane); //fields related to navigation navigationPanel = new JPanel(); backButton = new JButton("<"); backButton.setToolTipText("Previous Event"); backButton.setMaximumSize(new Dimension(50, 30)); backButton.setEnabled(false); forwardButton = new JButton(">"); forwardButton.setToolTipText("Next Event"); forwardButton.setMaximumSize(new Dimension(50, 30)); forwardButton.setEnabled(false); showEventSummaryButton = new JButton("Show All"); showEventSummaryButton.setToolTipText("Show all events in a table"); showEventSummaryButton.setEnabled(false); helper.addListener(backButton, "buttonBack_actionPerformed"); helper.addListener(forwardButton, "buttonForward_actionPerformed"); helper.addListener(showEventSummaryButton, "buttonShowEventSummary_actionPerformed"); gbc.fill = GridBagConstraints.NONE; gbc.gridwidth = GridBagConstraints.RELATIVE; gbc.anchor = GridBagConstraints.WEST; navigationPanel.add(backButton, gbc); gbc.gridwidth = GridBagConstraints.RELATIVE; navigationPanel.add(forwardButton, gbc); gbc.gridwidth = GridBagConstraints.REMAINDER; navigationPanel.add(showEventSummaryButton, gbc); gbc.fill = GridBagConstraints.BOTH; navigationPanel.setBorder(BorderFactory.createTitledBorder("Event")); gbc.anchor = GridBagConstraints.PAGE_START; //Fields related to curation of events curationPanel = new JPanel(); curationPanel.setLayout(new GridBagLayout()); curationPanel.setBorder(BorderFactory.createTitledBorder("Curation")); //Quantitation curation JPanel quantCurationPanel = new JPanel(); quantCurationPanel.setLayout(new GridBagLayout()); quantCurationPanel.setBorder(BorderFactory.createTitledBorder("Quantitation")); quantCurationButtonGroup = new ButtonGroup(); JRadioButton unknownRadioButton = new JRadioButton("?"); JRadioButton goodRadioButton = new JRadioButton("Good"); JRadioButton badRadioButton = new JRadioButton("Bad"); onePeakRatioRadioButton = new JRadioButton("1-Peak"); unknownRadioButton.setEnabled(false); goodRadioButton.setEnabled(false); badRadioButton.setEnabled(false); onePeakRatioRadioButton.setEnabled(false); quantCurationButtonGroup.add(unknownRadioButton); quantCurationButtonGroup.add(goodRadioButton); quantCurationButtonGroup.add(badRadioButton); quantCurationButtonGroup.add(onePeakRatioRadioButton); unknownRadioButtonModel = unknownRadioButton.getModel(); goodRadioButtonModel = goodRadioButton.getModel(); badRadioButtonModel = badRadioButton.getModel(); onePeakRadioButtonModel = onePeakRatioRadioButton.getModel(); helper.addListener(unknownRadioButton, "buttonCuration_actionPerformed"); helper.addListener(goodRadioButton, "buttonCuration_actionPerformed"); helper.addListener(badRadioButton, "buttonCuration_actionPerformed"); helper.addListener(onePeakRadioButtonModel, "buttonCuration_actionPerformed"); gbc.anchor = GridBagConstraints.WEST; quantCurationPanel.add(unknownRadioButton, gbc); quantCurationPanel.add(badRadioButton, gbc); quantCurationPanel.add(goodRadioButton, gbc); quantCurationPanel.add(onePeakRatioRadioButton, gbc); gbc.anchor = GridBagConstraints.PAGE_START; //ID curation JPanel idCurationPanel = new JPanel(); idCurationPanel.setLayout(new GridBagLayout()); idCurationPanel.setBorder(BorderFactory.createTitledBorder("ID")); idCurationButtonGroup = new ButtonGroup(); JRadioButton idUnknownRadioButton = new JRadioButton("?"); JRadioButton idGoodRadioButton = new JRadioButton("Good"); JRadioButton idBadRadioButton = new JRadioButton("Bad"); idUnknownRadioButton.setEnabled(false); idGoodRadioButton.setEnabled(false); idBadRadioButton.setEnabled(false); idCurationButtonGroup.add(idUnknownRadioButton); idCurationButtonGroup.add(idGoodRadioButton); idCurationButtonGroup.add(idBadRadioButton); idUnknownRadioButtonModel = idUnknownRadioButton.getModel(); idGoodRadioButtonModel = idGoodRadioButton.getModel(); idBadRadioButtonModel = idBadRadioButton.getModel(); helper.addListener(idUnknownRadioButton, "buttonIDCuration_actionPerformed"); helper.addListener(idGoodRadioButton, "buttonIDCuration_actionPerformed"); helper.addListener(idBadRadioButton, "buttonIDCuration_actionPerformed"); gbc.anchor = GridBagConstraints.WEST; idCurationPanel.add(idUnknownRadioButton, gbc); idCurationPanel.add(idBadRadioButton, gbc); idCurationPanel.add(idGoodRadioButton, gbc); gbc.gridwidth = GridBagConstraints.RELATIVE; curationPanel.add(quantCurationPanel, gbc); gbc.gridwidth = GridBagConstraints.REMAINDER; curationPanel.add(idCurationPanel, gbc); //curation comment commentTextField = new JTextField(); commentTextField.setToolTipText("Comment on this event"); //saves after every keypress. Would be more efficient to save when navigating away or saving to file commentTextField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent e) { if (quantEvents == null) return; QuantEvent quantEvent = quantEvents.get(displayedEventIndex); //save the comment, being careful about tabs and new lines quantEvent.setComment(commentTextField.getText().replace("\t", " ").replace("\n", " ")); } public void keyTyped(KeyEvent e) { } public void keyPressed(KeyEvent e) { } }); curationPanel.add(commentTextField, gbc); assessmentPanel = new JPanel(); assessmentPanel.setLayout(new GridBagLayout()); assessmentPanel.setBorder(BorderFactory.createTitledBorder("Algorithmic Assessment")); assessmentTypeTextField = new JTextField(); assessmentTypeTextField.setEditable(false); assessmentPanel.add(assessmentTypeTextField, gbc); assessmentDescTextField = new JTextField(); assessmentDescTextField.setEditable(false); assessmentPanel.add(assessmentDescTextField, gbc); //Theoretical peak distribution gbc.fill = GridBagConstraints.NONE; gbc.anchor = GridBagConstraints.CENTER; theoreticalPeaksPanel = new JPanel(); theoreticalPeaksPanel.setBorder(BorderFactory.createTitledBorder("Theoretical Peaks")); theoreticalPeaksPanel.setLayout(new GridBagLayout()); theoreticalPeaksPanel.setMinimumSize(new Dimension(leftPanelWidth - 10, theoreticalPeaksPanelHeight)); theoreticalPeaksPanel.setMaximumSize(new Dimension(1200, theoreticalPeaksPanelHeight)); showTheoreticalPeaks(); //Add everything to the left panel gbc.insets = new Insets(0, 5, 0, 5); gbc.fill = GridBagConstraints.BOTH; gbc.anchor = GridBagConstraints.PAGE_START; leftPanel.addComponentListener(new LeftPanelResizeListener()); gbc.weighty = 10; gbc.fill = GridBagConstraints.VERTICAL; leftPanel.add(propertiesScrollPane, gbc); gbc.fill = GridBagConstraints.NONE; gbc.weighty = 1; gbc.anchor = GridBagConstraints.PAGE_END; gbc.fill = GridBagConstraints.HORIZONTAL; leftPanel.add(assessmentPanel, gbc); leftPanel.add(theoreticalPeaksPanel, gbc); gbc.fill = GridBagConstraints.HORIZONTAL; leftPanel.add(curationPanel, gbc); leftPanel.add(navigationPanel, gbc); gbc.fill = GridBagConstraints.BOTH; gbc.weighty = 1; gbc.anchor = GridBagConstraints.PAGE_START; //Chart display multiChartDisplay = new TabbedMultiChartDisplayPanel(); multiChartDisplay.setResizeDelayMS(0); rightPanel.addComponentListener(new RightPanelResizeListener()); rightPanel.add(multiChartDisplay, gbc); //status message messageLabel.setBackground(Color.WHITE); messageLabel.setFont(Font.decode("verdana plain 12")); messageLabel.setText(" "); setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); //paranoia. Sometimes it seems Qurate doesn't exit when you close every window addWindowStateListener(new WindowStateListener() { public void windowStateChanged(WindowEvent e) { if (e.getNewState() == WindowEvent.WINDOW_CLOSED) { dispose(); System.exit(0); } } }); }
From source file:base.BasePlayer.BedCanvas.java
void drawScreen(Graphics g) { if (Main.readingbeds) { buf.setColor(Draw.backColor);/*from ww w. java2s . co m*/ buf.fillRect(Main.sidebarWidth - 4, 0, this.getWidth(), nodeImage.getHeight()); buf.drawString("Loading tracks...", 10, Main.bedScroll.getViewport().getHeight()); g.drawImage(bufImage, 0, 0, null); return; } if (this.trackDivider.size() > 0 && this.trackDivider.get(this.trackDivider.size() - 1) != 1.0) { for (int i = 0; i < Main.bedCanvas.trackDivider.size(); i++) { Main.bedCanvas.trackDivider.set(i, ((i + 1) * (this.getHeight() / (double) trackDivider.size()) / this.getHeight())); } } drawSidebar(); if (Settings.wallpaper == null) { buf.setColor(Draw.backColor); buf.fillRect(Main.sidebarWidth - 4, 0, this.getWidth(), this.getHeight()); } else { buf.drawImage(Settings.wallpaper, Main.sidebarWidth - 4, 0, this); buf.setColor(Draw.backColor); buf.fillRect(Main.sidebarWidth - 4, 0, this.getWidth(), this.getHeight()); } //buf.setColor(Color.gray); if (!zoomDrag && !resize) { try { drawNodes(); } catch (Exception e) { e.printStackTrace(); } } if (resizer && !mouseDrag) { resizer = false; } if (resize) { buf.drawImage(nodeImage, Main.sidebarWidth - 4, 0, nodeImage.getWidth(), (int) (Main.vardivider * Main.varPaneDivider.getY()), null); } else { buf.drawImage(nodeImage, Main.sidebarWidth - 4, 0, null); } for (int i = 0; i < bedTrack.size(); i++) { if (i < bedTrack.size() - 1) { buf.setColor(Color.lightGray); buf.drawLine(0, (int) (trackDivider.get(i) * this.getHeight()), this.getWidth(), (int) (trackDivider.get(i) * this.getHeight())); buf.setColor(Color.gray); buf.drawLine(0, (int) (trackDivider.get(i) * this.getHeight()) + 1, this.getWidth(), (int) (trackDivider.get(i) * this.getHeight()) + 1); if (!lineZoomer && mouseY < (int) (trackDivider.get(i) * this.getHeight()) + 4 && mouseY > (int) (trackDivider.get(i) * this.getHeight()) - 4) { resizer = true; if (getCursor().getType() != Cursor.N_RESIZE_CURSOR) { resizeDivider = i; setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR)); } } } if (bedTrack.get(i).graph && bedTrack.get(i).minvalue != Double.MAX_VALUE && bedTrack.get(i).getHead().getNext() != null) { if (!buf.getColor().equals(Color.white)) { buf.setColor(Color.white); } if (bedTrack.get(i).getLogscale().isSelected()) { scaletext = "Log scale [" + MethodLibrary.round(bedTrack.get(i).minvalue, 2) + ", " + MethodLibrary.round(bedTrack.get(i).maxvalue, 2) + "]"; scalewidth = buf.getFontMetrics().stringWidth(scaletext); buf.fillRoundRect(Main.sidebarWidth + 5, (int) (trackDivider.get(i) * this.getHeight()) - 5 - (Main.defaultFontSize + 4), scalewidth + 4, Main.defaultFontSize + 4, 4, 4); buf.setColor(Color.black); buf.drawString(scaletext, Main.sidebarWidth + 7, (int) (trackDivider.get(i) * this.getHeight()) - 9); } else { scaletext = "Scale [" + MethodLibrary.round(bedTrack.get(i).minvalue, 2) + ", " + MethodLibrary.round(bedTrack.get(i).maxvalue, 2) + "]"; scalewidth = buf.getFontMetrics().stringWidth(scaletext); buf.fillRoundRect(Main.sidebarWidth + 5, (int) (trackDivider.get(i) * this.getHeight()) - 5 - (Main.defaultFontSize + 4), scalewidth + 4, Main.defaultFontSize + 4, 4, 4); buf.setColor(Color.black); buf.drawString(scaletext, Main.sidebarWidth + 7, (int) (trackDivider.get(i) * this.getHeight()) - 9); } buf.setColor(Color.black); } } if (overlap) { drawInfo(); } if (!resizer && !overlapping) { if (getCursor().getType() != Cursor.DEFAULT_CURSOR) { setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (Main.drawCanvas.splits.get(0).pixel > 1) { // Middle line buf.setColor(Color.black); buf.setStroke(Draw.dashed); buf.drawLine((Main.drawCanvas.getDrawWidth()) / 2 + Main.sidebarWidth - 2, 0, ((Main.drawCanvas.getDrawWidth())) / 2 + Main.sidebarWidth - 2, Main.bedScroll.getViewport().getHeight()); buf.drawLine( (int) ((Main.drawCanvas.getDrawWidth()) / 2 + Main.drawCanvas.splits.get(0).pixel + Main.sidebarWidth - 2), 0, (int) (((Main.drawCanvas.getDrawWidth())) / 2 + Main.drawCanvas.splits.get(0).pixel + Main.sidebarWidth - 2), Main.bedScroll.getViewport().getHeight()); // buf.setStroke(Draw.doubleStroke); buf.setStroke(Draw.basicStroke); } for (int i = 1; i < Main.drawCanvas.splits.size(); i++) { buf.setColor(Color.gray); buf.fillRect(Main.drawCanvas.splits.get(i).offset - 3, 0, 5, this.getHeight()); buf.setColor(Color.lightGray); buf.fillRect(Main.drawCanvas.splits.get(i).offset - 1, 0, 2, this.getHeight()); } if (getCursor().getType() != Cursor.N_RESIZE_CURSOR) { drawZoom(); } g.drawImage(bufImage, 0, 0, null); }
From source file:cs.gui.stats.PerformanceStats.java
private ChartPanel createChart(String axisLabel, int type) { int width = (screenSize.width - (screenSize.width / 35)); int height = (int) (screenSize.height - (screenSize.height / (double) 4)); //int width = (screenSize.width - (screenSize.width / 35)) / 2; //int height = (int) (screenSize.height - (screenSize.height / (double) 4)) / 2; lastValue = new double[SUBPLOT_COUNT]; //================= visualise standard chart ========================== CombinedDomainXYPlot combineddomainxyplot = new CombinedDomainXYPlot(new DateAxis("Time")); lastValue[0] = 100D;/*from w w w. jav a 2s . c om*/ TimeSeries timeseries = null; XYPlot xyplot = null; //add new timeseries to modularity row datasets[type] = new TimeSeriesCollection(); NumberAxis numberaxis = new NumberAxis(axisLabel); numberaxis.setAutoRangeIncludesZero(true); //fast StandardXYItemRenderer xyItemRender = new StandardXYItemRenderer(); //original //xyItemRender = new StandardXYItemRenderer(); xyItemRender.setSeriesStroke(0, new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0)); xyItemRender.setSeriesStroke(1, new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0)); xyItemRender.setSeriesStroke(2, new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0)); xyItemRender.setSeriesStroke(3, new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0)); //TODO colours need to be defined statically before the renderer is created! xyplot = new XYPlot(datasets[type], null, numberaxis, xyItemRender); switch (type) { case 0: { xyItemRender.setSeriesPaint(0, Color.BLACK); timeseries = new TimeSeries("Number of existing threads", org.jfree.data.time.Hour.class); datasets[type].addSeries(timeseries); timeseries = new TimeSeries("Number of answered threads", org.jfree.data.time.Hour.class); datasets[type].addSeries(timeseries); } break; case 1: { xyItemRender.setSeriesPaint(0, Color.YELLOW); timeseries = new TimeSeries("Mean thread answer time (per day)", org.jfree.data.time.Hour.class); datasets[type].addSeries(timeseries); } break; case 2: { xyItemRender.setSeriesPaint(0, Color.GRAY); timeseries = new TimeSeries("Number of thread replies", org.jfree.data.time.Hour.class); datasets[type].addSeries(timeseries); } break; case 3: { xyItemRender.setSeriesPaint(0, Color.GREEN); timeseries = new TimeSeries("New thread arrival activity change (%)", org.jfree.data.time.Hour.class); datasets[type].addSeries(timeseries); xyItemRender.setSeriesPaint(1, Color.BLUE); timeseries = new TimeSeries("Thread reply activity change (%)", org.jfree.data.time.Hour.class); datasets[type].addSeries(timeseries); } break; case 4: { xyItemRender.setSeriesPaint(0, Color.GREEN); timeseries = new TimeSeries("Mean thread aswer time (per month)", org.jfree.data.time.Hour.class); datasets[type].addSeries(timeseries); } break; } NumberAxis rangeAxis = (NumberAxis) xyplot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); xyplot.setBackgroundPaint(Color.lightGray); xyplot.setDomainGridlinePaint(Color.white); xyplot.setRangeGridlinePaint(Color.white); combineddomainxyplot.add(xyplot); ChartPanel chart = null; switch (type) { case 0: { jfreechart1 = new JFreeChart("", combineddomainxyplot); LegendTitle legendtitle = (LegendTitle) jfreechart1.getSubtitle(0); //set legend fonts jfreechart1.getLegend(0).setItemFont(new Font("Italic", Font.PLAIN, 11)); legendtitle.setPosition(RectangleEdge.BOTTOM); legendtitle.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0.0D, 4D, 0.0D, 4D)); jfreechart1.setBorderPaint(Color.black); jfreechart1.setBorderVisible(true); jfreechart1.setBackgroundPaint(Color.white); combineddomainxyplot.setBackgroundPaint(Color.lightGray); combineddomainxyplot.setDomainGridlinePaint(Color.white); combineddomainxyplot.setRangeGridlinePaint(Color.white); combineddomainxyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D)); valueAxis1 = combineddomainxyplot.getDomainAxis(); dateAxis1 = (DateAxis) valueAxis1; if (scope1 == 0) { valueAxis1.setAutoRange(true); } else { valueAxis1.setFixedAutoRange(scope1); } chart = new ChartPanel(jfreechart1); chart.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); chart.add(buildPlotDisplayManagementPanel(valueAxis1, dateAxis1, ddlScope1)); combineddomainxyplot.setInsets(new RectangleInsets(40, 25, 0, 10)); chart.setPreferredSize(new Dimension(width, height)); jfreechart1.setAntiAlias(false); } break; case 1: { jfreechart2 = new JFreeChart("", combineddomainxyplot); LegendTitle legendtitle = (LegendTitle) jfreechart2.getSubtitle(0); //set legend fonts jfreechart2.getLegend(0).setItemFont(new Font("Italic", Font.PLAIN, 11)); legendtitle.setPosition(RectangleEdge.BOTTOM); legendtitle.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0.0D, 4D, 0.0D, 4D)); jfreechart2.setBorderPaint(Color.black); jfreechart2.setBorderVisible(true); jfreechart2.setBackgroundPaint(Color.white); combineddomainxyplot.setBackgroundPaint(Color.lightGray); combineddomainxyplot.setDomainGridlinePaint(Color.white); combineddomainxyplot.setRangeGridlinePaint(Color.white); combineddomainxyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D)); valueAxis2 = combineddomainxyplot.getDomainAxis(); dateAxis2 = (DateAxis) valueAxis2; if (scope2 == 0) { valueAxis2.setAutoRange(true); } else { valueAxis2.setFixedAutoRange(scope2); } chart = new ChartPanel(jfreechart2); chart.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); chart.add(buildPlotDisplayManagementPanel(valueAxis2, dateAxis2, ddlScope2)); combineddomainxyplot.setInsets(new RectangleInsets(40, 25, 0, 10)); chart.setPreferredSize(new Dimension(width, height)); jfreechart2.setAntiAlias(false); } break; case 2: { jfreechart3 = new JFreeChart("", combineddomainxyplot); LegendTitle legendtitle = (LegendTitle) jfreechart3.getSubtitle(0); //set legend fonts jfreechart3.getLegend(0).setItemFont(new Font("Italic", Font.PLAIN, 11)); legendtitle.setPosition(RectangleEdge.BOTTOM); legendtitle.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0.0D, 4D, 0.0D, 4D)); jfreechart3.setBorderPaint(Color.black); jfreechart3.setBorderVisible(true); jfreechart3.setBackgroundPaint(Color.white); combineddomainxyplot.setBackgroundPaint(Color.lightGray); combineddomainxyplot.setDomainGridlinePaint(Color.white); combineddomainxyplot.setRangeGridlinePaint(Color.white); combineddomainxyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D)); valueAxis3 = combineddomainxyplot.getDomainAxis(); dateAxis3 = (DateAxis) valueAxis3; if (scope3 == 0) { valueAxis3.setAutoRange(true); } else { valueAxis3.setFixedAutoRange(scope3); } chart = new ChartPanel(jfreechart3); chart.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); chart.add(buildPlotDisplayManagementPanel(valueAxis3, dateAxis3, ddlScope3)); combineddomainxyplot.setInsets(new RectangleInsets(40, 25, 0, 10)); chart.setPreferredSize(new Dimension(width, height)); jfreechart3.setAntiAlias(false); } break; case 3: { jfreechart4 = new JFreeChart("", combineddomainxyplot); LegendTitle legendtitle = (LegendTitle) jfreechart4.getSubtitle(0); //set legend fonts jfreechart4.getLegend(0).setItemFont(new Font("Italic", Font.PLAIN, 11)); legendtitle.setPosition(RectangleEdge.BOTTOM); legendtitle.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0.0D, 4D, 0.0D, 4D)); jfreechart4.setBorderPaint(Color.black); jfreechart4.setBorderVisible(true); jfreechart4.setBackgroundPaint(Color.white); combineddomainxyplot.setBackgroundPaint(Color.lightGray); combineddomainxyplot.setDomainGridlinePaint(Color.white); combineddomainxyplot.setRangeGridlinePaint(Color.white); combineddomainxyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D)); valueAxis4 = combineddomainxyplot.getDomainAxis(); dateAxis4 = (DateAxis) valueAxis4; if (scope4 == 0) { valueAxis4.setAutoRange(true); } else { valueAxis4.setFixedAutoRange(scope4); } chart = new ChartPanel(jfreechart4); chart.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); chart.add(buildPlotDisplayManagementPanel(valueAxis4, dateAxis4, ddlScope4)); combineddomainxyplot.setInsets(new RectangleInsets(40, 25, 0, 10)); chart.setPreferredSize(new Dimension(width, height)); jfreechart4.setAntiAlias(false); } break; case 4: { jfreechart5 = new JFreeChart("", combineddomainxyplot); LegendTitle legendtitle = (LegendTitle) jfreechart5.getSubtitle(0); //set legend fonts jfreechart5.getLegend(0).setItemFont(new Font("Italic", Font.PLAIN, 11)); legendtitle.setPosition(RectangleEdge.BOTTOM); legendtitle.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0.0D, 4D, 0.0D, 4D)); jfreechart5.setBorderPaint(Color.black); jfreechart5.setBorderVisible(true); jfreechart5.setBackgroundPaint(Color.white); combineddomainxyplot.setBackgroundPaint(Color.lightGray); combineddomainxyplot.setDomainGridlinePaint(Color.white); combineddomainxyplot.setRangeGridlinePaint(Color.white); combineddomainxyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D)); valueAxis5 = combineddomainxyplot.getDomainAxis(); dateAxis5 = (DateAxis) valueAxis5; if (scope5 == 0) { valueAxis5.setAutoRange(true); } else { valueAxis5.setFixedAutoRange(scope5); } chart = new ChartPanel(jfreechart5); chart.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); chart.add(buildPlotDisplayManagementPanel(valueAxis5, dateAxis5, ddlScope5)); combineddomainxyplot.setInsets(new RectangleInsets(40, 25, 0, 10)); chart.setPreferredSize(new Dimension(width, height)); jfreechart5.setAntiAlias(false); } break; } return chart; }
From source file:org.fhcrc.cpl.viewer.quant.gui.ProteinQuantSummaryFrame.java
License:asdf
/** * Initialize the GUI components//from ww w .j ava2 s.c o m */ protected void initGUI() { //Global stuff setSize(fullWidth, fullHeight); eventPropertiesTable = new QuantEvent.QuantEventPropertiesTable(); eventPropertiesTable.setVisible(true); JScrollPane eventPropsScrollPane = new JScrollPane(); eventPropsScrollPane.setViewportView(eventPropertiesTable); eventPropsScrollPane.setSize(propertiesWidth, propertiesHeight); eventPropertiesDialog = new JDialog(this, "Event Properties"); eventPropertiesDialog.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); eventPropertiesDialog.setSize(propertiesWidth, propertiesHeight); eventPropertiesDialog.setContentPane(eventPropsScrollPane); ListenerHelper helper = new ListenerHelper(this); setTitle("Protein Summary"); setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.BOTH; gbc.anchor = GridBagConstraints.PAGE_START; gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.insets = new Insets(5, 5, 5, 5); gbc.weighty = 1; gbc.weightx = 1; try { (getOwner()).setIconImage(ImageIO.read(WorkbenchFrame.class.getResourceAsStream("icon.gif"))); } catch (Exception e) { } try { Localizer.renderSwixml("org/fhcrc/cpl/viewer/quant/gui/ProteinQuantSummaryFrame.xml", this); assert null != contentPanel; setContentPane(contentPanel); } catch (Exception x) { ApplicationContext.errorMessage("error creating dialog", x); throw new RuntimeException(x); } buttonSelectAllVisible.setEnabled(false); helper.addListener(buttonSelectAllVisible, "buttonSelectAllVisible_actionPerformed"); buttonDeselectAll.setEnabled(false); helper.addListener(buttonDeselectAll, "buttonDeselectAll_actionPerformed"); buildTurkHITsButton.setEnabled(false); helper.addListener(buildTurkHITsButton, "buttonBuildTurkHITs_actionPerformed"); loadSelectedEventsButton.setEnabled(false); helper.addListener(loadSelectedEventsButton, "buttonLoadSelected_actionPerformed"); autoAssessSelectedEventsButton.setEnabled(false); helper.addListener(autoAssessSelectedEventsButton, "buttonAutoAssess_actionPerformed"); showPropertiesButton.setEnabled(false); helper.addListener(showPropertiesButton, "buttonShowProperties_actionPerformed"); showProteinRatiosButton.setEnabled(false); helper.addListener(showProteinRatiosButton, "buttonShowProteinRatios_actionPerformed"); //summary panel summaryPanel.setBorder(BorderFactory.createLineBorder(Color.gray)); summaryPanel.setPreferredSize(new Dimension(fullWidth, summaryPanelHeight)); summaryPanel.setMinimumSize(new Dimension(200, summaryPanelHeight)); gbc.fill = GridBagConstraints.NONE; gbc.gridwidth = 1; summaryPanel.add(buttonSelectAllVisible, gbc); summaryPanel.add(buttonDeselectAll, gbc); gbc.gridwidth = GridBagConstraints.RELATIVE; summaryPanel.add(showPropertiesButton, gbc); gbc.gridwidth = GridBagConstraints.REMAINDER; summaryPanel.add(showProteinRatiosButton, gbc); gbc.gridwidth = 1; summaryPanel.add(loadSelectedEventsButton, gbc); gbc.gridwidth = GridBagConstraints.RELATIVE; summaryPanel.add(autoAssessSelectedEventsButton, gbc); gbc.gridwidth = GridBagConstraints.REMAINDER; summaryPanel.add(buildTurkHITsButton, gbc); gbc.fill = GridBagConstraints.BOTH; eventsScrollPane = new JScrollPane(); eventsScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); eventsScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); eventsPanel = new JPanel(); eventsPanel.setLayout(new GridBagLayout()); eventsTable = new QuantEventsSummaryTable(); eventsTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); eventsTable.getSelectionModel().addListSelectionListener(new EventsTableListSelectionHandler()); eventsScrollPane.setViewportView(eventsTable); eventsScrollPane.setMinimumSize(new Dimension(400, 400)); gbc.insets = new Insets(0, 0, 0, 0); mainPanel.add(eventsScrollPane, gbc); logRatioHistogramPanel = new PanelWithLogRatioHistAndFields(); logRatioHistogramPanel.setBorder(BorderFactory.createTitledBorder("Log Ratios")); logRatioHistogramPanel.setPreferredSize(new Dimension(width - 10, 300)); gbc.fill = GridBagConstraints.BOTH; gbc.weighty = 100; gbc.gridwidth = GridBagConstraints.REMAINDER; add(logRatioHistogramPanel, gbc); //status message messageLabel = new JLabel(); messageLabel.setBackground(Color.WHITE); messageLabel.setFont(Font.decode("verdana plain 12")); messageLabel.setText(" "); statusPanel = new JPanel(); gbc.weighty = 1; statusPanel.setPreferredSize(new Dimension(width - 10, 50)); statusPanel.add(messageLabel, gbc); add(statusPanel, gbc); //per-protein event summary table; disembodied //todo: move this into its own class? it's getting kind of complicated proteinRatiosTable = new JTable(); proteinRatiosTable.setVisible(true); ListSelectionModel proteinTableSelectionModel = proteinRatiosTable.getSelectionModel(); proteinTableSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); proteinTableSelectionModel.addListSelectionListener(new ProteinTableListSelectionHandler()); JScrollPane proteinRatiosScrollPane = new JScrollPane(); proteinRatiosScrollPane.setViewportView(proteinRatiosTable); proteinRatiosScrollPane.setPreferredSize(new Dimension(proteinDialogWidth, proteinDialogHeight - PROTEINTABLE_HISTPANEL_HEIGHT - PROTEINTABLE_SCATTERPLOTPANEL_HEIGHT - 70)); proteinRatiosDialog = new JDialog(this, "Protein Ratios"); proteinRatiosDialog.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); proteinRatiosDialog.setSize(proteinDialogWidth, proteinDialogHeight); JPanel proteinRatiosContentPanel = new JPanel(); gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.fill = GridBagConstraints.BOTH; proteinRatiosContentPanel.add(proteinRatiosScrollPane, gbc); proteinRatiosDialog.setContentPane(proteinRatiosContentPanel); perProteinLogRatioHistogramPanel = new PanelWithLogRatioHistAndFields(); perProteinLogRatioHistogramPanel.addRangeUpdateListener(new ProteinTableLogRatioHistogramListener()); perProteinLogRatioHistogramPanel.setBorder(BorderFactory.createTitledBorder("Log Ratios")); perProteinLogRatioHistogramPanel .setPreferredSize(new Dimension(proteinDialogWidth - 10, PROTEINTABLE_HISTPANEL_HEIGHT)); gbc.fill = GridBagConstraints.BOTH; gbc.gridwidth = GridBagConstraints.REMAINDER; proteinRatiosDialog.add(perProteinLogRatioHistogramPanel, gbc); perProteinPeptideLogRatioPanel = new JPanel(); perProteinPeptideLogRatioPanel.setBorder(BorderFactory.createTitledBorder("By Peptide")); perProteinPeptideLogRatioPanel .setPreferredSize(new Dimension(proteinDialogWidth - 10, PROTEINTABLE_SCATTERPLOTPANEL_HEIGHT)); proteinRatiosDialog.add(perProteinPeptideLogRatioPanel, gbc); }